nginxtra 1.0.15.0 → 1.2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. data/VERSION +1 -1
  2. data/bin/nginxtra +1 -1
  3. data/lib/nginxtra/action.rb +10 -0
  4. data/lib/nginxtra/actions/compile.rb +16 -2
  5. data/lib/nginxtra/actions/start.rb +18 -2
  6. data/lib/nginxtra/actions/status.rb +1 -10
  7. data/lib/nginxtra/actions/stop.rb +18 -0
  8. data/lib/nginxtra/cli.rb +12 -3
  9. data/lib/nginxtra/config.rb +10 -0
  10. data/src/nginx/CHANGES +311 -90
  11. data/src/nginx/CHANGES.ru +315 -88
  12. data/src/nginx/auto/lib/pcre/conf +22 -5
  13. data/src/nginx/auto/lib/pcre/make +1 -1
  14. data/src/nginx/auto/modules +14 -3
  15. data/src/nginx/auto/options +17 -3
  16. data/src/nginx/auto/os/freebsd +8 -0
  17. data/src/nginx/auto/os/linux +5 -4
  18. data/src/nginx/auto/os/solaris +2 -1
  19. data/src/nginx/auto/sources +10 -2
  20. data/src/nginx/auto/summary +2 -0
  21. data/src/nginx/auto/types/sizeof +2 -1
  22. data/src/nginx/auto/types/typedef +1 -1
  23. data/src/nginx/auto/types/uintptr_t +7 -4
  24. data/src/nginx/auto/unix +82 -21
  25. data/src/nginx/conf/fastcgi.conf +1 -0
  26. data/src/nginx/conf/fastcgi_params +1 -0
  27. data/src/nginx/conf/scgi_params +1 -0
  28. data/src/nginx/conf/uwsgi_params +1 -0
  29. data/src/nginx/man/nginx.8 +49 -49
  30. data/src/nginx/src/core/nginx.c +10 -12
  31. data/src/nginx/src/core/nginx.h +2 -2
  32. data/src/nginx/src/core/ngx_buf.c +9 -7
  33. data/src/nginx/src/core/ngx_buf.h +2 -2
  34. data/src/nginx/src/core/ngx_conf_file.c +4 -11
  35. data/src/nginx/src/core/ngx_conf_file.h +1 -1
  36. data/src/nginx/src/core/ngx_connection.c +52 -1
  37. data/src/nginx/src/core/ngx_connection.h +6 -0
  38. data/src/nginx/src/core/ngx_core.h +5 -0
  39. data/src/nginx/src/core/ngx_cycle.c +1 -1
  40. data/src/nginx/src/core/ngx_cycle.h +2 -2
  41. data/src/nginx/src/core/ngx_file.c +1 -1
  42. data/src/nginx/src/core/ngx_inet.c +11 -8
  43. data/src/nginx/src/core/ngx_murmurhash.h +1 -1
  44. data/src/nginx/src/core/ngx_open_file_cache.c +343 -38
  45. data/src/nginx/src/core/ngx_open_file_cache.h +10 -0
  46. data/src/nginx/src/core/ngx_output_chain.c +2 -1
  47. data/src/nginx/src/core/ngx_parse.h +0 -3
  48. data/src/nginx/src/core/ngx_rbtree.c +1 -2
  49. data/src/nginx/src/core/ngx_regex.c +263 -5
  50. data/src/nginx/src/core/ngx_regex.h +6 -2
  51. data/src/nginx/src/core/ngx_resolver.c +88 -21
  52. data/src/nginx/src/core/ngx_resolver.h +7 -8
  53. data/src/nginx/src/core/ngx_shmtx.c +69 -44
  54. data/src/nginx/src/core/ngx_shmtx.h +12 -1
  55. data/src/nginx/src/core/ngx_slab.c +3 -3
  56. data/src/nginx/src/core/ngx_slab.h +1 -1
  57. data/src/nginx/src/core/ngx_string.c +19 -16
  58. data/src/nginx/src/core/ngx_times.c +2 -2
  59. data/src/nginx/src/event/modules/ngx_epoll_module.c +2 -2
  60. data/src/nginx/src/event/modules/ngx_eventport_module.c +1 -1
  61. data/src/nginx/src/event/modules/ngx_kqueue_module.c +1 -1
  62. data/src/nginx/src/event/ngx_event.c +25 -17
  63. data/src/nginx/src/event/ngx_event_openssl.c +3 -1
  64. data/src/nginx/src/event/ngx_event_pipe.c +108 -85
  65. data/src/nginx/src/event/ngx_event_pipe.h +1 -2
  66. data/src/nginx/src/event/ngx_event_timer.c +2 -3
  67. data/src/nginx/src/http/modules/ngx_http_access_module.c +9 -4
  68. data/src/nginx/src/http/modules/ngx_http_browser_module.c +5 -3
  69. data/src/nginx/src/http/modules/ngx_http_chunked_filter_module.c +1 -1
  70. data/src/nginx/src/http/modules/ngx_http_degradation_module.c +1 -1
  71. data/src/nginx/src/http/modules/ngx_http_fastcgi_module.c +144 -22
  72. data/src/nginx/src/http/modules/ngx_http_flv_module.c +8 -0
  73. data/src/nginx/src/http/modules/ngx_http_geo_module.c +3 -3
  74. data/src/nginx/src/http/modules/ngx_http_gzip_filter_module.c +20 -6
  75. data/src/nginx/src/http/modules/ngx_http_gzip_static_module.c +8 -0
  76. data/src/nginx/src/http/modules/ngx_http_headers_filter_module.c +23 -27
  77. data/src/nginx/src/http/modules/ngx_http_image_filter_module.c +1 -3
  78. data/src/nginx/src/http/modules/ngx_http_index_module.c +24 -0
  79. data/src/nginx/src/http/modules/ngx_http_limit_conn_module.c +747 -0
  80. data/src/nginx/src/http/modules/ngx_http_limit_req_module.c +289 -133
  81. data/src/nginx/src/http/modules/ngx_http_log_module.c +34 -6
  82. data/src/nginx/src/http/modules/ngx_http_memcached_module.c +19 -3
  83. data/src/nginx/src/http/modules/ngx_http_mp4_module.c +8 -0
  84. data/src/nginx/src/http/modules/ngx_http_proxy_module.c +1446 -239
  85. data/src/nginx/src/http/modules/ngx_http_realip_module.c +4 -10
  86. data/src/nginx/src/http/modules/ngx_http_scgi_module.c +90 -21
  87. data/src/nginx/src/http/modules/ngx_http_split_clients_module.c +8 -11
  88. data/src/nginx/src/http/modules/ngx_http_ssi_filter_module.c +16 -6
  89. data/src/nginx/src/http/modules/ngx_http_static_module.c +8 -0
  90. data/src/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +2 -2
  91. data/src/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c +570 -0
  92. data/src/nginx/src/http/modules/ngx_http_userid_filter_module.c +1 -5
  93. data/src/nginx/src/http/modules/ngx_http_uwsgi_module.c +77 -26
  94. data/src/nginx/src/http/modules/ngx_http_xslt_filter_module.c +171 -37
  95. data/src/nginx/src/http/modules/perl/nginx.pm +2 -1
  96. data/src/nginx/src/http/modules/perl/nginx.xs +4 -0
  97. data/src/nginx/src/http/ngx_http.c +8 -1
  98. data/src/nginx/src/http/ngx_http.h +1 -0
  99. data/src/nginx/src/http/ngx_http_busy_lock.c +2 -2
  100. data/src/nginx/src/http/ngx_http_cache.h +12 -1
  101. data/src/nginx/src/http/ngx_http_copy_filter_module.c +4 -3
  102. data/src/nginx/src/http/ngx_http_core_module.c +303 -37
  103. data/src/nginx/src/http/ngx_http_core_module.h +15 -0
  104. data/src/nginx/src/http/ngx_http_file_cache.c +226 -52
  105. data/src/nginx/src/http/ngx_http_parse.c +69 -3
  106. data/src/nginx/src/http/ngx_http_postpone_filter_module.c +4 -4
  107. data/src/nginx/src/http/ngx_http_request.c +61 -27
  108. data/src/nginx/src/http/ngx_http_request.h +3 -3
  109. data/src/nginx/src/http/ngx_http_request_body.c +1 -1
  110. data/src/nginx/src/http/ngx_http_script.c +6 -0
  111. data/src/nginx/src/http/ngx_http_upstream.c +200 -47
  112. data/src/nginx/src/http/ngx_http_upstream.h +20 -1
  113. data/src/nginx/src/http/ngx_http_upstream_round_robin.c +22 -6
  114. data/src/nginx/src/http/ngx_http_upstream_round_robin.h +1 -0
  115. data/src/nginx/src/http/ngx_http_variables.c +123 -4
  116. data/src/nginx/src/mail/ngx_mail.c +13 -0
  117. data/src/nginx/src/mail/ngx_mail.h +12 -0
  118. data/src/nginx/src/mail/ngx_mail_core_module.c +100 -15
  119. data/src/nginx/src/os/unix/ngx_daemon.c +2 -1
  120. data/src/nginx/src/os/unix/ngx_darwin.h +3 -0
  121. data/src/nginx/src/os/unix/ngx_darwin_config.h +1 -0
  122. data/src/nginx/src/os/unix/ngx_darwin_init.c +30 -0
  123. data/src/nginx/src/os/unix/ngx_darwin_sendfile_chain.c +11 -5
  124. data/src/nginx/src/os/unix/ngx_errno.h +5 -0
  125. data/src/nginx/src/os/unix/ngx_files.h +50 -1
  126. data/src/nginx/src/os/unix/ngx_freebsd.h +2 -1
  127. data/src/nginx/src/os/unix/ngx_freebsd_config.h +2 -0
  128. data/src/nginx/src/os/unix/ngx_freebsd_init.c +4 -3
  129. data/src/nginx/src/os/unix/ngx_freebsd_rfork_thread.c +2 -2
  130. data/src/nginx/src/os/unix/ngx_freebsd_sendfile_chain.c +12 -6
  131. data/src/nginx/src/os/unix/ngx_gcc_atomic_sparc64.h +1 -1
  132. data/src/nginx/src/os/unix/ngx_linux_config.h +1 -0
  133. data/src/nginx/src/os/unix/ngx_linux_sendfile_chain.c +6 -4
  134. data/src/nginx/src/os/unix/ngx_os.h +0 -1
  135. data/src/nginx/src/os/unix/ngx_posix_config.h +3 -0
  136. data/src/nginx/src/os/unix/ngx_process.c +50 -11
  137. data/src/nginx/src/os/unix/ngx_process.h +1 -0
  138. data/src/nginx/src/os/unix/ngx_process_cycle.c +6 -15
  139. data/src/nginx/src/os/unix/ngx_readv_chain.c +8 -0
  140. data/src/nginx/src/os/unix/ngx_setaffinity.c +69 -0
  141. data/src/nginx/src/os/unix/ngx_setaffinity.h +23 -0
  142. data/src/nginx/src/os/unix/ngx_setproctitle.c +1 -1
  143. data/src/nginx/src/os/unix/ngx_solaris_config.h +2 -0
  144. data/src/nginx/src/os/unix/ngx_solaris_sendfilev_chain.c +11 -3
  145. data/src/nginx/src/os/unix/ngx_writev_chain.c +7 -3
  146. metadata +7 -4
  147. data/src/nginx/src/http/modules/ngx_http_limit_zone_module.c +0 -553
