int hc_code;
http_ver_t hc_version;
+ http_ver_t hc_redirv;
http_cmd_t hc_cmd;
struct http_arg_list hc_args; /* header */
http_arg_list_t *header, void *body, size_t body_size );
void http_client_basic_auth( http_client_t *hc, http_arg_list_t *h,
const char *user, const char *pass );
-int http_client_simple_reconnect ( http_client_t *hc, const url_t *u );
+int http_client_simple_reconnect ( http_client_t *hc, const url_t *u, http_ver_t ver );
int http_client_simple( http_client_t *hc, const url_t *url);
int http_client_clear_state( http_client_t *hc );
int http_client_run( http_client_t *hc );
}
int
-http_client_simple_reconnect ( http_client_t *hc, const url_t *u )
+http_client_simple_reconnect ( http_client_t *hc, const url_t *u, http_ver_t ver )
{
http_arg_list_t h;
tvhpoll_t *efd;
hc->hc_reconnected = 1;
hc->hc_shutdown = 0;
hc->hc_pevents = 0;
+ hc->hc_version = ver;
r = http_client_send(hc, hc->hc_cmd, u->path, u->query, &h, NULL, 0);
if (r < 0)
}
free(location);
- r = http_client_simple_reconnect(hc, &u);
+ r = http_client_simple_reconnect(hc, &u, hc->hc_redirv);
urlreset(&u);
return r;
port = http_port(hc, scheme, port);
hc->hc_pevents = 0;
hc->hc_version = ver;
+ hc->hc_redirv = ver;
hc->hc_scheme = strdup(scheme);
hc->hc_host = strdup(host);
hc->hc_port = port;
urlinit(&u);
if (!urlparse(url, &u)) {
hc->hc_keepalive = 0;
- r = http_client_simple_reconnect(hc, &u);
+ r = http_client_simple_reconnect(hc, &u, HTTP_VERSION_1_1);
if (r < 0)
tvherror("iptv", "cannot reopen http client: %d'", r);
} else {