X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=contrib%2Fpackage%2Fuhttpd%2Fsrc%2Fuhttpd-file.c;h=f0379bccc1b58082610ff41b683bc311e179ac71;hp=63c2d7e4fdee91cfb5d09eb7636074f71a8aff72;hb=79dde1ad3fd240ec084b4b9c160c95e6c82336ee;hpb=074690aa549db034b9d1599b9fa38dfd577db868 diff --git a/contrib/package/uhttpd/src/uhttpd-file.c b/contrib/package/uhttpd/src/uhttpd-file.c index 63c2d7e4f..f0379bccc 100644 --- a/contrib/package/uhttpd/src/uhttpd-file.c +++ b/contrib/package/uhttpd/src/uhttpd-file.c @@ -16,8 +16,8 @@ * limitations under the License. */ -#define _XOPEN_SOURCE 500 /* strptime() ... */ -#define _BSD_SOURCE /* scandir() ... */ +#define _XOPEN_SOURCE 500 /* strptime() */ +#define _BSD_SOURCE /* scandir(), timegm() */ #include "uhttpd.h" #include "uhttpd-utils.h" @@ -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 */