2008-03-05 17:21:29 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Rob Kendrick <rjek@netsurf-browser.org>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf.
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-04-22 00:36:21 +03:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* data scheme handling. See http://tools.ietf.org/html/rfc2397
|
|
|
|
*/
|
2008-03-05 17:21:29 +03:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <string.h>
|
2019-11-12 22:16:07 +03:00
|
|
|
#include <stdarg.h>
|
2016-04-22 00:36:21 +03:00
|
|
|
#include <stdlib.h>
|
2011-09-27 01:07:19 +04:00
|
|
|
#include <libwapcaplet/libwapcaplet.h>
|
2016-11-19 20:11:23 +03:00
|
|
|
#include <nsutils/base64.h>
|
2011-09-27 01:07:19 +04:00
|
|
|
|
2017-01-21 17:20:55 +03:00
|
|
|
#include "netsurf/inttypes.h"
|
2016-07-24 14:23:42 +03:00
|
|
|
#include "utils/url.h"
|
2016-04-22 00:36:21 +03:00
|
|
|
#include "utils/nsurl.h"
|
2014-01-25 00:08:41 +04:00
|
|
|
#include "utils/corestrings.h"
|
2008-03-05 17:21:29 +03:00
|
|
|
#include "utils/log.h"
|
|
|
|
#include "utils/utils.h"
|
|
|
|
#include "utils/ring.h"
|
|
|
|
|
2016-04-22 00:36:21 +03:00
|
|
|
#include "content/fetch.h"
|
|
|
|
#include "content/fetchers.h"
|
|
|
|
#include "content/fetchers/data.h"
|
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
struct fetch_data_context {
|
|
|
|
struct fetch *parent_fetch;
|
2019-05-05 22:36:19 +03:00
|
|
|
nsurl *url;
|
2008-03-05 17:21:29 +03:00
|
|
|
char *mimetype;
|
|
|
|
char *data;
|
|
|
|
size_t datalen;
|
|
|
|
bool base64;
|
2008-03-06 14:28:00 +03:00
|
|
|
|
|
|
|
bool aborted;
|
|
|
|
bool locked;
|
2008-03-05 17:21:29 +03:00
|
|
|
|
|
|
|
struct fetch_data_context *r_next, *r_prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct fetch_data_context *ring = NULL;
|
|
|
|
|
2011-09-27 01:07:19 +04:00
|
|
|
static bool fetch_data_initialise(lwc_string *scheme)
|
2008-03-05 17:21:29 +03:00
|
|
|
{
|
Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done
@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 20:28:12 +03:00
|
|
|
NSLOG(netsurf, INFO, "fetch_data_initialise called for %s",
|
|
|
|
lwc_string_data(scheme));
|
2016-07-24 14:23:42 +03:00
|
|
|
|
|
|
|
return true;
|
2008-03-05 17:21:29 +03:00
|
|
|
}
|
|
|
|
|
2011-09-27 01:07:19 +04:00
|
|
|
static void fetch_data_finalise(lwc_string *scheme)
|
2008-03-05 17:21:29 +03:00
|
|
|
{
|
Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done
@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 20:28:12 +03:00
|
|
|
NSLOG(netsurf, INFO, "fetch_data_finalise called for %s",
|
|
|
|
lwc_string_data(scheme));
|
2008-03-05 17:21:29 +03:00
|
|
|
}
|
|
|
|
|
2011-11-27 18:14:36 +04:00
|
|
|
static bool fetch_data_can_fetch(const nsurl *url)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-11-10 14:58:38 +03:00
|
|
|
static void fetch_data_send_callback(const fetch_msg *msg,
|
|
|
|
struct fetch_data_context *c)
|
|
|
|
{
|
|
|
|
c->locked = true;
|
|
|
|
fetch_send_callback(msg, c->parent_fetch);
|
|
|
|
c->locked = false;
|
|
|
|
}
|
|
|
|
|
2019-11-10 15:19:02 +03:00
|
|
|
static void fetch_data_send_header(struct fetch_data_context *ctx,
|
|
|
|
const char *fmt, ...)
|
|
|
|
{
|
|
|
|
char header[64];
|
2019-11-12 00:27:06 +03:00
|
|
|
fetch_msg msg;
|
2019-11-10 15:19:02 +03:00
|
|
|
va_list ap;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
va_start(ap, fmt);
|
|
|
|
len = vsnprintf(header, sizeof(header), fmt, ap);
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
if (len >= (int)sizeof(header) || len < 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-11-12 00:27:06 +03:00
|
|
|
msg.type = FETCH_HEADER;
|
2019-11-10 15:19:02 +03:00
|
|
|
msg.data.header_or_data.len = len;
|
2019-11-12 00:27:06 +03:00
|
|
|
msg.data.header_or_data.buf = (const uint8_t *)header;
|
2019-11-10 15:19:02 +03:00
|
|
|
fetch_data_send_callback(&msg, ctx);
|
|
|
|
}
|
|
|
|
|
2011-09-29 19:31:54 +04:00
|
|
|
static void *fetch_data_setup(struct fetch *parent_fetch, nsurl *url,
|
2013-01-05 03:13:23 +04:00
|
|
|
bool only_2xx, bool downgrade_tls, const char *post_urlenc,
|
2010-04-10 21:13:53 +04:00
|
|
|
const struct fetch_multipart_data *post_multipart,
|
2008-03-05 17:21:29 +03:00
|
|
|
const char **headers)
|
|
|
|
{
|
|
|
|
struct fetch_data_context *ctx = calloc(1, sizeof(*ctx));
|
|
|
|
|
2008-03-05 18:01:42 +03:00
|
|
|
if (ctx == NULL)
|
|
|
|
return NULL;
|
2008-03-06 14:28:00 +03:00
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
ctx->parent_fetch = parent_fetch;
|
2019-05-05 22:36:19 +03:00
|
|
|
ctx->url = nsurl_ref(url);
|
2008-03-06 14:28:00 +03:00
|
|
|
|
|
|
|
RING_INSERT(ring, ctx);
|
2008-03-06 01:57:46 +03:00
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
return ctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool fetch_data_start(void *ctx)
|
2008-03-06 01:57:46 +03:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void fetch_data_free(void *ctx)
|
|
|
|
{
|
|
|
|
struct fetch_data_context *c = ctx;
|
|
|
|
|
2019-05-05 22:36:19 +03:00
|
|
|
nsurl_unref(c->url);
|
2008-03-06 01:57:46 +03:00
|
|
|
free(c->data);
|
|
|
|
free(c->mimetype);
|
|
|
|
RING_REMOVE(ring, c);
|
|
|
|
free(ctx);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void fetch_data_abort(void *ctx)
|
2008-03-05 17:21:29 +03:00
|
|
|
{
|
|
|
|
struct fetch_data_context *c = ctx;
|
2008-03-06 14:28:00 +03:00
|
|
|
|
|
|
|
/* To avoid the poll loop having to deal with the fetch context
|
|
|
|
* disappearing from under it, we simply flag the abort here.
|
|
|
|
* The poll loop itself will perform the appropriate cleanup.
|
|
|
|
*/
|
|
|
|
c->aborted = true;
|
|
|
|
}
|
|
|
|
|
2008-03-06 01:57:46 +03:00
|
|
|
static bool fetch_data_process(struct fetch_data_context *c)
|
|
|
|
{
|
2016-07-24 14:23:42 +03:00
|
|
|
nserror res;
|
2011-11-09 01:51:42 +04:00
|
|
|
fetch_msg msg;
|
2019-05-05 22:11:21 +03:00
|
|
|
const char *params;
|
|
|
|
const char *comma;
|
2008-03-06 01:57:46 +03:00
|
|
|
char *unescaped;
|
2016-07-24 15:59:30 +03:00
|
|
|
size_t unescaped_len;
|
2008-03-05 17:21:29 +03:00
|
|
|
|
|
|
|
/* format of a data: URL is:
|
|
|
|
* data:[<mimetype>][;base64],<data>
|
|
|
|
* The mimetype is optional. If it is missing, the , before the
|
|
|
|
* data must still be there.
|
|
|
|
*/
|
|
|
|
|
2019-05-05 22:39:26 +03:00
|
|
|
NSLOG(netsurf, DEEPDEBUG, "url: %.140s", nsurl_access(c->url));
|
2008-03-06 02:09:36 +03:00
|
|
|
|
2019-05-05 22:36:19 +03:00
|
|
|
if (nsurl_length(c->url) < 6) {
|
2008-03-06 02:09:36 +03:00
|
|
|
/* 6 is the minimum possible length (data:,) */
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_ERROR;
|
|
|
|
msg.data.error = "Malformed data: URL";
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-06 02:09:36 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
/* skip the data: part */
|
2019-05-05 22:36:19 +03:00
|
|
|
params = nsurl_access(c->url) + SLEN("data:");
|
2008-03-05 17:21:29 +03:00
|
|
|
|
|
|
|
/* find the comma */
|
|
|
|
if ( (comma = strchr(params, ',')) == NULL) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_ERROR;
|
|
|
|
msg.data.error = "Malformed data: URL";
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-05 17:21:29 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (params[0] == ',') {
|
|
|
|
/* there is no mimetype here, assume text/plain */
|
|
|
|
c->mimetype = strdup("text/plain;charset=US-ASCII");
|
|
|
|
} else {
|
|
|
|
/* make a copy of everything between data: and the comma */
|
|
|
|
c->mimetype = strndup(params, comma - params);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c->mimetype == NULL) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_ERROR;
|
|
|
|
msg.data.error =
|
|
|
|
"Unable to allocate memory for mimetype in data: URL";
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-05 17:21:29 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(c->mimetype + strlen(c->mimetype) - 7, ";base64") == 0) {
|
|
|
|
c->base64 = true;
|
|
|
|
c->mimetype[strlen(c->mimetype) - 7] = '\0';
|
|
|
|
} else {
|
|
|
|
c->base64 = false;
|
|
|
|
}
|
|
|
|
|
2014-11-17 19:05:17 +03:00
|
|
|
/* URL unescape the data first, just incase some insane page
|
2008-03-06 01:57:46 +03:00
|
|
|
* decides to nest URL and base64 encoding. Like, say, Acid2.
|
|
|
|
*/
|
2016-07-24 15:59:30 +03:00
|
|
|
res = url_unescape(comma + 1, 0, &unescaped_len, &unescaped);
|
2016-07-24 14:23:42 +03:00
|
|
|
if (res != NSERROR_OK) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_ERROR;
|
|
|
|
msg.data.error = "Unable to URL decode data: URL";
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-06 01:57:46 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
if (c->base64) {
|
2016-11-19 17:40:10 +03:00
|
|
|
if ((nsu_base64_decode_alloc((uint8_t *)unescaped,
|
|
|
|
unescaped_len,
|
|
|
|
(uint8_t **)&c->data,
|
|
|
|
&c->datalen) != NSUERROR_OK) ||
|
|
|
|
(c->data == NULL)) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_ERROR;
|
|
|
|
msg.data.error = "Unable to Base64 decode data: URL";
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2016-07-24 14:23:42 +03:00
|
|
|
free(unescaped);
|
2008-03-05 17:21:29 +03:00
|
|
|
return false;
|
|
|
|
}
|
2019-05-05 22:23:25 +03:00
|
|
|
free(unescaped);
|
2008-03-05 17:21:29 +03:00
|
|
|
} else {
|
2014-11-17 19:05:17 +03:00
|
|
|
c->datalen = unescaped_len;
|
2019-05-05 22:23:25 +03:00
|
|
|
c->data = unescaped;
|
2008-03-05 17:21:29 +03:00
|
|
|
}
|
|
|
|
|
2008-03-06 01:57:46 +03:00
|
|
|
|
2008-03-05 17:21:29 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-09-27 01:07:19 +04:00
|
|
|
static void fetch_data_poll(lwc_string *scheme)
|
2008-03-05 17:21:29 +03:00
|
|
|
{
|
2011-11-09 01:51:42 +04:00
|
|
|
fetch_msg msg;
|
2008-03-06 14:28:00 +03:00
|
|
|
struct fetch_data_context *c, *next;
|
2008-03-05 17:21:29 +03:00
|
|
|
|
2008-03-06 01:57:46 +03:00
|
|
|
if (ring == NULL) return;
|
2008-03-05 17:21:29 +03:00
|
|
|
|
2008-03-06 14:28:00 +03:00
|
|
|
/* Iterate over ring, processing each pending fetch */
|
|
|
|
c = ring;
|
|
|
|
do {
|
|
|
|
/* Ignore fetches that have been flagged as locked.
|
|
|
|
* This allows safe re-entrant calls to this function.
|
|
|
|
* Re-entrancy can occur if, as a result of a callback,
|
|
|
|
* the interested party causes fetch_poll() to be called
|
|
|
|
* again.
|
|
|
|
*/
|
|
|
|
if (c->locked == true) {
|
2011-02-24 01:41:17 +03:00
|
|
|
next = c->r_next;
|
2008-03-06 14:28:00 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only process non-aborted fetches */
|
2011-02-24 01:41:17 +03:00
|
|
|
if (c->aborted == false && fetch_data_process(c) == true) {
|
2008-03-06 14:28:00 +03:00
|
|
|
fetch_set_http_code(c->parent_fetch, 200);
|
Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done
@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
2017-09-06 20:28:12 +03:00
|
|
|
NSLOG(netsurf, INFO,
|
|
|
|
"setting data: MIME type to %s, length to %"PRIsizet,
|
|
|
|
c->mimetype,
|
|
|
|
c->datalen);
|
2008-03-06 14:28:00 +03:00
|
|
|
/* Any callback can result in the fetch being aborted.
|
|
|
|
* Therefore, we _must_ check for this after _every_
|
|
|
|
* call to fetch_data_send_callback().
|
|
|
|
*/
|
2019-11-10 15:19:02 +03:00
|
|
|
fetch_data_send_header(c, "Content-Type: %s",
|
2010-03-28 16:56:39 +04:00
|
|
|
c->mimetype);
|
|
|
|
|
2011-02-24 01:41:17 +03:00
|
|
|
if (c->aborted == false) {
|
2019-11-10 15:19:02 +03:00
|
|
|
fetch_data_send_header(c, "Content-Length: %"
|
|
|
|
PRIsizet, c->datalen);
|
2011-02-24 01:41:17 +03:00
|
|
|
}
|
2010-03-28 16:56:39 +04:00
|
|
|
|
2019-11-10 15:39:43 +03:00
|
|
|
if (c->aborted == false) {
|
|
|
|
/* Set max-age to 1 year. */
|
|
|
|
fetch_data_send_header(c, "Cache-Control: "
|
|
|
|
"max-age=31536000");
|
|
|
|
}
|
|
|
|
|
2011-02-24 01:41:17 +03:00
|
|
|
if (c->aborted == false) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_DATA;
|
|
|
|
msg.data.header_or_data.buf =
|
|
|
|
(const uint8_t *) c->data;
|
|
|
|
msg.data.header_or_data.len = c->datalen;
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-06 14:28:00 +03:00
|
|
|
}
|
2011-02-24 01:41:17 +03:00
|
|
|
|
|
|
|
if (c->aborted == false) {
|
2011-11-09 01:51:42 +04:00
|
|
|
msg.type = FETCH_FINISHED;
|
|
|
|
fetch_data_send_callback(&msg, c);
|
2008-03-06 01:57:46 +03:00
|
|
|
}
|
|
|
|
} else {
|
2019-05-05 22:36:19 +03:00
|
|
|
NSLOG(netsurf, INFO, "Processing of %.140s failed!",
|
|
|
|
nsurl_access(c->url));
|
2008-03-06 14:28:00 +03:00
|
|
|
|
|
|
|
/* Ensure that we're unlocked here. If we aren't,
|
|
|
|
* then fetch_data_process() is broken.
|
|
|
|
*/
|
|
|
|
assert(c->locked == false);
|
2008-03-06 01:57:46 +03:00
|
|
|
}
|
2008-03-06 14:28:00 +03:00
|
|
|
|
2011-02-24 01:41:17 +03:00
|
|
|
/* Compute next fetch item at the last possible moment as
|
|
|
|
* processing this item may have added to the ring.
|
|
|
|
*/
|
|
|
|
next = c->r_next;
|
|
|
|
|
2008-03-06 14:28:00 +03:00
|
|
|
fetch_remove_from_queues(c->parent_fetch);
|
|
|
|
fetch_free(c->parent_fetch);
|
|
|
|
|
|
|
|
/* Advance to next ring entry, exiting if we've reached
|
|
|
|
* the start of the ring or the ring has become empty
|
|
|
|
*/
|
|
|
|
} while ( (c = next) != ring && ring != NULL);
|
2008-03-05 17:21:29 +03:00
|
|
|
}
|
|
|
|
|
2014-06-19 21:27:24 +04:00
|
|
|
nserror fetch_data_register(void)
|
2008-03-05 17:21:29 +03:00
|
|
|
{
|
2014-01-25 00:08:41 +04:00
|
|
|
lwc_string *scheme = lwc_string_ref(corestring_lwc_data);
|
2014-06-19 21:27:24 +04:00
|
|
|
const struct fetcher_operation_table fetcher_ops = {
|
|
|
|
.initialise = fetch_data_initialise,
|
|
|
|
.acceptable = fetch_data_can_fetch,
|
|
|
|
.setup = fetch_data_setup,
|
|
|
|
.start = fetch_data_start,
|
|
|
|
.abort = fetch_data_abort,
|
|
|
|
.free = fetch_data_free,
|
|
|
|
.poll = fetch_data_poll,
|
|
|
|
.finalise = fetch_data_finalise
|
|
|
|
};
|
|
|
|
|
|
|
|
return fetcher_add(scheme, &fetcher_ops);
|
2008-03-05 17:21:29 +03:00
|
|
|
}
|