Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_send.c @ 676:bfa81a0490a2 NGINX_1_3_1
nginx 1.3.1
*) Security: now nginx/Windows ignores trailing dot in URI path
component, and does not allow URIs with ":$" in it.
Thanks to Vladimir Kochetkov, Positive Research Center.
*) Feature: the "proxy_pass", "fastcgi_pass", "scgi_pass", "uwsgi_pass"
directives, and the "server" directive inside the "upstream" block,
now support IPv6 addresses.
*) Feature: the "resolver" directive now support IPv6 addresses and an
optional port specification.
*) Feature: the "least_conn" directive inside the "upstream" block.
*) Feature: it is now possible to specify a weight for servers while
using the "ip_hash" directive.
*) Bugfix: a segmentation fault might occur in a worker process if the
"image_filter" directive was used; the bug had appeared in 1.3.0.
*) Bugfix: nginx could not be built with ngx_cpp_test_module; the bug
had appeared in 1.1.12.
*) Bugfix: access to variables from SSI and embedded perl module might
not work after reconfiguration.
Thanks to Yichun Zhang.
*) Bugfix: in the ngx_http_xslt_filter_module.
Thanks to Kuramoto Eiji.
*) Bugfix: memory leak if $geoip_org variable was used.
Thanks to Denis F. Latypoff.
*) Bugfix: in the "proxy_cookie_domain" and "proxy_cookie_path"
directives.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 05 Jun 2012 00:00:00 +0400 |
parents | d0f7a625f27c |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
660 | 4 * Copyright (C) Nginx, Inc. |
0 | 5 */ |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 #include <ngx_event.h> | |
11 | |
12 | |
354 | 13 ssize_t |
14 ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size) | |
0 | 15 { |
16 ssize_t n; | |
17 ngx_err_t err; | |
18 ngx_event_t *wev; | |
19 | |
20 wev = c->write; | |
21 | |
18 | 22 #if (NGX_HAVE_KQUEUE) |
0 | 23 |
136 | 24 if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) { |
86 | 25 (void) ngx_connection_error(c, wev->kq_errno, |
26 "kevent() reported about an closed connection"); | |
0 | 27 wev->error = 1; |
28 return NGX_ERROR; | |
29 } | |
30 | |
31 #endif | |
32 | |
33 for ( ;; ) { | |
34 n = send(c->fd, buf, size, 0); | |
35 | |
36 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
37 "send: fd:%d %d of %d", c->fd, n, size); | |
38 | |
39 if (n > 0) { | |
40 if (n < (ssize_t) size) { | |
41 wev->ready = 0; | |
42 } | |
43 | |
480 | 44 c->sent += n; |
45 | |
0 | 46 return n; |
47 } | |
48 | |
49 err = ngx_socket_errno; | |
50 | |
51 if (n == 0) { | |
52 ngx_log_error(NGX_LOG_ALERT, c->log, err, "send() returned zero"); | |
53 wev->ready = 0; | |
54 return n; | |
55 } | |
56 | |
57 if (err == NGX_EAGAIN || err == NGX_EINTR) { | |
58 wev->ready = 0; | |
59 | |
60 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err, | |
61 "send() not ready"); | |
62 | |
63 if (err == NGX_EAGAIN) { | |
64 return NGX_AGAIN; | |
65 } | |
66 | |
67 } else { | |
68 wev->error = 1; | |
86 | 69 (void) ngx_connection_error(c, err, "send() failed"); |
0 | 70 return NGX_ERROR; |
71 } | |
72 } | |
73 } |