fix handling of responses bigger than the client BUFFER_SIZE (32kb)

This commit is contained in:
Thomas Porzelt 2009-09-11 20:16:03 +02:00
parent 572ab4496e
commit 2a8afc8dfb

View File

@ -219,7 +219,7 @@ void client_state_machine(Client *client) {
}
case CLIENT_READING:
while (1) {
r = read(client->sock_watcher.fd, &client->buffer[client->buffer_offset], sizeof(client->buffer) - client->buffer_offset);
r = read(client->sock_watcher.fd, &client->buffer[client->buffer_offset], sizeof(client->buffer) - client->buffer_offset - 1);
//printf("read(): %d\n", r);
if (r == -1) {
/* error */