nginxtra 1.2.1.3 → 1.2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/VERSION +1 -1
  2. data/bin/nginxtra +1 -1
  3. data/src/nginx/CHANGES +60 -0
  4. data/src/nginx/CHANGES.ru +57 -0
  5. data/src/nginx/auto/{endianess → endianness} +5 -5
  6. data/src/nginx/auto/lib/google-perftools/conf +16 -0
  7. data/src/nginx/auto/modules +10 -0
  8. data/src/nginx/auto/options +3 -0
  9. data/src/nginx/auto/os/conf +2 -0
  10. data/src/nginx/auto/sources +5 -0
  11. data/src/nginx/auto/unix +1 -1
  12. data/src/nginx/src/core/nginx.h +2 -2
  13. data/src/nginx/src/core/ngx_hash.c +13 -11
  14. data/src/nginx/src/core/ngx_inet.c +32 -31
  15. data/src/nginx/src/core/ngx_regex.c +3 -3
  16. data/src/nginx/src/core/ngx_regex.h +2 -2
  17. data/src/nginx/src/core/ngx_resolver.c +22 -16
  18. data/src/nginx/src/event/ngx_event_openssl.c +18 -1
  19. data/src/nginx/src/http/modules/ngx_http_geo_module.c +1 -1
  20. data/src/nginx/src/http/modules/ngx_http_geoip_module.c +15 -4
  21. data/src/nginx/src/http/modules/ngx_http_log_module.c +3 -6
  22. data/src/nginx/src/http/modules/ngx_http_mp4_module.c +18 -1
  23. data/src/nginx/src/http/modules/ngx_http_rewrite_module.c +6 -0
  24. data/src/nginx/src/http/modules/ngx_http_split_clients_module.c +7 -0
  25. data/src/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +44 -17
  26. data/src/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c +4 -29
  27. data/src/nginx/src/http/modules/ngx_http_upstream_least_conn_module.c +402 -0
  28. data/src/nginx/src/http/modules/ngx_http_xslt_filter_module.c +2 -2
  29. data/src/nginx/src/http/modules/perl/nginx.pm +1 -1
  30. data/src/nginx/src/http/modules/perl/nginx.xs +1 -1
  31. data/src/nginx/src/http/ngx_http_core_module.c +1 -1
  32. data/src/nginx/src/http/ngx_http_header_filter_module.c +2 -2
  33. data/src/nginx/src/http/ngx_http_request.c +1 -1
  34. data/src/nginx/src/http/ngx_http_request.h +8 -1
  35. data/src/nginx/src/http/ngx_http_upstream.c +15 -1
  36. data/src/nginx/src/http/ngx_http_upstream_round_robin.c +11 -1
  37. data/src/nginx/src/http/ngx_http_upstream_round_robin.h +5 -1
  38. data/src/nginx/src/http/ngx_http_variables.c +49 -3
  39. data/src/nginx/src/os/unix/ngx_errno.c +1 -1
  40. data/src/nginx/src/os/unix/ngx_errno.h +1 -1
  41. data/src/nginx/src/os/unix/ngx_freebsd_init.c +2 -2
  42. data/src/nginx/src/os/unix/ngx_posix_config.h +1 -0
  43. data/src/nginx/src/os/unix/ngx_process_cycle.c +4 -0
  44. metadata +5 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1.3
1
+ 1.2.2.3
data/bin/nginxtra CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "rubygems"
3
- gem "nginxtra", "= 1.2.1.3"
3
+ gem "nginxtra", "= 1.2.2.3"
4
4
  require "nginxtra"
5
5
  Nginxtra::CLI.start
data/src/nginx/CHANGES CHANGED
@@ -1,4 +1,64 @@
1
1
 
