Mercurial > hg > nginx
comparison src/os/win32/ngx_wsasend_chain.c @ 278:0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 04 Mar 2004 07:04:55 +0000 |
parents | 70e1c7d2b83d |
children | 7c7183b3ea8b |
comparison
equal
deleted
inserted
replaced
277:e91499541410 | 278:0ba4821f4460 |
---|---|
51 | 51 |
52 if (rc == -1) { | 52 if (rc == -1) { |
53 err = ngx_errno; | 53 err = ngx_errno; |
54 | 54 |
55 if (err == WSAEWOULDBLOCK) { | 55 if (err == WSAEWOULDBLOCK) { |
56 ngx_log_error(NGX_LOG_INFO, c->log, err, "WSASend() EAGAIN"); | 56 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err, |
57 "WSASend() not ready"); | |
57 wev->ready = 0; | 58 wev->ready = 0; |
58 return in; | 59 return in; |
59 | 60 |
60 } else { | 61 } else { |
61 wev->error = 1; | 62 wev->error = 1; |
62 ngx_log_error(NGX_LOG_CRIT, c->log, err, "WSASend() failed"); | 63 ngx_connection_error(c, err, "WSASend() failed"); |
63 return NGX_CHAIN_ERROR; | 64 return NGX_CHAIN_ERROR; |
64 } | 65 } |
65 } | 66 } |
66 | 67 |
67 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "WSASend(): %d", sent); | 68 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "WSASend: %d", sent); |
68 | 69 |
69 c->sent += sent; | 70 c->sent += sent; |
70 | 71 |
71 for (cl = in; cl && sent > 0; cl = cl->next) { | 72 for (cl = in; cl && sent > 0; cl = cl->next) { |
72 | 73 |
160 wev->active = 1; | 161 wev->active = 1; |
161 return in; | 162 return in; |
162 | 163 |
163 } else { | 164 } else { |
164 wev->error = 1; | 165 wev->error = 1; |
165 ngx_log_error(NGX_LOG_CRIT, c->log, err, "WSASend() failed"); | 166 ngx_connection_error(c, err, "WSASend() failed"); |
166 return NGX_CHAIN_ERROR; | 167 return NGX_CHAIN_ERROR; |
167 } | 168 } |
168 | 169 |
169 } else if (ngx_event_flags & NGX_USE_IOCP_EVENT) { | 170 } else if (ngx_event_flags & NGX_USE_IOCP_EVENT) { |
170 | 171 |
185 wev->complete = 0; | 186 wev->complete = 0; |
186 wev->active = 0; | 187 wev->active = 0; |
187 | 188 |
188 if (ngx_event_flags & NGX_USE_IOCP_EVENT) { | 189 if (ngx_event_flags & NGX_USE_IOCP_EVENT) { |
189 if (wev->ovlp.error) { | 190 if (wev->ovlp.error) { |
190 ngx_log_error(NGX_LOG_ERR, c->log, wev->ovlp.error, | 191 ngx_connection_error(c, wev->ovlp.error, "WSASend() failed"); |
191 "WSASend() failed"); | |
192 return NGX_CHAIN_ERROR; | 192 return NGX_CHAIN_ERROR; |
193 } | 193 } |
194 | 194 |
195 sent = wev->available; | 195 sent = wev->available; |
196 | 196 |
197 } else { | 197 } else { |
198 if (WSAGetOverlappedResult(c->fd, (LPWSAOVERLAPPED) &wev->ovlp, | 198 if (WSAGetOverlappedResult(c->fd, (LPWSAOVERLAPPED) &wev->ovlp, |
199 &sent, 0, NULL) == 0) { | 199 &sent, 0, NULL) == 0) { |
200 ngx_log_error(NGX_LOG_CRIT, c->log, ngx_socket_errno, | 200 ngx_connection_error(c, ngx_socket_errno, |
201 "WSASend() or WSAGetOverlappedResult() failed"); | 201 "WSASend() or WSAGetOverlappedResult() failed"); |
202 | 202 |
203 return NGX_CHAIN_ERROR; | 203 return NGX_CHAIN_ERROR; |
204 } | 204 } |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "WSASend(): %d", sent); | 208 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "WSASend: %d", sent); |
209 | 209 |
210 c->sent += sent; | 210 c->sent += sent; |
211 | 211 |
212 for (cl = in; cl && sent > 0; cl = cl->next) { | 212 for (cl = in; cl && sent > 0; cl = cl->next) { |
213 | 213 |