Skip to content

Commit

Permalink
Bugfix for large outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasff committed Jul 22, 2011
1 parent 7360f8f commit 394cd4f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion http.c
Expand Up @@ -137,7 +137,16 @@ http_response_write(struct http_response *r, int fd) {
}

/* send buffer to client */
ret = write(fd, s, sz);
p = s;
while(sz) {
ret = write(fd, p, sz);
if(ret <= 0) /* error or closed socket */
break;

sz -= ret;
p += ret;
}


/* cleanup buffer */
free(s);
Expand Down

0 comments on commit 394cd4f

Please sign in to comment.