summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/uhttpd/src/uhttpd-file.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-03-21 02:27:29 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-03-21 02:27:29 +0000
commit79dde1ad3fd240ec084b4b9c160c95e6c82336ee (patch)
treeb65f08141160a3da3b953eb127da083a194bb3a6 /contrib/package/uhttpd/src/uhttpd-file.c
parent707f9dd2d0979f655e583031d81284aff499f1ac (diff)
uhttpd: terminate I/O loops if socket writes fail
Diffstat (limited to 'contrib/package/uhttpd/src/uhttpd-file.c')
-rw-r--r--contrib/package/uhttpd/src/uhttpd-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/package/uhttpd/src/uhttpd-file.c b/contrib/package/uhttpd/src/uhttpd-file.c
index e8ea17464..f0379bccc 100644
--- a/contrib/package/uhttpd/src/uhttpd-file.c
+++ b/contrib/package/uhttpd/src/uhttpd-file.c
@@ -349,7 +349,8 @@ void uh_file_request(struct client *cl, struct http_request *req, struct path_in
/* pump file data */
while( (rlen = read(fd, buf, sizeof(buf))) > 0 )
{
- uh_http_send(cl, req, buf, rlen);
+ if( uh_http_send(cl, req, buf, rlen) < 0 )
+ break;
}
/* send trailer in chunked mode */