- for (;;) {
- int new_loc;
- // Note: This uses buffering, potentially reading more than the
- // HTTP header. If tunneling a protocol where the server starts
- // the conversation, we might buffer part of that here, too.
- // Reading that requires using the proper ffurl_read() function
- // on this URLContext, not using the fd directly (as the tls
- // protocol does). This shouldn't be an issue for tls though,
- // since the client starts the conversation there, so there
- // is no extra data that we might buffer up here.
- if (http_get_line(s, line, sizeof(line)) < 0) {
- ret = AVERROR(EIO);
- goto fail;
- }
-
- av_dlog(h, "header='%s'\n", line);
+ /* Note: This uses buffering, potentially reading more than the
+ * HTTP header. If tunneling a protocol where the server starts
+ * the conversation, we might buffer part of that here, too.
+ * Reading that requires using the proper ffurl_read() function
+ * on this URLContext, not using the fd directly (as the tls
+ * protocol does). This shouldn't be an issue for tls though,
+ * since the client starts the conversation there, so there
+ * is no extra data that we might buffer up here.
+ */
+ ret = http_read_header(h, &new_loc);
+ if (ret < 0)
+ goto fail;