Lines Matching refs:request
184 php_cli_server_request request; member
379 if (NULL != (val = zend_hash_find(&client->request.headers, ZSTR_KNOWN(ZEND_STR_HOST)))) { in append_essential_headers()
418 RETURN_ARR(zend_array_dup(&client->request.headers_original_case)); in PHP_FUNCTION()
566 …append_http_status_line(&buffer, client->request.protocol_version, SG(sapi_headers).http_response_… in sapi_cli_server_send_headers()
592 if (NULL == (val = zend_hash_str_find(&client->request.headers, "cookie", sizeof("cookie")-1))) { in sapi_cli_server_read_cookies()
601 if (client->request.content) { in sapi_cli_server_read_post()
602 size_t content_len = client->request.content_len; in sapi_cli_server_read_post()
604 memmove(buf, client->request.content + client->post_read_offset, nbytes_copied); in sapi_cli_server_read_post()
719 …nd_string *tmp = strpprintf(0, "HTTP/%d.%d", client->request.protocol_version / 100, client->reque… in sapi_cli_server_register_variables()
732 "REQUEST_URI", strlen("REQUEST_URI"), client->request.request_uri); in sapi_cli_server_register_variables()
737 "SCRIPT_NAME", strlen("SCRIPT_NAME"), client->request.vpath, client->request.vpath_len); in sapi_cli_server_register_variables()
746 if (client->request.path_info) { in sapi_cli_server_register_variables()
748 "PATH_INFO", strlen("PATH_INFO"), client->request.path_info, client->request.path_info_len); in sapi_cli_server_register_variables()
750 if (client->request.path_info_len) { in sapi_cli_server_register_variables()
751 zend_string *tmp = strpprintf(0, "%s%s", client->request.vpath, client->request.path_info); in sapi_cli_server_register_variables()
756 "PHP_SELF", strlen("PHP_SELF"), client->request.vpath, client->request.vpath_len); in sapi_cli_server_register_variables()
758 if (client->request.query_string) { in sapi_cli_server_register_variables()
761 sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string); in sapi_cli_server_register_variables()
765 …zend_hash_apply_with_arguments(&client->request.headers, (apply_func_args_t)sapi_cli_server_regist… in sapi_cli_server_register_variables()
1219 php_http_method_str(client->request.request_method), ZSTR_VAL(client->request.request_uri)); in php_cli_server_log_response()
1440 …st_translate_vpath(const php_cli_server *server, php_cli_server_request *request, const char *docu… in php_cli_server_request_translate_vpath() argument
1444 …char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"),… in php_cli_server_request_translate_vpath()
1451 if (request->vpath_len != 0) { in php_cli_server_request_translate_vpath()
1452 if (request->vpath[0] != '/') { in php_cli_server_request_translate_vpath()
1455 memmove(p, request->vpath, request->vpath_len); in php_cli_server_request_translate_vpath()
1457 q = p + request->vpath_len; in php_cli_server_request_translate_vpath()
1464 p += request->vpath_len; in php_cli_server_request_translate_vpath()
1504 request->path_info_len = prev_path_len; in php_cli_server_request_translate_vpath()
1512 request->path_info = prev_path; in php_cli_server_request_translate_vpath()
1513 pefree(request->vpath, 1); in php_cli_server_request_translate_vpath()
1514 request->vpath = pestrndup(vpath, q - vpath, 1); in php_cli_server_request_translate_vpath()
1515 request->vpath_len = q - vpath; in php_cli_server_request_translate_vpath()
1516 request->path_translated = buf; in php_cli_server_request_translate_vpath()
1517 request->path_translated_len = q - buf; in php_cli_server_request_translate_vpath()
1519 pefree(request->vpath, 1); in php_cli_server_request_translate_vpath()
1520 request->vpath = pestrndup(vpath, q - vpath, 1); in php_cli_server_request_translate_vpath()
1521 request->vpath_len = q - vpath; in php_cli_server_request_translate_vpath()
1522 request->path_translated = buf; in php_cli_server_request_translate_vpath()
1523 request->path_translated_len = q - buf; in php_cli_server_request_translate_vpath()
1528 for (;i<request->vpath_len;i++) { in php_cli_server_request_translate_vpath()
1529 if (request->vpath[i] == '\\') { in php_cli_server_request_translate_vpath()
1530 request->vpath[i] = '/'; in php_cli_server_request_translate_vpath()
1535 request->sb = sb; in php_cli_server_request_translate_vpath()
1632 if (UNEXPECTED(client->request.vpath != NULL)) { in php_cli_server_client_read_request_on_path()
1636 client->request.vpath = vpath; in php_cli_server_client_read_request_on_path()
1637 client->request.vpath_len = vpath_len; in php_cli_server_client_read_request_on_path()
1645 if (EXPECTED(client->request.query_string == NULL)) { in php_cli_server_client_read_request_on_query_string()
1646 client->request.query_string = pestrndup(at, length, 1); in php_cli_server_client_read_request_on_query_string()
1647 client->request.query_string_len = length; in php_cli_server_client_read_request_on_query_string()
1649 …PHP_HTTP_MAX_HEADER_SIZE && PHP_HTTP_MAX_HEADER_SIZE - length >= client->request.query_string_len); in php_cli_server_client_read_request_on_query_string()
1650 …client->request.query_string = perealloc(client->request.query_string, client->request.query_strin… in php_cli_server_client_read_request_on_query_string()
1651 memcpy(client->request.query_string + client->request.query_string_len, at, length); in php_cli_server_client_read_request_on_query_string()
1652 client->request.query_string_len += length; in php_cli_server_client_read_request_on_query_string()
1653 client->request.query_string[client->request.query_string_len] = '\0'; in php_cli_server_client_read_request_on_query_string()
1661 if (EXPECTED(client->request.request_uri == NULL)) { in php_cli_server_client_read_request_on_url()
1662 client->request.request_method = parser->method; in php_cli_server_client_read_request_on_url()
1663 client->request.request_uri = zend_string_init(at, length, /* persistent */ true); in php_cli_server_client_read_request_on_url()
1664 GC_MAKE_PERSISTENT_LOCAL(client->request.request_uri); in php_cli_server_client_read_request_on_url()
1666 ZEND_ASSERT(client->request.request_method == parser->method); in php_cli_server_client_read_request_on_url()
1667 …PHP_HTTP_MAX_HEADER_SIZE && PHP_HTTP_MAX_HEADER_SIZE - length >= client->request.query_string_len); in php_cli_server_client_read_request_on_url()
1669 …client->request.request_uri = cli_concat_persistent_zstr_with_char(client->request.request_uri, at… in php_cli_server_client_read_request_on_url()
1687 zval *entry = zend_hash_find(&client->request.headers, lc_header_name); in php_cli_server_client_save_header()
1708 zend_hash_update(&client->request.headers, lc_header_name, &tmp); in php_cli_server_client_save_header()
1709 zend_hash_update(&client->request.headers_original_case, client->current_header_name, &tmp); in php_cli_server_client_save_header()
1801 if (!client->request.content) { in php_cli_server_client_read_request_on_body()
1802 client->request.content = pemalloc(parser->content_length, 1); in php_cli_server_client_read_request_on_body()
1803 client->request.content_len = 0; in php_cli_server_client_read_request_on_body()
1805 …client->request.content = perealloc(client->request.content, client->request.content_len + length,… in php_cli_server_client_read_request_on_body()
1806 memmove(client->request.content + client->request.content_len, at, length); in php_cli_server_client_read_request_on_body()
1807 client->request.content_len += length; in php_cli_server_client_read_request_on_body()
1814 client->request.protocol_version = parser->http_major * 100 + parser->http_minor; in php_cli_server_client_read_request_on_message_complete()
1815 …php_cli_server_request_translate_vpath(client->server, &client->request, client->server->document_… in php_cli_server_client_read_request_on_message_complete()
1816 if (client->request.vpath) { in php_cli_server_client_read_request_on_message_complete()
1817 const char *vpath = client->request.vpath; in php_cli_server_client_read_request_on_message_complete()
1818 const char *end = vpath + client->request.vpath_len; in php_cli_server_client_read_request_on_message_complete()
1820 client->request.ext = end; in php_cli_server_client_read_request_on_message_complete()
1821 client->request.ext_len = 0; in php_cli_server_client_read_request_on_message_complete()
1826 client->request.ext = p; in php_cli_server_client_read_request_on_message_complete()
1827 client->request.ext_len = end - p; in php_cli_server_client_read_request_on_message_complete()
1940 request_info->request_method = php_http_method_str(client->request.request_method); in php_cli_server_client_populate_request_info()
1941 request_info->proto_num = client->request.protocol_version; in php_cli_server_client_populate_request_info()
1942 request_info->request_uri = ZSTR_VAL(client->request.request_uri); in php_cli_server_client_populate_request_info()
1943 request_info->path_translated = client->request.path_translated; in php_cli_server_client_populate_request_info()
1944 request_info->query_string = client->request.query_string; in php_cli_server_client_populate_request_info()
1945 request_info->content_length = client->request.content_len; in php_cli_server_client_populate_request_info()
1947 …if (NULL != (val = zend_hash_str_find(&client->request.headers, "content-type", sizeof("content-ty… in php_cli_server_client_populate_request_info()
1983 php_cli_server_request_ctor(&client->request); in php_cli_server_client_ctor()
1991 php_cli_server_request_dtor(&client->request); in php_cli_server_client_dtor()
2025 if (client->request.request_method != PHP_HTTP_HEAD) { in php_cli_server_send_error_page()
2026 …entities_ex((const unsigned char *) ZSTR_VAL(client->request.request_uri), ZSTR_LEN(client->reques… in php_cli_server_send_error_page()
2075 append_http_status_line(&buffer, client->request.protocol_version, status, 1); in php_cli_server_send_error_page()
2127 if (strlen(client->request.path_translated) != client->request.path_translated_len) { in php_cli_server_dispatch_script()
2149 if (client->request.request_method == PHP_HTTP_DELETE in php_cli_server_begin_send_static()
2150 || client->request.request_method == PHP_HTTP_PUT in php_cli_server_begin_send_static()
2151 || client->request.request_method == PHP_HTTP_PATCH) { in php_cli_server_begin_send_static()
2155 …if (client->request.path_translated && strlen(client->request.path_translated) != client->request.… in php_cli_server_begin_send_static()
2166 if (client->request.path_translated && in php_cli_server_begin_send_static()
2167 ('.' == client->request.path_translated[client->request.path_translated_len-1] || in php_cli_server_begin_send_static()
2168 ' ' == client->request.path_translated[client->request.path_translated_len-1])) { in php_cli_server_begin_send_static()
2172 …fd = client->request.path_translated ? php_win32_ioutil_open(client->request.path_translated, O_RD… in php_cli_server_begin_send_static()
2174 fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1; in php_cli_server_begin_send_static()
2182 if (client->request.request_method != PHP_HTTP_HEAD) { in php_cli_server_begin_send_static()
2189 const char *mime_type = get_mime_type(server, client->request.ext, client->request.ext_len); in php_cli_server_begin_send_static()
2191 append_http_status_line(&buffer, client->request.protocol_version, status, 1); in php_cli_server_begin_send_static()
2207 smart_str_append_unsigned_ex(&buffer, client->request.sb.st_size, 1); in php_cli_server_begin_send_static()
2227 …if (NULL != (auth = zend_hash_str_find(&client->request.headers, "authorization", sizeof("authoriz… in php_cli_server_request_startup()
2297 const char *ext = client->request.ext; in php_cli_server_dispatch()
2300 if (client->request.ext_len != 3 in php_cli_server_dispatch()
2302 || !client->request.path_translated) { in php_cli_server_dispatch()
2649 if (client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { in php_cli_server_recv_event_read_request()