nginxtra 1.8.1.12 → 1.10.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/bin/nginxtra +1 -1
  3. data/bin/nginxtra_rails +1 -1
  4. data/lib/nginxtra/version.rb +1 -1
  5. data/vendor/nginx/CHANGES +363 -25
  6. data/vendor/nginx/CHANGES.ru +365 -21
  7. data/vendor/nginx/LICENSE +2 -2
  8. data/vendor/nginx/auto/cc/conf +32 -0
  9. data/vendor/nginx/auto/cc/gcc +1 -1
  10. data/vendor/nginx/auto/cc/icc +2 -2
  11. data/vendor/nginx/auto/cc/msvc +29 -8
  12. data/vendor/nginx/auto/cc/name +2 -25
  13. data/vendor/nginx/auto/cc/sunc +3 -0
  14. data/vendor/nginx/auto/endianness +7 -2
  15. data/vendor/nginx/auto/install +60 -26
  16. data/vendor/nginx/auto/lib/conf +4 -4
  17. data/vendor/nginx/auto/lib/geoip/conf +6 -1
  18. data/vendor/nginx/auto/lib/libgd/conf +6 -1
  19. data/vendor/nginx/auto/lib/libxslt/conf +11 -2
  20. data/vendor/nginx/auto/lib/make +1 -1
  21. data/vendor/nginx/auto/lib/md5/conf +2 -2
  22. data/vendor/nginx/auto/lib/md5/make +2 -2
  23. data/vendor/nginx/auto/lib/openssl/conf +52 -3
  24. data/vendor/nginx/auto/lib/openssl/make +1 -1
  25. data/vendor/nginx/auto/lib/pcre/conf +2 -2
  26. data/vendor/nginx/auto/lib/pcre/make +2 -2
  27. data/vendor/nginx/auto/lib/perl/conf +6 -3
  28. data/vendor/nginx/auto/lib/perl/make +4 -1
  29. data/vendor/nginx/auto/lib/sha1/conf +2 -2
  30. data/vendor/nginx/auto/lib/sha1/make +2 -2
  31. data/vendor/nginx/auto/lib/zlib/conf +2 -2
  32. data/vendor/nginx/auto/lib/zlib/make +2 -2
  33. data/vendor/nginx/auto/make +281 -16
  34. data/vendor/nginx/auto/module +122 -0
  35. data/vendor/nginx/auto/modules +909 -178
  36. data/vendor/nginx/auto/options +81 -19
  37. data/vendor/nginx/auto/os/conf +9 -0
  38. data/vendor/nginx/auto/os/darwin +3 -0
  39. data/vendor/nginx/auto/os/freebsd +0 -20
  40. data/vendor/nginx/auto/os/linux +0 -12
  41. data/vendor/nginx/auto/os/win32 +5 -1
  42. data/vendor/nginx/auto/sources +11 -311
  43. data/vendor/nginx/auto/summary +1 -0
  44. data/vendor/nginx/auto/types/sizeof +5 -3
  45. data/vendor/nginx/auto/types/typedef +9 -4
  46. data/vendor/nginx/auto/types/uintptr_t +7 -2
  47. data/vendor/nginx/auto/unix +72 -12
  48. data/vendor/nginx/conf/fastcgi.conf +1 -0
  49. data/vendor/nginx/conf/fastcgi_params +1 -0
  50. data/vendor/nginx/conf/scgi_params +1 -0
  51. data/vendor/nginx/conf/uwsgi_params +1 -0
  52. data/vendor/nginx/configure +1 -1
  53. data/vendor/nginx/contrib/vim/syntax/nginx.vim +2 -2
  54. data/vendor/nginx/man/nginx.8 +6 -2
  55. data/vendor/nginx/src/core/nginx.c +281 -114
  56. data/vendor/nginx/src/core/nginx.h +2 -2
  57. data/vendor/nginx/src/core/ngx_conf_file.c +54 -13
  58. data/vendor/nginx/src/core/ngx_conf_file.h +8 -52
  59. data/vendor/nginx/src/core/ngx_config.h +0 -5
  60. data/vendor/nginx/src/core/ngx_connection.c +270 -37
  61. data/vendor/nginx/src/core/ngx_connection.h +35 -12
  62. data/vendor/nginx/src/core/ngx_core.h +4 -0
  63. data/vendor/nginx/src/core/ngx_crypt.c +2 -2
  64. data/vendor/nginx/src/core/ngx_cycle.c +72 -25
  65. data/vendor/nginx/src/core/ngx_cycle.h +28 -39
  66. data/vendor/nginx/src/core/ngx_file.c +14 -5
  67. data/vendor/nginx/src/core/ngx_file.h +2 -0
  68. data/vendor/nginx/src/core/ngx_hash.c +13 -1
  69. data/vendor/nginx/src/core/ngx_inet.c +20 -18
  70. data/vendor/nginx/src/core/ngx_log.c +12 -12
  71. data/vendor/nginx/src/core/ngx_log.h +13 -6
  72. data/vendor/nginx/src/core/ngx_module.c +360 -0
  73. data/vendor/nginx/src/core/ngx_module.h +307 -0
  74. data/vendor/nginx/src/core/ngx_open_file_cache.c +2 -2
  75. data/vendor/nginx/src/core/ngx_output_chain.c +8 -4
  76. data/vendor/nginx/src/core/ngx_palloc.c +42 -44
  77. data/vendor/nginx/src/{http/ngx_http_parse_time.c → core/ngx_parse_time.c} +2 -3
  78. data/vendor/nginx/src/core/ngx_parse_time.h +22 -0
  79. data/vendor/nginx/src/core/ngx_proxy_protocol.c +50 -1
  80. data/vendor/nginx/src/core/ngx_proxy_protocol.h +3 -1
  81. data/vendor/nginx/src/core/ngx_regex.c +1 -38
  82. data/vendor/nginx/src/core/ngx_resolver.c +1814 -320
  83. data/vendor/nginx/src/core/ngx_resolver.h +67 -10
  84. data/vendor/nginx/src/core/ngx_rwlock.c +120 -0
  85. data/vendor/nginx/src/core/ngx_rwlock.h +21 -0
  86. data/vendor/nginx/src/core/ngx_slab.c +6 -5
  87. data/vendor/nginx/src/core/ngx_string.c +1 -1
  88. data/vendor/nginx/src/core/ngx_syslog.c +11 -3
  89. data/vendor/nginx/src/core/ngx_syslog.h +2 -1
  90. data/vendor/nginx/src/core/ngx_thread_pool.c +4 -0
  91. data/vendor/nginx/src/core/ngx_times.c +2 -2
  92. data/vendor/nginx/src/event/modules/ngx_devpoll_module.c +3 -1
  93. data/vendor/nginx/src/event/modules/ngx_epoll_module.c +5 -2
  94. data/vendor/nginx/src/event/modules/ngx_eventport_module.c +5 -5
  95. data/vendor/nginx/src/event/modules/ngx_kqueue_module.c +15 -8
  96. data/vendor/nginx/src/event/modules/ngx_poll_module.c +0 -10
  97. data/vendor/nginx/src/event/modules/ngx_select_module.c +0 -10
  98. data/vendor/nginx/src/event/ngx_event.c +60 -103
  99. data/vendor/nginx/src/event/ngx_event.h +22 -26
  100. data/vendor/nginx/src/event/ngx_event_accept.c +414 -88
  101. data/vendor/nginx/src/event/ngx_event_connect.c +27 -18
  102. data/vendor/nginx/src/event/ngx_event_connect.h +1 -0
  103. data/vendor/nginx/src/event/ngx_event_openssl.c +65 -25
  104. data/vendor/nginx/src/event/ngx_event_openssl.h +17 -0
  105. data/vendor/nginx/src/event/ngx_event_openssl_stapling.c +73 -7
  106. data/vendor/nginx/src/event/ngx_event_pipe.c +85 -27
  107. data/vendor/nginx/src/event/ngx_event_pipe.h +10 -0
  108. data/vendor/nginx/src/http/modules/ngx_http_auth_basic_module.c +1 -1
  109. data/vendor/nginx/src/http/modules/ngx_http_auth_request_module.c +2 -2
  110. data/vendor/nginx/src/http/modules/ngx_http_chunked_filter_module.c +2 -2
  111. data/vendor/nginx/src/http/modules/ngx_http_dav_module.c +6 -6
  112. data/vendor/nginx/src/http/modules/ngx_http_fastcgi_module.c +17 -11
  113. data/vendor/nginx/src/http/modules/ngx_http_gzip_filter_module.c +2 -2
  114. data/vendor/nginx/src/http/modules/ngx_http_headers_filter_module.c +9 -9
  115. data/vendor/nginx/src/http/modules/ngx_http_image_filter_module.c +2 -2
  116. data/vendor/nginx/src/http/modules/ngx_http_limit_conn_module.c +2 -2
  117. data/vendor/nginx/src/http/modules/ngx_http_limit_req_module.c +0 -7
  118. data/vendor/nginx/src/http/modules/ngx_http_map_module.c +6 -6
  119. data/vendor/nginx/src/http/modules/ngx_http_memcached_module.c +2 -1
  120. data/vendor/nginx/src/http/modules/ngx_http_mp4_module.c +13 -13
  121. data/vendor/nginx/src/http/modules/ngx_http_not_modified_filter_module.c +2 -2
  122. data/vendor/nginx/src/http/modules/ngx_http_proxy_module.c +26 -21
  123. data/vendor/nginx/src/http/modules/ngx_http_random_index_module.c +1 -1
  124. data/vendor/nginx/src/http/modules/ngx_http_range_filter_module.c +26 -8
  125. data/vendor/nginx/src/http/modules/ngx_http_realip_module.c +73 -3
  126. data/vendor/nginx/src/http/modules/ngx_http_referer_module.c +1 -1
  127. data/vendor/nginx/src/http/modules/ngx_http_rewrite_module.c +6 -6
  128. data/vendor/nginx/src/http/modules/ngx_http_scgi_module.c +5 -3
  129. data/vendor/nginx/src/http/modules/ngx_http_slice_filter_module.c +526 -0
  130. data/vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.c +7 -7
  131. data/vendor/nginx/src/http/modules/ngx_http_ssl_module.c +19 -16
  132. data/vendor/nginx/src/http/modules/ngx_http_static_module.c +1 -1
  133. data/vendor/nginx/src/http/modules/ngx_http_stub_status_module.c +1 -1
  134. data/vendor/nginx/src/http/modules/ngx_http_sub_filter_module.c +373 -173
  135. data/vendor/nginx/src/http/modules/ngx_http_upstream_hash_module.c +72 -46
  136. data/vendor/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +18 -30
  137. data/vendor/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c +50 -39
  138. data/vendor/nginx/src/http/modules/ngx_http_upstream_least_conn_module.c +38 -129
  139. data/vendor/nginx/src/http/modules/ngx_http_upstream_zone_module.c +246 -0
  140. data/vendor/nginx/src/http/modules/ngx_http_uwsgi_module.c +6 -5
  141. data/vendor/nginx/src/http/modules/perl/nginx.xs +9 -9
  142. data/vendor/nginx/src/http/ngx_http.c +46 -43
  143. data/vendor/nginx/src/http/ngx_http.h +4 -9
  144. data/vendor/nginx/src/http/ngx_http_cache.h +4 -0
  145. data/vendor/nginx/src/http/ngx_http_copy_filter_module.c +13 -5
  146. data/vendor/nginx/src/http/ngx_http_core_module.c +92 -91
  147. data/vendor/nginx/src/http/ngx_http_core_module.h +12 -8
  148. data/vendor/nginx/src/http/ngx_http_file_cache.c +61 -10
  149. data/vendor/nginx/src/http/ngx_http_request.c +37 -50
  150. data/vendor/nginx/src/http/ngx_http_request.h +10 -15
  151. data/vendor/nginx/src/http/ngx_http_request_body.c +64 -88
  152. data/vendor/nginx/src/http/ngx_http_script.c +3 -3
  153. data/vendor/nginx/src/http/ngx_http_special_response.c +1 -4
  154. data/vendor/nginx/src/http/ngx_http_upstream.c +245 -109
  155. data/vendor/nginx/src/http/ngx_http_upstream.h +11 -5
  156. data/vendor/nginx/src/http/ngx_http_upstream_round_robin.c +212 -65
  157. data/vendor/nginx/src/http/ngx_http_upstream_round_robin.h +66 -5
  158. data/vendor/nginx/src/http/ngx_http_variables.c +28 -15
  159. data/vendor/nginx/src/http/ngx_http_write_filter_module.c +1 -1
  160. data/vendor/nginx/src/http/v2/ngx_http_v2.c +4349 -0
  161. data/vendor/nginx/src/http/v2/ngx_http_v2.h +337 -0
  162. data/vendor/nginx/src/http/v2/ngx_http_v2_filter_module.c +1391 -0
  163. data/vendor/nginx/src/http/v2/ngx_http_v2_huff_decode.c +2714 -0
  164. data/vendor/nginx/src/http/v2/ngx_http_v2_huff_encode.c +254 -0
  165. data/vendor/nginx/src/http/v2/ngx_http_v2_module.c +469 -0
  166. data/vendor/nginx/src/http/{ngx_http_spdy_module.h → v2/ngx_http_v2_module.h} +10 -9
  167. data/vendor/nginx/src/http/v2/ngx_http_v2_table.c +349 -0
  168. data/vendor/nginx/src/mail/ngx_mail.c +49 -82
  169. data/vendor/nginx/src/mail/ngx_mail.h +16 -23
  170. data/vendor/nginx/src/mail/ngx_mail_auth_http_module.c +1 -1
  171. data/vendor/nginx/src/mail/ngx_mail_core_module.c +60 -34
  172. data/vendor/nginx/src/mail/ngx_mail_handler.c +17 -12
  173. data/vendor/nginx/src/mail/ngx_mail_proxy_module.c +1 -14
  174. data/vendor/nginx/src/mail/ngx_mail_smtp_handler.c +1 -1
  175. data/vendor/nginx/src/mail/ngx_mail_ssl_module.c +5 -5
  176. data/vendor/nginx/src/os/unix/ngx_atomic.h +10 -10
  177. data/vendor/nginx/src/os/unix/ngx_channel.h +4 -4
  178. data/vendor/nginx/src/os/unix/ngx_darwin_config.h +2 -0
  179. data/vendor/nginx/src/os/unix/ngx_darwin_init.c +1 -0
  180. data/vendor/nginx/src/os/unix/ngx_dlopen.c +28 -0
  181. data/vendor/nginx/src/os/unix/ngx_dlopen.h +31 -0
  182. data/vendor/nginx/src/os/unix/ngx_errno.h +1 -0
  183. data/vendor/nginx/src/os/unix/ngx_file_aio_read.c +1 -1
  184. data/vendor/nginx/src/os/unix/ngx_files.c +313 -80
  185. data/vendor/nginx/src/os/unix/ngx_files.h +5 -2
  186. data/vendor/nginx/src/os/unix/ngx_freebsd_config.h +3 -1
  187. data/vendor/nginx/src/os/unix/ngx_freebsd_init.c +1 -0
  188. data/vendor/nginx/src/os/unix/ngx_freebsd_sendfile_chain.c +13 -0
  189. data/vendor/nginx/src/os/unix/ngx_linux.h +0 -2
  190. data/vendor/nginx/src/os/unix/ngx_linux_aio_read.c +1 -1
  191. data/vendor/nginx/src/os/unix/ngx_linux_config.h +2 -6
  192. data/vendor/nginx/src/os/unix/ngx_linux_init.c +1 -33
  193. data/vendor/nginx/src/os/unix/ngx_linux_sendfile_chain.c +55 -12
  194. data/vendor/nginx/src/os/unix/ngx_os.h +3 -9
  195. data/vendor/nginx/src/os/unix/ngx_posix_config.h +14 -1
  196. data/vendor/nginx/src/os/unix/ngx_posix_init.c +2 -1
  197. data/vendor/nginx/src/os/unix/ngx_process.c +1 -1
  198. data/vendor/nginx/src/os/unix/ngx_process_cycle.c +25 -51
  199. data/vendor/nginx/src/os/unix/ngx_process_cycle.h +1 -0
  200. data/vendor/nginx/src/os/unix/ngx_readv_chain.c +24 -28
  201. data/vendor/nginx/src/os/unix/ngx_recv.c +30 -79
  202. data/vendor/nginx/src/os/unix/ngx_send.c +1 -1
  203. data/vendor/nginx/src/os/unix/ngx_setaffinity.c +14 -30
  204. data/vendor/nginx/src/os/unix/ngx_setaffinity.h +15 -1
  205. data/vendor/nginx/src/os/unix/ngx_solaris_config.h +2 -0
  206. data/vendor/nginx/src/os/unix/ngx_solaris_init.c +1 -0
  207. data/vendor/nginx/src/os/unix/ngx_solaris_sendfilev_chain.c +23 -0
  208. data/vendor/nginx/src/os/unix/ngx_sunpro_amd64.il +3 -3
  209. data/vendor/nginx/src/os/unix/ngx_sunpro_x86.il +3 -3
  210. data/vendor/nginx/src/os/unix/ngx_udp_recv.c +5 -48
  211. data/vendor/nginx/src/os/unix/ngx_udp_send.c +56 -0
  212. data/vendor/nginx/src/stream/ngx_stream.c +564 -0
  213. data/vendor/nginx/src/stream/ngx_stream.h +212 -0
  214. data/vendor/nginx/src/stream/ngx_stream_access_module.c +451 -0
  215. data/vendor/nginx/src/stream/ngx_stream_core_module.c +562 -0
  216. data/vendor/nginx/src/stream/ngx_stream_handler.c +344 -0
  217. data/vendor/nginx/src/stream/ngx_stream_limit_conn_module.c +632 -0
  218. data/vendor/nginx/src/stream/ngx_stream_proxy_module.c +1674 -0
  219. data/vendor/nginx/src/stream/ngx_stream_ssl_module.c +460 -0
  220. data/vendor/nginx/src/stream/ngx_stream_ssl_module.h +49 -0
  221. data/vendor/nginx/src/stream/ngx_stream_upstream.c +464 -0
  222. data/vendor/nginx/src/stream/ngx_stream_upstream.h +107 -0
  223. data/vendor/nginx/src/stream/ngx_stream_upstream_hash_module.c +656 -0
  224. data/vendor/nginx/src/stream/ngx_stream_upstream_least_conn_module.c +307 -0
  225. data/vendor/nginx/src/stream/ngx_stream_upstream_round_robin.c +702 -0
  226. data/vendor/nginx/src/stream/ngx_stream_upstream_round_robin.h +139 -0
  227. data/vendor/nginx/src/stream/ngx_stream_upstream_zone_module.c +242 -0
  228. metadata +39 -15
  229. data/vendor/nginx/src/event/modules/ngx_aio_module.c +0 -171
  230. data/vendor/nginx/src/event/modules/ngx_rtsig_module.c +0 -735
  231. data/vendor/nginx/src/http/ngx_http_spdy.c +0 -3701
  232. data/vendor/nginx/src/http/ngx_http_spdy.h +0 -261
  233. data/vendor/nginx/src/http/ngx_http_spdy_filter_module.c +0 -1222
  234. data/vendor/nginx/src/http/ngx_http_spdy_module.c +0 -408
  235. data/vendor/nginx/src/os/unix/ngx_aio_read.c +0 -109
  236. data/vendor/nginx/src/os/unix/ngx_aio_read_chain.c +0 -78
  237. data/vendor/nginx/src/os/unix/ngx_aio_write.c +0 -109
  238. data/vendor/nginx/src/os/unix/ngx_aio_write_chain.c +0 -100
