Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.15.12 ]​[ nginx-1.16.0 ]​

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 #if (NGX_HTTP_SSL && defined SSL_R_CERT_CB_ERROR)
0092 int ngx_http_ssl_certificate(ngx_ssl_conn_t *ssl_conn, void *arg);
0093 #endif
0094 
0095 
0096 ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
0097 ngx_int_t ngx_http_parse_uri(ngx_http_request_t *r);
0098 ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
0099     ngx_uint_t merge_slashes);
0100 ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
0101     ngx_http_status_t *status);
0102 ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
0103     ngx_str_t *args, ngx_uint_t *flags);
0104 ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
0105     ngx_uint_t allow_underscores);
0106 ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
0107     ngx_str_t *name, ngx_str_t *value);
0108 ngx_int_t ngx_http_parse_set_cookie_lines(ngx_array_t *headers,
0109     ngx_str_t *name, ngx_str_t *value);
0110 ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
0111     ngx_str_t *value);
0112 void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
0113     ngx_str_t *args);
0114 ngx_int_t ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
0115     ngx_http_chunked_t *ctx);
0116 
0117 
0118 ngx_http_request_t *ngx_http_create_request(ngx_connection_t *c);
0119 ngx_int_t ngx_http_process_request_uri(ngx_http_request_t *r);
0120 ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
0121 void ngx_http_process_request(ngx_http_request_t *r);
0122 void ngx_http_update_location_config(ngx_http_request_t *r);
0123 void ngx_http_handler(ngx_http_request_t *r);
0124 void ngx_http_run_posted_requests(ngx_connection_t *c);
0125 ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
0126     ngx_http_posted_request_t *pr);
0127 void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
0128 void ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc);
0129 
0130 void ngx_http_empty_handler(ngx_event_t *wev);
0131 void ngx_http_request_empty_handler(ngx_http_request_t *r);
0132 
0133 
0134 #define NGX_HTTP_LAST   1
0135 #define NGX_HTTP_FLUSH  2
0136 
0137 ngx_int_t ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags);
0138 
0139 
0140 ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r,
0141     ngx_http_client_body_handler_pt post_handler);
0142 ngx_int_t ngx_http_read_unbuffered_request_body(ngx_http_request_t *r);
0143 
0144 ngx_int_t ngx_http_send_header(ngx_http_request_t *r);
0145 ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r,
0146     ngx_int_t error);
0147 ngx_int_t ngx_http_filter_finalize_request(ngx_http_request_t *r,
0148     ngx_module_t *m, ngx_int_t error);
0149 void ngx_http_clean_header(ngx_http_request_t *r);
0150 
0151 
0152 ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r);
0153 void ngx_http_discarded_request_body_handler(ngx_http_request_t *r);
0154 void ngx_http_block_reading(ngx_http_request_t *r);
0155 void ngx_http_test_reading(ngx_http_request_t *r);
0156 
0157 
0158 char *ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
0159 char *ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys,
0160     ngx_hash_t *types_hash, ngx_array_t **prev_keys,
0161     ngx_hash_t *prev_types_hash, ngx_str_t *default_types);
0162 ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
0163     ngx_str_t *default_type);
0164 
0165 #if (NGX_HTTP_DEGRADATION)
0166 ngx_uint_t  ngx_http_degraded(ngx_http_request_t *);
0167 #endif
0168 
0169 
0170 extern ngx_module_t  ngx_http_module;
0171 
0172 extern ngx_str_t  ngx_http_html_default_types[];
0173 
0174 
0175 extern ngx_http_output_header_filter_pt  ngx_http_top_header_filter;
0176 extern ngx_http_output_body_filter_pt    ngx_http_top_body_filter;
0177 extern ngx_http_request_body_filter_pt   ngx_http_top_request_body_filter;
0178 
0179 
0180 #endif /* _NGX_HTTP_H_INCLUDED_ */