1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-08 18:35:45 +02:00

HTTP: Compact the code for writing chunked post data

Originally committed as revision 23683 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Martin Storsjö 2010-06-21 19:02:05 +00:00
parent 077026ccf3
commit ea02b593a1

View File

@ -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;