changeset 6154:78f96a0ef08c libavformat

HTTP: Compact the code for writing chunked post data
author mstorsjo
date Mon, 21 Jun 2010 19:02:05 +0000
parents 2e07dcbab954
children a7094b61b3fb
files http.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;