Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_HTTP_H_INCLUDED_
0009 #define _NGX_HTTP_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 
0015 
0016 typedef struct ngx_http_request_s     ngx_http_request_t;
0017 typedef struct ngx_http_upstream_s    ngx_http_upstream_t;
0018 typedef struct ngx_http_cache_s       ngx_http_cache_t;
0019 typedef struct ngx_http_file_cache_s  ngx_http_file_cache_t;
0020 typedef struct ngx_http_log_ctx_s     ngx_http_log_ctx_t;
0021 typedef struct ngx_http_chunked_s     ngx_http_chunked_t;
0022 typedef struct ngx_http_v2_stream_s   ngx_http_v2_stream_t;
0023 
0024 typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
0025     ngx_table_elt_t *h, ngx_uint_t offset);
0026 typedef u_char *(*ngx_http_log_handler_pt)(ngx_http_request_t *r,
0027     ngx_http_request_t *sr, u_char *buf, size_t len);
0028 
0029 
0030 #include <ngx_http_variables.h>
0031 #include <ngx_http_config.h>
0032 #include <ngx_http_request.h>
0033 #include <ngx_http_script.h>
0034 #include <ngx_http_upstream.h>
0035 #include <ngx_http_upstream_round_robin.h>
0036 #include <ngx_http_core_module.h>
0037 
0038 #if (NGX_HTTP_V2)
0039 #include <ngx_http_v2.h>
0040 #endif
0041 #if (NGX_HTTP_CACHE)
0042 #include <ngx_http_cache.h>
0043 #endif
0044 #if (NGX_HTTP_SSI)
0045 #include <ngx_http_ssi_filter_module.h>
0046 #endif
0047 #if (NGX_HTTP_SSL)
0048 #include <ngx_http_ssl_module.h>
0049 #endif
0050 
0051 
0052 struct ngx_http_log_ctx_s {
0053     ngx_connection_t    *connection;
0054     ngx_http_request_t  *request;
0055     ngx_http_request_t  *current_request;
0056 };
0057 
0058 
0059 struct ngx_http_chunked_s {
0060     ngx_uint_t           state;
0061     off_t                size;
0062     off_t                length;
0063 };
0064 
0065 
0066 typedef struct {
0067     ngx_uint_t           http_version;
0068     ngx_uint_t           code;
0069     ngx_uint_t           count;
0070     u_char              *start;
0071     u_char              *end;
0072 } ngx_http_status_t;
0073 
0074 
0075 #define ngx_http_get_module_ctx(r, module)  (r)->ctx[module.ctx_index]
0076 #define ngx_http_set_ctx(r, c, module)      r->ctx[module.ctx_index] = c;
0077 
0078 
0079 ngx_int_t ngx_http_add_location(ngx_conf_t *cf, ngx_queue_t **locations,
0080     ngx_http_core_loc_conf_t *clcf);
0081 ngx_int_t ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
0082     ngx_http_listen_opt_t *lsopt);
0083 
0084 
0085 void ngx_http_init_connection(ngx_connection_t *c);
0086 void ngx_http_close_connection(ngx_connection_t *c);
0087 
0088 #if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
0089 int ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
0090 #endif
0091 
0092 ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
0093 ngx_int_t ngx_http_parse_uri(ngx_http_request_t *r);
0094 ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
0095     ngx_uint_t merge_slashes);
0096 ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
0097     ngx_http_status_t *status);
0098 ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
0099     ngx_str_t *args, ngx_uint_t *flags);
0100 ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
0101     ngx_uint_t allow_underscores);
0102 ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
0103     ngx_str_t *name, ngx_str_t *value);
0104 ngx_int_t ngx_http_parse_set_cookie_lines(ngx_array_t *headers,
0105     ngx_str_t *name, ngx_str_t *value);
0106 ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
0107     ngx_str_t *value);
0108 void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
0109     ngx_str_t *args);
0110 ngx_int_t ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
0111     ngx_http_chunked_t *ctx);
0112 
0113 
0114 ngx_http_request_t *ngx_http_create_request(ngx_connection_t *c);
0115 ngx_int_t ngx_http_process_request_uri(ngx_http_request_t *r);
0116 ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
0117 void ngx_http_process_request(ngx_http_request_t *r);
0118 void ngx_http_update_location_config(ngx_http_request_t *r);
0119 void ngx_http_handler(ngx_http_request_t *r);
0120 void ngx_http_run_posted_requests(ngx_connection_t *c);
0121 ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
0122     ngx_http_posted_request_t *pr);
0123 void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
0124 void ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc);
0125 
0126 void ngx_http_empty_handler(ngx_event_t *wev);
0127 void ngx_http_request_empty_handler(ngx_http_request_t *r);
0128 
0129 
0130 #define NGX_HTTP_LAST   1
0131 #define NGX_HTTP_FLUSH  2
0132 
0133 ngx_int_t ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags);
0134 
0135 
0136 ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r,
0137     ngx_http_client_body_handler_pt post_handler);
0138 ngx_int_t ngx_http_read_unbuffered_request_body(ngx_http_request_t *r);
0139 
0140 ngx_int_t ngx_http_send_header(ngx_http_request_t *r);
0141 ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r,
0142     ngx_int_t error);
0143 ngx_int_t ngx_http_filter_finalize_request(ngx_http_request_t *r,
0144     ngx_module_t *m, ngx_int_t error);
0145 void ngx_http_clean_header(ngx_http_request_t *r);
0146 
0147 
0148 ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r);
0149 void ngx_http_discarded_request_body_handler(ngx_http_request_t *r);
0150 void ngx_http_block_reading(ngx_http_request_t *r);
0151 void ngx_http_test_reading(ngx_http_request_t *r);
0152 
0153 
0154 char *ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
0155 char *ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys,
0156     ngx_hash_t *types_hash, ngx_array_t **prev_keys,
0157     ngx_hash_t *prev_types_hash, ngx_str_t *default_types);
0158 ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
0159     ngx_str_t *default_type);
0160 
0161 #if (NGX_HTTP_DEGRADATION)
0162 ngx_uint_t  ngx_http_degraded(ngx_http_request_t *);
0163 #endif
0164 
0165 
0166 extern ngx_module_t  ngx_http_module;
0167 
0168 extern ngx_str_t  ngx_http_html_default_types[];
0169 
0170 
0171 extern ngx_http_output_header_filter_pt  ngx_http_top_header_filter;
0172 extern ngx_http_output_body_filter_pt    ngx_http_top_body_filter;
0173 extern ngx_http_request_body_filter_pt   ngx_http_top_request_body_filter;
0174 
0175 
0176 #endif /* _NGX_HTTP_H_INCLUDED_ */