nginxtra 1.2.8.8 → 1.4.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/bin/nginxtra +1 -1
  2. data/bin/nginxtra_rails +1 -1
  3. data/lib/nginxtra/version.rb +1 -1
  4. data/vendor/nginx/CHANGES +202 -63
  5. data/vendor/nginx/CHANGES.ru +208 -66
  6. data/vendor/nginx/auto/lib/md5/conf +3 -3
  7. data/vendor/nginx/auto/lib/perl/conf +3 -1
  8. data/vendor/nginx/auto/lib/perl/make +21 -16
  9. data/vendor/nginx/auto/lib/sha1/conf +1 -1
  10. data/vendor/nginx/auto/modules +25 -4
  11. data/vendor/nginx/auto/options +7 -1
  12. data/vendor/nginx/auto/sources +15 -1
  13. data/vendor/nginx/auto/unix +14 -0
  14. data/vendor/nginx/src/core/nginx.h +2 -2
  15. data/vendor/nginx/src/core/ngx_array.c +1 -7
  16. data/vendor/nginx/src/core/ngx_array.h +2 -2
  17. data/vendor/nginx/src/core/ngx_connection.c +13 -7
  18. data/vendor/nginx/src/core/ngx_connection.h +1 -2
  19. data/vendor/nginx/src/core/ngx_core.h +1 -2
  20. data/vendor/nginx/src/core/ngx_crypt.c +37 -0
  21. data/vendor/nginx/src/core/ngx_cycle.h +1 -1
  22. data/vendor/nginx/src/core/ngx_inet.c +219 -48
  23. data/vendor/nginx/src/core/ngx_inet.h +1 -1
  24. data/vendor/nginx/src/event/modules/ngx_devpoll_module.c +7 -1
  25. data/vendor/nginx/src/event/modules/ngx_eventport_module.c +1 -1
  26. data/vendor/nginx/src/event/ngx_event.c +5 -1
  27. data/vendor/nginx/src/event/ngx_event.h +1 -0
  28. data/vendor/nginx/src/event/ngx_event_connect.c +1 -1
  29. data/vendor/nginx/src/event/ngx_event_openssl.c +135 -9
  30. data/vendor/nginx/src/event/ngx_event_openssl.h +9 -0
  31. data/vendor/nginx/src/event/ngx_event_openssl_stapling.c +1749 -0
  32. data/vendor/nginx/src/http/modules/ngx_http_addition_filter_module.c +1 -0
  33. data/vendor/nginx/src/http/modules/ngx_http_chunked_filter_module.c +1 -0
  34. data/vendor/nginx/src/http/modules/ngx_http_fastcgi_module.c +5 -0
  35. data/vendor/nginx/src/http/modules/ngx_http_flv_module.c +4 -0
  36. data/vendor/nginx/src/http/modules/ngx_http_geo_module.c +7 -8
  37. data/vendor/nginx/src/http/modules/ngx_http_geoip_module.c +10 -12
  38. data/vendor/nginx/src/http/modules/ngx_http_gunzip_filter_module.c +677 -0
  39. data/vendor/nginx/src/http/modules/ngx_http_gzip_filter_module.c +3 -0
  40. data/vendor/nginx/src/http/modules/ngx_http_gzip_static_module.c +36 -10
  41. data/vendor/nginx/src/http/modules/ngx_http_headers_filter_module.c +31 -13
  42. data/vendor/nginx/src/http/modules/ngx_http_image_filter_module.c +13 -0
  43. data/vendor/nginx/src/http/modules/ngx_http_limit_conn_module.c +18 -2
  44. data/vendor/nginx/src/http/modules/ngx_http_limit_req_module.c +19 -2
  45. data/vendor/nginx/src/http/modules/ngx_http_map_module.c +1 -1
  46. data/vendor/nginx/src/http/modules/ngx_http_memcached_module.c +60 -8
  47. data/vendor/nginx/src/http/modules/ngx_http_mp4_module.c +4 -8
  48. data/vendor/nginx/src/http/modules/ngx_http_not_modified_filter_module.c +126 -29
  49. data/vendor/nginx/src/http/modules/ngx_http_proxy_module.c +59 -301
  50. data/vendor/nginx/src/http/modules/ngx_http_range_filter_module.c +34 -6
  51. data/vendor/nginx/src/http/modules/ngx_http_realip_module.c +13 -12
  52. data/vendor/nginx/src/http/modules/ngx_http_scgi_module.c +30 -11
  53. data/vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.c +1 -0
  54. data/vendor/nginx/src/http/modules/ngx_http_ssl_module.c +155 -4
  55. data/vendor/nginx/src/http/modules/ngx_http_ssl_module.h +6 -0
  56. data/vendor/nginx/src/http/modules/ngx_http_static_module.c +4 -0
  57. data/vendor/nginx/src/http/modules/ngx_http_stub_status_module.c +90 -3
  58. data/vendor/nginx/src/http/modules/ngx_http_sub_filter_module.c +1 -0
  59. data/vendor/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +5 -0
  60. data/vendor/nginx/src/http/modules/ngx_http_upstream_least_conn_module.c +5 -0
  61. data/vendor/nginx/src/http/modules/ngx_http_uwsgi_module.c +14 -1
  62. data/vendor/nginx/src/http/modules/ngx_http_xslt_filter_module.c +1 -0
  63. data/vendor/nginx/src/http/modules/perl/Makefile.PL +4 -2
  64. data/vendor/nginx/src/http/modules/perl/nginx.pm +1 -1
  65. data/vendor/nginx/src/http/modules/perl/nginx.xs +36 -3
  66. data/vendor/nginx/src/http/ngx_http.c +24 -1
  67. data/vendor/nginx/src/http/ngx_http.h +26 -2
  68. data/vendor/nginx/src/http/ngx_http_core_module.c +136 -10
  69. data/vendor/nginx/src/http/ngx_http_core_module.h +37 -13
  70. data/vendor/nginx/src/http/ngx_http_header_filter_module.c +9 -2
  71. data/vendor/nginx/src/http/ngx_http_parse.c +404 -0
  72. data/vendor/nginx/src/http/ngx_http_request.c +840 -517
  73. data/vendor/nginx/src/http/ngx_http_request.h +37 -25
  74. data/vendor/nginx/src/http/ngx_http_request_body.c +585 -156
  75. data/vendor/nginx/src/http/ngx_http_spdy.c +2882 -0
  76. data/vendor/nginx/src/http/ngx_http_spdy.h +235 -0
  77. data/vendor/nginx/src/http/ngx_http_spdy_filter_module.c +999 -0
  78. data/vendor/nginx/src/http/ngx_http_spdy_module.c +351 -0
  79. data/vendor/nginx/src/http/ngx_http_spdy_module.h +36 -0
  80. data/vendor/nginx/src/http/ngx_http_special_response.c +3 -1
  81. data/vendor/nginx/src/http/ngx_http_upstream.c +415 -26
  82. data/vendor/nginx/src/http/ngx_http_upstream.h +11 -1
  83. data/vendor/nginx/src/http/ngx_http_upstream_round_robin.c +2 -45
  84. data/vendor/nginx/src/http/ngx_http_upstream_round_robin.h +0 -2
  85. data/vendor/nginx/src/http/ngx_http_variables.c +72 -12
  86. data/vendor/nginx/src/mail/ngx_mail.h +2 -2
  87. data/vendor/nginx/src/mail/ngx_mail_auth_http_module.c +35 -25
  88. data/vendor/nginx/src/mail/ngx_mail_core_module.c +5 -1
  89. metadata +9 -2
