diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-04-03 11:52:52 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-04-03 11:52:52 +0200 |
commit | 316bcc8c62e195a892813b050a922ebd3935eba2 (patch) | |
tree | 5165ed955c92af430774f031cebca6b65f06c93c /uclient-http.c | |
parent | 1c94253d3764e4e32cffa8703fb101ff8917fb78 (diff) | |
download | uclient-316bcc8c62e195a892813b050a922ebd3935eba2.tar.gz |
ignore empty writes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient-http.c')
-rw-r--r-- | uclient-http.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/uclient-http.c b/uclient-http.c index 7a54cce..05dd3aa 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -835,10 +835,11 @@ uclient_http_send_data(struct uclient *cl, char *buf, unsigned int len) uclient_http_send_headers(uh); - ustream_printf(uh->us, "%X\r\n", len); - if (len > 0) + if (len > 0) { + ustream_printf(uh->us, "%X\r\n", len); ustream_write(uh->us, buf, len, false); - ustream_printf(uh->us, "\r\n"); + ustream_printf(uh->us, "\r\n"); + } return len; } |