mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
Monkey: Update for new HTTP auth API.
This commit is contained in:
parent
e41e558c5f
commit
97810d0c1a
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user