From 27713dc5810320b159e79ef357c2acd6ff47ae90 Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Fri, 22 Jul 2011 13:43:57 +0100 Subject: [PATCH] Block when sending data to clients. --- http.c | 9 ++++----- webdis.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/http.c b/http.c index 22b859a6..fd3081f7 100644 --- a/http.c +++ b/http.c @@ -140,11 +140,10 @@ http_response_write(struct http_response *r, int fd) { p = s; while(sz) { ret = write(fd, p, sz); - if(ret <= 0) /* error or closed socket */ - break; - - sz -= ret; - p += ret; + if(ret > 0) { /* block */ + sz -= ret; + p += ret; + } } diff --git a/webdis.json b/webdis.json index c74d4850..c7c2c062 100644 --- a/webdis.json +++ b/webdis.json @@ -6,7 +6,7 @@ "http_host": "0.0.0.0", "http_port": 7379, - "threads": 4, + "threads": 3, "daemonize": false,