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
@@ -10,6 +10,7 @@ fastcgi_param REQUEST_URI $request_uri;
10
10
  fastcgi_param DOCUMENT_URI $document_uri;
11
11
  fastcgi_param DOCUMENT_ROOT $document_root;
12
12
  fastcgi_param SERVER_PROTOCOL $server_protocol;
13
+ fastcgi_param HTTPS $https if_not_empty;
13
14
 
14
15
  fastcgi_param GATEWAY_INTERFACE CGI/1.1;
15
16
  fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
@@ -9,6 +9,7 @@ fastcgi_param REQUEST_URI $request_uri;
9
9
  fastcgi_param DOCUMENT_URI $document_uri;
10
10
  fastcgi_param DOCUMENT_ROOT $document_root;
11
11
  fastcgi_param SERVER_PROTOCOL $server_protocol;
12
+ fastcgi_param HTTPS $https if_not_empty;
12
13
 
13
14
  fastcgi_param GATEWAY_INTERFACE CGI/1.1;
14
15
  fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
@@ -8,6 +8,7 @@ scgi_param DOCUMENT_URI $document_uri;
8
8
  scgi_param DOCUMENT_ROOT $document_root;
9
9
  scgi_param SCGI 1;
10
10
  scgi_param SERVER_PROTOCOL $server_protocol;
11
+ scgi_param HTTPS $https if_not_empty;
11
12
 
12
13
  scgi_param REMOTE_ADDR $remote_addr;
13
14
  scgi_param REMOTE_PORT $remote_port;
@@ -8,6 +8,7 @@ uwsgi_param REQUEST_URI $request_uri;
8
8
  uwsgi_param PATH_INFO $document_uri;
9
9
  uwsgi_param DOCUMENT_ROOT $document_root;
10
10
  uwsgi_param SERVER_PROTOCOL $server_protocol;
11
+ uwsgi_param HTTPS $https if_not_empty;
11
12
 
12
13
  uwsgi_param REMOTE_ADDR $remote_addr;
13
14
  uwsgi_param REMOTE_PORT $remote_port;
@@ -25,7 +25,7 @@
25
25
  .\" SUCH DAMAGE.
26
26
  .\"
27
27
  .\"
28
- .Dd August 10, 2011
28
+ .Dd March 6, 2012
29
29
  .Dt NGINX 8
30
30
  .Os
31
31
  .Sh NAME
@@ -33,25 +33,22 @@
33
33
  .Nd "HTTP and reverse proxy server, mail proxy server"
34
34
  .Sh SYNOPSIS
35
35
  .Nm
36
- .Op Fl hqtvV?
36
+ .Op Fl ?hqtVv
37
37
  .Op Fl c Ar file
38
38
  .Op Fl g Ar directives
39
39
  .Op Fl p Ar prefix
40
40
  .Op Fl s Ar signal
41
41
  .Sh DESCRIPTION
42
- The
43
42
  .Nm