@@ -5,8 +5,6 @@
5
5
 
6
6
  if [ $PCRE != NONE ]; then
7
7
  CORE_INCS="$CORE_INCS $PCRE"
8
- CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
9
- CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
10
8
 
11
9
  case "$NGX_CC_NAME" in
12
10
 
@@ -82,6 +80,12 @@ if [ $PCRE != NONE ]; then
82
80
 
83
81
  esac
84
82
 
83
+
84
+ if [ $PCRE_JIT = YES ]; then
85
+ have=NGX_HAVE_PCRE_JIT . auto/have
86
+ PCRE_CONF_OPT="$PCRE_CONF_OPT --enable-jit"
87
+ fi
88
+
85
89
  else
86
90
 
87
91
  if [ "$NGX_PLATFORM" != win32 ]; then
@@ -94,7 +98,9 @@ else
94
98
  ngx_feature_incs="#include <pcre.h>"
95
99
  ngx_feature_path=
96
100
  ngx_feature_libs="-lpcre"
97
- ngx_feature_test="pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL)"
101
+ ngx_feature_test="pcre *re;
102
+ re = pcre_compile(NULL, 0, NULL, 0, NULL);
103
+ if (re == NULL) return 1"
98
104
  . auto/feature
99
105
 
100
106
  if [ $ngx_found = no ]; then
