Lines Matching refs:request

178 	php_cli_server_request request;  member
371 if (NULL != (val = zend_hash_str_find_ptr(&client->request.headers, "host", sizeof("host")-1))) { in append_essential_headers()
412 headers = &client->request.headers_original_case; in PHP_FUNCTION()
567 …append_http_status_line(&buffer, client->request.protocol_version, SG(sapi_headers).http_response_… in sapi_cli_server_send_headers()
593 …if (NULL == (val = zend_hash_str_find_ptr(&client->request.headers, "cookie", sizeof("cookie")-1))… in sapi_cli_server_read_cookies()
602 if (client->request.content) { in sapi_cli_server_read_post()
603 size_t content_len = client->request.content_len; in sapi_cli_server_read_post()
605 memmove(buf, client->request.content + client->post_read_offset, nbytes_copied); in sapi_cli_server_read_post()
682 …spprintf(&tmp, 0, "HTTP/%d.%d", client->request.protocol_version / 100, client->request.protocol_v… in sapi_cli_server_register_variables()
694 sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri); in sapi_cli_server_register_variables()
696 sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath); in sapi_cli_server_register_variables()
702 if (client->request.path_info) { in sapi_cli_server_register_variables()
703 sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info); in sapi_cli_server_register_variables()
705 if (client->request.path_info_len) { in sapi_cli_server_register_variables()
707 spprintf(&tmp, 0, "%s%s", client->request.vpath, client->request.path_info); in sapi_cli_server_register_variables()
711 sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath); in sapi_cli_server_register_variables()
713 if (client->request.query_string) { in sapi_cli_server_register_variables()
714 sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string); in sapi_cli_server_register_variables()
716 …zend_hash_apply_with_arguments(&client->request.headers, (apply_func_args_t)sapi_cli_server_regist… in sapi_cli_server_register_variables()
1170 …, client->addr_str, status, php_http_method_str(client->request.request_method), client->request.r… in php_cli_server_log_response()
1392 static void php_cli_server_request_translate_vpath(php_cli_server_request *request, const char *doc… in php_cli_server_request_translate_vpath() argument
1396 …char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"),… in php_cli_server_request_translate_vpath()
1404 if (request->vpath_len > 0 && request->vpath[0] != '/') { in php_cli_server_request_translate_vpath()
1407 q = request->vpath + request->vpath_len; in php_cli_server_request_translate_vpath()
1408 while (q > request->vpath) { in php_cli_server_request_translate_vpath()
1414 memmove(p, request->vpath, request->vpath_len); in php_cli_server_request_translate_vpath()
1416 q = p + request->vpath_len; in php_cli_server_request_translate_vpath()
1423 p += request->vpath_len; in php_cli_server_request_translate_vpath()
1462 request->path_info_len = prev_path_len; in php_cli_server_request_translate_vpath()
1470 request->path_info = prev_path; in php_cli_server_request_translate_vpath()
1471 pefree(request->vpath, 1); in php_cli_server_request_translate_vpath()
1472 request->vpath = pestrndup(vpath, q - vpath, 1); in php_cli_server_request_translate_vpath()
1473 request->vpath_len = q - vpath; in php_cli_server_request_translate_vpath()
1474 request->path_translated = buf; in php_cli_server_request_translate_vpath()
1475 request->path_translated_len = q - buf; in php_cli_server_request_translate_vpath()
1477 pefree(request->vpath, 1); in php_cli_server_request_translate_vpath()
1478 request->vpath = pestrndup(vpath, q - vpath, 1); in php_cli_server_request_translate_vpath()
1479 request->vpath_len = q - vpath; in php_cli_server_request_translate_vpath()
1480 request->path_translated = buf; in php_cli_server_request_translate_vpath()
1481 request->path_translated_len = q - buf; in php_cli_server_request_translate_vpath()
1486 for (;i<request->vpath_len;i++) { in php_cli_server_request_translate_vpath()
1487 if (request->vpath[i] == '\\') { in php_cli_server_request_translate_vpath()
1488 request->vpath[i] = '/'; in php_cli_server_request_translate_vpath()
1493 request->sb = sb; in php_cli_server_request_translate_vpath()
1589 if (UNEXPECTED(client->request.vpath != NULL)) { in php_cli_server_client_read_request_on_path()
1593 client->request.vpath = vpath; in php_cli_server_client_read_request_on_path()
1594 client->request.vpath_len = vpath_len; in php_cli_server_client_read_request_on_path()
1602 if (EXPECTED(client->request.query_string == NULL)) { in php_cli_server_client_read_request_on_query_string()
1603 client->request.query_string = pestrndup(at, length, 1); in php_cli_server_client_read_request_on_query_string()
1604 client->request.query_string_len = length; in php_cli_server_client_read_request_on_query_string()
1606 …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()
1607 …client->request.query_string = perealloc(client->request.query_string, client->request.query_strin… in php_cli_server_client_read_request_on_query_string()
1608 memcpy(client->request.query_string + client->request.query_string_len, at, length); in php_cli_server_client_read_request_on_query_string()
1609 client->request.query_string_len += length; in php_cli_server_client_read_request_on_query_string()
1610 client->request.query_string[client->request.query_string_len] = '\0'; in php_cli_server_client_read_request_on_query_string()
1618 if (EXPECTED(client->request.request_uri == NULL)) { in php_cli_server_client_read_request_on_url()
1619 client->request.request_method = parser->method; in php_cli_server_client_read_request_on_url()
1620 client->request.request_uri = pestrndup(at, length, 1); in php_cli_server_client_read_request_on_url()
1621 client->request.request_uri_len = length; in php_cli_server_client_read_request_on_url()
1623 ZEND_ASSERT(client->request.request_method == parser->method); in php_cli_server_client_read_request_on_url()
1624 …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()
1625 …client->request.request_uri = perealloc(client->request.request_uri, client->request.request_uri_l… in php_cli_server_client_read_request_on_url()
1626 memcpy(client->request.request_uri + client->request.request_uri_len, at, length); in php_cli_server_client_read_request_on_url()
1627 client->request.request_uri_len += length; in php_cli_server_client_read_request_on_url()
1628 client->request.request_uri[client->request.request_uri_len] = '\0'; in php_cli_server_client_read_request_on_url()
1646 zend_hash_add_ptr(&client->request.headers, lc_header_name, client->current_header_value); in php_cli_server_client_save_header()
1647 …zend_hash_add_ptr(&client->request.headers_original_case, orig_header_name, client->current_header… in php_cli_server_client_save_header()
1744 if (!client->request.content) { in php_cli_server_client_read_request_on_body()
1745 client->request.content = pemalloc(parser->content_length, 1); in php_cli_server_client_read_request_on_body()
1746 client->request.content_len = 0; in php_cli_server_client_read_request_on_body()
1748 …client->request.content = perealloc(client->request.content, client->request.content_len + length,… in php_cli_server_client_read_request_on_body()
1749 memmove(client->request.content + client->request.content_len, at, length); in php_cli_server_client_read_request_on_body()
1750 client->request.content_len += length; in php_cli_server_client_read_request_on_body()
1757 client->request.protocol_version = parser->http_major * 100 + parser->http_minor; in php_cli_server_client_read_request_on_message_complete()
1758 …php_cli_server_request_translate_vpath(&client->request, client->server->document_root, client->se… in php_cli_server_client_read_request_on_message_complete()
1760 const char *vpath = client->request.vpath, *end = vpath + client->request.vpath_len, *p = end; in php_cli_server_client_read_request_on_message_complete()
1761 client->request.ext = end; in php_cli_server_client_read_request_on_message_complete()
1762 client->request.ext_len = 0; in php_cli_server_client_read_request_on_message_complete()
1767 client->request.ext = p; in php_cli_server_client_read_request_on_message_complete()
1768 client->request.ext_len = end - p; in php_cli_server_client_read_request_on_message_complete()
1879 request_info->request_method = php_http_method_str(client->request.request_method); in php_cli_server_client_populate_request_info()
1880 request_info->proto_num = client->request.protocol_version; in php_cli_server_client_populate_request_info()
1881 request_info->request_uri = client->request.request_uri; in php_cli_server_client_populate_request_info()
1882 request_info->path_translated = client->request.path_translated; in php_cli_server_client_populate_request_info()
1883 request_info->query_string = client->request.query_string; in php_cli_server_client_populate_request_info()
1884 request_info->content_length = client->request.content_len; in php_cli_server_client_populate_request_info()
1886 …request_info->content_type = zend_hash_str_find_ptr(&client->request.headers, "content-type", size… in php_cli_server_client_populate_request_info()
1918 if (FAILURE == php_cli_server_request_ctor(&client->request)) { in php_cli_server_client_ctor()
1928 php_cli_server_request_dtor(&client->request); in php_cli_server_client_dtor()
1958 …p_escape_html_entities_ex((const unsigned char *) client->request.request_uri, client->request.req… in php_cli_server_send_error_page()
2006 append_http_status_line(&buffer, client->request.protocol_version, status, 1); in php_cli_server_send_error_page()
2044 if (strlen(client->request.path_translated) != client->request.path_translated_len) { in php_cli_server_dispatch_script()
2067 …if (client->request.path_translated && strlen(client->request.path_translated) != client->request.… in php_cli_server_begin_send_static()
2078 if (client->request.path_translated && in php_cli_server_begin_send_static()
2079 ('.' == client->request.path_translated[client->request.path_translated_len-1] || in php_cli_server_begin_send_static()
2080 ' ' == client->request.path_translated[client->request.path_translated_len-1])) { in php_cli_server_begin_send_static()
2084 …fd = client->request.path_translated ? php_win32_ioutil_open(client->request.path_translated, O_RD… in php_cli_server_begin_send_static()
2086 fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1; in php_cli_server_begin_send_static()
2099 const char *mime_type = get_mime_type(server, client->request.ext, client->request.ext_len); in php_cli_server_begin_send_static()
2101 append_http_status_line(&buffer, client->request.protocol_version, status, 1); in php_cli_server_begin_send_static()
2117 smart_str_append_unsigned_ex(&buffer, client->request.sb.st_size, 1); in php_cli_server_begin_send_static()
2137 …if (NULL != (auth = zend_hash_str_find_ptr(&client->request.headers, "authorization", sizeof("auth… in php_cli_server_request_startup()
2201 const char *ext = client->request.ext; in php_cli_server_dispatch()
2204 if (client->request.ext_len != 3 in php_cli_server_dispatch()
2206 || !client->request.path_translated) { in php_cli_server_dispatch()
2544 } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { in php_cli_server_recv_event_read_request()