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
@@ -116,9 +116,16 @@ struct ngx_http_upstream_srv_conf_s {
116
116
  ngx_uint_t line;
117
117
  in_port_t port;
118
118
  in_port_t default_port;
119
+ ngx_uint_t no_port; /* unsigned no_port:1 */
119
120
  };
120
121
 
121
122
 
123
+ typedef struct {
124
+ ngx_addr_t *addr;
125
+ ngx_http_complex_value_t *value;
126
+ } ngx_http_upstream_local_t;
127
+
128
+
122
129
  typedef struct {
123
130
  ngx_http_upstream_srv_conf_t *upstream;
124
131
 
@@ -157,7 +164,7 @@ typedef struct {
157
164
  ngx_array_t *hide_headers;
158
165
  ngx_array_t *pass_headers;
159
166
 
160
- ngx_addr_t *local;
167
+ ngx_http_upstream_local_t *local;
161
168
 
162
169
  #if (NGX_HTTP_CACHE)
163
170
  ngx_shm_zone_t *cache;
@@ -277,6 +284,8 @@ struct ngx_http_upstream_s {
277
284
 
278
285
  ngx_http_upstream_resolved_t *resolved;
279
286
 
287
+ ngx_buf_t from_client;
288
+
280
289
  ngx_buf_t buffer;
281
290
  off_t length;
282
291
 
@@ -322,6 +331,7 @@ struct ngx_http_upstream_s {
322
331
 
323
332
  unsigned buffering:1;
324
333
  unsigned keepalive:1;
334
+ unsigned upgrade:1;
325
335
 
326
336
  unsigned request_sent:1;
327
337
  unsigned header_sent:1;
@@ -10,8 +10,6 @@
10
10
  #include <ngx_http.h>
11
11
 
12
12
 
13
- static ngx_int_t ngx_http_upstream_cmp_servers(const void *one,
14
- const void *two);
15
13
  static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer(
16
14
  ngx_http_upstream_rr_peer_data_t *rrp);
17
15
 
@@ -93,10 +91,6 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
93
91
 
94
92
  us->peer.data = peers;
95
93
 
96
- ngx_sort(&peers->peer[0], (size_t) n,
97
- sizeof(ngx_http_upstream_rr_peer_t),
98
- ngx_http_upstream_cmp_servers);
99
-
100
94
  /* backup servers */
101
95
 
102
96
  n = 0;
@@ -151,17 +145,13 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
151
145
 
152
146
  peers->next = backup;
153
147
 
154
- ngx_sort(&backup->peer[0], (size_t) n,
155
- sizeof(ngx_http_upstream_rr_peer_t),
156
- ngx_http_upstream_cmp_servers);
157
-
158
148
  return NGX_OK;
159
149
  }
160
150
 
161
151
 
162
152
  /* an upstream implicitly defined by proxy_pass, etc. */
163
153
 
164
- if (us->port == 0 && us->default_port == 0) {
154
+ if (us->port == 0) {
165
155
  ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
166
156
  "no port in upstream \"%V\" in %s:%ui",
167
157
  &us->host, us->file_name, us->line);
@@ -171,7 +161,7 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
171
161
  ngx_memzero(&u, sizeof(ngx_url_t));
172
162
 
173
163
  u.host = us->host;
174
- u.port = (in_port_t) (us->port ? us->port : us->default_port);
164
+ u.port = us->port;
175
165
 
176
166
  if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
177
167
  if (u.err) {
@@ -216,18 +206,6 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
216
206
  }
217
207
 
218
208
 
219
- static ngx_int_t
220
- ngx_http_upstream_cmp_servers(const void *one, const void *two)
221
- {
222
- ngx_http_upstream_rr_peer_t *first, *second;
223
-
224
- first = (ngx_http_upstream_rr_peer_t *) one;
225
- second = (ngx_http_upstream_rr_peer_t *) two;
226
-
227
- return (first->weight < second->weight);
228
- }
229
-
230
-
231
209
  ngx_int_t
232
210
  ngx_http_upstream_init_round_robin_peer(ngx_http_request_t *r,
233
211
  ngx_http_upstream_srv_conf_t *us)
@@ -395,7 +373,6 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
395
373
 
396
374
  ngx_int_t rc;
397
375
  ngx_uint_t i, n;
398
- ngx_connection_t *c;
399
376
  ngx_http_upstream_rr_peer_t *peer;
400
377
  ngx_http_upstream_rr_peers_t *peers;
401
378
 
@@ -404,26 +381,6 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
404
381
 
405
382
  /* ngx_lock_mutex(rrp->peers->mutex); */
406
383
 
407
- if (rrp->peers->last_cached) {
408
-
409
- /* cached connection */
410
-
411
- c = rrp->peers->cached[rrp->peers->last_cached];
412
- rrp->peers->last_cached--;
413
-
414
- /* ngx_unlock_mutex(ppr->peers->mutex); */
415
-
416
- #if (NGX_THREADS)
417
- c->read->lock = c->read->own_lock;
418
- c->write->lock = c->write->own_lock;
419
- #endif
420
-
421
- pc->connection = c;
422
- pc->cached = 1;
423
-
424
- return NGX_OK;
425
- }
426
-
427
384
  pc->cached = 0;
428
385
  pc->connection = NULL;
429
386
 
@@ -42,10 +42,8 @@ typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t;
42
42
 
43
43
  struct ngx_http_upstream_rr_peers_s {
44
44
  ngx_uint_t number;
45
- ngx_uint_t last_cached;
46
45
 
47
46
  /* ngx_mutex_t *mutex; */
48
- ngx_connection_t **cached;
49
47
 
50
48
  ngx_uint_t total_weight;
51
49
 
@@ -21,8 +21,13 @@ static void ngx_http_variable_request_set_size(ngx_http_request_t *r,
21
21
  ngx_http_variable_value_t *v, uintptr_t data);
22
22
  static ngx_int_t ngx_http_variable_header(ngx_http_request_t *r,
23
23
  ngx_http_variable_value_t *v, uintptr_t data);
24
+
25
+ static ngx_int_t ngx_http_variable_cookies(ngx_http_request_t *r,
26
+ ngx_http_variable_value_t *v, uintptr_t data);
24
27
  static ngx_int_t ngx_http_variable_headers(ngx_http_request_t *r,
25
28
  ngx_http_variable_value_t *v, uintptr_t data);
29
+ static ngx_int_t ngx_http_variable_headers_internal(ngx_http_request_t *r,
30
+ ngx_http_variable_value_t *v, uintptr_t data, u_char sep);
26
31
 
27
32
  static ngx_int_t ngx_http_variable_unknown_header_in(ngx_http_request_t *r,
28
33
  ngx_http_variable_value_t *v, uintptr_t data);
@@ -39,6 +44,8 @@ static ngx_int_t ngx_http_variable_tcpinfo(ngx_http_request_t *r,
39
44
  ngx_http_variable_value_t *v, uintptr_t data);
40
45
  #endif
41
46
 
47
+ static ngx_int_t ngx_http_variable_content_length(ngx_http_request_t *r,
48
+ ngx_http_variable_value_t *v, uintptr_t data);
42
49
  static ngx_int_t ngx_http_variable_host(ngx_http_request_t *r,
43
50
  ngx_http_variable_value_t *v, uintptr_t data);
44
51
  static ngx_int_t ngx_http_variable_binary_remote_addr(ngx_http_request_t *r,
@@ -131,8 +138,8 @@ static ngx_int_t ngx_http_variable_time_local(ngx_http_request_t *r,
131
138
  */
132
139
 
133
140
  /*
134
- * the $http_host, $http_user_agent, $http_referer, $http_via,
135
- * and $http_x_forwarded_for variables may be handled by generic
141
+ * the $http_host, $http_user_agent, $http_referer, and $http_via
142
+ * variables may be handled by generic
136
143
  * ngx_http_variable_unknown_header_in(), but for performance reasons
137
144
  * they are handled using dedicated entries
138
145
  */
@@ -154,15 +161,15 @@ static ngx_http_variable_t ngx_http_core_variables[] = {
154
161
  #endif
155
162
 
156
163
  #if (NGX_HTTP_X_FORWARDED_FOR)
157
- { ngx_string("http_x_forwarded_for"), NULL, ngx_http_variable_header,
164
+ { ngx_string("http_x_forwarded_for"), NULL, ngx_http_variable_headers,
158
165
  offsetof(ngx_http_request_t, headers_in.x_forwarded_for), 0, 0 },
159
166
  #endif
160
167
 
161
- { ngx_string("http_cookie"), NULL, ngx_http_variable_headers,
168
+ { ngx_string("http_cookie"), NULL, ngx_http_variable_cookies,
162
169
  offsetof(ngx_http_request_t, headers_in.cookies), 0, 0 },
163
170
 
164
- { ngx_string("content_length"), NULL, ngx_http_variable_header,
165
- offsetof(ngx_http_request_t, headers_in.content_length), 0, 0 },
171
+ { ngx_string("content_length"), NULL, ngx_http_variable_content_length,
172
+ 0, 0, 0 },
166
173
 
167
174
  { ngx_string("content_type"), NULL, ngx_http_variable_header,
168
175
  offsetof(ngx_http_request_t, headers_in.content_type), 0, 0 },
@@ -724,8 +731,24 @@ ngx_http_variable_header(ngx_http_request_t *r, ngx_http_variable_value_t *v,
724
731
 
725
732
 
726
733
  static ngx_int_t
727
- ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
728
- uintptr_t data)
734
+ ngx_http_variable_cookies(ngx_http_request_t *r,
735
+ ngx_http_variable_value_t *v, uintptr_t data)
736
+ {
737
+ return ngx_http_variable_headers_internal(r, v, data, ';');
738
+ }
739
+
740
+
741
+ static ngx_int_t
742
+ ngx_http_variable_headers(ngx_http_request_t *r,
743
+ ngx_http_variable_value_t *v, uintptr_t data)
744
+ {
745
+ return ngx_http_variable_headers_internal(r, v, data, ',');
746
+ }
747
+
748
+
749
+ static ngx_int_t
750
+ ngx_http_variable_headers_internal(ngx_http_request_t *r,
751
+ ngx_http_variable_value_t *v, uintptr_t data, u_char sep)
729
752
  {
730
753
  size_t len;
731
754
  u_char *p, *end;
@@ -746,7 +769,7 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
746
769
  continue;
747
770
  }
748
771
 
749
- len += h[i]->value.len + sizeof("; ") - 1;
772
+ len += h[i]->value.len + 2;
750
773
  }
751
774
 
752
775
  if (len == 0) {
@@ -754,7 +777,7 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
754
777
  return NGX_OK;
755
778
  }
756
779
 
757
- len -= sizeof("; ") - 1;
780
+ len -= 2;
758
781
 
759
782
  v->valid = 1;
760
783
  v->no_cacheable = 0;
@@ -789,7 +812,7 @@ ngx_http_variable_headers(ngx_http_request_t *r, ngx_http_variable_value_t *v,
789
812
  break;
790
813
  }
791
814
 
792
- *p++ = ';'; *p++ = ' ';
815
+ *p++ = sep; *p++ = ' ';
793
816
  }
794
817
 
795
818
  return NGX_OK;
@@ -1021,6 +1044,39 @@ ngx_http_variable_tcpinfo(ngx_http_request_t *r, ngx_http_variable_value_t *v,
1021
1044
  #endif
1022
1045
 
1023
1046
 
1047
+ static ngx_int_t
1048
+ ngx_http_variable_content_length(ngx_http_request_t *r,
1049
+ ngx_http_variable_value_t *v, uintptr_t data)
1050
+ {
1051
+ u_char *p;
1052
+
1053
+ if (r->headers_in.content_length) {
1054
+ v->len = r->headers_in.content_length->value.len;
1055
+ v->data = r->headers_in.content_length->value.data;
1056
+ v->valid = 1;
1057
+ v->no_cacheable = 0;
1058
+ v->not_found = 0;
1059
+
1060
+ } else if (r->headers_in.content_length_n >= 0) {
1061
+ p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
1062
+ if (p == NULL) {
1063
+ return NGX_ERROR;
1064
+ }
1065
+
1066
+ v->len = ngx_sprintf(p, "%O", r->headers_in.content_length_n) - p;
1067
+ v->data = p;
1068
+ v->valid = 1;
1069
+ v->no_cacheable = 0;
1070
+ v->not_found = 0;
1071
+
1072
+ } else {
1073
+ v->not_found = 1;
1074
+ }
1075
+
1076
+ return NGX_OK;
1077
+ }
1078
+
1079
+
1024
1080
  static ngx_int_t
1025
1081
  ngx_http_variable_host(ngx_http_request_t *r, ngx_http_variable_value_t *v,
1026
1082
  uintptr_t data)
@@ -1712,7 +1768,11 @@ ngx_http_variable_sent_connection(ngx_http_request_t *r,
1712
1768
  size_t len;
1713
1769
  char *p;
1714
1770
 
1715
- if (r->keepalive) {
1771
+ if (r->headers_out.status == NGX_HTTP_SWITCHING_PROTOCOLS) {
1772
+ len = sizeof("upgrade") - 1;
1773
+ p = "upgrade";
1774
+
1775
+ } else if (r->keepalive) {
1716
1776
  len = sizeof("keep-alive") - 1;
1717
1777
  p = "keep-alive";
1718
1778
 
@@ -39,7 +39,7 @@ typedef struct {
39
39
  unsigned ssl:1;
40
40
  #endif
41
41
  #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
42
- unsigned ipv6only:2;
42
+ unsigned ipv6only:1;
43
43
  #endif
44
44
  unsigned so_keepalive:2;
45
45
  #if (NGX_HAVE_KEEPALIVE_TUNABLE)
@@ -100,7 +100,7 @@ typedef struct {
100
100
  unsigned ssl:1;
101
101
  #endif
102
102
  #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
103
- unsigned ipv6only:2;
103
+ unsigned ipv6only:1;
104
104
  #endif
105
105
  unsigned so_keepalive:2;
106
106
  #if (NGX_HAVE_KEEPALIVE_TUNABLE)
@@ -454,12 +454,15 @@ static void
454
454
  ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
455
455
  ngx_mail_auth_http_ctx_t *ctx)
456
456
  {
457
- u_char *p;
458
- time_t timer;
459
- size_t len, size;
460
- ngx_int_t rc, port, n;
461
- ngx_addr_t *peer;
462
- struct sockaddr_in *sin;
457
+ u_char *p;
458
+ time_t timer;
459
+ size_t len, size;
460
+ ngx_int_t rc, port, n;
461
+ ngx_addr_t *peer;
462
+ struct sockaddr_in *sin;
463
+ #if (NGX_HAVE_INET6)
464
+ struct sockaddr_in6 *sin6;
465
+ #endif
463
466
 
464
467
  ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
465
468
  "mail auth http process headers");
@@ -772,17 +775,26 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
772
775
  return;
773
776
  }
774
777
 
775
- /* AF_INET only */
778
+ rc = ngx_parse_addr(s->connection->pool, peer,
779
+ ctx->addr.data, ctx->addr.len);
780
+
781
+ switch (rc) {
782
+ case NGX_OK:
783
+ break;
776
784
 
777
- sin = ngx_pcalloc(s->connection->pool, sizeof(struct sockaddr_in));
778
- if (sin == NULL) {
785
+ case NGX_DECLINED:
786
+ ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
787
+ "auth http server %V sent invalid server "
788
+ "address:\"%V\"",
789
+ ctx->peer.name, &ctx->addr);
790
+ /* fall through */
791
+
792
+ default:
779
793
  ngx_destroy_pool(ctx->pool);
780
794
  ngx_mail_session_internal_server_error(s);
781
795
  return;
782
796
  }
783
797
 
784
- sin->sin_family = AF_INET;
785
-
786
798
  port = ngx_atoi(ctx->port.data, ctx->port.len);
787
799
  if (port == NGX_ERROR || port < 1 || port > 65535) {
788
800
  ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
@@ -794,21 +806,20 @@ ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
794
806
  return;
795
807
  }
796
808
 
797
- sin->sin_port = htons((in_port_t) port);
809
+ switch (peer->sockaddr->sa_family) {
798
810
 
799
- sin->sin_addr.s_addr = ngx_inet_addr(ctx->addr.data, ctx->addr.len);
800
- if (sin->sin_addr.s_addr == INADDR_NONE) {
801
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
802
- "auth http server %V sent invalid server "
803
- "address:\"%V\"",
804
- ctx->peer.name, &ctx->addr);
805
- ngx_destroy_pool(ctx->pool);
806
- ngx_mail_session_internal_server_error(s);
807
- return;
808
- }
811
+ #if (NGX_HAVE_INET6)
812
+ case AF_INET6:
813
+ sin6 = (struct sockaddr_in6 *) peer->sockaddr;
814
+ sin6->sin6_port = htons((in_port_t) port);
815
+ break;
816
+ #endif
809
817
 
810
- peer->sockaddr = (struct sockaddr *) sin;
811
- peer->socklen = sizeof(struct sockaddr_in);
818
+ default: /* AF_INET */
819
+ sin = (struct sockaddr_in *) peer->sockaddr;
820
+ sin->sin_port = htons((in_port_t) port);
821
+ break;
822
+ }
812
823
 
813
824
  len = ctx->addr.len + 1 + ctx->port.len;
814
825
 
@@ -1388,7 +1399,6 @@ ngx_mail_auth_http(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1388
1399
  u.url = value[1];
1389
1400
  u.default_port = 80;
1390
1401
  u.uri_part = 1;
1391
- u.one_addr = 1;
1392
1402
 
1393
1403
  if (ngx_strncmp(u.url.data, "http://", 7) == 0) {
1394
1404
  u.url.len -= 7;
@@ -382,6 +382,10 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
382
382
  ls->wildcard = u.wildcard;
383
383
  ls->ctx = cf->ctx;
384
384
 
385
+ #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
386
+ ls->ipv6only = 1;
387
+ #endif
388
+
385
389
  if (cscf->protocol == NULL) {
386
390
  for (m = 0; ngx_modules[m]; m++) {
387
391
  if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
@@ -423,7 +427,7 @@ ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
423
427
  ls->ipv6only = 1;
424
428
 
425
429
  } else if (ngx_strcmp(&value[i].data[10], "ff") == 0) {
426
- ls->ipv6only = 2;
430
+ ls->ipv6only = 0;
427
431
 
428
432
  } else {
429
433
  ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nginxtra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8.8
4
+ version: 1.4.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-03 00:00:00.000000000 Z
12
+ date: 2013-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -237,6 +237,7 @@ files:
237
237
  - vendor/nginx/src/event/ngx_event_mutex.c
238
238
  - vendor/nginx/src/event/ngx_event_openssl.c
239
239
  - vendor/nginx/src/event/ngx_event_openssl.h
240
+ - vendor/nginx/src/event/ngx_event_openssl_stapling.c
240
241
  - vendor/nginx/src/event/ngx_event_pipe.c
241
242
  - vendor/nginx/src/event/ngx_event_pipe.h
242
243
  - vendor/nginx/src/event/ngx_event_posted.c
@@ -257,6 +258,7 @@ files:
257
258
  - vendor/nginx/src/http/modules/ngx_http_flv_module.c
258
259
  - vendor/nginx/src/http/modules/ngx_http_geo_module.c
259
260
  - vendor/nginx/src/http/modules/ngx_http_geoip_module.c
261
+ - vendor/nginx/src/http/modules/ngx_http_gunzip_filter_module.c
260
262
  - vendor/nginx/src/http/modules/ngx_http_gzip_filter_module.c
261
263
  - vendor/nginx/src/http/modules/ngx_http_gzip_static_module.c
262
264
  - vendor/nginx/src/http/modules/ngx_http_headers_filter_module.c
@@ -316,6 +318,11 @@ files:
316
318
  - vendor/nginx/src/http/ngx_http_request_body.c
317
319
  - vendor/nginx/src/http/ngx_http_script.c
318
320
  - vendor/nginx/src/http/ngx_http_script.h
321
+ - vendor/nginx/src/http/ngx_http_spdy.c
322
+ - vendor/nginx/src/http/ngx_http_spdy.h
323
+ - vendor/nginx/src/http/ngx_http_spdy_filter_module.c
324
+ - vendor/nginx/src/http/ngx_http_spdy_module.c
325
+ - vendor/nginx/src/http/ngx_http_spdy_module.h
319
326
  - vendor/nginx/src/http/ngx_http_special_response.c
320
327
  - vendor/nginx/src/http/ngx_http_upstream.c
321
328
  - vendor/nginx/src/http/ngx_http_upstream.h