Skip to content

Commit

Permalink
Block when sending data to clients.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasff committed Jul 22, 2011
1 parent 394cd4f commit 27713dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions http.c
Expand Up @@ -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;
}
}


Expand Down
2 changes: 1 addition & 1 deletion webdis.json
Expand Up @@ -6,7 +6,7 @@

"http_host": "0.0.0.0",
"http_port": 7379,
"threads": 4,
"threads": 3,

"daemonize": false,

Expand Down

0 comments on commit 27713dc

Please sign in to comment.