static int http_read_stream(URLContext *h, uint8_t *buf, int size)

{

    HTTPContext *s = h->priv_data;

    int err, new_location;



    if (!s->hd)

        return AVERROR_EOF;



    if (s->end_chunked_post && !s->end_header) {

        err = http_read_header(h, &new_location);

        if (err < 0)

            return err;

    }



    if (s->chunksize >= 0) {

        if (!s->chunksize) {

            char line[32];



            for (;;) {

                do {

                    if ((err = http_get_line(s, line, sizeof(line))) < 0)

                        return err;

                } while (!*line);    /* skip CR LF from last chunk */



                s->chunksize = strtoll(line, NULL, 16);



                av_log(NULL, AV_LOG_TRACE, "Chunked encoding data size: %"PRId64"'\n",

                        s->chunksize);



                if (!s->chunksize)

                    return 0;

                break;

            }

        }

        size = FFMIN(size, s->chunksize);

    }

#if CONFIG_ZLIB

    if (s->compressed)

        return http_buf_read_compressed(h, buf, size);

#endif /* CONFIG_ZLIB */

    return http_buf_read(h, buf, size);

}

static int http_read_stream(URLContext *h, uint8_t *buf, int size)

{

    HTTPContext *s = h->priv_data;

    int err, new_location;



    if (!s->hd)

        return AVERROR_EOF;



    if (s->end_chunked_post && !s->end_header) {

        err = http_read_header(h, &new_location);

        if (err < 0)

            return err;

    }



    if (s->chunksize >= 0) {

        if (!s->chunksize) {

            char line[32];



            for (;;) {

                do {

                    if ((err = http_get_line(s, line, sizeof(line))) < 0)

                        return err;

                } while (!*line);    



                s->chunksize = strtoll(line, NULL, 16);



                av_log(NULL, AV_LOG_TRACE, "Chunked encoding data size: %"PRId64"'\n",

                        s->chunksize);



                if (!s->chunksize)

                    return 0;

                break;

            }

        }

        size = FFMIN(size, s->chunksize);

    }

#if CONFIG_ZLIB

    if (s->compressed)

        return http_buf_read_compressed(h, buf, size);

#endif 

    return http_buf_read(h, buf, size);

}

                if (!s->chunksize)
static int FUNC_0(URLContext *VAR_0, uint8_t *VAR_1, int VAR_2)

{

    HTTPContext *s = VAR_0->priv_data;

    int VAR_3, VAR_4;



    if (!s->hd)

        return AVERROR_EOF;



    if (s->end_chunked_post && !s->end_header) {

        VAR_3 = http_read_header(VAR_0, &VAR_4);

        if (VAR_3 < 0)

            return VAR_3;

    }



    if (s->chunksize >= 0) {

        if (!s->chunksize) {

            char VAR_5[32];



            for (;;) {

                do {

                    if ((VAR_3 = http_get_line(s, VAR_5, sizeof(VAR_5))) < 0)

                        return VAR_3;

                } while (!*VAR_5);    



                s->chunksize = strtoll(VAR_5, NULL, 16);



                av_log(NULL, AV_LOG_TRACE, "Chunked encoding data VAR_2: %"PRId64"'\n",

                        s->chunksize);



                if (!s->chunksize)

                    return 0;

                break;

            }

        }

        VAR_2 = FFMIN(VAR_2, s->chunksize);

    }

#if CONFIG_ZLIB

    if (s->compressed)

        return http_buf_read_compressed(VAR_0, VAR_1, VAR_2);

#endif 

    return http_buf_read(VAR_0, VAR_1, VAR_2);

}

static int FUNC_0(URLContext *VAR_0, uint8_t *VAR_1, int VAR_2)
{ HTTPContext *s = VAR_0->priv_data; int VAR_3, VAR_4; if (!s->hd)
return AVERROR_EOF; if (s->end_chunked_post && !s->end_header) { VAR_3 = http_read_header(VAR_0, &VAR_4); if (VAR_3 < 0)
return VAR_3; } if (s->chunksize >= 0) { if (!s->chunksize) { char VAR_5[32]; for (;;) { do { if ((VAR_3 = http_get_line(s, VAR_5, sizeof(VAR_5))) < 0)
return VAR_3; } while (!*VAR_5); s->chunksize = strtoll(VAR_5, NULL, 16); av_log(NULL, AV_LOG_TRACE, "Chunked encoding data VAR_2: %"PRId64"'\n",
s->chunksize); if (!s->chunksize)
return 0; break; } } VAR_2 = FFMIN(VAR_2, s->chunksize); } #if CONFIG_ZLIB
if (s->compressed)
return http_buf_read_compressed(VAR_0, VAR_1, VAR_2); #endif
return http_buf_read(VAR_0, VAR_1, VAR_2); }