@@ -35,12 +35,18 @@ typedef struct {
35
35
  ngx_str_t dhparam;
36
36
  ngx_str_t ecdh_curve;
37
37
  ngx_str_t client_certificate;
38
+ ngx_str_t trusted_certificate;
38
39
  ngx_str_t crl;
39
40
 
40
41
  ngx_str_t ciphers;
41
42
 
42
43
  ngx_shm_zone_t *shm_zone;
43
44
 
45
+ ngx_flag_t stapling;
46
+ ngx_flag_t stapling_verify;
47
+ ngx_str_t stapling_file;
48
+ ngx_str_t stapling_responder;
49
+
44
50
  u_char *file;
45
51
  ngx_uint_t line;
46
52
  } ngx_http_ssl_srv_conf_t;
@@ -220,6 +220,10 @@ ngx_http_static_handler(ngx_http_request_t *r)
220
220
  r->headers_out.content_length_n = of.size;
221
221
  r->headers_out.last_modified_time = of.mtime;
222
222
 
223
+ if (ngx_http_set_etag(r) != NGX_OK) {
224
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
225
+ }
226
+
223
227
  if (ngx_http_set_content_type(r) != NGX_OK) {
224
228
  return NGX_HTTP_INTERNAL_SERVER_ERROR;
225
229
  }
@@ -10,6 +10,10 @@
10
10
  #include <ngx_http.h>
