Lines Matching refs:r

81 	bb = apr_brigade_create(ctx->r->pool, ba);  in php_apache_sapi_ub_write()
86 if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { in php_apache_sapi_ub_write()
101 f = ctx->r->output_filters; in php_apache_sapi_header_handler()
105 apr_table_unset(ctx->r->headers_out, sapi_header->header); in php_apache_sapi_header_handler()
109 apr_table_clear(ctx->r->headers_out); in php_apache_sapi_header_handler()
129 ctx->r->content_type = apr_pstrdup(ctx->r->pool, val); in php_apache_sapi_header_handler()
131 ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10)); in php_apache_sapi_header_handler()
133 apr_table_set(ctx->r->headers_out, sapi_header->header, val); in php_apache_sapi_header_handler()
135 apr_table_add(ctx->r->headers_out, sapi_header->header, val); in php_apache_sapi_header_handler()
150 ctx->r->status = SG(sapi_headers).http_response_code; in php_apache_sapi_send_headers()
181 ctx->finfo.st_uid = ctx->r->finfo.user; in php_apache_sapi_get_stat()
182 ctx->finfo.st_gid = ctx->r->finfo.group; in php_apache_sapi_get_stat()
183 ctx->finfo.st_dev = ctx->r->finfo.device; in php_apache_sapi_get_stat()
184 ctx->finfo.st_ino = ctx->r->finfo.inode; in php_apache_sapi_get_stat()
186 ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); in php_apache_sapi_get_stat()
187 ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); in php_apache_sapi_get_stat()
188 ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); in php_apache_sapi_get_stat()
190 ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); in php_apache_sapi_get_stat()
191 ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); in php_apache_sapi_get_stat()
192 ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); in php_apache_sapi_get_stat()
195 ctx->finfo.st_size = ctx->r->finfo.size; in php_apache_sapi_get_stat()
196 ctx->finfo.st_nlink = ctx->r->finfo.nlink; in php_apache_sapi_get_stat()
207 http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); in php_apache_sapi_read_cookies()
219 env_var = apr_table_get(ctx->r->subprocess_env, name); in php_apache_sapi_getenv()
228 const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); in php_apache_sapi_register_variables()
241 php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); in php_apache_sapi_register_variables()
242 …if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val… in php_apache_sapi_register_variables()
243 php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); in php_apache_sapi_register_variables()
266 ctx->r->status = SG(sapi_headers).http_response_code; in php_apache_sapi_flush()
276 ba = ctx->r->connection->bucket_alloc; in php_apache_sapi_flush()
277 bb = apr_brigade_create(ctx->r->pool, ba); in php_apache_sapi_flush()
280 if (ap_pass_brigade(f->next, bb) != APR_SUCCESS || ctx->r->connection->aborted) { in php_apache_sapi_flush()
295 ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctx->r->server, "%s", msg); in php_apache_sapi_log_message()
306 f->r->no_local_copy = 1; in php_apache_disable_caching()
314 return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; in php_apache_sapi_get_request_time()
370 if (f->r->proxyreq) { in php_input_filter()
376 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, in php_input_filter()
404 SG(sapi_headers).http_response_code = !f->r->status ? HTTP_OK : f->r->status; in php_apache_request_ctor()
405 SG(request_info).content_type = apr_table_get(f->r->headers_in, "Content-Type"); in php_apache_request_ctor()
408 SG(request_info).query_string = safe_strdup(f->r->args); in php_apache_request_ctor()
409 SG(request_info).request_method = f->r->method; in php_apache_request_ctor()
410 SG(request_info).proto_num = f->r->proto_num; in php_apache_request_ctor()
411 SG(request_info).request_uri = safe_strdup(f->r->uri); in php_apache_request_ctor()
412 SG(request_info).path_translated = safe_strdup(f->r->filename); in php_apache_request_ctor()
413 f->r->no_local_copy = 1; in php_apache_request_ctor()
415 f->r->content_type = apr_pstrdup(f->r->pool, content_type); in php_apache_request_ctor()
421 content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length"); in php_apache_request_ctor()
424 apr_table_unset(f->r->headers_out, "Content-Length"); in php_apache_request_ctor()
425 apr_table_unset(f->r->headers_out, "Last-Modified"); in php_apache_request_ctor()
426 apr_table_unset(f->r->headers_out, "Expires"); in php_apache_request_ctor()
427 apr_table_unset(f->r->headers_out, "ETag"); in php_apache_request_ctor()
429 auth = apr_table_get(f->r->headers_in, "Authorization"); in php_apache_request_ctor()
432 if (SG(request_info).auth_user == NULL && f->r->user) { in php_apache_request_ctor()
433 SG(request_info).auth_user = estrdup(f->r->user); in php_apache_request_ctor()
436 ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); in php_apache_request_ctor()
463 void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module); in php_output_filter()
470 if (f->r->proxyreq) { in php_output_filter()
488 pbb = f->ctx = apr_palloc(f->r->pool, sizeof(*pbb)); in php_output_filter()
489 pbb->bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc); in php_output_filter()
492 if(ap_save_brigade(NULL, &pbb->bb, &bb, f->r->pool) != APR_SUCCESS) { in php_output_filter()
505 if (f->r->main == NULL || in php_output_filter()
507 f->r->subprocess_env != f->r->main->subprocess_env in php_output_filter()
510 ap_add_common_vars(f->r); in php_output_filter()
511 ap_add_cgi_vars(f->r); in php_output_filter()
516 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r, in php_output_filter()
547 zfd.filename = f->r->filename; in php_output_filter()
553 apr_table_set(ctx->r->notes, "mod_php_memory_usage", in php_output_filter()
554 apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); in php_output_filter()
558 if (!f->r->main) { in php_output_filter()
641 static void php_add_filter(request_rec *r, ap_filter_t *f) in php_add_filter() argument
643 int output = (f == r->output_filters); in php_add_filter()
649 0, r->server, in php_add_filter()
651 output ? "Output" : "Input", r->uri); in php_add_filter()
658 ap_add_output_filter("PHP", NULL, r, r->connection); in php_add_filter()
660 ap_add_input_filter("PHP", NULL, r, r->connection); in php_add_filter()
664 static void php_insert_filter(request_rec *r) in php_insert_filter() argument
668 if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php", content_type_len-1)) { in php_insert_filter()
669 …if (r->content_type[content_type_len] == '\0' || !strncmp(r->content_type+content_type_len, "-sour… in php_insert_filter()
670 php_add_filter(r, r->output_filters); in php_insert_filter()
671 php_add_filter(r, r->input_filters); in php_insert_filter()
683 static int php_post_read_request(request_rec *r) in php_post_read_request() argument
689 SG(server_context) = ctx = apr_pcalloc(r->pool, sizeof(*ctx)); in php_post_read_request()
694 apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), in php_post_read_request()
700 ctx->r = r; in php_post_read_request()