ignore empty writes
authorFelix Fietkau <nbd@openwrt.org>
Thu, 3 Apr 2014 09:52:52 +0000 (11:52 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 3 Apr 2014 09:52:52 +0000 (11:52 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-http.c

index 7a54cce5c38a4b0e997157c984a305cdcea4aed5..05dd3aacf2c676604a79ed004f2ffe0387dbffda 100644 (file)
@@ -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;
 }