11
11
 
12
12
 
13
+ static ngx_int_t ngx_http_stub_status_variable(ngx_http_request_t *r,
14
+ ngx_http_variable_value_t *v, uintptr_t data);
15
+ static ngx_int_t ngx_http_stub_status_add_variables(ngx_conf_t *cf);
16
+
13
17
  static char *ngx_http_set_status(ngx_conf_t *cf, ngx_command_t *cmd,
14
18
  void *conf);
15
19
 
@@ -28,7 +32,7 @@ static ngx_command_t ngx_http_status_commands[] = {
28
32
 
29
33
 
30
34
  static ngx_http_module_t ngx_http_stub_status_module_ctx = {
31
- NULL, /* preconfiguration */
35
+ ngx_http_stub_status_add_variables, /* preconfiguration */
32
36
  NULL, /* postconfiguration */
33
37
 
34
38
  NULL, /* create main configuration */
@@ -58,13 +62,31 @@ ngx_module_t ngx_http_stub_status_module = {
58
62
  };
59
63
 
60
64
 
65
+ static ngx_http_variable_t ngx_http_stub_status_vars[] = {
66
+
67
+ { ngx_string("connections_active"), NULL, ngx_http_stub_status_variable,
68
+ 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
69
+
70
+ { ngx_string("connections_reading"), NULL, ngx_http_stub_status_variable,
71
+ 1, NGX_HTTP_VAR_NOCACHEABLE, 0 },
72
+
73
+ { ngx_string("connections_writing"), NULL, ngx_http_stub_status_variable,
74
+ 2, NGX_HTTP_VAR_NOCACHEABLE, 0 },
75
+
76
+ { ngx_string("connections_waiting"), NULL, ngx_http_stub_status_variable,
77
+ 3, NGX_HTTP_VAR_NOCACHEABLE, 0 },
78
+
79
+ { ngx_null_string, NULL, NULL, 0, 0, 0 }
80
+ };
81
+
82
+
61
83
  static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
62
84
  {
63
85
  size_t size;
64
86
  ngx_int_t rc;
65
87
  ngx_buf_t *b;
66
88
  ngx_chain_t out;
67
- ngx_atomic_int_t ap, hn, ac, rq, rd, wr;
89
+ ngx_atomic_int_t ap, hn, ac, rq, rd, wr, wa;
68
90
 
69
91
  if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
70
92
  return NGX_HTTP_NOT_ALLOWED;
@@ -107,6 +129,7 @@ static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
107
129
  rq = *ngx_stat_requests;
108
130
  rd = *ngx_stat_reading;
109
131
  wr = *ngx_stat_writing;
132
+ wa = *ngx_stat_waiting;
110
133
 
111
134
  b->last = ngx_sprintf(b->last, "Active connections: %uA \n", ac);
112
135
 
@@ -116,7 +139,7 @@ static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
116
139
  b->last = ngx_sprintf(b->last, " %uA %uA %uA \n", ap, hn, rq);
117
140
 
118
141
  b->last = ngx_sprintf(b->last, "Reading: %uA Writing: %uA Waiting: %uA \n",
119
- rd, wr, ac - (rd + wr));
142
+ rd, wr, wa);
120
143
 
121
144
  r->headers_out.status = NGX_HTTP_OK;
122
145
  r->headers_out.content_length_n = b->last - b->pos;
@@ -133,6 +156,70 @@ static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
133
156
  }
134
157
 
135
158
 
159
+ static ngx_int_t
160
+ ngx_http_stub_status_variable(ngx_http_request_t *r,
161
+ ngx_http_variable_value_t *v, uintptr_t data)
162
+ {
163
+ u_char *p;
164
+ ngx_atomic_int_t value;
165
+
166
+ p = ngx_pnalloc(r->pool, NGX_ATOMIC_T_LEN);
167
+ if (p == NULL) {
168
+ return NGX_ERROR;
169
+ }
170
+
171
+ switch (data) {
172
+ case 0:
173
+ value = *ngx_stat_active;
174
+ break;
175
+
176
+ case 1:
177
+ value = *ngx_stat_reading;
178
+ break;
179
+
180
+ case 2:
181
+ value = *ngx_stat_writing;
182
+ break;
183
+
184
+ case 3:
185
+ value = *ngx_stat_waiting;
186
+ break;
187
+
188
+ /* suppress warning */
189
+ default:
190
+ value = 0;
191
+ break;
192
+ }
193
+
194
+ v->len = ngx_sprintf(p, "%uA", value) - p;
195
+ v->valid = 1;
196
+ v->no_cacheable = 0;
197
+ v->not_found = 0;
198
+ v->data = p;
199
+
200
+ return NGX_OK;
201
+ }
202
+
203
+
204
+ static ngx_int_t
205
+ ngx_http_stub_status_add_variables(ngx_conf_t *cf)
206
+ {
207
+ ngx_http_variable_t *var, *v;
208
+
209
+ for (v = ngx_http_stub_status_vars; v->name.len; v++) {
210
+ var = ngx_http_add_variable(cf, &v->name, v->flags);
211
+ if (var == NULL) {
212
+ return NGX_ERROR;
213
+ }
214
+
215
+ var->get_handler = v->get_handler;
216
+ var->data = v->data;
217
+ }
218
+
219
+ return NGX_OK;
220
+ }
221
+
222
+
136
223
  static char *ngx_http_set_status(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
137
224
  {
138
225
  ngx_http_core_loc_conf_t *clcf;
@@ -168,6 +168,7 @@ ngx_http_sub_header_filter(ngx_http_request_t *r)
168
168
  if (r == r->main) {
169
169
  ngx_http_clear_content_length(r);
170
170
  ngx_http_clear_last_modified(r);
171
+ ngx_http_clear_etag(r);
171
172
  }
172
173
 
173
174
  return ngx_http_next_header_filter(r);
@@ -252,6 +252,11 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
252
252
 
253
253
  uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
254
254
 
255
+ if (uscf->peer.init_upstream) {
256
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
257
+ "load balancing method redefined");
258
+ }
259
+
255
260
  uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
256
261
 
257
262
  uscf->flags = NGX_HTTP_UPSTREAM_CREATE
@@ -387,6 +387,11 @@ ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
387
387
 
388
388
  uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
389
389
 
390
+ if (uscf->peer.init_upstream) {
391
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
392
+ "load balancing method redefined");
393
+ }
394
+
390
395
  uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
391
396
 
392
397
  uscf->flags = NGX_HTTP_UPSTREAM_CREATE
@@ -1018,7 +1018,7 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
1018
1018
  u = r->upstream;
1019
1019
 
1020
1020
  if (u->headers_in.status_n) {
1021
- return NGX_OK;
1021
+ goto done;
1022
1022
  }
1023
1023
 
1024
1024
  if (u->headers_in.status) {
@@ -1049,6 +1049,14 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
1049
1049
  u->state->status = u->headers_in.status_n;
1050
1050
  }
1051
1051
 
1052
+ done:
1053
+
1054
+ if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
1055
+ && r->headers_in.upgrade)
1056
+ {
1057
+ u->upgrade = 1;
1058
+ }
1059
+
1052
1060
  return NGX_OK;
1053
1061
  }