2
+ Changes with nginx 1.2.2 03 Jul 2012
3
+
4
+ *) Change: the "single" parameter of the "keepalive" directive is now
5
+ ignored.
6
+
7
+ *) Change: SSL compression is now disabled when using all versions of
8
+ OpenSSL, including ones prior to 1.0.0.
9
+
10
+ *) Feature: the "proxy_pass", "fastcgi_pass", "scgi_pass", "uwsgi_pass"
11
+ directives, and the "server" directive inside the "upstream" block,
12
+ now support IPv6 addresses.
13
+
14
+ *) Feature: the "resolver" directive now support IPv6 addresses and an
15
+ optional port specification.
16
+
17
+ *) Feature: the "least_conn" directive inside the "upstream" block.
18
+
19
+ *) Feature: it is now possible to specify a weight for servers while
20
+ using the "ip_hash" directive.
21
+
22
+ *) Feature: it is now possible to use the "ip_hash" directive to balance
23
+ IPv6 clients.
24
+
25
+ *) Feature: the $status variable can now be used not only in the
26
+ "log_format" directive.
27
+
28
+ *) Bugfix: nginx could not be built with ngx_cpp_test_module; the bug
29
+ had appeared in 1.1.12.
30
+
31
+ *) Bugfix: access to variables from SSI and embedded perl module might
32
+ not work after reconfiguration.
33
+ Thanks to Yichun Zhang.
34
+
35
+ *) Bugfix: in the ngx_http_xslt_filter_module.
36
+ Thanks to Kuramoto Eiji.
37
+
38
+ *) Bugfix: memory leak if $geoip_org variable was used.
39
+ Thanks to Denis F. Latypoff.
40
+
41
+ *) Bugfix: in the "proxy_cookie_domain" and "proxy_cookie_path"
42
+ directives.
43
+
44
+ *) Bugfix: a segmentation fault might occur in a worker process on
45
+ shutdown if the "resolver" directive was used.
46
+
47
+ *) Bugfix: a segmentation fault might occur in a worker process if the
48
+ ngx_http_mp4_module was used.
49
+
50
+ *) Bugfix: in the ngx_http_mp4_module.
51
+
52
+ *) Bugfix: a segmentation fault might occur in a worker process if
53
+ conflicting wildcard server names were used.
54
+
55
+ *) Bugfix: nginx might be terminated abnormally on a SIGBUS signal on
56
+ ARM platform.
57
+
58
+ *) Bugfix: an alert "sendmsg() failed (9: Bad file number)" on HP-UX
59
+ while reconfiguration.
60
+
61
+
2
62
  Changes with nginx 1.2.1 05 Jun 2012
3
63
 
4
64
  *) Security: now nginx/Windows ignores trailing dot in URI path
data/src/nginx/CHANGES.ru CHANGED
@@ -1,4 +1,61 @@
1
1
 
2
+ Изменения в nginx 1.2.2 03.07.2012
3
+
4
+ *) Изменение: параметр single директивы keepalive теперь игнорируется.
5
+
6
+ *) Изменение: сжатие SSL теперь отключено в том числе при использовании
7
+ OpenSSL cтарее 1.0.0.
8
+
9
+ *) Добавление: директивы proxy_pass, fastcgi_pass, scgi_pass, uwsgi_pass
10
+ и директива server в блоке upstream теперь поддерживают IPv6-адреса.
11
+
12
+ *) Добавление: в директиве resolver теперь можно указывать порт и
13
+ задавать IPv6-адреса DNS-серверов.
14
+
15
+ *) Добавление: директива least_conn в блоке upstream.
16
+
17
+ *) Добавление: при использовании директивы ip_hash теперь можно задавать
18
+ веса серверов.
19
+
20
+ *) Добавление: директиву "ip_hash" теперь можно использовать для
21
+ балансировки IPv6 клиентов.
22
+
23
+ *) Добавление: переменную $status теперь можно использовать не только в
24
+ директиве log_format.
25
+
26
+ *) Исправление: nginx не собирался с модулем ngx_cpp_test_module; ошибка
27
+ появилась в 1.1.12.
28
+
29
+ *) Исправление: доступ к переменным из SSI и встроенного перла мог не
30
+ работать после переконфигурации.
31
+ Спасибо Yichun Zhang.
32
+
33
+ *) Исправление: в модуле ngx_http_xslt_filter_module.
34
+ Спасибо Kuramoto Eiji.
35
+
36
+ *) Исправление: утечки памяти при использовании переменной $geoip_org.
37
+ Спасибо Денису Латыпову.
38
+
39
+ *) Исправление: в директивах proxy_cookie_domain и proxy_cookie_path.
40
+
41
+ *) Исправление: при завершении рабочего процесса мог произойти
42
+ segmentation fault, если использовалась директива resolver.
43
+
44
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
45
+ если использовался модуль ngx_http_mp4_module.
46
+
47
+ *) Исправление: в модуле ngx_http_mp4_module.
48
+
49
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
50
+ если использовались конфликтующие имена серверов с масками.
51
+
52
+ *) Исправление: на платформе ARM nginx мог аварийно завершаться по
53
+ сигналу SIGBUS.
54
+
55
+ *) Исправление: во время переконфигурации на HP-UX в лог записывался
56
+ alert "sendmsg() failed (9: Bad file number)".
57
+
58
+
2
59
  Изменения в nginx 1.2.1 05.06.2012
