diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-08-06 11:25:11 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2019-08-06 11:26:47 +0100 |
commit | 8469f4cc8e62e80a3165a1d4f13b62b5b4a04720 (patch) | |
tree | 707b46c3cf0b373b53adf8c54d290e4c546ebb2c /content/fetch.c | |
parent | 9c9c26a308995c22210c90e3772e86f49a1948b9 (diff) | |
download | netsurf-8469f4cc8e62e80a3165a1d4f13b62b5b4a04720.tar.gz netsurf-8469f4cc8e62e80a3165a1d4f13b62b5b4a04720.tar.bz2 |
Reimplement handling of BAD_AUTH inside browser_window
We now handle authentication requests via an `about:` page
which presents a nice form built into the browser window.
In order to do this, we add internal navigation as a concept
to the browser window and we strip the 401login support from all
frontends except monkey.
The 401login callback is now intended for password safe type support
rather than an immediately interactive prompt.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/fetch.c')
-rw-r--r-- | content/fetch.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/content/fetch.c b/content/fetch.c index 766502941..2ac86a812 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -712,6 +712,23 @@ fetch_multipart_data_clone(const struct fetch_multipart_data *list) return result; } + +/* exported interface documented in content/fetch.h */ +const char * +fetch_multipart_data_find(const struct fetch_multipart_data *list, + const char *name) +{ + while (list != NULL) { + if (strcmp(list->name, name) == 0) { + return list->value; + } + list = list->next; + } + + return NULL; +} + + /* exported interface documented in content/fetch.h */ void fetch_multipart_data_destroy(struct fetch_multipart_data *list) { @@ -730,6 +747,43 @@ void fetch_multipart_data_destroy(struct fetch_multipart_data *list) } } + +/* exported interface documented in content/fetch.h */ +nserror +fetch_multipart_data_new_kv(struct fetch_multipart_data **list, + const char *name, + const char *value) +{ + struct fetch_multipart_data *newdata; + + assert(list); + + newdata = calloc(sizeof(*newdata), 1); + + if (newdata == NULL) { + return NSERROR_NOMEM; + } + + newdata->name = strdup(name); + if (newdata->name == NULL) { + free(newdata); + return NSERROR_NOMEM; + } + + newdata->value = strdup(value); + if (newdata->value == NULL) { + free(newdata->name); + free(newdata); + return NSERROR_NOMEM; + } + + newdata->next = *list; + *list = newdata; + + return NSERROR_OK; +} + + /* exported interface documented in content/fetch.h */ void fetch_send_callback(const fetch_msg *msg, struct fetch *fetch) |