mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +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;
|
struct monkey401 *r_next, *r_prev;
|
||||||
uint32_t num;
|
uint32_t num;
|
||||||
lwc_string *host; /* Ignore */
|
lwc_string *host; /* Ignore */
|
||||||
nserror (*cb)(bool,void*);
|
nserror (*cb)(const char *, const char *, void *);
|
||||||
void *pw;
|
void *pw;
|
||||||
} monkey401_t;
|
} monkey401_t;
|
||||||
|
|
||||||
static monkey401_t *m4_ring = NULL;
|
static monkey401_t *m4_ring = NULL;
|
||||||
static uint32_t m4_ctr = 0;
|
static uint32_t m4_ctr = 0;
|
||||||
|
|
||||||
void gui_401login_open(nsurl *url, const char *realm,
|
nserror gui_401login_open(nsurl *url, const char *realm,
|
||||||
nserror (*cb)(bool proceed, void *pw), void *cbpw)
|
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);
|
monkey401_t *m4t = calloc(sizeof(*m4t), 1);
|
||||||
if (m4t == NULL) {
|
if (m4t == NULL) {
|
||||||
cb(false, cbpw);
|
return NSERROR_NOMEM;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
m4t->cb = cb;
|
m4t->cb = cb;
|
||||||
m4t->pw = cbpw;
|
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",
|
fprintf(stdout, "401LOGIN OPEN M4 %u URL %s REALM %s\n",
|
||||||
m4t->num, nsurl_access(url), realm);
|
m4t->num, nsurl_access(url), realm);
|
||||||
|
|
||||||
|
return NSERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,5 +5,9 @@
|
|||||||
#include "utils/errors.h"
|
#include "utils/errors.h"
|
||||||
|
|
||||||
|
|
||||||
void gui_401login_open(nsurl *url, const char *realm,
|
nserror gui_401login_open(nsurl *url, const char *realm,
|
||||||
nserror (*cb)(bool proceed, void *pw), void *cbpw);
|
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