@@ -840,6 +840,9 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
840
840
  }
841
841
 
842
842
  wev->ready = 1;
843
+ #if (NGX_THREADS)
844
+ wev->complete = 1;
845
+ #endif
843
846
 
844
847
  if (flags & NGX_POST_EVENTS) {
845
848
  ngx_post_event(wev, &ngx_posted_events);
@@ -899,7 +902,7 @@ ngx_epoll_eventfd_handler(ngx_event_t *ev)
899
902
  events = io_getevents(ngx_aio_ctx, 1, 64, event, &ts);
900
903
 
901
904
  ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
902
- "io_getevents: %l", events);
905
+ "io_getevents: %d", events);
903
906
 
904
907
  if (events > 0) {
905
908
  ready -= events;
@@ -907,7 +910,7 @@ ngx_epoll_eventfd_handler(ngx_event_t *ev)
907
910
  for (i = 0; i < events; i++) {
908
911
 
909
912
  ngx_log_debug4(NGX_LOG_DEBUG_EVENT, ev->log, 0,
910
- "io_event: %uXL %uXL %L %L",
913
+ "io_event: %XL %XL %L %L",
911
914
  event[i].data, event[i].obj,
912
915
  event[i].res, event[i].res2);
913
916
 
@@ -49,7 +49,7 @@ typedef struct port_notify {
49
49
  void *portnfy_user; /* user defined */
50
50
  } port_notify_t;
51
51
 
52
- #if (__FreeBSD_version < 700005)
52
+ #if (__FreeBSD__ && __FreeBSD_version < 700005) || (NGX_DARWIN)
53
53
 
54
54
  typedef struct itimerspec { /* definition per POSIX.4 */
55
55
  struct timespec it_interval;/* timer period */
@@ -526,18 +526,18 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
526
526
 
527
527
  ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
528
528
  "eventport: fd:%d, ev:%04Xd",
529
- event_list[i].portev_object, revents);
529
+ (int) event_list[i].portev_object, revents);
530
530
 
531
531
  if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
532
532
  ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
533
533
  "port_getn() error fd:%d ev:%04Xd",
534
- event_list[i].portev_object, revents);
534
+ (int) event_list[i].portev_object, revents);
535
535
  }
