Mercurial > hg > nginx-vendor-0-8
comparison src/os/unix/ngx_channel.c @ 92:45945fa8b8ba NGINX_0_2_0
nginx 0.2.0
*) The pid-file names used during online upgrade was changed and now is
not required a manual rename operation. The old master process adds
the ".oldbin" suffix to its pid-file and executes a new binary file.
The new master process creates usual pid-file without the ".newbin"
suffix. If the master process exits, then old master process renames
back its pid-file with the ".oldbin" suffix to the pid-file without
suffix.
*) Change: the "worker_connections" directive, new name of the
"connections" directive; now the directive specifies maximum number
of connections, but not maximum socket descriptor number.
*) Feature: SSL supports the session cache inside one worker process.
*) Feature: the "satisfy_any" directive.
*) Change: the ngx_http_access_module and ngx_http_auth_basic_module do
not run for subrequests.
*) Feature: the "worker_rlimit_nofile" and "worker_rlimit_sigpending"
directives.
*) Bugfix: if all backend using in load-balancing failed after one
error, then nginx did not try do connect to them during 60 seconds.
*) Bugfix: in IMAP/POP3 command argument parsing.
Thanks to Rob Mueller.
*) Bugfix: errors while using SSL in IMAP/POP3 proxy.
*) Bugfix: errors while using SSI and gzipping.
*) Bugfix: the "Expires" and "Cache-Control" header lines were omitted
from the 304 responses.
Thanks to Alexandr Kukushkin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Fri, 23 Sep 2005 00:00:00 +0400 |
parents | b55cbf18157e |
children | dad2fe8ecf08 |
comparison
equal
deleted
inserted
replaced
91:c3eee83ea942 | 92:45945fa8b8ba |
---|---|
7 #include <ngx_config.h> | 7 #include <ngx_config.h> |
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
9 #include <ngx_channel.h> | 9 #include <ngx_channel.h> |
10 | 10 |
11 | 11 |
12 ngx_int_t ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, | 12 ngx_int_t |
13 ngx_log_t *log) | 13 ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, |
14 ngx_log_t *log) | |
14 { | 15 { |
15 ssize_t n; | 16 ssize_t n; |
16 ngx_err_t err; | 17 ngx_err_t err; |
17 struct iovec iov[1]; | 18 struct iovec iov[1]; |
18 struct msghdr msg; | 19 struct msghdr msg; |
75 | 76 |
76 return NGX_OK; | 77 return NGX_OK; |
77 } | 78 } |
78 | 79 |
79 | 80 |
80 ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, | 81 ngx_int_t |
81 ngx_log_t *log) | 82 ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, ngx_log_t *log) |
82 { | 83 { |
83 ssize_t n; | 84 ssize_t n; |
84 ngx_err_t err; | 85 ngx_err_t err; |
85 struct iovec iov[1]; | 86 struct iovec iov[1]; |
86 struct msghdr msg; | 87 struct msghdr msg; |
176 | 177 |
177 return n; | 178 return n; |
178 } | 179 } |
179 | 180 |
180 | 181 |
181 ngx_int_t ngx_add_channel_event(ngx_cycle_t *cycle, ngx_fd_t fd, | 182 ngx_int_t |
182 ngx_int_t event, ngx_event_handler_pt handler) | 183 ngx_add_channel_event(ngx_cycle_t *cycle, ngx_fd_t fd, ngx_int_t event, |
184 ngx_event_handler_pt handler) | |
183 { | 185 { |
184 ngx_event_t *ev, *rev, *wev; | 186 ngx_event_t *ev, *rev, *wev; |
185 ngx_connection_t *c; | 187 ngx_connection_t *c; |
186 | 188 |
187 c = &cycle->connections[fd]; | 189 c = ngx_get_connection(fd, cycle->log); |
188 rev = &cycle->read_events[fd]; | 190 |
189 wev = &cycle->write_events[fd]; | 191 if (c == NULL) { |
192 return NGX_ERROR; | |
193 } | |
194 | |
195 rev = c->read; | |
196 wev = c->write; | |
190 | 197 |
191 ngx_memzero(c, sizeof(ngx_connection_t)); | 198 ngx_memzero(c, sizeof(ngx_connection_t)); |
199 | |
200 c->read = rev; | |
201 c->write = wev; | |
202 c->fd = fd; | |
203 c->log = cycle->log; | |
204 | |
205 c->pool = cycle->pool; | |
206 | |
192 ngx_memzero(rev, sizeof(ngx_event_t)); | 207 ngx_memzero(rev, sizeof(ngx_event_t)); |
193 ngx_memzero(wev, sizeof(ngx_event_t)); | 208 ngx_memzero(wev, sizeof(ngx_event_t)); |
194 | 209 |
195 c->fd = fd; | |
196 c->pool = cycle->pool; | |
197 | |
198 c->read = rev; | |
199 c->write = wev; | |
200 | |
201 c->log = cycle->log; | |
202 rev->log = cycle->log; | 210 rev->log = cycle->log; |
203 wev->log = cycle->log; | 211 wev->log = cycle->log; |
212 | |
204 rev->index = NGX_INVALID_INDEX; | 213 rev->index = NGX_INVALID_INDEX; |
205 wev->index = NGX_INVALID_INDEX; | 214 wev->index = NGX_INVALID_INDEX; |
215 | |
206 rev->data = c; | 216 rev->data = c; |
207 wev->data = c; | 217 wev->data = c; |
208 | 218 |
209 #if (NGX_THREADS) | 219 #if (NGX_THREADS) |
210 rev->lock = &c->lock; | 220 rev->lock = &c->lock; |
217 | 227 |
218 ev->handler = handler; | 228 ev->handler = handler; |
219 | 229 |
220 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) { | 230 if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) { |
221 if (ngx_add_conn(c) == NGX_ERROR) { | 231 if (ngx_add_conn(c) == NGX_ERROR) { |
232 ngx_free_connection(c); | |
222 return NGX_ERROR; | 233 return NGX_ERROR; |
223 } | 234 } |
224 | 235 |
225 } else { | 236 } else { |
226 if (ngx_add_event(ev, event, 0) == NGX_ERROR) { | 237 if (ngx_add_event(ev, event, 0) == NGX_ERROR) { |
238 ngx_free_connection(c); | |
227 return NGX_ERROR; | 239 return NGX_ERROR; |
228 } | 240 } |
229 } | 241 } |
230 | 242 |
231 return NGX_OK; | 243 return NGX_OK; |
232 } | 244 } |
233 | 245 |
234 | 246 |
235 void ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log) | 247 void |
248 ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log) | |
236 { | 249 { |
237 if (close(fd[0]) == -1) { | 250 if (close(fd[0]) == -1) { |
238 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() channel failed"); | 251 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() channel failed"); |
239 } | 252 } |
240 | 253 |