php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_http_parser.h File Reference
#include <sys/types.h>
#include <php_config.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  php_http_parser
 
struct  php_http_parser_settings
 

Macros

#define PHP_HTTP_PARSER_STRICT   1
 
#define PHP_HTTP_MAX_HEADER_SIZE   (80*1024)
 

Typedefs

typedef struct php_http_parser php_http_parser
 
typedef struct php_http_parser_settings php_http_parser_settings
 
typedef int(* php_http_data_cb) (php_http_parser *, const char *at, size_t length)
 
typedef int(* php_http_cb) (php_http_parser *)
 

Enumerations

enum  php_http_method {
  PHP_HTTP_DELETE = 0 , PHP_HTTP_GET , PHP_HTTP_HEAD , PHP_HTTP_POST ,
  PHP_HTTP_PUT , PHP_HTTP_PATCH , PHP_HTTP_CONNECT , PHP_HTTP_OPTIONS ,
  PHP_HTTP_TRACE , PHP_HTTP_COPY , PHP_HTTP_LOCK , PHP_HTTP_MKCOL ,
  PHP_HTTP_MOVE , PHP_HTTP_MKCALENDAR , PHP_HTTP_PROPFIND , PHP_HTTP_PROPPATCH ,
  PHP_HTTP_SEARCH , PHP_HTTP_UNLOCK , PHP_HTTP_REPORT , PHP_HTTP_MKACTIVITY ,
  PHP_HTTP_CHECKOUT , PHP_HTTP_MERGE , PHP_HTTP_MSEARCH , PHP_HTTP_NOTIFY ,
  PHP_HTTP_SUBSCRIBE , PHP_HTTP_UNSUBSCRIBE , PHP_HTTP_NOT_IMPLEMENTED
}
 
enum  php_http_parser_type { PHP_HTTP_REQUEST , PHP_HTTP_RESPONSE , PHP_HTTP_BOTH }
 
enum  state {
  s_dead = 1 , s_start_req_or_res , s_res_or_resp_H , s_start_res ,
  s_res_H , s_res_HT , s_res_HTT , s_res_HTTP ,
  s_res_first_http_major , s_res_http_major , s_res_first_http_minor , s_res_http_minor ,
  s_res_first_status_code , s_res_status_code , s_res_status , s_res_line_almost_done ,
  s_start_req , s_req_method , s_req_spaces_before_url , s_req_schema ,
  s_req_schema_slash , s_req_schema_slash_slash , s_req_host , s_req_port ,
  s_req_path , s_req_query_string_start , s_req_query_string , s_req_fragment_start ,
  s_req_fragment , s_req_http_start , s_req_http_H , s_req_http_HT ,
  s_req_http_HTT , s_req_http_HTTP , s_req_first_http_major , s_req_http_major ,
  s_req_first_http_minor , s_req_http_minor , s_req_line_almost_done , s_header_field_start ,
  s_header_field , s_header_value_start , s_header_value , s_header_almost_done ,
  s_headers_almost_done , s_chunk_size_start , s_chunk_size , s_chunk_size_almost_done ,
  s_chunk_parameters , s_chunk_data , s_chunk_data_almost_done , s_chunk_data_done ,
  s_body_identity , s_body_identity_eof
}
 

Functions

void php_http_parser_init (php_http_parser *parser, enum php_http_parser_type type)
 
size_t php_http_parser_execute (php_http_parser *parser, const php_http_parser_settings *settings, const char *data, size_t len)
 
int php_http_should_keep_alive (php_http_parser *parser)
 
const char * php_http_method_str (enum php_http_method)
 

Macro Definition Documentation

◆ PHP_HTTP_MAX_HEADER_SIZE

#define PHP_HTTP_MAX_HEADER_SIZE   (80*1024)

Definition at line 50 of file php_http_parser.h.

◆ PHP_HTTP_PARSER_STRICT

#define PHP_HTTP_PARSER_STRICT   1

Definition at line 43 of file php_http_parser.h.

Typedef Documentation

◆ php_http_cb

typedef int(* php_http_cb) (php_http_parser *)