1054
1062
 
@@ -1104,6 +1112,8 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
1104
1112
  conf->upstream.buffering = NGX_CONF_UNSET;
1105
1113
  conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
1106
1114
 
1115
+ conf->upstream.local = NGX_CONF_UNSET_PTR;
1116
+
1107
1117
  conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
1108
1118
  conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
1109
1119
  conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
@@ -1172,6 +1182,9 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
1172
1182
  ngx_conf_merge_value(conf->upstream.ignore_client_abort,
1173
1183
  prev->upstream.ignore_client_abort, 0);
1174
1184
 
1185
+ ngx_conf_merge_ptr_value(conf->upstream.local,
1186
+ prev->upstream.local, NULL);
1187
+
1175
1188
  ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
1176
1189
  prev->upstream.connect_timeout, 60000);
1177
1190
 
@@ -328,6 +328,7 @@ ngx_http_xslt_send(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
328
328
  }
329
329
 
330
330
  ngx_http_clear_last_modified(r);
331
+ ngx_http_clear_etag(r);
331
332
  }
332
333
 
333
334
  rc = ngx_http_next_header_filter(r);
@@ -21,8 +21,10 @@ WriteMakefile(
21
21
  } (split /\s+/, $ENV{NGX_INCS})),
22
22
 
23
23
  depend => {
24
- 'nginx.c' =>
25
- "../../../../../src/http/modules/perl/ngx_http_perl_module.h"
24
+ 'nginx.c' => join(" ", map {
25
+ m#^/# ? $_ : "../../../../../$_"
26
+ } (split(/\s+/, $ENV{NGX_DEPS}),
27
+ "src/http/modules/perl/ngx_http_perl_module.h"))
26
28
  },
27
29
 