3
60
 
4
61
  *) Безопасность: теперь nginx/Windows игнорирует точку в конце
@@ -3,9 +3,9 @@
3
3
  # Copyright (C) Nginx, Inc.
4
4
 
5
5
 
6
- echo $ngx_n "checking for system endianess ...$ngx_c"
6
+ echo $ngx_n "checking for system byte ordering ...$ngx_c"
7
7
  echo >> $NGX_ERR
8
- echo "checking for system endianess" >> $NGX_ERR
8
+ echo "checking for system byte ordering" >> $NGX_ERR
9
9
 
10
10
 
11
11
  cat << END > $NGX_AUTOTEST.c
@@ -28,10 +28,10 @@ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
28
28
 
29
29
  if [ -x $NGX_AUTOTEST ]; then
30
30
  if $NGX_AUTOTEST >/dev/null 2>&1; then
31
- echo " little endianess"
31
+ echo " little endian"
32
32
  have=NGX_HAVE_LITTLE_ENDIAN . auto/have
33
33
  else
34
- echo " big endianess"
34
+ echo " big endian"
35
35
  fi
36
36
 
37
37
  rm $NGX_AUTOTEST*
@@ -40,6 +40,6 @@ else
40
40
  rm $NGX_AUTOTEST*
41
41
 
42
42
  echo
43
- echo "$0: error: can not detect system endianess"
43
+ echo "$0: error: cannot detect system byte ordering"
44
44
  exit 1
45
45
  fi
@@ -29,6 +29,22 @@ if [ $ngx_found = no ]; then
29
29
  fi
30
30
 
31
31
 
32
+ if [ $ngx_found = no ]; then
33
+
34
+ # MacPorts
35
+
36
+ ngx_feature="Google perftools in /opt/local/"
37
+
38
+ if [ $NGX_RPATH = YES ]; then
39
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler"
40
+ else
41
+ ngx_feature_libs="-L/opt/local/lib -lprofiler"
42
+ fi
43
+
44
+ . auto/feature
45
+ fi
46
+
47
+
32
48
  if [ $ngx_found = yes ]; then
33
49
  CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
34
50
 
@@ -223,6 +223,7 @@ fi
223
223
 
224
224
  if [ $HTTP_REALIP = YES ]; then
225
225
  have=NGX_HTTP_REALIP . auto/have
226
+ have=NGX_HTTP_X_FORWARDED_FOR . auto/have
226
227
  HTTP_MODULES="$HTTP_MODULES $HTTP_REALIP_MODULE"
227
228
  HTTP_SRCS="$HTTP_SRCS $HTTP_REALIP_SRCS"
228
229
  fi
@@ -234,11 +235,13 @@ fi
234
235
 
235
236
  if [ $HTTP_GEO = YES ]; then
236
237
  have=NGX_HTTP_GEO . auto/have
238
+ have=NGX_HTTP_X_FORWARDED_FOR . auto/have
237
239
  HTTP_MODULES="$HTTP_MODULES $HTTP_GEO_MODULE"
238
240
  HTTP_SRCS="$HTTP_SRCS $HTTP_GEO_SRCS"
239
241
  fi
240
242
 
241
243
  if [ $HTTP_GEOIP = YES ]; then
244
+ have=NGX_HTTP_X_FORWARDED_FOR . auto/have
242
245
  HTTP_MODULES="$HTTP_MODULES $HTTP_GEOIP_MODULE"
243
246
  HTTP_SRCS="$HTTP_SRCS $HTTP_GEOIP_SRCS"
244
247
  fi
@@ -274,6 +277,7 @@ fi
274
277
 
