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
@@ -0,0 +1,139 @@
1
+
2
+ /*
3
+ * Copyright (C) Igor Sysoev
4
+ * Copyright (C) Nginx, Inc.
5
+ */
6
+
7
+
8
+ #ifndef _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
9
+ #define _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
10
+
11
+
12
+ #include <ngx_config.h>
13
+ #include <ngx_core.h>
14
+ #include <ngx_stream.h>
15
+
16
+
17
+ typedef struct ngx_stream_upstream_rr_peer_s ngx_stream_upstream_rr_peer_t;
18
+
19
+ struct ngx_stream_upstream_rr_peer_s {
20
+ struct sockaddr *sockaddr;
21
+ socklen_t socklen;
22
+ ngx_str_t name;
23
+ ngx_str_t server;
24
+
25
+ ngx_int_t current_weight;
26
+ ngx_int_t effective_weight;
27
+ ngx_int_t weight;
28
+
29
+ ngx_uint_t conns;
30
+
31
+ ngx_uint_t fails;
32
+ time_t accessed;
33
+ time_t checked;
34
+
35
+ ngx_uint_t max_fails;
36
+ time_t fail_timeout;
37
+
38
+ ngx_uint_t down; /* unsigned down:1; */
39
+
40
+ #if (NGX_STREAM_SSL)
41
+ void *ssl_session;
42
+ int ssl_session_len;
43
+ #endif
44
+
45
+ ngx_stream_upstream_rr_peer_t *next;
46
+
47
+ #if (NGX_STREAM_UPSTREAM_ZONE)
48
+ ngx_atomic_t lock;
49
+ #endif
50
+ };
51
+
52
+
53
+ typedef struct ngx_stream_upstream_rr_peers_s ngx_stream_upstream_rr_peers_t;
54
+
55
+ struct ngx_stream_upstream_rr_peers_s {
56
+ ngx_uint_t number;
57
+
58
+ #if (NGX_STREAM_UPSTREAM_ZONE)
59
+ ngx_slab_pool_t *shpool;
60
+ ngx_atomic_t rwlock;
61
+ ngx_stream_upstream_rr_peers_t *zone_next;
62
+ #endif
63
+
64
+ ngx_uint_t total_weight;
65
+
66
+ unsigned single:1;
67
+ unsigned weighted:1;
68
+
69
+ ngx_str_t *name;
70
+
71
+ ngx_stream_upstream_rr_peers_t *next;
72
+
73
+ ngx_stream_upstream_rr_peer_t *peer;
74
+ };
75
+
76
+
77
+ #if (NGX_STREAM_UPSTREAM_ZONE)
78
+
79
+ #define ngx_stream_upstream_rr_peers_rlock(peers) \
80
+ \
81
+ if (peers->shpool) { \
82
+ ngx_rwlock_rlock(&peers->rwlock); \
83
+ }
84
+
85
+ #define ngx_stream_upstream_rr_peers_wlock(peers) \
86
+ \
87
+ if (peers->shpool) { \
88
+ ngx_rwlock_wlock(&peers->rwlock); \
89
+ }
90
+
91
+ #define ngx_stream_upstream_rr_peers_unlock(peers) \
92
+ \
93
+ if (peers->shpool) { \
94
+ ngx_rwlock_unlock(&peers->rwlock); \
95
+ }
96
+
97
+
98
+ #define ngx_stream_upstream_rr_peer_lock(peers, peer) \
99
+ \
100
+ if (peers->shpool) { \
101
+ ngx_rwlock_wlock(&peer->lock); \
102
+ }
103
+
104
+ #define ngx_stream_upstream_rr_peer_unlock(peers, peer) \
105
+ \
106
+ if (peers->shpool) { \
107
+ ngx_rwlock_unlock(&peer->lock); \
108
+ }
109
+
110
+ #else
111
+
112
+ #define ngx_stream_upstream_rr_peers_rlock(peers)
113
+ #define ngx_stream_upstream_rr_peers_wlock(peers)
114
+ #define ngx_stream_upstream_rr_peers_unlock(peers)
115
+ #define ngx_stream_upstream_rr_peer_lock(peers, peer)
116
+ #define ngx_stream_upstream_rr_peer_unlock(peers, peer)
117
+
118
+ #endif
119
+
120
+
121
+ typedef struct {
122
+ ngx_stream_upstream_rr_peers_t *peers;
123
+ ngx_stream_upstream_rr_peer_t *current;
124
+ uintptr_t *tried;
125
+ uintptr_t data;
126
+ } ngx_stream_upstream_rr_peer_data_t;
127
+
128
+
129
+ ngx_int_t ngx_stream_upstream_init_round_robin(ngx_conf_t *cf,
130
+ ngx_stream_upstream_srv_conf_t *us);
131
+ ngx_int_t ngx_stream_upstream_init_round_robin_peer(ngx_stream_session_t *s,
132
+ ngx_stream_upstream_srv_conf_t *us);
133
+ ngx_int_t ngx_stream_upstream_get_round_robin_peer(ngx_peer_connection_t *pc,
134
+ void *data);
135
+ void ngx_stream_upstream_free_round_robin_peer(ngx_peer_connection_t *pc,
136
+ void *data, ngx_uint_t state);
137
+
138
+
139
+ #endif /* _NGX_STREAM_UPSTREAM_ROUND_ROBIN_H_INCLUDED_ */
@@ -0,0 +1,242 @@
1
+
2
+ /*
3
+ * Copyright (C) Ruslan Ermilov
4
+ * Copyright (C) Nginx, Inc.
5
+ */
6
+
7
+
8
+ #include <ngx_config.h>
9
+ #include <ngx_core.h>
10
+ #include <ngx_stream.h>
11
+
12
+
13
+ static char *ngx_stream_upstream_zone(ngx_conf_t *cf, ngx_command_t *cmd,
14
+ void *conf);
15
+ static ngx_int_t ngx_stream_upstream_init_zone(ngx_shm_zone_t *shm_zone,
16
+ void *data);
17
+ static ngx_stream_upstream_rr_peers_t *ngx_stream_upstream_zone_copy_peers(
18
+ ngx_slab_pool_t *shpool, ngx_stream_upstream_srv_conf_t *uscf);
19
+
20
+
21
+ static ngx_command_t ngx_stream_upstream_zone_commands[] = {
22
+
23
+ { ngx_string("zone"),
24
+ NGX_STREAM_UPS_CONF|NGX_CONF_TAKE12,
25
+ ngx_stream_upstream_zone,
26
+ 0,
27
+ 0,
28
+ NULL },
29
+
30
+ ngx_null_command
31
+ };
32
+
33
+
34
+ static ngx_stream_module_t ngx_stream_upstream_zone_module_ctx = {
35
+ NULL, /* postconfiguration */
36
+
37
+ NULL, /* create main configuration */
38
+ NULL, /* init main configuration */
39
+
40
+ NULL, /* create server configuration */
41
+ NULL, /* merge server configuration */
42
+ };
43
+
44
+
45
+ ngx_module_t ngx_stream_upstream_zone_module = {
46
+ NGX_MODULE_V1,
47
+ &ngx_stream_upstream_zone_module_ctx, /* module context */
48
+ ngx_stream_upstream_zone_commands, /* module directives */
49
+ NGX_STREAM_MODULE, /* module type */
50
+ NULL, /* init master */
51
+ NULL, /* init module */
52
+ NULL, /* init process */
53
+ NULL, /* init thread */
54
+ NULL, /* exit thread */
55
+ NULL, /* exit process */
56
+ NULL, /* exit master */
57
+ NGX_MODULE_V1_PADDING
58
+ };
59
+
60
+
61
+ static char *
62
+ ngx_stream_upstream_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
63
+ {
64
+ ssize_t size;
65
+ ngx_str_t *value;
66
+ ngx_stream_upstream_srv_conf_t *uscf;
67
+ ngx_stream_upstream_main_conf_t *umcf;
68
+
69
+ uscf = ngx_stream_conf_get_module_srv_conf(cf, ngx_stream_upstream_module);
70
+ umcf = ngx_stream_conf_get_module_main_conf(cf, ngx_stream_upstream_module);
71
+
72
+ value = cf->args->elts;
73
+
74
+ if (!value[1].len) {
75
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
76
+ "invalid zone name \"%V\"", &value[1]);
77
+ return NGX_CONF_ERROR;
78
+ }
79
+
80
+ if (cf->args->nelts == 3) {
81
+ size = ngx_parse_size(&value[2]);
82
+
83
+ if (size == NGX_ERROR) {
84
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
85
+ "invalid zone size \"%V\"", &value[2]);
86
+ return NGX_CONF_ERROR;
87
+ }
88
+
89
+ if (size < (ssize_t) (8 * ngx_pagesize)) {
90
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
91
+ "zone \"%V\" is too small", &value[1]);
92
+ return NGX_CONF_ERROR;
93
+ }
94
+
95
+ } else {
96
+ size = 0;
97
+ }
98
+
99
+ uscf->shm_zone = ngx_shared_memory_add(cf, &value[1], size,
100
+ &ngx_stream_upstream_module);
101
+ if (uscf->shm_zone == NULL) {
102
+ return NGX_CONF_ERROR;
103
+ }
104
+
105
+ uscf->shm_zone->init = ngx_stream_upstream_init_zone;
106
+ uscf->shm_zone->data = umcf;
107
+
108
+ uscf->shm_zone->noreuse = 1;
109
+
110
+ return NGX_CONF_OK;
111
+ }
112
+
113
+
114
+ static ngx_int_t
115
+ ngx_stream_upstream_init_zone(ngx_shm_zone_t *shm_zone, void *data)
116
+ {
117
+ size_t len;
118
+ ngx_uint_t i;
119
+ ngx_slab_pool_t *shpool;
120
+ ngx_stream_upstream_rr_peers_t *peers, **peersp;
121
+ ngx_stream_upstream_srv_conf_t *uscf, **uscfp;
122
+ ngx_stream_upstream_main_conf_t *umcf;
123
+
124
+ shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
125
+ umcf = shm_zone->data;
126
+ uscfp = umcf->upstreams.elts;
127
+
128
+ if (shm_zone->shm.exists) {
129
+ peers = shpool->data;
130
+
131
+ for (i = 0; i < umcf->upstreams.nelts; i++) {
132
+ uscf = uscfp[i];
133
+
134
+ if (uscf->shm_zone != shm_zone) {
135
+ continue;
136
+ }
137
+
138
+ uscf->peer.data = peers;
139
+ peers = peers->zone_next;
140
+ }
141
+
142
+ return NGX_OK;
143
+ }
144
+
145
+ len = sizeof(" in upstream zone \"\"") + shm_zone->shm.name.len;
146
+
147
+ shpool->log_ctx = ngx_slab_alloc(shpool, len);
148
+ if (shpool->log_ctx == NULL) {
149
+ return NGX_ERROR;
150
+ }
151
+
152
+ ngx_sprintf(shpool->log_ctx, " in upstream zone \"%V\"%Z",
153
+ &shm_zone->shm.name);
154
+
155
+
156
+ /* copy peers to shared memory */
157
+
158
+ peersp = (ngx_stream_upstream_rr_peers_t **) (void *) &shpool->data;
159
+
160
+ for (i = 0; i < umcf->upstreams.nelts; i++) {
161
+ uscf = uscfp[i];
162
+
163
+ if (uscf->shm_zone != shm_zone) {
164
+ continue;
165
+ }
166
+
167
+ peers = ngx_stream_upstream_zone_copy_peers(shpool, uscf);
168
+ if (peers == NULL) {
169
+ return NGX_ERROR;
170
+ }
171
+
172
+ *peersp = peers;
173
+ peersp = &peers->zone_next;
174
+ }
175
+
176
+ return NGX_OK;
177
+ }
178
+
179
+
180
+ static ngx_stream_upstream_rr_peers_t *
181
+ ngx_stream_upstream_zone_copy_peers(ngx_slab_pool_t *shpool,
182
+ ngx_stream_upstream_srv_conf_t *uscf)
183
+ {
184
+ ngx_stream_upstream_rr_peer_t *peer, **peerp;
185
+ ngx_stream_upstream_rr_peers_t *peers, *backup;
186
+
187
+ peers = ngx_slab_alloc(shpool, sizeof(ngx_stream_upstream_rr_peers_t));
188
+ if (peers == NULL) {
189
+ return NULL;
190
+ }
191
+
192
+ ngx_memcpy(peers, uscf->peer.data, sizeof(ngx_stream_upstream_rr_peers_t));
193
+
194
+ peers->shpool = shpool;
195
+
196
+ for (peerp = &peers->peer; *peerp; peerp = &peer->next) {
197
+ /* pool is unlocked */
198
+ peer = ngx_slab_calloc_locked(shpool,
199
+ sizeof(ngx_stream_upstream_rr_peer_t));
200
+ if (peer == NULL) {
201
+ return NULL;
202
+ }
203
+
204
+ ngx_memcpy(peer, *peerp, sizeof(ngx_stream_upstream_rr_peer_t));
205
+
206
+ *peerp = peer;
207
+ }
208
+
209
+ if (peers->next == NULL) {
210
+ goto done;
211
+ }
212
+
213
+ backup = ngx_slab_alloc(shpool, sizeof(ngx_stream_upstream_rr_peers_t));
214
+ if (backup == NULL) {
215
+ return NULL;
216
+ }
217
+
218
+ ngx_memcpy(backup, peers->next, sizeof(ngx_stream_upstream_rr_peers_t));
219
+
220
+ backup->shpool = shpool;
221
+
222
+ for (peerp = &backup->peer; *peerp; peerp = &peer->next) {
223
+ /* pool is unlocked */
224
+ peer = ngx_slab_calloc_locked(shpool,
225
+ sizeof(ngx_stream_upstream_rr_peer_t));
226
+ if (peer == NULL) {
227
+ return NULL;
228
+ }
229
+
230
+ ngx_memcpy(peer, *peerp, sizeof(ngx_stream_upstream_rr_peer_t));
231
+
232
+ *peerp = peer;
233
+ }
234
+
235
+ peers->next = backup;
236
+
237
+ done:
238
+
239
+ uscf->peer.data = peers;
240
+
241
+ return peers;
242
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nginxtra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1.12
4
+ version: 1.10.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Virata-Stone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -174,6 +174,7 @@ files:
174
174
  - vendor/nginx/auto/lib/zlib/makefile.msvc
175
175
  - vendor/nginx/auto/lib/zlib/makefile.owc
176
176
  - vendor/nginx/auto/make
177
+ - vendor/nginx/auto/module
177
178
  - vendor/nginx/auto/modules
178
179
  - vendor/nginx/auto/nohave
179
180
  - vendor/nginx/auto/options
@@ -245,6 +246,8 @@ files:
245
246
  - vendor/nginx/src/core/ngx_log.h
246
247
  - vendor/nginx/src/core/ngx_md5.c
247
248
  - vendor/nginx/src/core/ngx_md5.h
249
+ - vendor/nginx/src/core/ngx_module.c
250
+ - vendor/nginx/src/core/ngx_module.h
248
251
  - vendor/nginx/src/core/ngx_murmurhash.c
249
252
  - vendor/nginx/src/core/ngx_murmurhash.h
250
253
  - vendor/nginx/src/core/ngx_open_file_cache.c
@@ -254,6 +257,8 @@ files:
254
257
  - vendor/nginx/src/core/ngx_palloc.h
255
258
  - vendor/nginx/src/core/ngx_parse.c
256
259
  - vendor/nginx/src/core/ngx_parse.h
260
+ - vendor/nginx/src/core/ngx_parse_time.c
261
+ - vendor/nginx/src/core/ngx_parse_time.h
257
262
  - vendor/nginx/src/core/ngx_proxy_protocol.c
258
263
  - vendor/nginx/src/core/ngx_proxy_protocol.h
259
264
  - vendor/nginx/src/core/ngx_queue.c
@@ -266,6 +271,8 @@ files:
266
271
  - vendor/nginx/src/core/ngx_regex.h
267
272
  - vendor/nginx/src/core/ngx_resolver.c
268
273
  - vendor/nginx/src/core/ngx_resolver.h
274
+ - vendor/nginx/src/core/ngx_rwlock.c
275
+ - vendor/nginx/src/core/ngx_rwlock.h
269
276
  - vendor/nginx/src/core/ngx_sha1.h
270
277
  - vendor/nginx/src/core/ngx_shmtx.c
271
278
  - vendor/nginx/src/core/ngx_shmtx.h
@@ -280,13 +287,11 @@ files:
280
287
  - vendor/nginx/src/core/ngx_thread_pool.h
281
288
  - vendor/nginx/src/core/ngx_times.c
282
289
  - vendor/nginx/src/core/ngx_times.h
283
- - vendor/nginx/src/event/modules/ngx_aio_module.c
284
290
  - vendor/nginx/src/event/modules/ngx_devpoll_module.c
285
291
  - vendor/nginx/src/event/modules/ngx_epoll_module.c
286
292
  - vendor/nginx/src/event/modules/ngx_eventport_module.c
287
293
  - vendor/nginx/src/event/modules/ngx_kqueue_module.c
288
294
  - vendor/nginx/src/event/modules/ngx_poll_module.c
289
- - vendor/nginx/src/event/modules/ngx_rtsig_module.c
290
295
  - vendor/nginx/src/event/modules/ngx_select_module.c
291
296
  - vendor/nginx/src/event/modules/ngx_win32_select_module.c
292
297
  - vendor/nginx/src/event/ngx_event.c
@@ -339,6 +344,7 @@ files:
339
344
  - vendor/nginx/src/http/modules/ngx_http_rewrite_module.c
340
345
  - vendor/nginx/src/http/modules/ngx_http_scgi_module.c
341
346
  - vendor/nginx/src/http/modules/ngx_http_secure_link_module.c
347
+ - vendor/nginx/src/http/modules/ngx_http_slice_filter_module.c
342
348
  - vendor/nginx/src/http/modules/ngx_http_split_clients_module.c
343
349
  - vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.c
344
350
  - vendor/nginx/src/http/modules/ngx_http_ssi_filter_module.h
@@ -351,6 +357,7 @@ files:
351
357
  - vendor/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c
352
358
  - vendor/nginx/src/http/modules/ngx_http_upstream_keepalive_module.c
353
359
  - vendor/nginx/src/http/modules/ngx_http_upstream_least_conn_module.c
360
+ - vendor/nginx/src/http/modules/ngx_http_upstream_zone_module.c
354
361
  - vendor/nginx/src/http/modules/ngx_http_userid_filter_module.c
355
362
  - vendor/nginx/src/http/modules/ngx_http_uwsgi_module.c
356
363
  - vendor/nginx/src/http/modules/ngx_http_xslt_filter_module.c
@@ -370,18 +377,12 @@ files:
370
377
  - vendor/nginx/src/http/ngx_http_file_cache.c
371
378
  - vendor/nginx/src/http/ngx_http_header_filter_module.c
372
379
  - vendor/nginx/src/http/ngx_http_parse.c
373
- - vendor/nginx/src/http/ngx_http_parse_time.c
374
380
  - vendor/nginx/src/http/ngx_http_postpone_filter_module.c
375
381
  - vendor/nginx/src/http/ngx_http_request.c
376
382
  - vendor/nginx/src/http/ngx_http_request.h
377
383
  - vendor/nginx/src/http/ngx_http_request_body.c
378
384
  - vendor/nginx/src/http/ngx_http_script.c
379
385
  - vendor/nginx/src/http/ngx_http_script.h
380
- - vendor/nginx/src/http/ngx_http_spdy.c
381
- - vendor/nginx/src/http/ngx_http_spdy.h
382
- - vendor/nginx/src/http/ngx_http_spdy_filter_module.c
383
- - vendor/nginx/src/http/ngx_http_spdy_module.c
384
- - vendor/nginx/src/http/ngx_http_spdy_module.h
385
386
  - vendor/nginx/src/http/ngx_http_special_response.c
386
387
  - vendor/nginx/src/http/ngx_http_upstream.c
387
388
  - vendor/nginx/src/http/ngx_http_upstream.h
@@ -390,6 +391,14 @@ files:
390
391
  - vendor/nginx/src/http/ngx_http_variables.c
391
392
  - vendor/nginx/src/http/ngx_http_variables.h
392
393
  - vendor/nginx/src/http/ngx_http_write_filter_module.c
394
+ - vendor/nginx/src/http/v2/ngx_http_v2.c
395
+ - vendor/nginx/src/http/v2/ngx_http_v2.h
396
+ - vendor/nginx/src/http/v2/ngx_http_v2_filter_module.c
397
+ - vendor/nginx/src/http/v2/ngx_http_v2_huff_decode.c
398
+ - vendor/nginx/src/http/v2/ngx_http_v2_huff_encode.c
399
+ - vendor/nginx/src/http/v2/ngx_http_v2_module.c
400
+ - vendor/nginx/src/http/v2/ngx_http_v2_module.h
401
+ - vendor/nginx/src/http/v2/ngx_http_v2_table.c
393
402
  - vendor/nginx/src/mail/ngx_mail.c
394
403
  - vendor/nginx/src/mail/ngx_mail.h
395
404
  - vendor/nginx/src/mail/ngx_mail_auth_http_module.c
@@ -410,10 +419,6 @@ files:
410
419
  - vendor/nginx/src/mail/ngx_mail_ssl_module.h
411
420
  - vendor/nginx/src/misc/ngx_cpp_test_module.cpp
412
421
  - vendor/nginx/src/misc/ngx_google_perftools_module.c
413
- - vendor/nginx/src/os/unix/ngx_aio_read.c
414
- - vendor/nginx/src/os/unix/ngx_aio_read_chain.c
415
- - vendor/nginx/src/os/unix/ngx_aio_write.c
416
- - vendor/nginx/src/os/unix/ngx_aio_write_chain.c
417
422
  - vendor/nginx/src/os/unix/ngx_alloc.c
418
423
  - vendor/nginx/src/os/unix/ngx_alloc.h
419
424
  - vendor/nginx/src/os/unix/ngx_atomic.h
@@ -424,6 +429,8 @@ files:
424
429
  - vendor/nginx/src/os/unix/ngx_darwin_config.h
425
430
  - vendor/nginx/src/os/unix/ngx_darwin_init.c
426
431
  - vendor/nginx/src/os/unix/ngx_darwin_sendfile_chain.c
432
+ - vendor/nginx/src/os/unix/ngx_dlopen.c
433
+ - vendor/nginx/src/os/unix/ngx_dlopen.h
427
434
  - vendor/nginx/src/os/unix/ngx_errno.c
428
435
  - vendor/nginx/src/os/unix/ngx_errno.h
429
436
  - vendor/nginx/src/os/unix/ngx_file_aio_read.c
@@ -475,9 +482,26 @@ files:
475
482
  - vendor/nginx/src/os/unix/ngx_time.c
476
483
  - vendor/nginx/src/os/unix/ngx_time.h
477
484
  - vendor/nginx/src/os/unix/ngx_udp_recv.c
485
+ - vendor/nginx/src/os/unix/ngx_udp_send.c
478
486
  - vendor/nginx/src/os/unix/ngx_user.c
479
487
  - vendor/nginx/src/os/unix/ngx_user.h
480
488
  - vendor/nginx/src/os/unix/ngx_writev_chain.c
489
+ - vendor/nginx/src/stream/ngx_stream.c
490
+ - vendor/nginx/src/stream/ngx_stream.h
491
+ - vendor/nginx/src/stream/ngx_stream_access_module.c
492
+ - vendor/nginx/src/stream/ngx_stream_core_module.c
493
+ - vendor/nginx/src/stream/ngx_stream_handler.c
494
+ - vendor/nginx/src/stream/ngx_stream_limit_conn_module.c
495
+ - vendor/nginx/src/stream/ngx_stream_proxy_module.c
496
+ - vendor/nginx/src/stream/ngx_stream_ssl_module.c
497
+ - vendor/nginx/src/stream/ngx_stream_ssl_module.h
498
+ - vendor/nginx/src/stream/ngx_stream_upstream.c
499
+ - vendor/nginx/src/stream/ngx_stream_upstream.h
500
+ - vendor/nginx/src/stream/ngx_stream_upstream_hash_module.c
501
+ - vendor/nginx/src/stream/ngx_stream_upstream_least_conn_module.c
502
+ - vendor/nginx/src/stream/ngx_stream_upstream_round_robin.c
503
+ - vendor/nginx/src/stream/ngx_stream_upstream_round_robin.h
504
+ - vendor/nginx/src/stream/ngx_stream_upstream_zone_module.c
481
505
  homepage: https://github.com/smellsblue/nginxtra
482
506
  licenses:
483
507
  - nginx
@@ -498,7 +522,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
498
522
  version: '0'
499
523
  requirements: []
500
524
  rubyforge_project:
501
- rubygems_version: 2.5.1
525
+ rubygems_version: 2.4.8
502
526
  signing_key:
503
527
  specification_version: 4
504
528
  summary: Wrapper of nginx for easy install and use.