Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
httpc: add hc_url
  • Loading branch information
perexg committed Nov 19, 2015
1 parent 769f8f5 commit a74e106
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/http.h
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/httpc.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a74e106

Please sign in to comment.