275
278
  if [ $HTTP_PROXY = YES ]; then
276
279
  have=NGX_HTTP_PROXY . auto/have
280
+ have=NGX_HTTP_X_FORWARDED_FOR . auto/have
277
281
  #USE_MD5=YES
278
282
  HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
279
283
  HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS"
@@ -345,6 +349,11 @@ if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
345
349
  HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"
346
350
  fi
347
351
 
352
+ if [ $HTTP_UPSTREAM_LEAST_CONN = YES ]; then
353
+ HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_LEAST_CONN_MODULE"
354
+ HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_LEAST_CONN_SRCS"
355
+ fi
356
+
348
357
  if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then
349
358
  HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_KEEPALIVE_MODULE"
350
359
  HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_KEEPALIVE_SRCS"
@@ -458,6 +467,7 @@ fi
458
467
 
459
468
  if [ $NGX_CPP_TEST = YES ]; then
460
469
  NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_CPP_TEST_SRCS"
470
+ CORE_LIBS="$CORE_LIBS -lstdc++"
461
471
  fi
462
472
 
463
473
 
@@ -96,6 +96,7 @@ HTTP_FLV=NO
96
96
  HTTP_MP4=NO
97
97
  HTTP_GZIP_STATIC=NO
98
98
  HTTP_UPSTREAM_IP_HASH=YES
99
+ HTTP_UPSTREAM_LEAST_CONN=YES
99
100
  HTTP_UPSTREAM_KEEPALIVE=YES
100
101
 
101
102
  # STUB
@@ -243,6 +244,8 @@ use the \"--without-http_limit_conn_module\" option instead"
243
244
  --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
244
245
  --without-http_browser_module) HTTP_BROWSER=NO ;;
245
246
  --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
247
+ --without-http_upstream_least_conn_module)
248
+ HTTP_UPSTREAM_LEAST_CONN=NO ;;
246
249
  --without-http_upstream_keepalive_module) HTTP_UPSTREAM_KEEPALIVE=NO ;;
247
250
 
248
251
  --with-http_perl_module) HTTP_PERL=YES ;;
@@ -48,6 +48,7 @@ case "$NGX_PLATFORM" in
48
48
  CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
49
49
  CORE_SRCS="$UNIX_SRCS"
50
50
  CC_AUX_FLAGS="$CC_AUX_FLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
51
+ CC_AUX_FLAGS="$CC_AUX_FLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
51
52
  ;;
52
53
 
53
54
  OSF1:*)
@@ -93,6 +94,7 @@ case "$NGX_MACHINE" in
93
94
  ;;
94
95
 
95
96
  *)
97
+ have=NGX_ALIGNMENT value=16 . auto/define
96
98
  NGX_MACH_CACHE_LINE=32
97
99
  ;;
98
100
 
@@ -479,6 +479,11 @@ HTTP_UPSTREAM_IP_HASH_MODULE=ngx_http_upstream_ip_hash_module
479
479
  HTTP_UPSTREAM_IP_HASH_SRCS=src/http/modules/ngx_http_upstream_ip_hash_module.c
480
480
 
481
481
 
482
+ HTTP_UPSTREAM_LEAST_CONN_MODULE=ngx_http_upstream_least_conn_module
483
+ HTTP_UPSTREAM_LEAST_CONN_SRCS=" \
484
+ src/http/modules/ngx_http_upstream_least_conn_module.c"
485
+
486
+
482
487
  HTTP_UPSTREAM_KEEPALIVE_MODULE=ngx_http_upstream_keepalive_module
483
488
  HTTP_UPSTREAM_KEEPALIVE_SRCS=" \
484
489
  src/http/modules/ngx_http_upstream_keepalive_module.c"
data/src/nginx/auto/unix CHANGED
@@ -464,7 +464,7 @@ ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
464
464
 
465
465
  . auto/types/uintptr_t
466
466
 
467
- . auto/endianess
467
+ . auto/endianness
468
468
 
469
469
  ngx_type="size_t"; . auto/types/sizeof
470
470
  ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
@@ -9,8 +9,8 @@
9
9
  #define _NGINX_H_INCLUDED_
10
10
 
11
11
 
