~ubuntu-branches/ubuntu/trusty/nginx/trusty-proposed

« back to all changes in this revision

Viewing changes to src/http/ngx_http.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-04-25 12:51:45 UTC
  • mfrom: (1.3.28)
  • mto: (1.3.29) (15.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: package-import@ubuntu.com-20130425125145-ugl0wor6bq0u5eae
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
3
 * Copyright (C) Igor Sysoev
 
4
 * Copyright (C) Nginx, Inc.
4
5
 */
5
6
 
6
7
 
10
11
 
11
12
#include <ngx_config.h>
12
13
#include <ngx_core.h>
13
 
#include <ngx_garbage_collector.h>
14
 
 
15
 
 
16
 
typedef struct ngx_http_request_s   ngx_http_request_t;
17
 
typedef struct ngx_http_upstream_s  ngx_http_upstream_t;
18
 
typedef struct ngx_http_log_ctx_s   ngx_http_log_ctx_t;
 
14
 
 
15
 
 
16
typedef struct ngx_http_request_s     ngx_http_request_t;
 
17
typedef struct ngx_http_upstream_s    ngx_http_upstream_t;
 
18
typedef struct ngx_http_cache_s       ngx_http_cache_t;
 
19
typedef struct ngx_http_file_cache_s  ngx_http_file_cache_t;
 
20
typedef struct ngx_http_log_ctx_s     ngx_http_log_ctx_t;
 
21
typedef struct ngx_http_chunked_s     ngx_http_chunked_t;
 
22
 
 
23
#if (NGX_HTTP_SPDY)
 
24
typedef struct ngx_http_spdy_stream_s  ngx_http_spdy_stream_t;
 
25
#endif
19
26
 
20
27
typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
21
28
    ngx_table_elt_t *h, ngx_uint_t offset);
23
30
    ngx_http_request_t *sr, u_char *buf, size_t len);
24
31
 
25
32
 
26
 
#if (NGX_HTTP_CACHE)
27
 
#include <ngx_http_cache.h>
28
 
#endif
29
 
/* STUB */
30
 
#include <ngx_http_cache.h>
31
 
 
32
33
#include <ngx_http_variables.h>
 
34
#include <ngx_http_config.h>
33
35
#include <ngx_http_request.h>
 
36
#include <ngx_http_script.h>
34
37
#include <ngx_http_upstream.h>
35
38
#include <ngx_http_upstream_round_robin.h>
36
 
#include <ngx_http_config.h>
37
39
#include <ngx_http_busy_lock.h>
38
40
#include <ngx_http_core_module.h>
39
 
#include <ngx_http_script.h>
40
41
 
 
42
#if (NGX_HTTP_SPDY)
 
43
#include <ngx_http_spdy.h>
 
44
#endif
 
45
#if (NGX_HTTP_CACHE)
 
46
#include <ngx_http_cache.h>
 
47
#endif
41
48
#if (NGX_HTTP_SSI)
42
49
#include <ngx_http_ssi_filter_module.h>
43
50
#endif
53
60
};
54
61
 
55
62
 
 
63
struct ngx_http_chunked_s {
 
64
    ngx_uint_t           state;
 
65
    off_t                size;
 
66
    off_t                length;
 
67
};
 
68
 
 
69
 
 
70
typedef struct {
 
71
    ngx_uint_t           http_version;
 
72
    ngx_uint_t           code;
 
73
    ngx_uint_t           count;
 
74
    u_char              *start;
 
75
    u_char              *end;
 
76
} ngx_http_status_t;
 
77
 
 
78
 
56
79
#define ngx_http_get_module_ctx(r, module)  (r)->ctx[module.ctx_index]
57
80
#define ngx_http_set_ctx(r, c, module)      r->ctx[module.ctx_index] = c;
58
81
 
59
82
 
 
83
ngx_int_t ngx_http_add_location(ngx_conf_t *cf, ngx_queue_t **locations,
 
84
    ngx_http_core_loc_conf_t *clcf);
 