536
536
 
537
537
  if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
538
538
  ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
539
539
  "strange port_getn() events fd:%d ev:%04Xd",
540
- event_list[i].portev_object, revents);
540
+ (int) event_list[i].portev_object, revents);
541
541
  }
542
542
 
543
543
  if ((revents & (POLLERR|POLLHUP|POLLNVAL))
@@ -615,7 +615,7 @@ ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
615
615
  default:
616
616
  ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
617
617
  "unexpected eventport object %d",
618
- event_list[i].portev_object);
618
+ (int) event_list[i].portev_object);
619
619
  continue;
620
620
  }
621
621
  }
@@ -579,7 +579,7 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
579
579
  if (event_list[i].flags & EV_ERROR) {
580
580
  ngx_log_error(NGX_LOG_ALERT, cycle->log, event_list[i].data,
581
581
  "kevent() error on %d filter:%d flags:%04Xd",
582
- event_list[i].ident, event_list[i].filter,
582
+ (int) event_list[i].ident, event_list[i].filter,
583
583
  event_list[i].flags);
584
584
  continue;
585
585
  }
@@ -676,13 +676,20 @@ ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
676
676
  static ngx_inline void
677
677
  ngx_kqueue_dump_event(ngx_log_t *log, struct kevent *kev)
678
678
  {
679
- ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
680
- (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) ?
681
- "kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p":
682
- "kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
683
- kev->ident, kev->filter,
684
- kev->flags, kev->fflags,
685
- kev->data, kev->udata);
679
+ if (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) {
680
+ ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
681
+ "kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
682
+ (void *) kev->ident, kev->filter,
683
+ kev->flags, kev->fflags,
684
+ (int) kev->data, kev->udata);
685
+
686
+ } else {
687
+ ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
688
+ "kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
689
+ (int) kev->ident, kev->filter,
690
+ kev->flags, kev->fflags,
691
+ (int) kev->data, kev->udata);
692
+ }
686
693
  }
