From: Jaroslav Kysela Date: Thu, 19 Nov 2015 14:35:06 +0000 (+0100) Subject: httpc: add hc_url X-Git-Tag: v4.2.1~1514 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a74e10698383676d9092aabe2c66594f5c8b9a5b;p=thirdparty%2Ftvheadend.git httpc: add hc_url --- diff --git a/src/http.h b/src/http.h index e66263e2c..7e17dc195 100644 --- a/src/http.h +++ b/src/http.h @@ -284,6 +284,8 @@ struct http_client { struct http_arg_list hc_args; /* header */ + char *hc_url; + void *hc_aux; size_t hc_data_limit; size_t hc_io_size; diff --git a/src/httpc.c b/src/httpc.c index 5be4484b6..ed1eabec9 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -1247,6 +1247,8 @@ http_client_simple_reconnect ( http_client_t *hc, const url_t *u, return r; hc->hc_reconnected = 1; + free(hc->hc_url); + hc->hc_url = u->raw ? strdup(u->raw) : NULL; return HTTP_CON_RECEIVING; } @@ -1278,6 +1280,8 @@ http_client_redirected ( http_client_t *hc ) free(location); return -EIO; } + free(hc->hc_url); + hc->hc_url = u.raw ? strdup(u.raw) : NULL; free(location); r = http_client_simple_reconnect(hc, &u, hc->hc_redirv); @@ -1292,6 +1296,8 @@ http_client_simple( http_client_t *hc, const url_t *url ) http_arg_list_t h; hc->hc_hdr_create(hc, &h, url, 0); + free(hc->hc_url); + hc->hc_url = url->raw ? strdup(url->raw) : NULL; return http_client_send(hc, HTTP_CMD_GET, url->path, url->query, &h, NULL, 0); } @@ -1535,6 +1541,7 @@ http_client_close ( http_client_t *hc ) http_client_cmd_destroy(hc, wcmd); http_client_ssl_free(hc); rtsp_clear_session(hc); + free(hc->hc_url); free(hc->hc_location); free(hc->hc_rbuf); free(hc->hc_data);