44
- (spelled
43
+ (pronounced
45
44
  .Dq engine x )
46
45
  is an HTTP and reverse proxy server, as well as a mail proxy server.
47
- The
48
- .Nm
49
- is known for its high performance, stability, rich feature set, simple
46
+ It is known for its high performance, stability, rich feature set, simple
50
47
  configuration, and low resource consumption.
51
48
  .Pp
52
49
  The options are as follows:
53
50
  .Bl -tag -width ".Fl d Ar directives"
54
- .It Fl ?\& | h
51
+ .It Fl ?\& , h
55
52
  Print help.
56
53
  .It Fl c Ar file
57
54
  Use an alternative configuration
@@ -62,20 +59,20 @@ See
62
59
  .Sx EXAMPLES
63
60
  for details.
64
61
  .It Fl p Ar prefix
65
- Set prefix path.
66
- Default value is
62
+ Set the prefix path.
63
+ The default value is
67
64
  .Pa %%PREFIX%% .
68
65
  .It Fl q
69
66
  Suppress non-error messages during configuration testing.
70
67
  .It Fl s Ar signal
71
- Send signal to the master process.
68
+ Send a signal to the master process.
72
69
  The argument
73
70
  .Ar signal
74
71
  can be one of:
75
72
  .Cm stop , quit , reopen , reload .
76
- The following table shows the corresponding system signals.
73
+ The following table shows the corresponding system signals:
77
74
  .Pp
78
- .Bl -tag -width ".It Cm reopen" -compact
75
+ .Bl -tag -width ".Cm reopen" -compact
79
76
  .It Cm stop
80
77
  .Dv SIGTERM
81
78
  .It Cm quit
@@ -86,49 +83,48 @@ The following table shows the corresponding system signals.
86
83
  .Dv SIGHUP
87
84
  .El
88
85
  .It Fl t
89
- Don't run, just test the configuration file.
90
- The
86
+ Do not run, just test the configuration file.
91
87
  .Nm
92
- checks configuration for correct syntax and then tries to open files
93
- referred in configuration.
94
- .It Fl v
95
- Print
96
- .Nm
97
- version.
88
+ checks the configuration file syntax and then tries to open files
89
+ referenced in the configuration file.
98
90
  .It Fl V
99
- Print
91
+ Print the
100
92
  .Nm
101
- version, compiler version and
93
+ version, compiler version, and
102
94
  .Pa configure
103
95
  script parameters.
96
+ .It Fl v
97
+ Print the
98
+ .Nm
99
+ version.
104
100
  .El
105
101
  .Sh SIGNALS
106
102
  The master process of
107
103
  .Nm
108
- can handle the following signals.
104
+ can handle the following signals:
109
105
  .Pp
110
- .Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
106
+ .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
111
107
  .It Dv SIGINT , SIGTERM
112
108
  Shut down quickly.
113
109
  .It Dv SIGHUP
114
110
  Reload configuration, start the new worker process with a new
115
- configuration, gracefully shut down old worker processes.
111
+ configuration, and gracefully shut down old worker processes.
116
112
  .It Dv SIGQUIT
117
113
  Shut down gracefully.
118
114
  .It Dv SIGUSR1
119
115
  Reopen log files.
120
116
  .It Dv SIGUSR2
121
- Upgrade
117
+ Upgrade the
122
118
  .Nm
123
119
  executable on the fly.
124
120
  .It Dv SIGWINCH
125
- Shut down gracefully worker processes.
121
+ Shut down worker processes gracefully.
126
122
  .El
127
123
  .Pp
128
- While there's no need to explicitly control worker processes normally,
129
- they support some signals, too:
124
+ While there is no need to explicitly control worker processes normally,
125
+ they support some signals too:
130
126
  .Pp
131
- .Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
127
+ .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
132
128
  .It Dv SIGTERM
133
129
  Shut down quickly.
134
130
  .It Dv SIGQUIT
@@ -150,40 +146,44 @@ level of the
150
146
  .Pp
151
147
  .Dl "error_log /path/to/log debug;"
152
148
  .Pp
153
- It is also possible to enable the debugging for some IP address:
149
+ It is also possible to enable the debugging for a particular IP address:
154
150
  .Bd -literal -offset indent
155
151
  events {
156
152
  debug_connection 127.0.0.1;
157
153
  }
158
154
  .Ed
155
+ .Sh ENVIRONMENT
156
+ The
157
+ .Ev NGINX
158
+ environment variable is used internally by
159
+ .Nm
160
+ and should not be set directly by the user.
159
161
  .Sh FILES
160
- .Bl -tag -width indent -compact
162
+ .Bl -tag -width indent
161
163
  .It Pa %%PID_PATH%%
162
- Contains the process ID of the
163
- .Nm
164
- listening for connections.
165
- The content of this file is not sensitive; it can be world-readable.
164
+ Contains the process ID of
165
+ .Nm .
166
+ The contents of this file are not sensitive, so it can be world-readable.
166
167
  .It Pa %%CONF_PATH%%
167
- Main configuration file.
168
+ The main configuration file.
168
169
  .It Pa %%ERROR_LOG_PATH%%
169
170
  Error log file.
170
171
  .El
171
172
  .Sh EXIT STATUS
172
173
  Exit status is 0 on success, or 1 if the command fails.
173
174
  .Sh EXAMPLES
174
- .Bd -literal
175
- nginx -t -c ~/mynginx.conf -g "pid /var/run/mynginx.pid; worker_processes 2;"
176
- .Ed
177
175
  Test configuration file
178
176
  .Pa ~/mynginx.conf
179
- with global directives for PID and quantity of worker processes.
177
+ with global directives for PID and quantity of worker processes:
178
+ .Bd -literal -offset indent
179
+ nginx -t -c ~/mynginx.conf \e
180
+ -g "pid /var/run/mynginx.pid; worker_processes 2;"
181
+ .Ed
180
182
  .Sh SEE ALSO
181
183
  .\"Xr nginx.conf 5
182
184
  .\"Pp
183
185
  Documentation at
184
- .Pa http://nginx.org/
185
- and
186
- .Pa http://sysoev.ru/nginx/ .
186
+ .Pa http://nginx.org/en/docs/ .
187
187
  .Pp
188
188
  For questions and technical support, please refer to
189
189
  .Pa http://nginx.org/en/support.html .
@@ -193,10 +193,10 @@ Development of
193
193
  started in 2002, with the first public release on October 4, 2004.
194
194
  .Sh AUTHORS
195
195
  .An -nosplit
196
- .An Igor Sysoev Aq igor@sysoev.ru
196
+ .An Igor Sysoev Aq igor@sysoev.ru .
197
197
  .Pp
198
- This manual page was written by
198
+ This manual page was originally written by
199
199
  .An Sergey A. Osokin Aq osa@FreeBSD.org.ru
200
- as a result of compilation of many
200
+ as a result of compiling many
201
201
  .Nm
202
- documents all over the world.
202
+ documents from all over the world.
@@ -204,9 +204,7 @@ main(int argc, char *const *argv)
204
204
  ngx_cycle_t *cycle, init_cycle;
205
205
  ngx_core_conf_t *ccf;
206
206
 
207
- #if (NGX_FREEBSD)
208
207
  ngx_debug_init();
209
- #endif
210
208
 
211
209
  if (ngx_strerror_init() != NGX_OK) {
212
210
  return 1;
@@ -651,7 +649,7 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
651
649
  if (ngx_rename_file(ccf->oldpid.data, ccf->pid.data) != NGX_OK) {
652
650
  ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
653
651
  ngx_rename_file_n " %s back to %s failed after "
654
- "the try to execute the new binary process \"%s\"",
652
+ "an attempt to execute new binary process \"%s\"",
655
653
  ccf->oldpid.data, ccf->pid.data, argv[0]);
656
654
  }
657
655
  }
