Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/9f915f96616f48e243f5bc7238b18b6ec16f1c05
...commit
http://git.netsurf-browser.org/netsurf.git/commit/9f915f96616f48e243f5bc7238b18b6ec16f1c05
...tree
http://git.netsurf-browser.org/netsurf.git/tree/9f915f96616f48e243f5bc7238b18b6ec16f1c05
The branch, ashmew2/netsurf-kolibrios has been updated
via 9f915f96616f48e243f5bc7238b18b6ec16f1c05 (commit)
via bcd697423da1237126af9a3ec7704e62a27225ff (commit)
from 1b6e9af35e924c67467d30dd67662642186fd6af (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=9f915f96616f48e243f5bc7238b18b6ec16f1c05
commit 9f915f96616f48e243f5bc7238b18b6ec16f1c05
Author: Ashish Gupta <[email protected]>
Commit: Ashish Gupta <[email protected]>
Tidy up some things.
diff --git a/Makefile b/Makefile
index 0b3385d..a426fdc 100644
--- a/Makefile
+++ b/Makefile
@@ -712,7 +712,7 @@ OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst
/,_,$(patsubst %.c,%.o,$(patsu
IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
ifeq ($(TARGET),kolibrios)
- KOLOBJECTS = $(HOME)/kolibrios/programs/fs/unzip60/kolibri/dirent.o
$(HOME)/NETSURFLIBS/netsurf/font_internal.o
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/http.obj
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/loadhttp.obj
$(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o
+ KOLOBJECTS = $(HOME)/kolibrios/programs/fs/unzip60/kolibri/dirent.o
$(HOME)/NETSURFLIBS/netsurf/font_internal.o
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/loadhttp.obj
$(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o
endif
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
diff --git a/content/fetchers/httplib_kolibri.c
b/content/fetchers/httplib_kolibri.c
index 0f9bcb7..6800cab 100644
--- a/content/fetchers/httplib_kolibri.c
+++ b/content/fetchers/httplib_kolibri.c
@@ -85,16 +85,16 @@ void remove_from_poll(struct http_msg *donehttp) {
bool init_fetcher(lwc_string *scheme) {
bool supported_scheme;
assert(lwc_string_isequal(scheme, corestring_lwc_http, &supported_scheme) ==
lwc_error_ok);
- kolibri_http_init();
- /* if(supported_scheme) { */
- /* if(kolibri_http_init() == 0) */
- /* debug_board_printf("[INFO] Loaded http.obj library successfully.\n");
*/
- /* else { */
- /* debug_board_printf("[ERROR] Could not load http.obj library.\n"); */
- /* return false; */
- /* } */
- /* } */
+ LOG("Initializing http library!");
+ debug_board_printf("fetcher_init: Initializing http library!\n");
+ if(kolibri_http_init() == 0)
+ LOG("[INFO] Loaded http.obj library successfully.\n");
+ else {
+ LOG("[ERROR] Could not load http.obj library.\n");
+ assert(0 && 1);
+ return false;
+ }
return supported_scheme;
}
@@ -138,14 +138,17 @@ void *setup_fetch(struct fetch *parent_fetch, struct
nsurl *url,
request = http_get_asm(nsurl_access(url), NULL, 0, *headers);
}
- LOG("Address of request : 0x%x", request);
- assert(request != NULL);
-
if(request == NULL) {
- LOG("[ERROR] Cannot allocate more memory for http library handle
creation.");
+ LOG("Failed to allocate http buffer. Could be multiple reasons for failure
(like DNS resolution)", request);
return NULL;
}
+ /* This assert is tricky beacause the http library may fail when it fails to
resolve the hostname.
+ There is no sane way to understand that the hostname is wrong or needs to
be fixed.
+ assert leads to a crash for no reason. Disabling it, and the code should
handle this from now.
+ Returning NuLL from here should just force a BadURL to the user.
+ */
+
struct httpfetcher *newfetcher = (struct httpfetcher *) malloc(sizeof(struct
httpfetcher));
assert(newfetcher);
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index d12bdfc..ebd3a3d 100644
--- a/frontends/kolibrios/fb/gui.c
+++ b/frontends/kolibrios/fb/gui.c
@@ -30,6 +30,8 @@
#include <libnsfb_plot.h>
#include <libnsfb_event.h>
+#include <kos32sys.h>
+
#include "utils/utils.h"
#include "utils/nsoption.h"
#include "utils/filepath.h"
@@ -491,7 +493,7 @@ process_cmdline(int argc, char** argv)
}
/* Remove me! */
- feurl = "http://www.kolibrios.org";
+ feurl = "http://board.kolibrios.org";
/* NS on KolibriOS does not support option parsing (yet) */
@@ -2124,6 +2126,10 @@ int main(int argc, char** argv)
.layout = framebuffer_layout_table,
};
+ /* Initialize heap so that we can do memory allocations */
+ unsigned int heapsize = heap_init();
+ debug_board_printf("[SYSTEM] Initialized heap (Size = %u bytes)\n",
heapsize);
+ assert(heapsize != 0);
/* fix args */
#define MKARGV(i,opt) argv[i] = (char *) malloc(strlen(opt) + 1);
strcpy(argv[i], opt);
diff --git a/frontends/kolibrios/loadhttp.asm b/frontends/kolibrios/loadhttp.asm
index 859f56d..3aa7b27 100644
--- a/frontends/kolibrios/loadhttp.asm
+++ b/frontends/kolibrios/loadhttp.asm
@@ -21,27 +21,24 @@ public init_network as '_init_network_asm'
;;; Returns 0 on success. -1 on failure.
proc init_network
-
- mcall 68,11
-
stdcall dll.Load, @IMPORT
- test eax, eax
- jnz error
+ test eax, eax
+ jnz error
mov eax, 0
ret
-
-error:
+
+error:
mov eax, -1
ret
-endp
-
+endp
+
@IMPORT:
library lib_http, 'http.obj'
import lib_http, \
- HTTP_get , 'get' , \
+ HTTP_get , 'get' , \
HTTP_head , 'head' , \
HTTP_post , 'post' , \
HTTP_find_header_field , 'find_header_field' , \
@@ -51,7 +48,7 @@ import lib_http, \
HTTP_free , 'free' , \
HTTP_escape , 'escape' , \
HTTP_unescape , 'unescape'
-
+
public HTTP_get as '_http_get_asm'
public HTTP_head as '_http_head_asm'
public HTTP_post as '_http_post_asm'
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=bcd697423da1237126af9a3ec7704e62a27225ff
commit bcd697423da1237126af9a3ec7704e62a27225ff
Author: Ashish Gupta <[email protected]>
Commit: Ashish Gupta <[email protected]>
Fix description for FETCH_HEADER
Remove redundant FETCH_XXX description from the curl fetcher.
diff --git a/content/fetch.h b/content/fetch.h
index 5521778..79fb0ed 100644
--- a/content/fetch.h
+++ b/content/fetch.h
@@ -103,14 +103,14 @@ typedef void (*fetch_callback)(const fetch_msg *msg, void
*p);
* The function returns immediately. The fetch may be queued for later
* processing.
*
- * A pointer to an opaque struct fetch is returned, which can be passed to
+ * A pointer to an opaque struct fetch_info is returned, which can be passed to
* fetch_abort() to abort the fetch at any time. Returns NULL if memory is
* exhausted (or some other fatal error occurred).
*
* The caller must supply a callback function which is called when anything
- * interesting happens. The callback function is first called with msg
- * FETCH_HEADER, with the header in data, then one or more times
- * with FETCH_DATA with some data for the url, and finally with
+ * interesting happens. The callback function is first called one or more times
+ * with msg.type FETCH_HEADER for each line of the header in data, then one or
+ * more times with FETCH_DATA with some data for the url, and finally with
* FETCH_FINISHED. Alternatively, FETCH_ERROR indicates an error occurred:
* data contains an error message. FETCH_REDIRECT may replace the FETCH_HEADER,
* FETCH_DATA, FETCH_FINISHED sequence if the server sends a replacement URL.
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 7d0e40c..4b5745c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -283,24 +283,8 @@ fetch_curl_post_convert(const struct fetch_multipart_data
*control)
/**
* Start fetching data for the given URL.
- *
- * The function returns immediately. The fetch may be queued for later
- * processing.
- *
- * A pointer to an opaque struct curl_fetch_info is returned, which can be
- * passed to fetch_abort() to abort the fetch at any time. Returns 0 if memory
- * is exhausted (or some other fatal error occurred).
- *
- * The caller must supply a callback function which is called when anything
- * interesting happens. The callback function is first called with msg
- * FETCH_HEADER, with the header in data, then one or more times
- * with FETCH_DATA with some data for the url, and finally with
- * FETCH_FINISHED. Alternatively, FETCH_ERROR indicates an error occurred:
- * data contains an error message. FETCH_REDIRECT may replace the FETCH_HEADER,
- * FETCH_DATA, FETCH_FINISHED sequence if the server sends a replacement URL.
- *
- * Some private data can be passed as the last parameter to fetch_start, and
- * callbacks will contain this.
+ * Returns a pointer to struct curl_fetch_info.
+ * See content/fetch.h for more information.
*/
static void *
fetch_curl_setup(struct fetch *parent_fetch,
-----------------------------------------------------------------------
Summary of changes:
Makefile | 2 +-
content/fetch.h | 8 ++++----
content/fetchers/curl.c | 20 ++------------------
content/fetchers/httplib_kolibri.c | 29 ++++++++++++++++-------------
frontends/kolibrios/fb/gui.c | 8 +++++++-
frontends/kolibrios/loadhttp.asm | 19 ++++++++-----------
6 files changed, 38 insertions(+), 48 deletions(-)
diff --git a/Makefile b/Makefile
index 0b3385d..a426fdc 100644
--- a/Makefile
+++ b/Makefile
@@ -712,7 +712,7 @@ OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst
/,_,$(patsubst %.c,%.o,$(patsu
IFLAGS = $(addprefix -I,$(INCLUDE_DIRS))
ifeq ($(TARGET),kolibrios)
- KOLOBJECTS = $(HOME)/kolibrios/programs/fs/unzip60/kolibri/dirent.o
$(HOME)/NETSURFLIBS/netsurf/font_internal.o
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/http.obj
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/loadhttp.obj
$(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o
+ KOLOBJECTS = $(HOME)/kolibrios/programs/fs/unzip60/kolibri/dirent.o
$(HOME)/NETSURFLIBS/netsurf/font_internal.o
$(HOME)/NETSURFLIBS/netsurf/frontends/kolibrios/asmobj/loadhttp.obj
$(HOME)/kolibrios/programs/develop/libraries/iconv/iconv.o
endif
$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES)
diff --git a/content/fetch.h b/content/fetch.h
index 5521778..79fb0ed 100644
--- a/content/fetch.h
+++ b/content/fetch.h
@@ -103,14 +103,14 @@ typedef void (*fetch_callback)(const fetch_msg *msg, void
*p);
* The function returns immediately. The fetch may be queued for later
* processing.
*
- * A pointer to an opaque struct fetch is returned, which can be passed to
+ * A pointer to an opaque struct fetch_info is returned, which can be passed to
* fetch_abort() to abort the fetch at any time. Returns NULL if memory is
* exhausted (or some other fatal error occurred).
*
* The caller must supply a callback function which is called when anything
- * interesting happens. The callback function is first called with msg
- * FETCH_HEADER, with the header in data, then one or more times
- * with FETCH_DATA with some data for the url, and finally with
+ * interesting happens. The callback function is first called one or more times
+ * with msg.type FETCH_HEADER for each line of the header in data, then one or
+ * more times with FETCH_DATA with some data for the url, and finally with
* FETCH_FINISHED. Alternatively, FETCH_ERROR indicates an error occurred:
* data contains an error message. FETCH_REDIRECT may replace the FETCH_HEADER,
* FETCH_DATA, FETCH_FINISHED sequence if the server sends a replacement URL.
diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 7d0e40c..4b5745c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -283,24 +283,8 @@ fetch_curl_post_convert(const struct fetch_multipart_data
*control)
/**
* Start fetching data for the given URL.
- *
- * The function returns immediately. The fetch may be queued for later
- * processing.
- *
- * A pointer to an opaque struct curl_fetch_info is returned, which can be
- * passed to fetch_abort() to abort the fetch at any time. Returns 0 if memory
- * is exhausted (or some other fatal error occurred).
- *
- * The caller must supply a callback function which is called when anything
- * interesting happens. The callback function is first called with msg
- * FETCH_HEADER, with the header in data, then one or more times
- * with FETCH_DATA with some data for the url, and finally with
- * FETCH_FINISHED. Alternatively, FETCH_ERROR indicates an error occurred:
- * data contains an error message. FETCH_REDIRECT may replace the FETCH_HEADER,
- * FETCH_DATA, FETCH_FINISHED sequence if the server sends a replacement URL.
- *
- * Some private data can be passed as the last parameter to fetch_start, and
- * callbacks will contain this.
+ * Returns a pointer to struct curl_fetch_info.
+ * See content/fetch.h for more information.
*/
static void *
fetch_curl_setup(struct fetch *parent_fetch,
diff --git a/content/fetchers/httplib_kolibri.c
b/content/fetchers/httplib_kolibri.c
index 0f9bcb7..6800cab 100644
--- a/content/fetchers/httplib_kolibri.c
+++ b/content/fetchers/httplib_kolibri.c
@@ -85,16 +85,16 @@ void remove_from_poll(struct http_msg *donehttp) {
bool init_fetcher(lwc_string *scheme) {
bool supported_scheme;
assert(lwc_string_isequal(scheme, corestring_lwc_http, &supported_scheme) ==
lwc_error_ok);
- kolibri_http_init();
- /* if(supported_scheme) { */
- /* if(kolibri_http_init() == 0) */
- /* debug_board_printf("[INFO] Loaded http.obj library successfully.\n");
*/
- /* else { */
- /* debug_board_printf("[ERROR] Could not load http.obj library.\n"); */
- /* return false; */
- /* } */
- /* } */
+ LOG("Initializing http library!");
+ debug_board_printf("fetcher_init: Initializing http library!\n");
+ if(kolibri_http_init() == 0)
+ LOG("[INFO] Loaded http.obj library successfully.\n");
+ else {
+ LOG("[ERROR] Could not load http.obj library.\n");
+ assert(0 && 1);
+ return false;
+ }
return supported_scheme;
}
@@ -138,14 +138,17 @@ void *setup_fetch(struct fetch *parent_fetch, struct
nsurl *url,
request = http_get_asm(nsurl_access(url), NULL, 0, *headers);
}
- LOG("Address of request : 0x%x", request);
- assert(request != NULL);
-
if(request == NULL) {
- LOG("[ERROR] Cannot allocate more memory for http library handle
creation.");
+ LOG("Failed to allocate http buffer. Could be multiple reasons for failure
(like DNS resolution)", request);
return NULL;
}
+ /* This assert is tricky beacause the http library may fail when it fails to
resolve the hostname.
+ There is no sane way to understand that the hostname is wrong or needs to
be fixed.
+ assert leads to a crash for no reason. Disabling it, and the code should
handle this from now.
+ Returning NuLL from here should just force a BadURL to the user.
+ */
+
struct httpfetcher *newfetcher = (struct httpfetcher *) malloc(sizeof(struct
httpfetcher));
assert(newfetcher);
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index d12bdfc..ebd3a3d 100644
--- a/frontends/kolibrios/fb/gui.c
+++ b/frontends/kolibrios/fb/gui.c
@@ -30,6 +30,8 @@
#include <libnsfb_plot.h>
#include <libnsfb_event.h>
+#include <kos32sys.h>
+
#include "utils/utils.h"
#include "utils/nsoption.h"
#include "utils/filepath.h"
@@ -491,7 +493,7 @@ process_cmdline(int argc, char** argv)
}
/* Remove me! */
- feurl = "http://www.kolibrios.org";
+ feurl = "http://board.kolibrios.org";
/* NS on KolibriOS does not support option parsing (yet) */
@@ -2124,6 +2126,10 @@ int main(int argc, char** argv)
.layout = framebuffer_layout_table,
};
+ /* Initialize heap so that we can do memory allocations */
+ unsigned int heapsize = heap_init();
+ debug_board_printf("[SYSTEM] Initialized heap (Size = %u bytes)\n",
heapsize);
+ assert(heapsize != 0);
/* fix args */
#define MKARGV(i,opt) argv[i] = (char *) malloc(strlen(opt) + 1);
strcpy(argv[i], opt);
diff --git a/frontends/kolibrios/loadhttp.asm b/frontends/kolibrios/loadhttp.asm
index 859f56d..3aa7b27 100644
--- a/frontends/kolibrios/loadhttp.asm
+++ b/frontends/kolibrios/loadhttp.asm
@@ -21,27 +21,24 @@ public init_network as '_init_network_asm'
;;; Returns 0 on success. -1 on failure.
proc init_network
-
- mcall 68,11
-
stdcall dll.Load, @IMPORT
- test eax, eax
- jnz error
+ test eax, eax
+ jnz error
mov eax, 0
ret
-
-error:
+
+error:
mov eax, -1
ret
-endp
-
+endp
+
@IMPORT:
library lib_http, 'http.obj'
import lib_http, \
- HTTP_get , 'get' , \
+ HTTP_get , 'get' , \
HTTP_head , 'head' , \
HTTP_post , 'post' , \
HTTP_find_header_field , 'find_header_field' , \
@@ -51,7 +48,7 @@ import lib_http, \
HTTP_free , 'free' , \
HTTP_escape , 'escape' , \
HTTP_unescape , 'unescape'
-
+
public HTTP_get as '_http_get_asm'
public HTTP_head as '_http_head_asm'
public HTTP_post as '_http_post_asm'
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org