85
ngx_int_t ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
 
86
    ngx_http_listen_opt_t *lsopt);
 
87
 
 
88
 
60
89
void ngx_http_init_connection(ngx_connection_t *c);
 
90
void ngx_http_close_connection(ngx_connection_t *c);
61
91
 
62
92
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
63
93
int ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
64
94
#endif
65
95
 
66
96
ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
 
97
ngx_int_t ngx_http_parse_uri(ngx_http_request_t *r);
67
98
ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
68
99
    ngx_uint_t merge_slashes);
 
100
ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
 
101
    ngx_http_status_t *status);
69
102
ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
70
103
    ngx_str_t *args, ngx_uint_t *flags);
71
 
ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b);
 
104
ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
 
105
    ngx_uint_t allow_underscores);
72
106
ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
73
107
    ngx_str_t *name, ngx_str_t *value);
74
 
 
75
 
ngx_int_t ngx_http_find_server_conf(ngx_http_request_t *r);
 
108
ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
 
109
    ngx_str_t *value);
 
110
void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
 
111
    ngx_str_t *args);
 
112
ngx_int_t ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
 
113
    ngx_http_chunked_t *ctx);
 
114
 
 
115
 
 
116
ngx_http_request_t *ngx_http_create_request(ngx_connection_t *c);
 
117
ngx_int_t ngx_http_process_request_uri(ngx_http_request_t *r);
 
118
ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
 
119
void ngx_http_process_request(ngx_http_request_t *r);
76
120
void ngx_http_update_location_config(ngx_http_request_t *r);
77
121
void ngx_http_handler(ngx_http_request_t *r);
 
122
void ngx_http_run_posted_requests(ngx_connection_t *c);
 
123
ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
 
124
    ngx_http_posted_request_t *pr);
78
125
void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
 
126
void ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc);
79
127
 
80
128
void ngx_http_empty_handler(ngx_event_t *wev);
81
129
void ngx_http_request_empty_handler(ngx_http_request_t *r);
82
130
 
 
131
 
 
132
#define ngx_http_ephemeral(r)  (void *) (&r->uri_start)
 
133
 
 
134
 
83
135
#define NGX_HTTP_LAST   1
84
136
#define NGX_HTTP_FLUSH  2
85
137
 
92
144
ngx_int_t ngx_http_send_header(ngx_http_request_t *r);
93
145
ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r,
94
146
    ngx_int_t error);
 
147
ngx_int_t ngx_http_filter_finalize_request(ngx_http_request_t *r,
 
148
    ngx_module_t *m, ngx_int_t error);
 
149
void ngx_http_clean_header(ngx_http_request_t *r);
95
150
 
96
151
 
97
152
time_t ngx_http_parse_time(u_char *value, size_t len);
100
155
 
101
156
 
102
157
ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r);
 
158
void ngx_http_discarded_request_body_handler(ngx_http_request_t *r);
103
159
void ngx_http_block_reading(ngx_http_request_t *r);
 
160
void ngx_http_test_reading(ngx_http_request_t *r);
 
161
 
 
162
 
 
163
char *ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 
164
char *ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys,
 
165
    ngx_hash_t *types_hash, ngx_array_t **prev_keys,
 
166
    ngx_hash_t *prev_types_hash, ngx_str_t *default_types);
 
167
ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
 
168
    ngx_str_t *default_type);
 
169
 
 
170
#if (NGX_HTTP_DEGRADATION)
 
171
ngx_uint_t  ngx_http_degraded(ngx_http_request_t *);
 
172
#endif
104
173
 
105
174
 
106
175
extern ngx_module_t  ngx_http_module;
107
176
 
108
 
 
109
 
extern ngx_uint_t  ngx_http_total_requests;
110
 
extern uint64_t    ngx_http_total_sent;
 
177
extern ngx_str_t  ngx_http_html_default_types[];
111
178
 
112
179
 
113
180
extern ngx_http_output_header_filter_pt  ngx_http_top_header_filter;