pass auth_str to uclient_new()
authorFelix Fietkau <nbd@openwrt.org>
Wed, 26 Mar 2014 19:55:18 +0000 (20:55 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 26 Mar 2014 19:55:18 +0000 (20:55 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-example.c
uclient.c
uclient.h

index 64395fa..2e88b28 100644 (file)
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
 
        uloop_init();
 
 
        uloop_init();
 
-       cl = uclient_new(argv[0], &cb);
+       cl = uclient_new(argv[0], NULL, &cb);
        if (!cl) {
                fprintf(stderr, "Failed to allocate uclient context\n");
                return 1;
        if (!cl) {
                fprintf(stderr, "Failed to allocate uclient context\n");
                return 1;
index b020ad0..2e3d3ae 100644 (file)
--- a/uclient.c
+++ b/uclient.c
@@ -112,12 +112,12 @@ free:
        return NULL;
 }
 
        return NULL;
 }
 
-struct uclient *uclient_new(const char *url_str, const struct uclient_cb *cb)
+struct uclient *uclient_new(const char *url_str, const char *auth_str, const struct uclient_cb *cb)
 {
        struct uclient *cl;
        struct uclient_url *url;
 
 {
        struct uclient *cl;
        struct uclient_url *url;
 
-       url = uclient_get_url(url_str, NULL);
+       url = uclient_get_url(url_str, auth_str);
        if (!url)
                return NULL;
 
        if (!url)
                return NULL;
 
index 961f523..60b021e 100644 (file)
--- a/uclient.h
+++ b/uclient.h
@@ -55,7 +55,7 @@ struct uclient_cb {
        void (*error)(struct uclient *cl, int code);
 };
 
        void (*error)(struct uclient *cl, int code);
 };
 
-struct uclient *uclient_new(const char *url, const struct uclient_cb *cb);
+struct uclient *uclient_new(const char *url, const char *auth_str, const struct uclient_cb *cb);
 void uclient_free(struct uclient *cl);
 
 int uclient_connect_url(struct uclient *cl, const char *url_str);
 void uclient_free(struct uclient *cl);
 
 int uclient_connect_url(struct uclient *cl, const char *url_str);