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()
352 request_rec *r = (request_rec *) SG(server_context); in php_apache_sapi_activate() local
363 register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); in php_apache_sapi_activate()
370 SG(request_info).headers_only = r->header_only; in php_apache_sapi_activate()
400 request_rec *r = SG(server_context); in sapi_apache_get_fd() local
403 fd = r->connection->client->fd; in sapi_apache_get_fd()
418 request_rec *r = SG(server_context); in sapi_apache_force_http_10() local
420 r->proto_num = HTTP_VERSION(1,0); in sapi_apache_force_http_10()
526 request_rec *r = ((request_rec *) SG(server_context)); in init_request_info() local
527 char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); in init_request_info()
531 SG(request_info).query_string = r->args; in init_request_info()
532 SG(request_info).path_translated = r->filename; in init_request_info()
533 SG(request_info).request_uri = r->uri; in init_request_info()
534 SG(request_info).request_method = (char *)r->method; in init_request_info()
535 SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); in init_request_info()
537 SG(sapi_headers).http_response_code = r->status; in init_request_info()
538 SG(request_info).proto_num = r->proto_num; in init_request_info()
540 if (r->headers_in) { in init_request_info()
541 authorization = table_get(r->headers_in, "Authorization"); in init_request_info()
548 if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) { in init_request_info()
549 char *p = getword(r->pool, &authorization, ' '); in init_request_info()
551 tmp = uudecode(r->pool, authorization); in init_request_info()
552 tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); in init_request_info()
554 r->connection->user = pstrdup(r->connection->pool, tmp_user); in init_request_info()
555 r->connection->ap_auth_type = "Basic"; in init_request_info()
562 r->connection->ap_auth_type = "Digest"; in init_request_info()
580 static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) in php_apache_get_default_mimetype()
589 mimetype = pstrdup(r->pool, tmpmimetype); in php_apache_get_default_mimetype()
600 static int send_php(request_rec *r, int display_source_mode, char *filename) in send_php() argument
609 fh.filename = r->filename; in send_php()
618 SG(server_context) = r; in send_php()
623 if (filename == NULL && r->finfo.st_mode == 0) { in send_php()
627 per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); in send_php()
636 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
643 filename = r->filename; in send_php()
648 if ((retval = setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) { in send_php()
658 if ((retval = set_last_modified(r, r->finfo.st_mtime))) { in send_php()
665 update_mtime (r, r->finfo.st_mtime); in send_php()
666 set_last_modified(r); in send_php()
667 set_etag(r); in send_php()
672 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
675 hard_timeout("send", r); in send_php()
678 add_common_vars(r); in send_php()
679 add_cgi_vars(r); in send_php()
682 apache_php_module_main(r, display_source_mode TSRMLS_CC); in send_php()
686 kill_timeout(r); in send_php()
695 static int send_parsed_php(request_rec * r) in send_parsed_php() argument
697 int result = send_php(r, 0, NULL); in send_parsed_php()
700 ap_table_setn(r->notes, "mod_php_memory_usage", in send_parsed_php()
701 ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC))); in send_parsed_php()
709 static int send_parsed_php_source(request_rec * r) in send_parsed_php_source() argument
711 return send_php(r, 1, NULL); in send_parsed_php_source()
898 static int php_xbithack_handler(request_rec * r) in php_xbithack_handler() argument
903 if (!(r->finfo.st_mode & S_IXUSR)) { in php_xbithack_handler()
906 per_dir_conf = (HashTable *) get_module_config(r->per_dir_config, &php5_module); in php_xbithack_handler()
916 return send_parsed_php(r); in php_xbithack_handler()