687
694
 
688
695
 
@@ -413,15 +413,5 @@ ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf)
413
413
  return NGX_CONF_OK;
414
414
  }
415
415
 
416
- #if (NGX_OLD_THREADS)
417
-
418
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
419
- "poll() is not supported in the threaded mode");
420
- return NGX_CONF_ERROR;
421
-
422
- #else
423
-
424
416
  return NGX_CONF_OK;
425
-
426
- #endif
427
417
  }
@@ -419,15 +419,5 @@ ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
419
419
  return NGX_CONF_ERROR;
420
420
  }
421
421
 
422
- #if (NGX_OLD_THREADS)
423
-
424
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
425
- "select() is not supported in the threaded mode");
426
- return NGX_CONF_ERROR;
427
-
428
- #else
429
-
430
422
  return NGX_CONF_OK;
431
-
432
- #endif
433
423
  }
@@ -17,7 +17,6 @@ extern ngx_module_t ngx_kqueue_module;
17
17
  extern ngx_module_t ngx_eventport_module;
18
18
  extern ngx_module_t ngx_devpoll_module;
19
19
  extern ngx_module_t ngx_epoll_module;
20
- extern ngx_module_t ngx_rtsig_module;
21
20
  extern ngx_module_t ngx_select_module;
22
21
 
