From 97810d0c1aeab995d0b27c976c8d3e9e1a0c8b3f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 13 Aug 2018 17:52:44 +0100 Subject: Monkey: Update for new HTTP auth API. --- frontends/monkey/401login.c | 15 ++++++++++----- frontends/monkey/401login.h | 8 ++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/frontends/monkey/401login.c b/frontends/monkey/401login.c index 090f18984..58335dd7b 100644 --- a/frontends/monkey/401login.c +++ b/frontends/monkey/401login.c @@ -27,20 +27,23 @@ typedef struct monkey401 { struct monkey401 *r_next, *r_prev; uint32_t num; lwc_string *host; /* Ignore */ - nserror (*cb)(bool,void*); + nserror (*cb)(const char *, const char *, void *); void *pw; } monkey401_t; static monkey401_t *m4_ring = NULL; static uint32_t m4_ctr = 0; -void gui_401login_open(nsurl *url, const char *realm, - nserror (*cb)(bool proceed, void *pw), void *cbpw) +nserror gui_401login_open(nsurl *url, const char *realm, + const char *username, const char *password, + nserror (*cb)(const char *username, + const char *password, + void *pw), + void *cbpw) { monkey401_t *m4t = calloc(sizeof(*m4t), 1); if (m4t == NULL) { - cb(false, cbpw); - return; + return NSERROR_NOMEM; } m4t->cb = cb; m4t->pw = cbpw; @@ -50,6 +53,8 @@ void gui_401login_open(nsurl *url, const char *realm, fprintf(stdout, "401LOGIN OPEN M4 %u URL %s REALM %s\n", m4t->num, nsurl_access(url), realm); + + return NSERROR_OK; } diff --git a/frontends/monkey/401login.h b/frontends/monkey/401login.h index e78355ea2..93606e5b9 100644 --- a/frontends/monkey/401login.h +++ b/frontends/monkey/401login.h @@ -5,5 +5,9 @@ #include "utils/errors.h" -void gui_401login_open(nsurl *url, const char *realm, - nserror (*cb)(bool proceed, void *pw), void *cbpw); +nserror gui_401login_open(nsurl *url, const char *realm, + const char *username, const char *password, + nserror (*cb)(const char *username, + const char *password, + void *pw), + void *cbpw); -- cgit v1.2.3