Mercurial > hg > nginx
comparison src/event/ngx_event_proxy.c @ 79:eacfdd1c31b9
nginx-0.0.1-2003-04-22-19:02:58 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 22 Apr 2003 15:02:58 +0000 |
parents | 9f81437e0ad3 |
children | a7e45c45a95c |
comparison
equal
deleted
inserted
replaced
78:9f81437e0ad3 | 79:eacfdd1c31b9 |
---|---|
38 p->preread_hunks = NULL; | 38 p->preread_hunks = NULL; |
39 n = p->preread_size; | 39 n = p->preread_size; |
40 | 40 |
41 } else { | 41 } else { |
42 | 42 |
43 #if (HAVE_KQUEUE) /* kqueue notifies about the end of file or a pending error */ | |
44 | |
45 if (ngx_event_type == NGX_HAVE_KQUEUE_EVENT) { | |
46 | |
47 if (p->upstream->read->error) { | |
48 ngx_log_error(NGX_LOG_ERR, p->log, | |
49 p->upstream->read->error, | |
50 "readv() failed"); | |
51 p->upstream_error = 1; | |
52 | |
53 return NGX_ERROR; | |
54 | |
55 } else if (p->upstream->read->eof | |
56 && p->upstream->read->available == 0) { | |
57 p->upstream_eof = 1; | |
58 p->block_upstream = 0; | |
59 | |
60 break; | |
61 } | |
62 } | |
63 #endif | |
43 /* use the free hunks if they exist */ | 64 /* use the free hunks if they exist */ |
44 | 65 |
45 if (p->free_hunks) { | 66 if (p->free_hunks) { |
46 chain = p->free_hunks; | 67 chain = p->free_hunks; |
47 p->free_hunks = NULL; | 68 p->free_hunks = NULL; |
149 if (chain->hunk->shadow == NULL) { | 170 if (chain->hunk->shadow == NULL) { |
150 p->free_hunks = chain; | 171 p->free_hunks = chain; |
151 } | 172 } |
152 p->upstream_eof = 1; | 173 p->upstream_eof = 1; |
153 p->block_upstream = 0; | 174 p->block_upstream = 0; |
175 | |
154 break; | 176 break; |
155 } | 177 } |
156 | 178 |
157 /* move the full hunks to a read chain | 179 /* move the full hunks to a read chain |
158 and the partial filled hunk to a free chain | 180 and the partial filled hunk to a free chain |
397 { | 419 { |
398 int rc; | 420 int rc; |
399 ngx_hunk_t *h; | 421 ngx_hunk_t *h; |
400 ngx_chain_t *entry; | 422 ngx_chain_t *entry; |
401 | 423 |
402 if (p->downstream_level == 0 | 424 if (p->upstream_level == 0 |
425 && p->downstream_level == 0 | |
403 && p->busy_hunk == NULL | 426 && p->busy_hunk == NULL |
404 && p->out_hunks == NULL | 427 && p->out_hunks == NULL |
405 && p->in_hunks == NULL | 428 && p->in_hunks == NULL |
406 && ngx_event_flags & NGX_USE_LEVEL_EVENT) | 429 && ngx_event_flags & NGX_USE_LEVEL_EVENT) |
407 { | 430 { |