@@ -985,15 +983,15 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
985
983
  ngx_conf_init_value(ccf->worker_processes, 1);
986
984
  ngx_conf_init_value(ccf->debug_points, 0);
987
985
 
988
- #if (NGX_HAVE_SCHED_SETAFFINITY)
986
+ #if (NGX_HAVE_CPU_AFFINITY)
989
987
 
990
988
  if (ccf->cpu_affinity_n
991
989
  && ccf->cpu_affinity_n != 1
992
990
  && ccf->cpu_affinity_n != (ngx_uint_t) ccf->worker_processes)
993
991
  {
994
992
  ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
995
- "number of the \"worker_processes\" is not equal to "
996
- "the number of the \"worker_cpu_affinity\" mask, "
993
+ "the number of \"worker_processes\" is not equal to "
994
+ "the number of \"worker_cpu_affinity\" masks, "
997
995
  "using last mask for remaining worker processes");
998
996
  }
999
997
 
@@ -1244,11 +1242,11 @@ ngx_set_priority(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1244
1242
  static char *
1245
1243
  ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1246
1244
  {
1247
- #if (NGX_HAVE_SCHED_SETAFFINITY)
1245
+ #if (NGX_HAVE_CPU_AFFINITY)
1248
1246
  ngx_core_conf_t *ccf = conf;
1249
1247
 
1250
1248
  u_char ch;
1251
- u_long *mask;
1249
+ uint64_t *mask;
1252
1250
  ngx_str_t *value;
1253
1251
  ngx_uint_t i, n;
1254
1252
 
@@ -1256,7 +1254,7 @@ ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1256
1254
  return "is duplicate";
1257
1255
  }
1258
1256
 
1259
- mask = ngx_palloc(cf->pool, (cf->args->nelts - 1) * sizeof(long));
1257
+ mask = ngx_palloc(cf->pool, (cf->args->nelts - 1) * sizeof(uint64_t));
1260
1258
  if (mask == NULL) {
1261
1259
  return NGX_CONF_ERROR;
1262
1260
  }
@@ -1268,9 +1266,9 @@ ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1268
1266
 
1269
1267
  for (n = 1; n < cf->args->nelts; n++) {
1270
1268
 
1271
- if (value[n].len > 32) {
1269
+ if (value[n].len > 64) {
1272
1270
  ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1273
- "\"worker_cpu_affinity\" supports up to 32 CPU only");
1271
+ "\"worker_cpu_affinity\" supports up to 64 CPUs only");
1274
1272
  return NGX_CONF_ERROR;
1275
1273
  }
1276
1274
 
@@ -1313,7 +1311,7 @@ ngx_set_cpu_affinity(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1313
1311
  }
1314
1312
 
1315
1313
 
1316
- u_long
1314
+ uint64_t
1317
1315
  ngx_get_cpu_affinity(ngx_uint_t n)
1318
1316
  {
1319
1317
  ngx_core_conf_t *ccf;
@@ -9,8 +9,8 @@
9
9
  #define _NGINX_H_INCLUDED_
10
10
 
11
11
 
12
- #define nginx_version 1000015
13
- #define NGINX_VERSION "1.0.15"
12
+ #define nginx_version 1002000
13
+ #define NGINX_VERSION "1.2.0"
14
14
  #define NGINX_VER "nginx/" NGINX_VERSION
15
15
 
16
16
  #define NGINX_VAR "NGINX"
@@ -181,7 +181,7 @@ ngx_chain_get_free_buf(ngx_pool_t *p, ngx_chain_t **free)
181
181
 
182
182
 
183
183
  void
184
- ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy,
184
+ ngx_chain_update_chains(ngx_pool_t *p, ngx_chain_t **free, ngx_chain_t **busy,
185
185
  ngx_chain_t **out, ngx_buf_tag_t tag)
186
186
  {
187
187
  ngx_chain_t *cl;
@@ -198,19 +198,21 @@ ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy,
198
198
  *out = NULL;
199
199
 
200
200
  while (*busy) {
201
- if (ngx_buf_size((*busy)->buf) != 0) {
201
+ cl = *busy;
202
+
203
+ if (ngx_buf_size(cl->buf) != 0) {
202
204
  break;
203
205
  }
204
206
 
205
- if ((*busy)->buf->tag != tag) {
206
- *busy = (*busy)->next;
207
+ if (cl->buf->tag != tag) {
208
+ *busy = cl->next;
209
+ ngx_free_chain(p, cl);
207
210
  continue;
208
211
  }
209
212
 
210
- (*busy)->buf->pos = (*busy)->buf->start;
211
- (*busy)->buf->last = (*busy)->buf->start;
213
+ cl->buf->pos = cl->buf->start;
214
+ cl->buf->last = cl->buf->start;
212
215
 
213
- cl = *busy;
214
216
  *busy = cl->next;
215
217
  cl->next = *free;
216
218
  *free = cl;
@@ -155,8 +155,8 @@ ngx_int_t ngx_chain_writer(void *ctx, ngx_chain_t *in);
155
155
  ngx_int_t ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain,
156
156
  ngx_chain_t *in);
157
157
  ngx_chain_t *ngx_chain_get_free_buf(ngx_pool_t *p, ngx_chain_t **free);
158
- void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy,
159
- ngx_chain_t **out, ngx_buf_tag_t tag);
158
+ void ngx_chain_update_chains(ngx_pool_t *p, ngx_chain_t **free,
159
+ ngx_chain_t **busy, ngx_chain_t **out, ngx_buf_tag_t tag);
160
160
 
161
161
 
162
162
  #endif /* _NGX_BUF_H_INCLUDED_ */
@@ -465,7 +465,7 @@ ngx_conf_read_token(ngx_conf_t *cf)
465
465
 
466
466
  if (cf->conf_file->file.offset >= file_size) {
467
467
 
468
- if (cf->args->nelts > 0) {
468
+ if (cf->args->nelts > 0 || !last_space) {
469
469
 
470
470
  if (cf->conf_file->file.fd == NGX_INVALID_FILE) {
471
471
  ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -1295,10 +1295,6 @@ ngx_conf_set_msec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1295
1295
  return "invalid value";
1296
1296
  }
1297
1297
 
1298
- if (*msp == (ngx_msec_t) NGX_PARSE_LARGE_TIME) {
1299
- return "value must be less than 597 hours";
1300
- }
1301
-
1302
1298
  if (cmd->post) {
1303
1299
  post = cmd->post;
1304
1300
  return post->post_handler(cf, post, msp);
@@ -1326,14 +1322,10 @@ ngx_conf_set_sec_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1326
1322
  value = cf->args->elts;
1327
1323
 
1328
1324
  *sp = ngx_parse_time(&value[1], 1);
1329
- if (*sp == NGX_ERROR) {
1325
+ if (*sp == (time_t) NGX_ERROR) {
1330
1326
  return "invalid value";
1331
1327
  }
1332
1328
 
1333
- if (*sp == NGX_PARSE_LARGE_TIME) {
1334
- return "value must be less than 68 years";
1335
- }
1336
-
1337
1329
  if (cmd->post) {
1338
1330
  post = cmd->post;
1339
1331
  return post->post_handler(cf, post, sp);
@@ -1489,7 +1481,8 @@ ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data)
1489
1481
  }
1490
1482
 
1491
1483
  ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1492
- "value must be equal or more than %i", bounds->low);
1484
+ "value must be equal to or greater than %i",
1485
+ bounds->low);
1493
1486
 
1494
1487
  return NGX_CONF_ERROR;
1495
1488
  }
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  /*
17
- * AAAA number of agruments
17
+ * AAAA number of arguments
18
18
  * FF command flags
19
19
  * TT command type, i.e. HTTP "location" or "server" command
20
20
  */
@@ -463,6 +463,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
463
463
  void
464
464
  ngx_configure_listening_sockets(ngx_cycle_t *cycle)
465
465
  {
466
+ int keepalive;
466
467
  ngx_uint_t i;
467
468
  ngx_listening_t *ls;
468
469
 
@@ -500,6 +501,56 @@ ngx_configure_listening_sockets(ngx_cycle_t *cycle)
500
501
  }
501
502
  }
502
503
 
504
+ if (ls[i].keepalive) {
505
+ keepalive = (ls[i].keepalive == 1) ? 1 : 0;
506
+
507
+ if (setsockopt(ls[i].fd, SOL_SOCKET, SO_KEEPALIVE,
508
+ (const void *) &keepalive, sizeof(int))
509
+ == -1)
510
+ {
511
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
512
+ "setsockopt(SO_KEEPALIVE, %d) %V failed, ignored",
513
+ keepalive, &ls[i].addr_text);
514
+ }
515
+ }
516
+
517
+ #if (NGX_HAVE_KEEPALIVE_TUNABLE)
518
+
519
+ if (ls[i].keepidle) {
520
+ if (setsockopt(ls[i].fd, IPPROTO_TCP, TCP_KEEPIDLE,
521
+ (const void *) &ls[i].keepidle, sizeof(int))
522
+ == -1)
523
+ {
524
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
525
+ "setsockopt(TCP_KEEPIDLE, %d) %V failed, ignored",
526
+ ls[i].keepidle, &ls[i].addr_text);
527
+ }
528
+ }
529
+
530
+ if (ls[i].keepintvl) {
531
+ if (setsockopt(ls[i].fd, IPPROTO_TCP, TCP_KEEPINTVL,
532
+ (const void *) &ls[i].keepintvl, sizeof(int))
533
+ == -1)
534
+ {
535
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
536
+ "setsockopt(TCP_KEEPINTVL, %d) %V failed, ignored",
537
+ ls[i].keepintvl, &ls[i].addr_text);
538
+ }
539
+ }
540
+
541
+ if (ls[i].keepcnt) {
542
+ if (setsockopt(ls[i].fd, IPPROTO_TCP, TCP_KEEPCNT,
543
+ (const void *) &ls[i].keepcnt, sizeof(int))
544
+ == -1)
545
+ {
546
+ ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
547
+ "setsockopt(TCP_KEEPCNT, %d) %V failed, ignored",
548
+ ls[i].keepcnt, &ls[i].addr_text);
549
+ }
550
+ }
551
+
552
+ #endif
553
+
503
554
  #if (NGX_HAVE_SETFIB)
504
555
  if (ls[i].setfib != -1) {
505
556
  if (setsockopt(ls[i].fd, SOL_SOCKET, SO_SETFIB,
@@ -657,7 +708,7 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle)
657
708
  /*
658
709
  * it seems that Linux-2.6.x OpenVZ sends events
659
710
  * for closed shared listening sockets unless
660
- * the events was explicity deleted
711
+ * the events was explicitly deleted
661
712
  */
662
713
 
663
714
  ngx_del_event(c->read, NGX_READ_EVENT, 0);