add support for passing in auth to uclient_set_url()
authorFelix Fietkau <nbd@openwrt.org>
Sat, 29 Mar 2014 13:52:12 +0000 (14:52 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 29 Mar 2014 13:52:12 +0000 (14:52 +0100)
uclient.c
uclient.h

index 5b71bf4bb9a3380c4b9403bd02bdb9eea00819c6..2ac052d8bbf5529063b1f3da4da4852d33a56f55 100644 (file)
--- a/uclient.c
+++ b/uclient.c
@@ -132,12 +132,12 @@ struct uclient *uclient_new(const char *url_str, const char *auth_str, const str
        return cl;
 }
 
        return cl;
 }
 
-int uclient_set_url(struct uclient *cl, const char *url_str)
+int uclient_set_url(struct uclient *cl, const char *url_str, const char *auth_str)
 {
        const struct uclient_backend *backend = cl->backend;
        struct uclient_url *url = cl->url;
 
 {
        const struct uclient_backend *backend = cl->backend;
        struct uclient_url *url = cl->url;
 
-       url = uclient_get_url(url_str, NULL);
+       url = uclient_get_url(url_str, auth_str);
        if (!url)
                return -1;
 
        if (!url)
                return -1;
 
index 35204736bd019a9e414769c64169480a3a2943e0..e8214c28008ef7ee3258073dfd94ccfe662baea5 100644 (file)
--- a/uclient.h
+++ b/uclient.h
@@ -58,7 +58,7 @@ struct uclient_cb {
 struct uclient *uclient_new(const char *url, const char *auth_str, const struct uclient_cb *cb);
 void uclient_free(struct uclient *cl);
 
 struct uclient *uclient_new(const char *url, const char *auth_str, const struct uclient_cb *cb);
 void uclient_free(struct uclient *cl);
 
-int uclient_set_url(struct uclient *cl, const char *url_str);
+int uclient_set_url(struct uclient *cl, const char *url, const char *auth);
 int uclient_connect(struct uclient *cl);
 
 int uclient_read(struct uclient *cl, char *buf, int len);
 int uclient_connect(struct uclient *cl);
 
 int uclient_read(struct uclient *cl, char *buf, int len);