12
- #define nginx_version 1002001
13
- #define NGINX_VERSION "1.2.1"
12
+ #define nginx_version 1002002
13
+ #define NGINX_VERSION "1.2.2"
14
14
  #define NGINX_VER "nginx/" NGINX_VERSION
15
15
 
16
16
  #define NGINX_VAR "NGINX"
@@ -924,17 +924,6 @@ wildcard:
924
924
  }
925
925
 
926
926
 
927
- hk = ngx_array_push(hwc);
928
- if (hk == NULL) {
929
- return NGX_ERROR;
930
- }
931
-
932
- hk->key.len = last - 1;
933
- hk->key.data = p;
934
- hk->key_hash = 0;
935
- hk->value = value;
936
-
937
-
938
927
  /* check conflicts in wildcard hash */
939
928
 
940
929
  name = keys->elts;
@@ -972,5 +961,18 @@ wildcard:
972
961
 
973
962
  ngx_memcpy(name->data, key->data + skip, name->len);
974
963
 
964
+
965
+ /* add to wildcard hash */
966
+
967
+ hk = ngx_array_push(hwc);
968
+ if (hk == NULL) {
969
+ return NGX_ERROR;
970
+ }
971
+
972
+ hk->key.len = last - 1;
973
+ hk->key.data = p;
974
+ hk->key_hash = 0;
975
+ hk->value = value;
976
+
975
977
  return NGX_OK;
976
978
  }
@@ -522,11 +522,6 @@ ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)
522
522
  return ngx_parse_unix_domain_url(pool, u);
523
523
  }
524
524
 
525
- if ((p[0] == ':' || p[0] == '/') && !u->listen) {
526
- u->err = "invalid host";
527
- return NGX_ERROR;
528
- }
529
-
530
525
  if (p[0] == '[') {
531
526
  return ngx_parse_inet6_url(pool, u);
532
527
  }
@@ -639,10 +634,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
639
634
  args = ngx_strlchr(host, last, '?');
640
635
 
641
636
  if (args) {
642
- if (uri == NULL) {
643
- uri = args;
644
-
645
- } else if (args < uri) {
637
+ if (uri == NULL || args < uri) {
646
638
  uri = args;
647
639
  }
648
640
  }
@@ -668,11 +660,6 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
668
660
 
669
661
  len = last - port;
670
662
 
671
- if (len == 0) {
672
- u->err = "invalid port";
673
- return NGX_ERROR;
674
- }
675
-
676
663
  n = ngx_atoi(port, len);
677
664
 
678
665
  if (n < 1 || n > 65535) {
@@ -779,11 +766,7 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
779
766
  return NGX_OK;
780
767
  }
781
768
 
782
- if (ngx_inet_resolve_host(pool, u) != NGX_OK) {
783
- return NGX_ERROR;
784
- }
785
-
786
- return NGX_OK;
769
+ return ngx_inet_resolve_host(pool, u);
787
770
  }
788
771
 
789
772
 
@@ -825,6 +808,8 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
825
808
 
826
809
  u->uri.len = last - uri;
827
810
  u->uri.data = uri;
811
+
812
+ last = uri;
828
813
  }
829
814
 
