From 8edb43af7dbf0b28892f9d8a8d8ddae523e41b73 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Tue, 25 Feb 2003 21:00:27 +0000 Subject: [project @ 2003-02-25 21:00:27 by bursa] Bug fixes, experimental JPEG support. svn path=/import/netsurf/; revision=100 --- content/fetch.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'content/fetch.c') diff --git a/content/fetch.c b/content/fetch.c index 63283238a..6e6e50ce3 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -1,5 +1,5 @@ /** - * $Id: fetch.c,v 1.1 2003/02/09 12:58:14 bursa Exp $ + * $Id: fetch.c,v 1.2 2003/02/25 21:00:27 bursa Exp $ */ #include @@ -9,11 +9,6 @@ #include "netsurf/utils/utils.h" #include "netsurf/utils/log.h" -#ifndef TEST -#else -#include -#endif - struct fetch { time_t start_time; @@ -94,6 +89,8 @@ struct fetch * fetch_start(char *url, char *referer, /* create the curl easy handle */ fetch->curl_handle = curl_easy_init(); assert(fetch->curl_handle != 0); /* TODO: handle curl errors */ + code = curl_easy_setopt(fetch->curl_handle, CURLOPT_VERBOSE, 1); + assert(code == CURLE_OK); code = curl_easy_setopt(fetch->curl_handle, CURLOPT_URL, fetch->url); assert(code == CURLE_OK); code = curl_easy_setopt(fetch->curl_handle, CURLOPT_PRIVATE, fetch); @@ -211,7 +208,7 @@ size_t fetch_curl_data(void * data, size_t size, size_t nmemb, struct fetch *f) { f->in_callback = 1; - LOG(("fetch %p, size %lu", f, size * nmemb)); + LOG(("fetch %p, size %u", f, size * nmemb)); if (!f->had_headers) { /* find the content type and inform the caller */ @@ -248,6 +245,8 @@ size_t fetch_curl_data(void * data, size_t size, size_t nmemb, struct fetch *f) */ #ifdef TEST +#include + struct test {char *url; struct fetch *f;}; void callback(fetch_msg msg, struct test *t, char *data, unsigned long size) @@ -273,8 +272,11 @@ void callback(fetch_msg msg, struct test *t, char *data, unsigned long size) } struct test test[] = { + {"http://127.0.0.1/", 0}, + {"http://netsurf.strcprstskrzkrk.co.uk/", 0}, {"http://www.oxfordstudent.com/", 0}, {"http://www.google.co.uk/", 0}, + {"http://news.bbc.co.uk/", 0}, {"http://doesnt.exist/", 0}, {"blah://blah", 0}, }; -- cgit v1.2.3