Deleted
Added
nxt_http.h (1148:f93deb2432da) | nxt_http.h (1183:6008abf06746) |
---|---|
1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#ifndef _NXT_HTTP_H_INCLUDED_ 8#define _NXT_HTTP_H_INCLUDED_ --- 10 unchanged lines hidden (view full) --- 19 20 NXT_HTTP_MULTIPLE_CHOICES = 300, 21 NXT_HTTP_MOVED_PERMANENTLY = 301, 22 NXT_HTTP_FOUND = 302, 23 NXT_HTTP_SEE_OTHER = 303, 24 NXT_HTTP_NOT_MODIFIED = 304, 25 26 NXT_HTTP_BAD_REQUEST = 400, | 1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#ifndef _NXT_HTTP_H_INCLUDED_ 8#define _NXT_HTTP_H_INCLUDED_ --- 10 unchanged lines hidden (view full) --- 19 20 NXT_HTTP_MULTIPLE_CHOICES = 300, 21 NXT_HTTP_MOVED_PERMANENTLY = 301, 22 NXT_HTTP_FOUND = 302, 23 NXT_HTTP_SEE_OTHER = 303, 24 NXT_HTTP_NOT_MODIFIED = 304, 25 26 NXT_HTTP_BAD_REQUEST = 400, |
27 NXT_HTTP_FORBIDDEN = 403, |
|
27 NXT_HTTP_NOT_FOUND = 404, | 28 NXT_HTTP_NOT_FOUND = 404, |
29 NXT_HTTP_METHOD_NOT_ALLOWED = 405, |
|
28 NXT_HTTP_REQUEST_TIMEOUT = 408, 29 NXT_HTTP_LENGTH_REQUIRED = 411, 30 NXT_HTTP_PAYLOAD_TOO_LARGE = 413, 31 NXT_HTTP_URI_TOO_LONG = 414, 32 NXT_HTTP_UPGRADE_REQUIRED = 426, 33 NXT_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, 34 35 NXT_HTTP_TO_HTTPS = 497, --- 146 unchanged lines hidden (view full) --- 182 void (*discard)(nxt_task_t *task, nxt_http_request_t *r, nxt_buf_t *last); 183 void (*close)(nxt_task_t *task, nxt_http_proto_t proto, 184 nxt_socket_conf_joint_t *joint); 185 void (*ws_frame_start)(nxt_task_t *task, nxt_http_request_t *r, 186 nxt_buf_t *ws_frame); 187} nxt_http_proto_table_t; 188 189 | 30 NXT_HTTP_REQUEST_TIMEOUT = 408, 31 NXT_HTTP_LENGTH_REQUIRED = 411, 32 NXT_HTTP_PAYLOAD_TOO_LARGE = 413, 33 NXT_HTTP_URI_TOO_LONG = 414, 34 NXT_HTTP_UPGRADE_REQUIRED = 426, 35 NXT_HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, 36 37 NXT_HTTP_TO_HTTPS = 497, --- 146 unchanged lines hidden (view full) --- 184 void (*discard)(nxt_task_t *task, nxt_http_request_t *r, nxt_buf_t *last); 185 void (*close)(nxt_task_t *task, nxt_http_proto_t proto, 186 nxt_socket_conf_joint_t *joint); 187 void (*ws_frame_start)(nxt_task_t *task, nxt_http_request_t *r, 188 nxt_buf_t *ws_frame); 189} nxt_http_proto_table_t; 190 191 |
192#define NXT_HTTP_DATE_LEN nxt_length("Wed, 31 Dec 1986 16:40:00 GMT") 193 194nxt_inline u_char * 195nxt_http_date(u_char *buf, struct tm *tm) 196{ 197 static const char *week[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", 198 "Sat" }; 199 200 static const char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", 201 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 202 203 return nxt_sprintf(buf, buf + NXT_HTTP_DATE_LEN, 204 "%s, %02d %s %4d %02d:%02d:%02d GMT", 205 week[tm->tm_wday], tm->tm_mday, 206 month[tm->tm_mon], tm->tm_year + 1900, 207 tm->tm_hour, tm->tm_min, tm->tm_sec); 208} 209 210 |
|
190nxt_int_t nxt_http_init(nxt_task_t *task, nxt_runtime_t *rt); 191nxt_int_t nxt_h1p_init(nxt_task_t *task, nxt_runtime_t *rt); 192nxt_int_t nxt_http_response_hash_init(nxt_task_t *task, nxt_runtime_t *rt); 193 194void nxt_http_conn_init(nxt_task_t *task, void *obj, void *data); 195nxt_http_request_t *nxt_http_request_create(nxt_task_t *task); 196void nxt_http_request_error(nxt_task_t *task, nxt_http_request_t *r, 197 nxt_http_status_t status); --- 22 unchanged lines hidden (view full) --- 220nxt_http_pass_t *nxt_http_pass_create(nxt_task_t *task, 221 nxt_router_temp_conf_t *tmcf, nxt_str_t *name); 222void nxt_http_routes_resolve(nxt_task_t *task, nxt_router_temp_conf_t *tmcf); 223nxt_http_pass_t *nxt_http_pass_application(nxt_task_t *task, 224 nxt_router_temp_conf_t *tmcf, nxt_str_t *name); 225void nxt_http_routes_cleanup(nxt_task_t *task, nxt_http_routes_t *routes); 226void nxt_http_pass_cleanup(nxt_task_t *task, nxt_http_pass_t *pass); 227 | 211nxt_int_t nxt_http_init(nxt_task_t *task, nxt_runtime_t *rt); 212nxt_int_t nxt_h1p_init(nxt_task_t *task, nxt_runtime_t *rt); 213nxt_int_t nxt_http_response_hash_init(nxt_task_t *task, nxt_runtime_t *rt); 214 215void nxt_http_conn_init(nxt_task_t *task, void *obj, void *data); 216nxt_http_request_t *nxt_http_request_create(nxt_task_t *task); 217void nxt_http_request_error(nxt_task_t *task, nxt_http_request_t *r, 218 nxt_http_status_t status); --- 22 unchanged lines hidden (view full) --- 241nxt_http_pass_t *nxt_http_pass_create(nxt_task_t *task, 242 nxt_router_temp_conf_t *tmcf, nxt_str_t *name); 243void nxt_http_routes_resolve(nxt_task_t *task, nxt_router_temp_conf_t *tmcf); 244nxt_http_pass_t *nxt_http_pass_application(nxt_task_t *task, 245 nxt_router_temp_conf_t *tmcf, nxt_str_t *name); 246void nxt_http_routes_cleanup(nxt_task_t *task, nxt_http_routes_t *routes); 247void nxt_http_pass_cleanup(nxt_task_t *task, nxt_http_pass_t *pass); 248 |
249nxt_http_pass_t *nxt_http_static_handler(nxt_task_t *task, 250 nxt_http_request_t *r, nxt_http_pass_t *pass); 251nxt_int_t nxt_http_static_mtypes_init(nxt_mp_t *mp, nxt_lvlhsh_t *hash); 252nxt_int_t nxt_http_static_mtypes_hash_add(nxt_mp_t *mp, nxt_lvlhsh_t *hash, 253 nxt_str_t *extension, nxt_str_t *type); 254nxt_str_t *nxt_http_static_mtypes_hash_find(nxt_lvlhsh_t *hash, 255 nxt_str_t *extension); 256 |
|
228nxt_http_pass_t *nxt_http_request_application(nxt_task_t *task, 229 nxt_http_request_t *r, nxt_http_pass_t *pass); 230 231extern nxt_time_string_t nxt_http_date_cache; 232 233extern nxt_lvlhsh_t nxt_response_fields_hash; 234 235extern const nxt_http_proto_table_t nxt_http_proto[]; 236 237void nxt_h1p_websocket_first_frame_start(nxt_task_t *task, 238 nxt_http_request_t *r, nxt_buf_t *ws_frame); 239void nxt_h1p_websocket_frame_start(nxt_task_t *task, nxt_http_request_t *r, 240 nxt_buf_t *ws_frame); 241void nxt_h1p_complete_buffers(nxt_task_t *task, nxt_h1proto_t *h1p); 242nxt_msec_t nxt_h1p_conn_request_timer_value(nxt_conn_t *c, uintptr_t data); 243 244extern const nxt_conn_state_t nxt_h1p_idle_close_state; 245 246#endif /* _NXT_HTTP_H_INCLUDED_ */ | 257nxt_http_pass_t *nxt_http_request_application(nxt_task_t *task, 258 nxt_http_request_t *r, nxt_http_pass_t *pass); 259 260extern nxt_time_string_t nxt_http_date_cache; 261 262extern nxt_lvlhsh_t nxt_response_fields_hash; 263 264extern const nxt_http_proto_table_t nxt_http_proto[]; 265 266void nxt_h1p_websocket_first_frame_start(nxt_task_t *task, 267 nxt_http_request_t *r, nxt_buf_t *ws_frame); 268void nxt_h1p_websocket_frame_start(nxt_task_t *task, nxt_http_request_t *r, 269 nxt_buf_t *ws_frame); 270void nxt_h1p_complete_buffers(nxt_task_t *task, nxt_h1proto_t *h1p); 271nxt_msec_t nxt_h1p_conn_request_timer_value(nxt_conn_t *c, uintptr_t data); 272 273extern const nxt_conn_state_t nxt_h1p_idle_close_state; 274 275#endif /* _NXT_HTTP_H_INCLUDED_ */ |