23
22
 
@@ -127,13 +126,6 @@ static ngx_command_t ngx_event_core_commands[] = {
127
126
  0,
128
127
  NULL },
129
128
 
130
- { ngx_string("connections"),
131
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
132
- ngx_event_connections,
133
- 0,
134
- 0,
135
- NULL },
136
-
137
129
  { ngx_string("use"),
138
130
  NGX_EVENT_CONF|NGX_CONF_TAKE1,
139
131
  ngx_event_use,
@@ -212,7 +204,9 @@ ngx_process_events_and_timers(ngx_cycle_t *cycle)
212
204
  timer = ngx_event_find_timer();
213
205
  flags = NGX_UPDATE_TIME;
214
206
 
215
- #if (NGX_OLD_THREADS)
207
+ #if (NGX_WIN32)
208
+
209
+ /* handle signals from master in case of network inactivity */
216
210
 
217
211
  if (timer == NGX_TIMER_INFINITE || timer > 500) {
218
212
  timer = 500;
@@ -328,7 +322,7 @@ ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
328
322
  }
329
323
  }
330
324
 
331
- /* aio, iocp, rtsig */
325
+ /* iocp */
332
326
 
333
327
  return NGX_OK;
334
328
  }
@@ -407,7 +401,7 @@ ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
407
401
  }