28
30
  PM => {
@@ -50,7 +50,7 @@ our @EXPORT = qw(
50
50
  HTTP_INSUFFICIENT_STORAGE
51
51
  );
52
52
 
53
- our $VERSION = '1.2.8';
53
+ our $VERSION = '%%VERSION%%';
54
54
 
55
55
  require XSLoader;
56
56
  XSLoader::load('nginx', $VERSION);
@@ -357,7 +357,7 @@ has_request_body(r, next)
357
357
 
358
358
  ngx_http_perl_set_request(r);
359
359
 
360
- if (r->headers_in.content_length_n <= 0) {
360
+ if (r->headers_in.content_length_n <= 0 && !r->headers_in.chunked) {
361
361
  XSRETURN_UNDEF;
362
362
  }
363
363
 
@@ -386,7 +386,10 @@ request_body(r)
386
386
 
387
387
  dXSTARG;
388
388
  ngx_http_request_t *r;
389
+ u_char *p, *data;
389
390
  size_t len;
391
+ ngx_buf_t *buf;
392
+ ngx_chain_t *cl;
390
393
 
391
394
  ngx_http_perl_set_request(r);
392
395
 
@@ -397,13 +400,43 @@ request_body(r)
397
400
  XSRETURN_UNDEF;
398
401
  }
399
402
 
400
- len = r->request_body->bufs->buf->last - r->request_body->bufs->buf->pos;
403
+ cl = r->request_body->bufs;
404
+ buf = cl->buf;
405
+
406
+ if (cl->next == NULL) {
407
+ len = buf->last - buf->pos;
408
+ data = buf->pos;
409
+ goto done;
410
+ }
411
+
412
+ len = buf->last - buf->pos;
413
+ cl = cl->next;
414
+
415
+ for ( /* void */ ; cl; cl = cl->next) {
416
+ buf = cl->buf;
417
+ len += buf->last - buf->pos;
418
+ }
419
+
420
+ p = ngx_pnalloc(r->pool, len);
421
+ if (p == NULL) {
422
+ return XSRETURN_UNDEF;
423
+ }
424
+
425
+ data = p;
426
+ cl = r->request_body->bufs;
427
+
428
+ for ( /* void */ ; cl; cl = cl->next) {
429
+ buf = cl->buf;
430
+ p = ngx_cpymem(p, buf->pos, buf->last - buf->pos);
431
+ }
432
+
433
+ done:
401
434
 
402
435
  if (len == 0) {
403
436
  XSRETURN_UNDEF;
404
437
  }
405
438
 
406
- ngx_http_perl_set_targ(r->request_body->bufs->buf->pos, len);
439
+ ngx_http_perl_set_targ(data, len);
407
440
 
408
441
  ST(0) = TARG;
409
442
 
@@ -1225,6 +1225,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1225
1225
  #if (NGX_HTTP_SSL)
1226
1226
  ngx_uint_t ssl;
1227
1227
  #endif
1228
+ #if (NGX_HTTP_SPDY)
1229
+ ngx_uint_t spdy;
1230
+ #endif
1228
1231
 
1229
1232
  /*
1230
1233
  * we cannot compare whole sockaddr struct's as kernel
@@ -1277,6 +1280,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1277
1280
  #if (NGX_HTTP_SSL)
1278
1281
  ssl = lsopt->ssl || addr[i].opt.ssl;
1279
1282
  #endif
1283
+ #if (NGX_HTTP_SPDY)
1284
+ spdy = lsopt->spdy || addr[i].opt.spdy;
1285
+ #endif
1280
1286
 
1281
1287
  if (lsopt->set) {
1282
1288
 
@@ -1307,6 +1313,9 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1307
1313
  #if (NGX_HTTP_SSL)
1308
1314
  addr[i].opt.ssl = ssl;
1309
1315
  #endif
1316
+ #if (NGX_HTTP_SPDY)
1317
+ addr[i].opt.spdy = spdy;
1318
+ #endif
1310
1319
 
1311
1320
  return NGX_OK;
1312
1321
  }
@@ -1337,6 +1346,14 @@ ngx_http_add_address(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
1337
1346
  }
1338
1347
  }
1339
1348
 
1349
+ #if (NGX_HTTP_SPDY && NGX_HTTP_SSL && !defined TLSEXT_TYPE_next_proto_neg)
1350
+ if (lsopt->spdy && lsopt->ssl) {
1351
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
1352
+ "nginx was built without OpenSSL NPN support, "
1353
+ "SPDY is not enabled for %s", lsopt->addr);
1354
+ }
1355
+ #endif
1356
+
1340
1357
  addr = ngx_array_push(&port->addrs);
1341
1358
  if (addr == NULL) {
1342
1359
  return NGX_ERROR;
@@ -1462,7 +1479,7 @@ ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
1462
1479
 
1463
1480
  ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t));
1464
1481
 
1465
- ha.temp_pool = ngx_create_pool(16384, cf->log);
1482
+ ha.temp_pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, cf->log);
1466
1483
  if (ha.temp_pool == NULL) {
1467
1484
  return NGX_ERROR;
1468
1485
  }
@@ -1820,6 +1837,9 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport,
1820
1837
  #if (NGX_HTTP_SSL)
1821
1838
  addrs[i].conf.ssl = addr[i].opt.ssl;
1822
1839
  #endif
1840
+ #if (NGX_HTTP_SPDY)
1841
+ addrs[i].conf.spdy = addr[i].opt.spdy;
1842
+ #endif
1823
1843
 
1824
1844
  if (addr[i].hash.buckets == NULL
1825
1845
  && (addr[i].wc_head == NULL
@@ -1881,6 +1901,9 @@ ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport,
1881
1901
  #if (NGX_HTTP_SSL)
1882
1902
  addrs6[i].conf.ssl = addr[i].opt.ssl;
1883
1903
  #endif
1904
+ #if (NGX_HTTP_SPDY)
1905
+ addrs6[i].conf.spdy = addr[i].opt.spdy;
1906
+ #endif
1884
1907
 
1885
1908
  if (addr[i].hash.buckets == NULL
1886
1909
  && (addr[i].wc_head == NULL
@@ -18,6 +18,11 @@ typedef struct ngx_http_upstream_s ngx_http_upstream_t;
18
18
  typedef struct ngx_http_cache_s ngx_http_cache_t;
19
19
  typedef struct ngx_http_file_cache_s ngx_http_file_cache_t;
20
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
21
26
 
22
27
  typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
23
28
  ngx_table_elt_t *h, ngx_uint_t offset);
@@ -26,14 +31,17 @@ typedef u_char *(*ngx_http_log_handler_pt)(ngx_http_request_t *r,
26
31
 
27
32
 
28
33
  #include <ngx_http_variables.h>
34
+ #include <ngx_http_config.h>
29
35
  #include <ngx_http_request.h>
36
+ #include <ngx_http_script.h>
30
37
  #include <ngx_http_upstream.h>
31
38
  #include <ngx_http_upstream_round_robin.h>
32
- #include <ngx_http_config.h>
33
39
  #include <ngx_http_busy_lock.h>
34
- #include <ngx_http_script.h>
35
40
  #include <ngx_http_core_module.h>
36
41
 
42
+ #if (NGX_HTTP_SPDY)
43
+ #include <ngx_http_spdy.h>
44
+ #endif
37
45
  #if (NGX_HTTP_CACHE)
38
46
  #include <ngx_http_cache.h>
39
47
  #endif
@@ -52,6 +60,13 @@ struct ngx_http_log_ctx_s {
52
60
  };
53
61
 
54
62
 
63
+ struct ngx_http_chunked_s {
64
+ ngx_uint_t state;
65
+ off_t size;
66
+ off_t length;
67
+ };
68
+
69
+
55
70
  typedef struct {
56
71
  ngx_uint_t http_version;
57
72
  ngx_uint_t code;
@@ -72,12 +87,14 @@ ngx_int_t ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
72
87
 
73
88
 
74
89
  void ngx_http_init_connection(ngx_connection_t *c);
90
+ void ngx_http_close_connection(ngx_connection_t *c);
75
91
 
76
92
  #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
77
93
  int ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
78
94
  #endif
79
95
 
80
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);
81
98
  ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
82
99
  ngx_uint_t merge_slashes);
83
100
  ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
@@ -92,14 +109,21 @@ ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
92
109
  ngx_str_t *value);
93
110
  void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
94
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);
95
114
 
96
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);
97
120
  void ngx_http_update_location_config(ngx_http_request_t *r);
98
121
  void ngx_http_handler(ngx_http_request_t *r);
99
122
  void ngx_http_run_posted_requests(ngx_connection_t *c);
100
123
  ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
101
124
  ngx_http_posted_request_t *pr);
102
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);
103
127
 
104
128
  void ngx_http_empty_handler(ngx_event_t *wev);
105
129
  void ngx_http_request_empty_handler(ngx_http_request_t *r);