830
815
  if (*port == ':') {
@@ -832,11 +817,6 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
832
817
 
833
818
  len = last - port;
834
819
 
835
- if (len == 0) {
836
- u->err = "invalid port";
837
- return NGX_ERROR;
838
- }
839
-
840
820
  n = ngx_atoi(port, len);
841
821
 
842
822
  if (n < 1 || n > 65535) {
@@ -862,8 +842,8 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
862
842
  return NGX_ERROR;
863
843
  }
864
844
 
865
- u->host.len = len;
866
- u->host.data = host;
845
+ u->host.len = len + 2;
846
+ u->host.data = host - 1;
867
847
 
868
848
  if (ngx_inet6_addr(host, len, sin6->sin6_addr.s6_addr) != NGX_OK) {
869
849
  u->err = "invalid IPv6 address";
@@ -874,17 +854,38 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
874
854
  u->wildcard = 1;
875
855
  }
876
856
 
857
+ if (u->no_port) {
858
+ u->port = u->default_port;
859
+ sin6->sin6_port = htons(u->default_port);
860
+ }
861
+
877
862
  u->family = AF_INET6;
863
+ u->naddrs = 1;
878
864
 
879
- if (u->no_resolve) {
880
- return NGX_OK;
865
+ u->addrs = ngx_pcalloc(pool, sizeof(ngx_addr_t));
866
+ if (u->addrs == NULL) {
867
+ return NGX_ERROR;
881
868
  }
882
869
 
883
- if (u->no_port) {
884
- u->port = u->default_port;
885
- sin6->sin6_port = htons(u->default_port);
870
+ sin6 = ngx_pcalloc(pool, sizeof(struct sockaddr_in6));
871
+ if (sin6 == NULL) {
872
+ return NGX_ERROR;
886
873
  }
887
874
 
875
+ ngx_memcpy(sin6, u->sockaddr, sizeof(struct sockaddr_in6));
876
+
877
+ u->addrs[0].sockaddr = (struct sockaddr *) sin6;
878
+ u->addrs[0].socklen = sizeof(struct sockaddr_in6);
879
+
880
+ p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
881
+ if (p == NULL) {
882
+ return NGX_ERROR;
883
+ }
884
+
885
+ u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",
886
+ &u->host, u->port) - p;
887
+ u->addrs[0].name.data = p;
888
+
888
889
  return NGX_OK;
889
890
 
890
891
  #else
@@ -152,7 +152,7 @@ ngx_regex_compile(ngx_regex_compile_t *rc)
152
152
  return NGX_ERROR;
153
153
  }
154
154
 
155
- rc->regex->pcre = re;
155
+ rc->regex->code = re;
156
156
 
157
157
  /* do not study at runtime */
158
158
 
@@ -367,7 +367,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle)
367
367
  i = 0;
368
368
  }
369
369
 
370
- elts[i].regex->extra = pcre_study(elts[i].regex->pcre, opt, &errstr);
370
+ elts[i].regex->extra = pcre_study(elts[i].regex->code, opt, &errstr);
371
371
 
