# HG changeset patch # User mstorsjo # Date 1277146925 0 # Node ID 78f96a0ef08c2e90dbd3970c51f179dc993819e9 # Parent 2e07dcbab9545d8e2e41c0abe63c8f4a3af1363b HTTP: Compact the code for writing chunked post data diff -r 2e07dcbab954 -r 78f96a0ef08c http.c --- a/http.c Mon Jun 21 19:01:32 2010 +0000 +++ b/http.c Mon Jun 21 19:02:05 2010 +0000 @@ -440,13 +440,10 @@ if (size > 0) { /* upload data using chunked encoding */ snprintf(temp, sizeof(temp), "%x\r\n", size); - if ((ret = url_write(s->hd, temp, strlen(temp))) < 0) - return ret; - if ((ret = url_write(s->hd, buf, size)) < 0) - return ret; - - if ((ret = url_write(s->hd, crlf, sizeof(crlf) - 1)) < 0) + if ((ret = url_write(s->hd, temp, strlen(temp))) < 0 || + (ret = url_write(s->hd, buf, size)) < 0 || + (ret = url_write(s->hd, crlf, sizeof(crlf) - 1)) < 0) return ret; } return size;