Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-06-21 23:02:05 +0400
committerMartin Storsjö <martin@martin.st>2010-06-21 23:02:05 +0400
commitea02b593a1bdfaec16934dd1fc64c55653aedb76 (patch)
tree33835310678414550b420c267953fb990b774b4e /libavformat/http.c
parent077026ccf38e77f11de244d526c89c3d031ce9d2 (diff)
HTTP: Compact the code for writing chunked post data
Originally committed as revision 23683 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 7156e0c799..d4300a67c1 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -440,13 +440,10 @@ static int http_write(URLContext *h, const uint8_t *buf, int size)
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;