372
372
  if (errstr != NULL) {
373
373
  ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
@@ -380,7 +380,7 @@ ngx_regex_module_init(ngx_cycle_t *cycle)
380
380
  int jit, n;
381
381
 
382
382
  jit = 0;
383
- n = pcre_fullinfo(elts[i].regex->pcre, elts[i].regex->extra,
383
+ n = pcre_fullinfo(elts[i].regex->code, elts[i].regex->extra,
384
384
  PCRE_INFO_JIT, &jit);
385
385
 
386
386
  if (n != 0 || jit != 1) {
@@ -21,7 +21,7 @@
21
21
 
22
22
 
23
23
  typedef struct {
24
- pcre *pcre;
24
+ pcre *code;
25
25
  pcre_extra *extra;
26
26
  } ngx_regex_t;
27
27
 
@@ -50,7 +50,7 @@ void ngx_regex_init(void);
50
50
  ngx_int_t ngx_regex_compile(ngx_regex_compile_t *rc);
51
51
 
52
52
  #define ngx_regex_exec(re, s, captures, size) \
53
- pcre_exec(re->pcre, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \
53
+ pcre_exec(re->code, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \
54
54
  captures, size)
55
55
  #define ngx_regex_exec_n "pcre_exec()"
56
56
 
@@ -96,7 +96,7 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
96
96
  {
97
97
  ngx_str_t s;
98
98
  ngx_url_t u;
99
- ngx_uint_t i;
99
+ ngx_uint_t i, j;
100
100
  ngx_resolver_t *r;
101
101
  ngx_pool_cleanup_t *cln;
102
102
  ngx_udp_connection_t *uc;
@@ -171,24 +171,31 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
171
171
 
172
172
  ngx_memzero(&u, sizeof(ngx_url_t));
173
173
 
174
- u.host = names[i];
175
- u.port = 53;
174
+ u.url = names[i];
175
+ u.default_port = 53;
176
+
177
+ if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
178
+ if (u.err) {
179
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
180
+ "%s in resolver \"%V\"",
181
+ u.err, &u.url);
182
+ }
176
183
 
177
- if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
178
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err);
179
184
  return NULL;
180
185
  }
181
186
 
182
- uc = ngx_array_push(&r->udp_connections);
187
+ uc = ngx_array_push_n(&r->udp_connections, u.naddrs);
183
188
  if (uc == NULL) {
184
189
  return NULL;
185
190
  }
186
191
 
187
- ngx_memzero(uc, sizeof(ngx_udp_connection_t));
192
+ ngx_memzero(uc, u.naddrs * sizeof(ngx_udp_connection_t));
188
193
 
189
- uc->sockaddr = u.addrs->sockaddr;
190
- uc->socklen = u.addrs->socklen;
191
- uc->server = u.addrs->name;
194
+ for (j = 0; j < u.naddrs; j++) {
195
+ uc[j].sockaddr = u.addrs[j].sockaddr;
196
+ uc[j].socklen = u.addrs[j].socklen;
197
+ uc[j].server = u.addrs[j].name;
198
+ }
192
199
  }
193
200
 
194
201
  return r;
@@ -972,12 +979,11 @@ ngx_resolver_resend(ngx_resolver_t *r, ngx_rbtree_t *tree, ngx_queue_t *queue)
972
979
 
973
980
  if (rn->waiting) {
974
981
 
975
- if (ngx_resolver_send_query(r, rn) == NGX_OK) {
982
+ (void) ngx_resolver_send_query(r, rn);
976
983
 
977
- rn->expire = now + r->resend_timeout;
984
+ rn->expire = now + r->resend_timeout;
978
985
 
979
- ngx_queue_insert_head(queue, &rn->queue);
980
- }
986
+ ngx_queue_insert_head(queue, q);
981
987
 
982
988
  continue;
983
989
  }
@@ -1035,7 +1041,7 @@ ngx_resolver_process_response(ngx_resolver_t *r, u_char *buf, size_t n)
1035
1041
  nan = (query->nan_hi << 8) + query->nan_lo;
1036
1042
 
1037
1043
  ngx_log_debug6(NGX_LOG_DEBUG_CORE, r->log, 0,
1038
- "resolver DNS response %ui fl:%04Xui %ui/%ui/%ui/%ui",
1044
+ "resolver DNS response %ui fl:%04Xui %ui/%ui/%ud/%ud",
1039
1045
  ident, flags, nqs, nan,
1040
1046
  (query->nns_hi << 8) + query->nns_lo,
1041
1047
  (query->nar_hi << 8) + query->nar_lo);
@@ -2184,7 +2190,7 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
2184
2190
  ngx_socket_t s;
2185
2191
  ngx_connection_t *c;
2186
2192
 
2187
- s = ngx_socket(AF_INET, SOCK_DGRAM, 0);
2193
+ s = ngx_socket(uc->sockaddr->sa_family, SOCK_DGRAM, 0);
2188
2194
 
2189
2195
  ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &uc->log, 0, "UDP socket %d", s);
2190
2196
 
@@ -94,6 +94,24 @@ ngx_ssl_init(ngx_log_t *log)
94
94
 
95
95
  OpenSSL_add_all_algorithms();
96
96
 
97
+ #ifndef SSL_OP_NO_COMPRESSION
98
+ {
99
+ /*
100
+ * Disable gzip compression in OpenSSL prior to 1.0.0 version,
101
+ * this saves about 522K per connection.
102
+ */
103
+ int i, n;
104
+ STACK_OF(SSL_COMP) *ssl_comp_methods;
105
+
106
+ ssl_comp_methods = SSL_COMP_get_compression_methods();
107
+ n = sk_SSL_COMP_num(ssl_comp_methods);
108
+
109
+ for (i = 0; i < n; i++) {
110
+ (void) sk_SSL_COMP_delete(ssl_comp_methods, i);
111
+ }
112
+ }
113
+ #endif
114
+
97
115
  ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
98
116
 
99
117
  if (ngx_ssl_connection_index == -1) {
@@ -990,7 +1008,6 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
990
1008
  }
991
1009
 
992
1010
  if (n == NGX_AGAIN) {
993
- c->buffered |= NGX_SSL_BUFFERED;
994
1011
  return in;
995
1012
  }
996
1013
 
@@ -145,7 +145,7 @@ typedef struct {
145
145
  u_char GEORNG[6];
146
146
  u_char version;
147
147
  u_char ptr_size;
148
- uint32_t endianess;
148
+ uint32_t endianness;
149
149
  uint32_t crc32;
150
150
  } ngx_http_geo_header_t;
151
151