Browse Source

[core] allocate at least 4k buffer for incoming data

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3042 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.38
Stefan Bühler 6 years ago
parent
commit
3512b5cb77
  1. 1
      NEWS
  2. 5
      src/connections.c

1
NEWS

@ -5,6 +5,7 @@ NEWS
- 1.4.38
* [stat-cache] fix handling of collisions, might have returned wrong data (fixes #2669)
* [core] allocate at least 4k buffer for incoming data
- 1.4.37 - 2015-08-30
* [mod_proxy] remove debug log line from error log (fixes #2659)

5
src/connections.c

@ -336,10 +336,11 @@ static int connection_handle_read(server *srv, connection *con) {
len = recv(con->fd, mem, mem_len, 0);
#else /* __WIN32 */
if (ioctl(con->fd, FIONREAD, &toread) || toread == 0 || toread <= 4*1024) {
if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;
} else {
toread = 4096;
}
else if (toread > MAX_READ_LIMIT) {
toread = MAX_READ_LIMIT;
}
chunkqueue_get_memory(con->read_queue, &mem, &mem_len, 0, toread);
len = read(con->fd, mem, mem_len);

Loading…
Cancel
Save