diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-03-21 21:43:02 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-03-21 21:43:02 +0100 |
commit | 05df41f861b3b492221489423bc80360a21582da (patch) | |
tree | 6c804c0f23eee945719f27d22591e88e62439ca6 /uclient.c | |
parent | 66b4e5035104658ad54ef48a4d04e61cba8d4e01 (diff) | |
download | uclient-05df41f861b3b492221489423bc80360a21582da.tar.gz |
add support for reusing connections
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient.c')
-rw-r--r-- | uclient.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -106,6 +106,7 @@ struct uclient *uclient_new(const char *url_str, const struct uclient_cb *cb) int uclient_connect_url(struct uclient *cl, const char *url_str) { struct uclient_url *url = cl->url; + const struct uclient_backend *backend = cl->backend; if (url_str) { url = uclient_get_url(url_str); @@ -117,9 +118,12 @@ int uclient_connect_url(struct uclient *cl, const char *url_str) free(cl->url); cl->url = url; + + if (backend->update_url) + backend->update_url(cl); } - return cl->backend->connect(cl); + return backend->connect(cl); } void uclient_free(struct uclient *cl) |