Bug #1640 ยป mod_cgi.c.patch
lighttpd-1.4.19.patched/src/mod_cgi.c 2008-04-15 05:06:05.335717999 +0000 | ||
---|---|---|
/* there is content to send */
|
||
for (c = cq->first; c; c = cq->first) {
|
||
int r = 0;
|
||
int write_eintr = 0;
|
||
|
||
/* copy all chunks */
|
||
switch(c->type) {
|
||
case FILE_CHUNK:
|
||
... | ... | |
switch(errno) {
|
||
case ENOSPC:
|
||
con->http_status = 507;
|
||
break;
|
||
case EINTR:
|
||
write_eintr = 1;
|
||
break;
|
||
default:
|
||
con->http_status = 403;
|
||
... | ... | |
switch(errno) {
|
||
case ENOSPC:
|
||
con->http_status = 507;
|
||
break;
|
||
case EINTR:
|
||
write_eintr = 1;
|
||
break;
|
||
default:
|
||
con->http_status = 403;
|
||
... | ... | |
if (r > 0) {
|
||
c->offset += r;
|
||
cq->bytes_out += r;
|
||
} else {
|
||
}
|
||
if (r < 0) {
|
||
/* if write failed for reasons other than EINTR log and break out */
|
||
if (write_eintr != 1) {
|
||
log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno));
|
||
con->http_status = 500;
|
||
break;
|
||
}
|
||
}
|
||
if (r == 0) {
|
||
break;
|
||
}
|
||
chunkqueue_remove_finished_chunks(cq);
|