1- from libc.stdint cimport int32_t, uint8_t, uint16_t, uint64_t
1+ # This file contains just the definitions needed in our Cython code.
2+
3+ from libc.stdint cimport uint8_t, uint16_t, uint64_t
24
35
46cdef extern from " llhttp.h" :
57
68 struct llhttp__internal_s:
7- int32_t _index
8- void * _span_pos0
9- void * _span_cb0
10- int32_t error
11- const char * reason
12- const char * error_pos
139 void * data
14- void * _current
1510 uint64_t content_length
1611 uint8_t type
1712 uint8_t method
1813 uint8_t http_major
1914 uint8_t http_minor
20- uint8_t header_state
21- uint8_t lenient_flags
2215 uint8_t upgrade
23- uint8_t finish
2416 uint16_t flags
2517 uint16_t status_code
26- void * settings
2718
2819 ctypedef llhttp__internal_s llhttp__internal_t
2920 ctypedef llhttp__internal_t llhttp_t
@@ -43,20 +34,10 @@ cdef extern from "llhttp.h":
4334 llhttp_cb on_chunk_header
4435 llhttp_cb on_chunk_complete
4536
46- llhttp_cb on_url_complete
47- llhttp_cb on_status_complete
48- llhttp_cb on_header_field_complete
49- llhttp_cb on_header_value_complete
50-
5137 ctypedef llhttp_settings_s llhttp_settings_t
5238
5339 enum llhttp_errno:
5440 HPE_OK,
55- HPE_INTERNAL,
56- HPE_STRICT,
57- HPE_LF_EXPECTED,
58- HPE_UNEXPECTED_CONTENT_LENGTH,
59- HPE_CLOSED_CONNECTION,
6041 HPE_INVALID_METHOD,
6142 HPE_INVALID_URL,
6243 HPE_INVALID_CONSTANT,
@@ -73,8 +54,7 @@ cdef extern from "llhttp.h":
7354 HPE_CB_CHUNK_HEADER,
7455 HPE_CB_CHUNK_COMPLETE,
7556 HPE_PAUSED,
76- HPE_PAUSED_UPGRADE,
77- HPE_USER
57+ HPE_PAUSED_UPGRADE
7858
7959 ctypedef llhttp_errno llhttp_errno_t
8060
@@ -84,58 +64,10 @@ cdef extern from "llhttp.h":
8464
8565 enum llhttp_type:
8666 HTTP_REQUEST,
87- HTTP_RESPONSE,
88- HTTP_BOTH
67+ HTTP_RESPONSE
8968
9069 enum llhttp_method:
91- HTTP_DELETE,
92- HTTP_GET,
93- HTTP_HEAD,
94- HTTP_POST,
95- HTTP_PUT,
96- HTTP_CONNECT,
97- HTTP_OPTIONS,
98- HTTP_TRACE,
99- HTTP_COPY,
100- HTTP_LOCK,
101- HTTP_MKCOL,
102- HTTP_MOVE,
103- HTTP_PROPFIND,
104- HTTP_PROPPATCH,
105- HTTP_SEARCH,
106- HTTP_UNLOCK,
107- HTTP_BIND,
108- HTTP_REBIND,
109- HTTP_UNBIND,
110- HTTP_ACL,
111- HTTP_REPORT,
112- HTTP_MKACTIVITY,
113- HTTP_CHECKOUT,
114- HTTP_MERGE,
115- HTTP_MSEARCH,
116- HTTP_NOTIFY,
117- HTTP_SUBSCRIBE,
118- HTTP_UNSUBSCRIBE,
119- HTTP_PATCH,
120- HTTP_PURGE,
121- HTTP_MKCALENDAR,
122- HTTP_LINK,
123- HTTP_UNLINK,
124- HTTP_SOURCE,
125- HTTP_PRI,
126- HTTP_DESCRIBE,
127- HTTP_ANNOUNCE,
128- HTTP_SETUP,
129- HTTP_PLAY,
130- HTTP_PAUSE,
131- HTTP_TEARDOWN,
132- HTTP_GET_PARAMETER,
133- HTTP_SET_PARAMETER,
134- HTTP_REDIRECT,
135- HTTP_RECORD,
136- HTTP_FLUSH
137-
138- ctypedef llhttp_method llhttp_method_t;
70+ HTTP_CONNECT
13971
14072 void llhttp_settings_init(llhttp_settings_t* settings)
14173 void llhttp_init(llhttp_t* parser, llhttp_type type ,
@@ -152,8 +84,6 @@ cdef extern from "llhttp.h":
15284 const char * llhttp_get_error_reason(const llhttp_t* parser)
15385 const char * llhttp_get_error_pos(const llhttp_t* parser)
15486
155- const char * llhttp_method_name(llhttp_method_t method)
156-
15787 void llhttp_set_lenient_headers(llhttp_t* parser, int enabled)
15888 void llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, int enabled)
15989 void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled)
0 commit comments