Lines Matching refs:r

32 int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
39 static int send_php(request_rec *r, int display_source_mode, char *filename);
40 static int send_parsed_php(request_rec * r);
41 static int send_parsed_php_source(request_rec * r);
42 static int php_xbithack_handler(request_rec * r);
273 request_rec *r = (request_rec *) SG(server_context); in sapi_apache_read_post() local
282 if (!SG(read_post_bytes) && !ap_should_client_block(r)) { in sapi_apache_read_post()
288 hard_timeout("Read POST information", r); /* start timeout timer */ in sapi_apache_read_post()
289 read_bytes = get_client_block(r, buffer+total_read_bytes, count_bytes-total_read_bytes); in sapi_apache_read_post()
290 reset_timeout(r); in sapi_apache_read_post()
314 request_rec *r = (request_rec *) SG(server_context); in sapi_apache_header_handler() local
315 if(!r) { in sapi_apache_header_handler()
321 clear_table(r->headers_out); in sapi_apache_header_handler()
325 table_unset(r->headers_out, sapi_header->header); in sapi_apache_header_handler()
343 r->content_type = pstrdup(r->pool, header_content); in sapi_apache_header_handler()
345 table_add(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
347 table_set(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
349 table_add(r->headers_out, header_name, header_content); in sapi_apache_header_handler()
473 request_rec *r = (request_rec *) SG(server_context); in php_apache_sapi_activate() local
484 register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec); in php_apache_sapi_activate()
491 SG(request_info).headers_only = r->header_only; in php_apache_sapi_activate()
574 request_rec *r = ((request_rec *) SG(server_context)); in init_request_info() local
575 char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); in init_request_info()
579 SG(request_info).query_string = r->args; in init_request_info()
580 SG(request_info).path_translated = r->filename; in init_request_info()
581 SG(request_info).request_uri = r->uri; in init_request_info()
582 SG(request_info).request_method = (char *)r->method; in init_request_info()
583 SG(request_info).proto_num = r->proto_num; in init_request_info()
584 SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); in init_request_info()
586 SG(sapi_headers).http_response_code = r->status; in init_request_info()
588 if (r->headers_in) { in init_request_info()
589 authorization = table_get(r->headers_in, "Authorization"); in init_request_info()
595 if (authorization && !auth_type(r)) { in init_request_info()
596 if (!strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) { in init_request_info()
597 tmp = uudecode(r->pool, authorization); in init_request_info()
598 tmp_user = getword_nulls_nc(r->pool, &tmp, ':'); in init_request_info()
600 r->connection->user = pstrdup(r->connection->pool, tmp_user); in init_request_info()
601 r->connection->ap_auth_type = "Basic"; in init_request_info()
607 } else if (!strcasecmp(getword(r->pool, &authorization, ' '), "Digest")) { in init_request_info()
608 r->connection->ap_auth_type = "Digest"; in init_request_info()
626 static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC) in php_apache_get_default_mimetype()
635 mimetype = pstrdup(r->pool, tmpmimetype); in php_apache_get_default_mimetype()
646 static int send_php(request_rec *r, int display_source_mode, char *filename) in send_php() argument
654 fh.filename = r->filename; in send_php()
666 if (filename == NULL && r->finfo.st_mode == 0) { in send_php()
670 per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in send_php()
679 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
680 r->allowed |= (1 << METHODS) - 1; in send_php()
687 filename = r->filename; in send_php()
692 if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { in send_php()
702 if ((retval = set_last_modified(r, r->finfo.st_mtime))) { in send_php()
709 update_mtime (r, r->finfo.st_mtime); in send_php()
710 set_last_modified(r); in send_php()
711 set_etag(r); in send_php()
716 r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC); in send_php()
719 hard_timeout("send", r); in send_php()
721 SG(server_context) = r; in send_php()
726 add_common_vars(r); in send_php()
727 add_cgi_vars(r); in send_php()
730 apache_php_module_main(r, display_source_mode TSRMLS_CC); in send_php()
734 kill_timeout(r); in send_php()
743 static int send_parsed_php(request_rec * r) in send_parsed_php() argument
745 int result = send_php(r, 0, NULL); in send_parsed_php()
748 ap_table_setn(r->notes, "mod_php_memory_usage", in send_parsed_php()
749 ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC))); in send_parsed_php()
757 static int send_parsed_php_source(request_rec * r) in send_parsed_php_source() argument
759 return send_php(r, 1, NULL); in send_parsed_php_source()
1178 static int php_xbithack_handler(request_rec * r) in php_xbithack_handler() argument
1183 if (!(r->finfo.st_mode & S_IXUSR)) { in php_xbithack_handler()
1184 r->allowed |= (1 << METHODS) - 1; in php_xbithack_handler()
1187 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_xbithack_handler()
1192 r->allowed |= (1 << METHODS) - 1; in php_xbithack_handler()
1198 return send_parsed_php(r); in php_xbithack_handler()
1261 static int php_run_hook(php_handler *handler, request_rec *r) in php_run_hook() argument
1269 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_run_hook()
1280 add_common_vars(r); in php_run_hook()
1281 add_cgi_vars(r); in php_run_hook()
1283 SG(server_context) = r; in php_run_hook()
1285 apache_php_module_hook(r, handler, &ret TSRMLS_CC); in php_run_hook()
1287 kill_timeout(r); in php_run_hook()
1296 static int php_uri_translation(request_rec *r) in php_uri_translation() argument
1301 conf = (php_per_server_config *) get_module_config(r->server->module_config, &php5_module); in php_uri_translation()
1304 (int (*)(void *element, void *)) php_run_hook, r, OK); in php_uri_translation()
1307 static int php_header_hook(request_rec *r) in php_header_hook() argument
1312 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_header_hook()
1315 (int (*)(void *element, void *)) php_run_hook, r); in php_header_hook()
1318 static int php_auth_hook(request_rec *r) in php_auth_hook() argument
1323 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_auth_hook()
1326 (int (*)(void *element, void *)) php_run_hook, r, OK); in php_auth_hook()
1329 static int php_access_hook(request_rec *r) in php_access_hook() argument
1335 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_access_hook()
1338 (int (*)(void *element, void *)) php_run_hook, r); in php_access_hook()
1343 static int php_type_hook(request_rec *r) in php_type_hook() argument
1348 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_type_hook()
1352 r, OK); in php_type_hook()
1355 static int php_fixup_hook(request_rec *r) in php_fixup_hook() argument
1360 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_fixup_hook()
1364 r); in php_fixup_hook()
1367 static int php_logger_hook(request_rec *r) in php_logger_hook() argument
1372 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_logger_hook()
1376 r); in php_logger_hook()
1379 static int php_post_read_hook(request_rec *r) in php_post_read_hook() argument
1385 svr = get_module_config(r->server->module_config, &php5_module); in php_post_read_hook()
1386 if(ap_is_initial_req(r)) { in php_post_read_hook()
1387 …t_all(&svr->requires, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); in php_post_read_hook()
1389 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_post_read_hook()
1392 (int (*)(void *element, void *)) php_run_hook, r); in php_post_read_hook()
1395 static int php_response_handler(request_rec *r) in php_response_handler() argument
1400 conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php5_module); in php_response_handler()
1401 …f->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r); in php_response_handler()