Lines Matching refs:r
33 int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
40 static int send_php(request_rec *r, int display_source_mode, char *filename);
41 static int send_parsed_php(request_rec * r);
42 static int send_parsed_php_source(request_rec * r);
43 static int php_xbithack_handler(request_rec * r);
128 request_rec *r = (request_rec *) SG(server_context); in sapi_apache_read_post() local
137 if (!SG(read_post_bytes) && !ap_should_client_block(r)) { in sapi_apache_read_post()
143 hard_timeout("Read POST information", r); /* start timeout timer */ in sapi_apache_read_post()
144 read_bytes = get_client_block(r, buffer+total_read_bytes, count_bytes-total_read_bytes); in sapi_apache_read_post()
145 reset_timeout(r); in sapi_apache_read_post()
169 request_rec *r = (request_rec *) SG(server_context); in sapi_apache_header_handler() local
170 if(!r) { in sapi_apache_header_handler()
176 clear_table(r->headers_out); in sapi_apache_header_handler()
180 table_unset(r->headers_out, sapi_header->header); in sapi_apache_header_handler()
198 r->content_type = pstrdup(r->pool, header_content); in sapi_apache_header_handler()
200 ap_set_content_length(r, strtol(header_content, (char **)NULL, 10)); in sapi_apache_header_handler()
202 table_add(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
204 table_set(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
206 table_add(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
223 request_rec *r = SG(server_context); in sapi_apache_send_headers() local
227 if(r == NULL) { /* server_context is not here anymore */ in sapi_apache_send_headers()
231 r->status = SG(sapi_headers).http_response_code; in sapi_apache_send_headers()
237 r->status_line = ap_pstrndup(r->pool, sline + 9, MAX_STATUS_LENGTH); in sapi_apache_send_headers()
239 r->status_line = ap_pstrndup(r->pool, sline + 9, sline_len - 9); in sapi_apache_send_headers()
243 if(r->status==304) { in sapi_apache_send_headers()
244 send_error_response(r,0); in sapi_apache_send_headers()
246 send_http_header(r); in sapi_apache_send_headers()
347 request_rec *r = (request_rec *) SG(server_context); in php_apache_sapi_activate() local
358 register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); in php_apache_sapi_activate()
365 SG(request_info).headers_only = r->header_only; in php_apache_sapi_activate()
395 request_rec *r = SG(server_context); in sapi_apache_get_fd() local
398 fd = r->connection->client->fd; in sapi_apache_get_fd()
413 request_rec *r = SG(server_context); in sapi_apache_force_http_10() local
415 r->proto_num = HTTP_VERSION(1,0); in sapi_apache_force_http_10()
522 request_rec *r = ((request_rec *) SG(server_context)); in init_request_info() local
523 char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); in init_request_info()
527 SG(request_info).query_string = r->args; in init_request_info()
528 SG(request_info).path_translated = r->filename; in init_request_info()
529 SG(request_info).request_uri = r->uri; in init_request_info()
530 SG(request_info).request_method = (char *)r->method; in init_request_info()
531 SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); in init_request_info()
533 SG(sapi_headers).http_response_code = r->status; in init_request_info()
534 SG(request_info).proto_num = r->proto_num; in init_request_info()
536 if (r->headers_in) { in init_request_info()
537 authorization = table_get(r->headers_in, "Authorization"); in init_request_info()
545 char *p = getword(r->pool, &authorization, ' '); in init_request_info()
547 tmp = uudecode(r->pool, authorization); in init_request_info()
548 tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); in init_request_info()
550 r->connection->user = pstrdup(r->connection->pool, tmp_user); in init_request_info()
551 r->connection->ap_auth_type = "Basic"; in init_request_info()
558 r->connection->ap_auth_type = "Digest"; in init_request_info()
576 static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) in php_apache_get_default_mimetype()
585 mimetype = pstrdup(r->pool, tmpmimetype); in php_apache_get_default_mimetype()
596 static int send_php(request_rec *r, int display_source_mode, char *filename) in send_php() argument
605 fh.filename = r->filename; in send_php()
614 SG(server_context) = r; in send_php()
619 if (filename == NULL && r->finfo.st_mode == 0) { in send_php()
623 per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); in send_php()
632 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
639 filename = r->filename; in send_php()
644 if ((retval = setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) { in send_php()
654 if ((retval = set_last_modified(r, r->finfo.st_mtime))) { in send_php()
661 update_mtime (r, r->finfo.st_mtime); in send_php()
662 set_last_modified(r); in send_php()
663 set_etag(r); in send_php()
668 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
671 hard_timeout("send", r); in send_php()
674 add_common_vars(r); in send_php()
675 add_cgi_vars(r); in send_php()
678 apache_php_module_main(r, display_source_mode TSRMLS_CC); in send_php()
682 kill_timeout(r); in send_php()
691 static int send_parsed_php(request_rec * r) in send_parsed_php() argument
693 int result = send_php(r, 0, NULL); in send_parsed_php()
696 ap_table_setn(r->notes, "mod_php_memory_usage", in send_parsed_php()
697 ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC))); in send_parsed_php()
705 static int send_parsed_php_source(request_rec * r) in send_parsed_php_source() argument
707 return send_php(r, 1, NULL); in send_parsed_php_source()
894 static int php_xbithack_handler(request_rec * r) in php_xbithack_handler() argument
899 if (!(r->finfo.st_mode & S_IXUSR)) { in php_xbithack_handler()
902 per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); in php_xbithack_handler()
912 return send_parsed_php(r); in php_xbithack_handler()