From ea02b593a1bdfaec16934dd1fc64c55653aedb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 21 Jun 2010 19:02:05 +0000 Subject: [PATCH] HTTP: Compact the code for writing chunked post data Originally committed as revision 23683 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/http.c | 9 +++------ 1 file 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;