+ authstr = ff_http_auth_create_response(&s->auth_state, auth, path,
+ post ? "POST" : "GET");
+
+ /* set default headers if needed */
+ if (!has_header(s->headers, "\r\nUser-Agent: "))
+ len += av_strlcatf(headers + len, sizeof(headers) - len,
+ "User-Agent: %s\r\n", LIBAVFORMAT_IDENT);
+ if (!has_header(s->headers, "\r\nAccept: "))
+ len += av_strlcpy(headers + len, "Accept: */*\r\n",
+ sizeof(headers) - len);
+ if (!has_header(s->headers, "\r\nRange: "))
+ len += av_strlcatf(headers + len, sizeof(headers) - len,
+ "Range: bytes=%"PRId64"-\r\n", s->off);
+ if (!has_header(s->headers, "\r\nConnection: "))
+ len += av_strlcpy(headers + len, "Connection: close\r\n",
+ sizeof(headers)-len);
+ if (!has_header(s->headers, "\r\nHost: "))
+ len += av_strlcatf(headers + len, sizeof(headers) - len,
+ "Host: %s\r\n", hoststr);
+
+ /* now add in custom headers */
+ av_strlcpy(headers+len, s->headers, sizeof(headers)-len);
+