@@ -157,12 +163,23 @@ else
157
163
  fi
158
164
 
159
165
  if [ $ngx_found = yes ]; then
160
- CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
161
- CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
162
166
  CORE_INCS="$CORE_INCS $ngx_feature_path"
163
167
  CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
164
168
  PCRE=YES
165
169
  fi
170
+
171
+ if [ $PCRE = YES ]; then
172
+ ngx_feature="PCRE JIT support"
173
+ ngx_feature_name="NGX_HAVE_PCRE_JIT"
174
+ ngx_feature_test="int jit = 0;
175
+ pcre_config(PCRE_CONFIG_JIT, &jit);
176
+ if (jit != 1) return 1;"
177
+ . auto/feature
178
+
179
+ if [ $ngx_found = yes ]; then
180
+ PCRE_JIT=YES
181
+ fi
182
+ fi
166
183
  fi
167
184
 
168
185
  if [ $PCRE != YES ]; then
@@ -51,7 +51,7 @@ $PCRE/Makefile: $NGX_MAKEFILE
51
51
  cd $PCRE \\
52
52
  && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
53
53
  && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
54
- ./configure --disable-shared
54
+ ./configure --disable-shared $PCRE_CONF_OPT
55
55
 
56
56
  $PCRE/.libs/libpcre.a: $PCRE/Makefile
