diff options
author | Martin Storsjö <martin@martin.st> | 2010-06-21 19:02:05 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-06-21 19:02:05 +0000 |
commit | ea02b593a1bdfaec16934dd1fc64c55653aedb76 (patch) | |
tree | 33835310678414550b420c267953fb990b774b4e | |
parent | 077026ccf38e77f11de244d526c89c3d031ce9d2 (diff) | |
download | ffmpeg-ea02b593a1bdfaec16934dd1fc64c55653aedb76.tar.gz |
HTTP: Compact the code for writing chunked post data
Originally committed as revision 23683 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/http.c | 9 |
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; |