Definition at line 71 of file php_http_parser.h.

◆ php_http_data_cb

typedef int(* php_http_data_cb) (php_http_parser *, const char *at, size_t length)

Definition at line 70 of file php_http_parser.h.

◆ php_http_parser

typedef struct php_http_parser php_http_parser

Definition at line 53 of file php_http_parser.h.

◆ php_http_parser_settings

typedef struct php_http_parser_settings php_http_parser_settings

Definition at line 54 of file php_http_parser.h.

Enumeration Type Documentation

◆ php_http_method

Enumerator
PHP_HTTP_DELETE 
PHP_HTTP_GET 
PHP_HTTP_HEAD 
PHP_HTTP_POST 
PHP_HTTP_PUT 
PHP_HTTP_PATCH 
PHP_HTTP_CONNECT 
PHP_HTTP_OPTIONS 
PHP_HTTP_TRACE 
PHP_HTTP_COPY 
PHP_HTTP_LOCK 
PHP_HTTP_MKCOL 
PHP_HTTP_MOVE 
PHP_HTTP_MKCALENDAR 
PHP_HTTP_PROPFIND 
PHP_HTTP_PROPPATCH 
PHP_HTTP_SEARCH 
PHP_HTTP_UNLOCK 
PHP_HTTP_REPORT 
PHP_HTTP_MKACTIVITY 
PHP_HTTP_CHECKOUT 
PHP_HTTP_MERGE 
PHP_HTTP_MSEARCH 
PHP_HTTP_NOTIFY 
PHP_HTTP_SUBSCRIBE 
PHP_HTTP_UNSUBSCRIBE 
PHP_HTTP_NOT_IMPLEMENTED 

Definition at line 75 of file php_http_parser.h.

◆ php_http_parser_type

Enumerator
PHP_HTTP_REQUEST 
PHP_HTTP_RESPONSE 
PHP_HTTP_BOTH 

Definition at line 111 of file php_http_parser.h.

◆ state

enum state
Enumerator
s_dead 
s_start_req_or_res 
s_res_or_resp_H 
s_start_res 
s_res_H 
s_res_HT 
s_res_HTT 
s_res_HTTP 
s_res_first_http_major 
s_res_http_major 
s_res_first_http_minor 
s_res_http_minor 
s_res_first_status_code 
s_res_status_code 
s_res_status 
s_res_line_almost_done 
s_start_req 
s_req_method 
s_req_spaces_before_url 
s_req_schema 
s_req_schema_slash 
s_req_schema_slash_slash 
s_req_host 
s_req_port 
s_req_path 
s_req_query_string_start 
s_req_query_string 
s_req_fragment_start 
s_req_fragment 
s_req_http_start 
s_req_http_H 
s_req_http_HT 
s_req_http_HTT 
s_req_http_HTTP 
s_req_first_http_major 
s_req_http_major 
s_req_first_http_minor 
s_req_http_minor 
s_req_line_almost_done 
s_header_field_start 
s_header_field 
s_header_value_start 
s_header_value 
s_header_almost_done 
s_headers_almost_done 
s_chunk_size_start 
s_chunk_size 
s_chunk_size_almost_done 
s_chunk_parameters 
s_chunk_data 
s_chunk_data_almost_done 
s_chunk_data_done 
s_body_identity 
s_body_identity_eof 

Definition at line 113 of file php_http_parser.h.

Function Documentation

◆ php_http_method_str()

const char * php_http_method_str ( enum php_http_method)

Definition at line 1545 of file php_http_parser.c.

◆ php_http_parser_execute()

size_t php_http_parser_execute ( php_http_parser * parser,
const php_http_parser_settings * settings,
const char * data,
size_t len )

Definition at line 256 of file php_http_parser.c.

◆ php_http_parser_init()

void php_http_parser_init ( php_http_parser * parser,
enum php_http_parser_type type )

Definition at line 1552 of file php_http_parser.c.

◆ php_http_should_keep_alive()

int php_http_should_keep_alive ( php_http_parser * parser)

Definition at line 1525 of file php_http_parser.c.