57
57
  cd $PCRE \\
@@ -211,9 +211,9 @@ if [ $HTTP_ACCESS = YES ]; then
211
211
  HTTP_SRCS="$HTTP_SRCS $HTTP_ACCESS_SRCS"
212
212
  fi
213
213
 
214
- if [ $HTTP_LIMIT_ZONE = YES ]; then
215
- HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_ZONE_MODULE"
216
- HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_ZONE_SRCS"
214
+ if [ $HTTP_LIMIT_CONN = YES ]; then
215
+ HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_CONN_MODULE"
216
+ HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_CONN_SRCS"
217
217
  fi
218
218
 
219
219
  if [ $HTTP_LIMIT_REQ = YES ]; then
@@ -345,6 +345,11 @@ if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
345
345
  HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"
346
346
  fi
347
347
 
348
+ if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then
349
+ HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_KEEPALIVE_MODULE"
350
+ HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_KEEPALIVE_SRCS"
351
+ fi
352
+
348
353
  if [ $HTTP_STUB_STATUS = YES ]; then
349
354
  have=NGX_STAT_STUB . auto/have
350
355
  HTTP_MODULES="$HTTP_MODULES ngx_http_stub_status_module"
@@ -392,6 +397,12 @@ if [ $USE_OPENSSL = YES ]; then
392
397
  CORE_SRCS="$CORE_SRCS $OPENSSL_SRCS"
393
398
  fi
394
399
 
400
+ if [ $USE_PCRE = YES ]; then
401
+ modules="$modules $REGEX_MODULE"
402
+ CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
403
+ CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
404
+ fi
405
+
395
406
  if [ $HTTP = YES ]; then
396
407
  modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
397
408
  $HTTP_HEADERS_FILTER_MODULE \
@@ -86,7 +86,7 @@ HTTP_UWSGI=YES
86
86
  HTTP_SCGI=YES
87
87
  HTTP_PERL=NO
88
88
  HTTP_MEMCACHED=YES
89
- HTTP_LIMIT_ZONE=YES
89
+ HTTP_LIMIT_CONN=YES
90
90
  HTTP_LIMIT_REQ=YES
91
91
  HTTP_EMPTY_GIF=YES
92
92
  HTTP_BROWSER=YES
@@ -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_KEEPALIVE=YES
99
100
 
100
101
  # STUB
101
102
  HTTP_STUB_STATUS=NO
@@ -111,6 +112,8 @@ NGX_ADDONS=
111
112
  USE_PCRE=NO
112
113
  PCRE=NONE
113
114
  PCRE_OPT=
115
+ PCRE_CONF_OPT=
116
+ PCRE_JIT=NO
114
117
 
115
118
  USE_OPENSSL=NO
116
119
  OPENSSL=NONE
@@ -143,6 +146,8 @@ NGX_LIBATOMIC=NO
143
146
 
144
147
  NGX_CPU_CACHE_LINE=
145
148
 
149
+ NGX_POST_CONF_MSG=
150
+
146
151
  opt=
147
152
 
148
153
  for option
@@ -227,11 +232,18 @@ do
227
232
  --without-http_uwsgi_module) HTTP_UWSGI=NO ;;
228
233
  --without-http_scgi_module) HTTP_SCGI=NO ;;
229
234
  --without-http_memcached_module) HTTP_MEMCACHED=NO ;;
230
- --without-http_limit_zone_module) HTTP_LIMIT_ZONE=NO ;;
235
+ --without-http_limit_zone_module)
236
+ HTTP_LIMIT_CONN=NO
237
+ NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
238
+ $0: warning: the \"--without-http_limit_zone_module\" option is deprecated, \
239
+ use the \"--without-http_limit_conn_module\" option instead"
240
+ ;;
241
+ --without-http_limit_conn_module) HTTP_LIMIT_CONN=NO ;;
231
242
  --without-http_limit_req_module) HTTP_LIMIT_REQ=NO ;;
232
243
  --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
233
244
  --without-http_browser_module) HTTP_BROWSER=NO ;;
234
245
  --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
246
+ --without-http_upstream_keepalive_module) HTTP_UPSTREAM_KEEPALIVE=NO ;;
235
247
 
