Lines Matching refs:SG
315 fcgi_request *request = (fcgi_request*) SG(server_context); in sapi_fcgi_ub_write()
411 int response_status = SG(sapi_headers).http_response_code; in sapi_cgi_send_headers()
413 if (SG(request_info).no_headers == 1) { in sapi_cgi_send_headers()
417 if (CGIG(nph) || SG(sapi_headers).http_response_code != 200) in sapi_cgi_send_headers()
422 if (CGIG(rfc2616_headers) && SG(sapi_headers).http_status_line) { in sapi_cgi_send_headers()
424 len = slprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, "%s\r\n", SG(sapi_headers).http_status_line); in sapi_cgi_send_headers()
425 if ((s = strchr(SG(sapi_headers).http_status_line, ' '))) { in sapi_cgi_send_headers()
436 if (SG(sapi_headers).http_status_line && in sapi_cgi_send_headers()
437 (s = strchr(SG(sapi_headers).http_status_line, ' ')) != 0 && in sapi_cgi_send_headers()
438 (s - SG(sapi_headers).http_status_line) >= 5 && in sapi_cgi_send_headers()
439 strncasecmp(SG(sapi_headers).http_status_line, "HTTP/", 5) == 0 in sapi_cgi_send_headers()
458 if (err->code == SG(sapi_headers).http_response_code) { in sapi_cgi_send_headers()
464 …len = slprintf(buf, sizeof(buf), "Status: %d %s\r\n", SG(sapi_headers).http_response_code, err->ms… in sapi_cgi_send_headers()
466 len = slprintf(buf, sizeof(buf), "Status: %d\r\n", SG(sapi_headers).http_response_code); in sapi_cgi_send_headers()
516 count_bytes = MIN(count_bytes, SG(request_info).content_length - SG(read_post_bytes)); in sapi_cgi_read_post()
531 fcgi_request *request = (fcgi_request*) SG(server_context); in sapi_fcgi_read_post()
532 size_t remaining = SG(request_info).content_length - SG(read_post_bytes); in sapi_fcgi_read_post()
558 fcgi_request *request = (fcgi_request*) SG(server_context); in sapi_fcgi_getenv()
619 fcgi_request *request = (fcgi_request*) SG(server_context); in sapi_fcgi_read_cookies()
663 fcgi_request *request = (fcgi_request*) SG(server_context); in cgi_php_import_environment_variables()
679 char *script_name = SG(request_info).request_uri; in sapi_cgi_register_variables()
685 fcgi_request *request = (fcgi_request*) SG(server_context); in sapi_cgi_register_variables()
726 php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ""; in sapi_cgi_register_variables()
739 request = (fcgi_request*) SG(server_context); in sapi_cgi_log_message()
845 if (!SG(request_info).path_translated) {
852 fcgi_request *request = (fcgi_request*) SG(server_context);
872 path_len = strlen(SG(request_info).path_translated);
875 if (!IS_SLASH(SG(request_info).path_translated[path_len])) {
877 memcpy(path, SG(request_info).path_translated, path_len + 1);
881 path = estrndup(SG(request_info).path_translated, path_len);
892 fcgi_request *request = (fcgi_request*) SG(server_context);
929 if (SG(sapi_started)) {
935 !fcgi_finish_request((fcgi_request*)SG(server_context), 0)) {
939 sapi_cgi_flush(SG(server_context));
1160 SG(request_info).path_translated = NULL;
1161 SG(request_info).request_method = NULL;
1162 SG(request_info).proto_num = 1000;
1163 SG(request_info).query_string = NULL;
1164 SG(request_info).request_uri = NULL;
1165 SG(request_info).content_type = NULL;
1166 SG(request_info).content_length = 0;
1167 SG(sapi_headers).http_response_code = 200;
1286 SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_path_info);
1288 SG(request_info).request_uri = orig_script_name;
1366 SG(sapi_headers).http_response_code = 404;
1368 if (!SG(request_info).request_uri) {
1374 SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_script_name);
1376 SG(request_info).request_uri = orig_script_name;
1406 SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_script_name);
1408 SG(request_info).request_uri = env_script_name;
1415 SG(request_info).request_uri = env_path_info;
1417 SG(request_info).request_uri = env_script_name;
1425 SG(request_info).path_translated = estrdup(script_path_translated);
1428 SG(request_info).request_method = CGI_GETENV("REQUEST_METHOD");
1430 SG(request_info).query_string = CGI_GETENV("QUERY_STRING");
1431 SG(request_info).content_type = (content_type ? content_type : "" );
1432 SG(request_info).content_length = (content_length ? atol(content_length) : 0);
1591 fcgi_request *request = (fcgi_request*) SG(server_context);
1703 if (!&SG(sapi_headers).headers) {
1707 …zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_respons…
1915 SG(request_info).path_translated = NULL;
1946 SG(sapi_headers).http_response_code = 400;
2127 SG(headers_sent) = 1;
2147 SG(server_context) = fastcgi ? (void *) request : (void *) 1;
2161 SG(options) |= SAPI_OPTION_NO_CHDIR;
2181 SG(server_context) = NULL;
2186 SG(headers_sent) = 1;
2187 SG(request_info).no_headers = 1;
2204 SG(headers_sent) = 1;
2231 SG(server_context) = NULL;
2236 SG(headers_sent) = 1;
2237 SG(request_info).no_headers = 1;
2264 STR_FREE(SG(request_info).path_translated);
2265 SG(request_info).path_translated = script_file;
2268 SG(request_info).argc = argc - (php_optind - 1);
2269 SG(request_info).argv = &argv[php_optind - 1];
2270 SG(request_info).argv[0] = script_file;
2273 STR_FREE(SG(request_info).path_translated);
2274 SG(request_info).path_translated = estrdup(argv[php_optind]);
2276 SG(request_info).argc = argc - php_optind;
2277 SG(request_info).argv = &argv[php_optind];
2281 SG(headers_sent) = 1;
2282 SG(request_info).no_headers = 1;
2294 if (!SG(request_info).query_string && argc > php_optind) {
2314 SG(request_info).query_string = s;
2324 if (SG(request_info).path_translated || cgi || fastcgi) {
2326 file_handle.filename = SG(request_info).path_translated;
2343 SG(server_context) = NULL;
2348 SG(headers_sent) = 1;
2349 SG(request_info).no_headers = 1;
2357 if (cgi || fastcgi || SG(request_info).path_translated) {
2361 SG(sapi_headers).http_response_code = 403;
2364 SG(sapi_headers).http_response_code = 404;
2376 STR_FREE(SG(request_info).path_translated);
2378 if (free_query_string && SG(request_info).query_string) {
2379 free(SG(request_info).query_string);
2380 SG(request_info).query_string = NULL;
2384 SG(server_context) = NULL;
2520 STR_FREE(SG(request_info).path_translated);
2528 if (free_query_string && SG(request_info).query_string) {
2529 free(SG(request_info).query_string);
2530 SG(request_info).query_string = NULL;
2603 SG(server_context) = NULL;