408
402
  }
409
403
 
410
- /* aio, iocp, rtsig */
404
+ /* iocp */
411
405
 
412
406
  return NGX_OK;
413
407
  }
@@ -506,7 +500,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
506
500
  #endif
507
501
 
508
502
  shm.size = size;
509
- shm.name.len = sizeof("nginx_shared_zone");
503
+ shm.name.len = sizeof("nginx_shared_zone") - 1;
510
504
  shm.name.data = (u_char *) "nginx_shared_zone";
511
505
  shm.log = cycle->log;
512
506
 
@@ -531,7 +525,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
531
525
  (void) ngx_atomic_cmp_set(ngx_connection_counter, 0, 1);
532
526
 
533
527
  ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
534
- "counter: %p, %d",
528
+ "counter: %p, %uA",
535
529
  ngx_connection_counter, *ngx_connection_counter);
536
530
 
537
531
  ngx_temp_number = (ngx_atomic_t *) (shared + 2 * cl);
@@ -612,16 +606,16 @@ ngx_event_process_init(ngx_cycle_t *cycle)
612
606
  return NGX_ERROR;
613
607
  }
614
608
 
615
- for (m = 0; ngx_modules[m]; m++) {
616
- if (ngx_modules[m]->type != NGX_EVENT_MODULE) {
609
+ for (m = 0; cycle->modules[m]; m++) {
610
+ if (cycle->modules[m]->type != NGX_EVENT_MODULE) {
617
611
  continue;
618
612
  }
619
613
 
620
- if (ngx_modules[m]->ctx_index != ecf->use) {
614
+ if (cycle->modules[m]->ctx_index != ecf->use) {
621
615
  continue;
622
616
  }
623
617
 
624
- module = ngx_modules[m]->ctx;
618
+ module = cycle->modules[m]->ctx;
625
619
 
626
620
  if (module->actions.init(cycle, ngx_timer_resolution) != NGX_OK) {
627
621
  /* fatal */
@@ -676,6 +670,15 @@ ngx_event_process_init(ngx_cycle_t *cycle)
676
670
  }
677
671
  }
678
672
 
673
+ #else
674
+
675
+ if (ngx_timer_resolution && !(ngx_event_flags & NGX_USE_TIMER_EVENT)) {
676
+ ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
677
+ "the \"timer_resolution\" directive is not supported "
678
+ "with the configured event method, ignored");
679
+ ngx_timer_resolution = 0;
680
+ }
681
+
679
682
  #endif
680
683
 
681
684
  cycle->connections =
@@ -731,12 +734,19 @@ ngx_event_process_init(ngx_cycle_t *cycle)
731
734
  ls = cycle->listening.elts;
732
735
  for (i = 0; i < cycle->listening.nelts; i++) {
733
736
 
737
+ #if (NGX_HAVE_REUSEPORT)
738
+ if (ls[i].reuseport && ls[i].worker != ngx_worker) {
739
+ continue;
740
+ }
741
+ #endif
742
+
734
743
  c = ngx_get_connection(ls[i].fd, cycle->log);
735
744
 
736
745
  if (c == NULL) {
737
746
  return NGX_ERROR;
738
747
  }
739
748
 
749
+ c->type = ls[i].type;
740
750
  c->log = &ls[i].log;
741
751
 
742
752
  c->listening = &ls[i];
@@ -809,21 +819,20 @@ ngx_event_process_init(ngx_cycle_t *cycle)
809
819
 
810
820
  #else
811
821
 
812
- rev->handler = ngx_event_accept;
822
+ rev->handler = (c->type == SOCK_STREAM) ? ngx_event_accept
823
+ : ngx_event_recvmsg;
813
824
 
814
- if (ngx_use_accept_mutex) {
825
+ if (ngx_use_accept_mutex
826
+ #if (NGX_HAVE_REUSEPORT)
827
+ && !ls[i].reuseport
828
+ #endif
829
+ )
830
+ {
815
831
  continue;
816
832
  }
817
833
 
818
- if (ngx_event_flags & NGX_USE_RTSIG_EVENT) {
819
- if (ngx_add_conn(c) == NGX_ERROR) {
820
- return NGX_ERROR;
821
- }
822
-
823
- } else {
824
- if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
825
- return NGX_ERROR;
826
- }
834
+ if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
835
+ return NGX_ERROR;
827
836
  }
828
837
 
829
838
  #endif
@@ -884,14 +893,7 @@ ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
884
893
 
885
894
  /* count the number of the event modules and set up their indices */
886
895
 
887
- ngx_event_max_module = 0;
888
- for (i = 0; ngx_modules[i]; i++) {
889
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
890
- continue;
891
- }
892
-
893
- ngx_modules[i]->ctx_index = ngx_event_max_module++;
894
- }
896
+ ngx_event_max_module = ngx_count_modules(cf->cycle, NGX_EVENT_MODULE);
895
897
 
896
898
  ctx = ngx_pcalloc(cf->pool, sizeof(void *));
897
899
  if (ctx == NULL) {
@@ -905,16 +907,17 @@ ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
905
907
 
906
908
  *(void **) conf = ctx;
907
909
 
908
- for (i = 0; ngx_modules[i]; i++) {
909
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
910
+ for (i = 0; cf->cycle->modules[i]; i++) {
911
+ if (cf->cycle->modules[i]->type != NGX_EVENT_MODULE) {
910
912
  continue;
911
913
  }
912
914
 
913
- m = ngx_modules[i]->ctx;
915
+ m = cf->cycle->modules[i]->ctx;
914
916
 
915
917
  if (m->create_conf) {
916
- (*ctx)[ngx_modules[i]->ctx_index] = m->create_conf(cf->cycle);
917
- if ((*ctx)[ngx_modules[i]->ctx_index] == NULL) {
918
+ (*ctx)[cf->cycle->modules[i]->ctx_index] =
919
+ m->create_conf(cf->cycle);
920
+ if ((*ctx)[cf->cycle->modules[i]->ctx_index] == NULL) {
918
921
  return NGX_CONF_ERROR;
919
922
  }
920
923
  }
@@ -929,18 +932,20 @@ ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
929
932
 
930
933
  *cf = pcf;
931
934
 
932
- if (rv != NGX_CONF_OK)
935
+ if (rv != NGX_CONF_OK) {
933
936
  return rv;
937
+ }
934
938
 
935
- for (i = 0; ngx_modules[i]; i++) {
936
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
939
+ for (i = 0; cf->cycle->modules[i]; i++) {
940
+ if (cf->cycle->modules[i]->type != NGX_EVENT_MODULE) {
937
941
  continue;
938
942
  }
939
943
 
940
- m = ngx_modules[i]->ctx;
944
+ m = cf->cycle->modules[i]->ctx;
941
945
 
942
946
  if (m->init_conf) {
943
- rv = m->init_conf(cf->cycle, (*ctx)[ngx_modules[i]->ctx_index]);
947
+ rv = m->init_conf(cf->cycle,
948
+ (*ctx)[cf->cycle->modules[i]->ctx_index]);
944
949
  if (rv != NGX_CONF_OK) {
945
950
  return rv;
946
951
  }
@@ -962,12 +967,6 @@ ngx_event_connections(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
962
967
  return "is duplicate";
963
968
  }
964
969
 
965
- if (ngx_strcmp(cmd->name.data, "connections") == 0) {
966
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
967
- "the \"connections\" directive is deprecated, "
968
- "use the \"worker_connections\" directive instead");
969
- }
970
-
971
970
  value = cf->args->elts;
972
971
  ecf->connections = ngx_atoi(value[1].data, value[1].len);
973
972
  if (ecf->connections == (ngx_uint_t) NGX_ERROR) {
@@ -1007,15 +1006,15 @@ ngx_event_use(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1007
1006
  }
1008
1007
 
1009
1008
 
1010
- for (m = 0; ngx_modules[m]; m++) {
1011
- if (ngx_modules[m]->type != NGX_EVENT_MODULE) {
1009
+ for (m = 0; cf->cycle->modules[m]; m++) {
1010
+ if (cf->cycle->modules[m]->type != NGX_EVENT_MODULE) {
1012
1011
  continue;
1013
1012
  }
1014
1013
 
1015
- module = ngx_modules[m]->ctx;
1014
+ module = cf->cycle->modules[m]->ctx;
1016
1015
  if (module->name->len == value[1].len) {
1017
1016
  if (ngx_strcmp(module->name->data, value[1].data) == 0) {
1018
- ecf->use = ngx_modules[m]->ctx_index;
1017
+ ecf->use = cf->cycle->modules[m]->ctx_index;
1019
1018
  ecf->name = module->name->data;
1020
1019
 
1021
1020
  if (ngx_process == NGX_PROCESS_SINGLE
@@ -1188,10 +1187,6 @@ ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
1188
1187
 
1189
1188
  #if (NGX_HAVE_EPOLL) && !(NGX_TEST_BUILD_EPOLL)
1190
1189
  int fd;
1191
- #endif
1192
- #if (NGX_HAVE_RTSIG)
1193
- ngx_uint_t rtsig;
1194
- ngx_core_conf_t *ccf;
1195
1190
  #endif
1196
1191
  ngx_int_t i;
1197
1192
  ngx_module_t *module;
@@ -1213,19 +1208,7 @@ ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
1213
1208
 
1214
1209
  #endif
1215
1210
 
1216
- #if (NGX_HAVE_RTSIG)
1217
-
1218
- if (module == NULL) {
1219
- module = &ngx_rtsig_module;
1220
- rtsig = 1;
1221
-
1222
- } else {
1223
- rtsig = 0;
1224
- }
1225
-
1226
- #endif
1227
-
1228
- #if (NGX_HAVE_DEVPOLL)
1211
+ #if (NGX_HAVE_DEVPOLL) && !(NGX_TEST_BUILD_DEVPOLL)
1229
1212
 
1230
1213
  module = &ngx_devpoll_module;
1231
1214
 
@@ -1246,20 +1229,20 @@ ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
1246
1229
  #endif
1247
1230
 
1248
1231
  if (module == NULL) {
1249
- for (i = 0; ngx_modules[i]; i++) {
1232
+ for (i = 0; cycle->modules[i]; i++) {
1250
1233
 
1251
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
1234
+ if (cycle->modules[i]->type != NGX_EVENT_MODULE) {
1252
1235
  continue;
1253
1236
  }
1254
1237
 
1255
- event_module = ngx_modules[i]->ctx;
1238
+ event_module = cycle->modules[i]->ctx;
1256
1239
 
1257
1240
  if (ngx_strcmp(event_module->name->data, event_core_name.data) == 0)
1258
1241
  {
1259
1242
  continue;
1260
1243
  }
1261
1244
 
1262
- module = ngx_modules[i];
1245
+ module = cycle->modules[i];
1263
1246
  break;
1264
1247
  }
1265
1248
  }
@@ -1281,31 +1264,5 @@ ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
1281
1264
  ngx_conf_init_value(ecf->accept_mutex, 1);
1282
1265
  ngx_conf_init_msec_value(ecf->accept_mutex_delay, 500);
1283
1266
 
1284
-
1285
- #if (NGX_HAVE_RTSIG)
1286
-
1287
- if (!rtsig) {
1288
- return NGX_CONF_OK;
1289
- }
1290
-
1291
- if (ecf->accept_mutex) {
1292
- return NGX_CONF_OK;
1293
- }
1294
-
1295
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
1296
-
1297
- if (ccf->worker_processes == 0) {
1298
- return NGX_CONF_OK;
1299
- }
1300
-
1301
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
1302
- "the \"rtsig\" method requires \"accept_mutex\" to be on");
1303
-
1304
- return NGX_CONF_ERROR;
1305
-
1306
- #else
1307
-
1308
1267
  return NGX_CONF_OK;
1309
-
1310
- #endif
1311
1268
  }