236
248
  --with-http_perl_module) HTTP_PERL=YES ;;
237
249
  --with-perl_modules_path=*) NGX_PERL_MODULES="$value" ;;
@@ -265,6 +277,7 @@ do
265
277
  --with-pcre) USE_PCRE=YES ;;
266
278
  --with-pcre=*) PCRE="$value" ;;
267
279
  --with-pcre-opt=*) PCRE_OPT="$value" ;;
280
+ --with-pcre-jit) PCRE_JIT=YES ;;
268
281
 
269
282
  --with-openssl=*) OPENSSL="$value" ;;
270
283
  --with-openssl-opt=*) OPENSSL_OPT="$value" ;;
@@ -363,7 +376,7 @@ cat << END
363
376
  --without-http_uwsgi_module disable ngx_http_uwsgi_module
364
377
  --without-http_scgi_module disable ngx_http_scgi_module
365
378
  --without-http_memcached_module disable ngx_http_memcached_module
366
- --without-http_limit_zone_module disable ngx_http_limit_zone_module
379
+ --without-http_limit_conn_module disable ngx_http_limit_conn_module
367
380
  --without-http_limit_req_module disable ngx_http_limit_req_module
368
381
  --without-http_empty_gif_module disable ngx_http_empty_gif_module
369
382
  --without-http_browser_module disable ngx_http_browser_module
@@ -412,6 +425,7 @@ cat << END
412
425
  --with-pcre force PCRE library usage
413
426
  --with-pcre=DIR set path to PCRE library sources
414
427
  --with-pcre-opt=OPTIONS set additional build options for PCRE
428
+ --with-pcre-jit build PCRE with JIT compilation support
415
429
 
416
430
  --with-md5=DIR set path to md5 library sources
417
431
  --with-md5-opt=OPTIONS set additional build options for md5
@@ -134,3 +134,11 @@ END
134
134
  exit 1
135
135
  fi
136
136
  fi
137
+
138
+
139
+ # cpuset_setaffinity()
140
+
141
+ if [ $version -ge 701000 ]; then
142
+ echo " + cpuset_setaffinity() found"
143
+ have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
144
+ fi
@@ -52,7 +52,7 @@ ngx_feature_run=yes
52
52
  ngx_feature_incs="#include <sys/epoll.h>"
53
53
  ngx_feature_path=
54
54
  ngx_feature_libs=
55
- ngx_feature_test="int efd = 0, fd = 1, n;
55
+ ngx_feature_test="int efd = 0;
56
56
  struct epoll_event ee;
57
57
  ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
58
58
  ee.data.ptr = NULL;
@@ -128,8 +128,9 @@ ngx_feature_run=no
128
128
  ngx_feature_incs="#include <sched.h>"
129
129
  ngx_feature_path=
130
130
  ngx_feature_libs=
131
- ngx_feature_test="long mask = 0;
132
- sched_setaffinity(0, 32, (cpu_set_t *) &mask)"
131
+ ngx_feature_test="cpu_set_t mask;
132
+ CPU_ZERO(&mask);
133
+ sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
133
134
  . auto/feature
134
135
 
135
136
 
@@ -142,7 +143,7 @@ ngx_feature_incs="#include <crypt.h>"
142
143
  ngx_feature_path=
143
144
  ngx_feature_libs=-lcrypt
144
145
  ngx_feature_test="struct crypt_data cd;
