summaryrefslogtreecommitdiff
path: root/uclient.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-03-21 21:43:02 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-21 21:43:02 +0100
commit05df41f861b3b492221489423bc80360a21582da (patch)
tree6c804c0f23eee945719f27d22591e88e62439ca6 /uclient.c
parent66b4e5035104658ad54ef48a4d04e61cba8d4e01 (diff)
downloaduclient-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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/uclient.c b/uclient.c
index a5c416e..5f27ec9 100644
--- a/uclient.c
+++ b/uclient.c
@@ -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)