Browse Source

[mod_cgi] check cgi fd for num bytes ready to read

(fix code which incorrectly checked con->fd, which may have resulted
 in suboptimal buffer size for read)
personal/stbuehler/mod-csrf lighttpd-1.4.45
Glenn Strauss 5 years ago
parent
commit
f9b391645f
  1. 2
      src/mod_cgi.c

2
src/mod_cgi.c

@ -398,7 +398,7 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) {
#if defined(__WIN32)
buffer_string_prepare_copy(hctx->response, 4 * 1024);
#else
if (ioctl(con->fd, FIONREAD, &toread) || toread <= 4*1024) {
if (ioctl(hctx->fd, FIONREAD, &toread) || toread <= 4*1024) {
buffer_string_prepare_copy(hctx->response, 4 * 1024);
} else {
if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;

Loading…
Cancel
Save