145
- crypt_r(NULL, NULL, &cd);"
146
+ crypt_r(\"key\", \"salt\", &cd);"
146
147
  . auto/feature
147
148
 
148
149
 
@@ -35,7 +35,8 @@ ngx_feature_path=
35
35
  ngx_feature_libs="-lsendfile"
36
36
  ngx_feature_test="int fd = 1; sendfilevec_t vec[1];
37
37
  size_t sent; ssize_t n;
38
- n = sendfilev(fd, vec, 1, &sent)"
38
+ n = sendfilev(fd, vec, 1, &sent);
39
+ if (n == -1) return 1"
39
40
  . auto/feature
40
41
 
41
42
 
@@ -70,6 +70,7 @@ CORE_SRCS="src/core/nginx.c \
70
70
  src/core/ngx_crypt.c"
71
71
 
72
72
 
73
+ REGEX_MODULE=ngx_regex_module
73
74
  REGEX_DEPS=src/core/ngx_regex.h
74
75
  REGEX_SRCS=src/core/ngx_regex.c
75
76
 
@@ -144,6 +145,7 @@ UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
144
145
  src/os/unix/ngx_channel.h \
145
146
  src/os/unix/ngx_shmem.h \
146
147
  src/os/unix/ngx_process.h \
148
+ src/os/unix/ngx_setaffinity.h \
147
149
  src/os/unix/ngx_setproctitle.h \
148
150
  src/os/unix/ngx_atomic.h \
149
151
  src/os/unix/ngx_gcc_atomic_x86.h \
@@ -178,6 +180,7 @@ UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
178
180
  src/os/unix/ngx_shmem.c \
179
181
  src/os/unix/ngx_process.c \
180
182
  src/os/unix/ngx_daemon.c \
183
+ src/os/unix/ngx_setaffinity.c \
181
184
  src/os/unix/ngx_setproctitle.c \
182
185
  src/os/unix/ngx_posix_init.c \
183
186
  src/os/unix/ngx_user.c \
@@ -436,8 +439,8 @@ HTTP_MEMCACHED_MODULE=ngx_http_memcached_module
436
439
  HTTP_MEMCACHED_SRCS=src/http/modules/ngx_http_memcached_module.c
437
440
 
438
441
 
439
- HTTP_LIMIT_ZONE_MODULE=ngx_http_limit_zone_module
440
- HTTP_LIMIT_ZONE_SRCS=src/http/modules/ngx_http_limit_zone_module.c
442
+ HTTP_LIMIT_CONN_MODULE=ngx_http_limit_conn_module
443
+ HTTP_LIMIT_CONN_SRCS=src/http/modules/ngx_http_limit_conn_module.c
441
444
 
442
445
 
443
446
  HTTP_LIMIT_REQ_MODULE=ngx_http_limit_req_module
@@ -476,6 +479,11 @@ HTTP_UPSTREAM_IP_HASH_MODULE=ngx_http_upstream_ip_hash_module
476
479
  HTTP_UPSTREAM_IP_HASH_SRCS=src/http/modules/ngx_http_upstream_ip_hash_module.c
477
480
 
478
481
 
482
+ HTTP_UPSTREAM_KEEPALIVE_MODULE=ngx_http_upstream_keepalive_module
483
+ HTTP_UPSTREAM_KEEPALIVE_SRCS=" \
484
+ src/http/modules/ngx_http_upstream_keepalive_module.c"
485
+
486
+
479
487
  MAIL_INCS="src/mail"
480
488
 
481
489
  MAIL_DEPS="src/mail/ngx_mail.h"
@@ -112,3 +112,5 @@ fi
112
112
  if [ $HTTP_SCGI = YES ]; then
113
113
  echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
114
114
  fi
115
+
116
+ echo "$NGX_POST_CONF_MSG"
@@ -20,12 +20,13 @@ cat << END > $NGX_AUTOTEST.c
20
20
  #include <sys/time.h>
21
21
  $NGX_INCLUDE_UNISTD_H
22
22
  #include <signal.h>
23
+ #include <stdio.h>
23
24
  #include <sys/resource.h>
24
25
  $NGX_INCLUDE_INTTYPES_H
25
26
  $NGX_INCLUDE_AUTO_CONFIG_H
26
27
 
27
28
  int main() {
28
- printf("%d", sizeof($ngx_type));
29
+ printf("%d", (int) sizeof($ngx_type));
29
30
  return 0;
30
31
  }
31
32
 
@@ -29,7 +29,7 @@ $NGX_INCLUDE_INTTYPES_H
29
29
 
30
30
  int main() {
31
31
  $ngx_try i = 0;
32
- return 0;
32
+ return (int) i;
33
33
  }
34
34
 
35
35
  END
@@ -4,8 +4,8 @@
4
4
 
5
5
 
6
6
  echo $ngx_n "checking for uintptr_t ...$ngx_c"
7
- echo >> $NGX_ERR
8
- echo "checking for uintptr_t" >> $NGX_ERR
7
+ echo >> $NGX_AUTOCONF_ERR
8
+ echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR
9
9
 
10
10
  found=no
11
11
 
@@ -16,12 +16,15 @@ $NGX_INTTYPES_H
16
16
 
17
17
  int main() {
18
18
  uintptr_t i = 0;
19
- return 0;
19
+ return (int) i;
20
20
  }
21
21
 
22
22
  END
23
23
 
24
- eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
24
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
25
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
26
+
27
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
25
28
 
26
29
  if [ -x $NGX_AUTOTEST ]; then
27
30
  echo " uintptr_t found"
data/src/nginx/auto/unix CHANGED
@@ -33,12 +33,12 @@ ngx_feature_run=no
33
33
  ngx_feature_incs="#include <poll.h>"
34
34
  ngx_feature_path=
35
35
  ngx_feature_libs=
36
- ngx_feature_test="int n, dp; struct pollfd pl;
37
- dp = 0;
36
+ ngx_feature_test="int n; struct pollfd pl;
38
37
  pl.fd = 0;
39
38
  pl.events = 0;
40
39
  pl.revents = 0;
41
- n = poll(&pl, 1, 0)"
40
+ n = poll(&pl, 1, 0);
41
+ if (n == -1) return 1"
42
42
  . auto/feature
43
43
 
44
44
  if [ $ngx_found = no ]; then
@@ -57,7 +57,8 @@ ngx_feature_test="int n, dp; struct dvpoll dvp;
57
57
  dvp.dp_fds = NULL;
58
58
  dvp.dp_nfds = 0;
59
59
  dvp.dp_timeout = 0;
60
- n = ioctl(dp, DP_POLL, &dvp)"
60
+ n = ioctl(dp, DP_POLL, &dvp);
61
+ if (n == -1) return 1"
61
62
  . auto/feature
62
63
 
63
64
  if [ $ngx_found = yes ]; then
@@ -237,7 +238,7 @@ ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
237
238
  ngx_feature_path=
238
239
  ngx_feature_libs=
239
240
  ngx_feature_test="struct statfs fs;
240
- statfs(NULL, &fs);"
241
+ statfs(\".\", &fs);"
241
242
  . auto/feature
242
243
 
243
244
 
@@ -249,7 +250,7 @@ ngx_feature_incs="#include <sys/types.h>
249
250
  ngx_feature_path=
250
251
  ngx_feature_libs=
251
252
  ngx_feature_test="struct statvfs fs;
252
- statvfs(NULL, &fs);"
253
+ statvfs(\".\", &fs);"
253
254
  . auto/feature
254
255
 
255
256
 
@@ -329,6 +330,38 @@ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
329
330
  . auto/feature
330
331
 
331
332
 
333
+ ngx_feature="TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT"
334
+ ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
335
+ ngx_feature_run=no
336
+ ngx_feature_incs="#include <sys/socket.h>
337
+ #include <netinet/in.h>
338
+ #include <netinet/tcp.h>"
339
+ ngx_feature_path=
340
+ ngx_feature_libs=
341
+ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
342
+ setsockopt(0, IPPROTO_TCP, TCP_KEEPINTVL, NULL, 0);
343
+ setsockopt(0, IPPROTO_TCP, TCP_KEEPCNT, NULL, 0)"
344
+ . auto/feature
345
+
346
+
347
+ ngx_feature="TCP_INFO"
348
+ ngx_feature_name="NGX_HAVE_TCP_INFO"
349
+ ngx_feature_run=no
350
+ ngx_feature_incs="#include <sys/socket.h>
351
+ #include <netinet/in.h>
352
+ #include <netinet/tcp.h>"
353
+ ngx_feature_path=
354
+ ngx_feature_libs=
355
+ ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
356
+ struct tcp_info ti;
357
+ ti.tcpi_rtt = 0;
358
+ ti.tcpi_rttvar = 0;
359
+ ti.tcpi_snd_cwnd = 0;
360
+ ti.tcpi_rcv_space = 0;
361
+ getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
362
+ . auto/feature
363
+
364
+
332
365
  ngx_feature="accept4()"
333
366
  ngx_feature_name="NGX_HAVE_ACCEPT4"
334
367
  ngx_feature_run=no
@@ -467,7 +500,7 @@ fi
467
500
  ngx_feature="setproctitle()"
468
501
  ngx_feature_name="NGX_HAVE_SETPROCTITLE"
469
502
  ngx_feature_run=no
470
- ngx_feature_incs=
503
+ ngx_feature_incs="#include <stdlib.h>"
471
504
  ngx_feature_path=
472
505
  ngx_feature_libs=$NGX_SETPROCTITLE_LIB
473
506
  ngx_feature_test="setproctitle(\"test\");"
@@ -480,7 +513,8 @@ ngx_feature_run=no
480
513
  ngx_feature_incs=
481
514
  ngx_feature_path=
482
515
  ngx_feature_libs=
483
- ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
516
+ ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
517
+ if (n == -1) return 1"
484
518
  . auto/feature
485
519
 
486
520
 
@@ -490,7 +524,8 @@ ngx_feature_run=no
490
524
  ngx_feature_incs=
491
525
  ngx_feature_path=
492
526
  ngx_feature_libs=
493
- ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
527
+ ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
528
+ if (n == -1) return 1"
494
529
  . auto/feature
495
530
 
496
531
 
@@ -564,17 +599,20 @@ ngx_feature_run=no
564
599
  ngx_feature_incs="#include <stdlib.h>"
565
600
  ngx_feature_path=
566
601
  ngx_feature_libs=
567
- ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
602
+ ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
603
+ if (n != 0) return 1"
568
604
  . auto/feature
569
605
 
570
606
 
571
607
  ngx_feature="memalign()"
572
608
  ngx_feature_name="NGX_HAVE_MEMALIGN"
573
609
  ngx_feature_run=no
574
- ngx_feature_incs="#include <stdlib.h>"
610
+ ngx_feature_incs="#include <stdlib.h>
611
+ #include <malloc.h>"
575
612
  ngx_feature_path=
576
613
  ngx_feature_libs=
577
- ngx_feature_test="void *p; p = memalign(4096, 4096)"
614
+ ngx_feature_test="void *p; p = memalign(4096, 4096);
615
+ if (p == NULL) return 1"
578
616
  . auto/feature
579
617
 
580
618
 
@@ -661,10 +699,12 @@ fi
661
699
  ngx_feature="struct msghdr.msg_control"
662
700
  ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
663
701
  ngx_feature_run=no
664
- ngx_feature_incs="#include <sys/socket.h>"
702
+ ngx_feature_incs="#include <sys/socket.h>
703
+ #include <stdio.h>"
665
704
  ngx_feature_path=
666
705
  ngx_feature_libs=
667
- ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
706
+ ngx_feature_test="struct msghdr msg;
707
+ printf(\"%d\", (int) sizeof(msg.msg_control))"
668
708
  . auto/feature
669
709
 
670
710
 
@@ -672,40 +712,47 @@ ngx_feature="ioctl(FIONBIO)"
672
712
  ngx_feature_name="NGX_HAVE_FIONBIO"
673
713
  ngx_feature_run=no
674
714
  ngx_feature_incs="#include <sys/ioctl.h>
715
+ #include <stdio.h>
675
716
  $NGX_INCLUDE_SYS_FILIO_H"
676
717
  ngx_feature_path=
677
718
  ngx_feature_libs=
678
- ngx_feature_test="int i; i = FIONBIO"
719
+ ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)"
679
720
  . auto/feature
680
721
 
681
722
 
682
723
  ngx_feature="struct tm.tm_gmtoff"
683
724
  ngx_feature_name="NGX_HAVE_GMTOFF"
684
725
  ngx_feature_run=no
685
- ngx_feature_incs="#include <time.h>"
726
+ ngx_feature_incs="#include <time.h>
727
+ #include <stdio.h>"
686
728
  ngx_feature_path=
687
729
  ngx_feature_libs=
688
- ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
730
+ ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
731
+ printf(\"%d\", (int) tm.tm_gmtoff)"
689
732
  . auto/feature
690
733
 
691
734
 
692
735
  ngx_feature="struct dirent.d_namlen"
693
736
  ngx_feature_name="NGX_HAVE_D_NAMLEN"
694
737
  ngx_feature_run=no
695
- ngx_feature_incs="#include <dirent.h>"
738
+ ngx_feature_incs="#include <dirent.h>
739
+ #include <stdio.h>"
696
740
  ngx_feature_path=
697
741
  ngx_feature_libs=
698
- ngx_feature_test="struct dirent dir; dir.d_namlen = 0"
742
+ ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
743
+ printf(\"%d\", (int) dir.d_namlen)"
699
744
  . auto/feature
700
745
 
701
746
 
702
747
  ngx_feature="struct dirent.d_type"
703
748
  ngx_feature_name="NGX_HAVE_D_TYPE"
704
749
  ngx_feature_run=no
705
- ngx_feature_incs="#include <dirent.h>"
750
+ ngx_feature_incs="#include <dirent.h>
751
+ #include <stdio.h>"
706
752
  ngx_feature_path=
707
753
  ngx_feature_libs=
708
- ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
754
+ ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
755
+ printf(\"%d\", (int) dir.d_type)"
709
756
  . auto/feature
710
757
 
711
758
 
@@ -717,3 +764,17 @@ ngx_feature_path=
717
764
  ngx_feature_libs=
718
765
  ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
719
766
  . auto/feature
767
+
768
+
769
+ ngx_feature="openat(), fstatat()"
770
+ ngx_feature_name="NGX_HAVE_OPENAT"
771
+ ngx_feature_run=no
772
+ ngx_feature_incs="#include <sys/types.h>
773
+ #include <sys/stat.h>
774
+ #include <fcntl.h>"
775
+ ngx_feature_path=
776
+ ngx_feature_libs=
777
+ ngx_feature_test="struct stat sb;
778
+ openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
779
+ fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
780
+ . auto/feature