netsurf: branch master updated. release/3.9-47-g1f24336

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Fri Aug 2 15:03:16 BST 2019


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/1f24336d6c3c496ac020981c4e1907508579422c
...commit http://git.netsurf-browser.org/netsurf.git/commit/1f24336d6c3c496ac020981c4e1907508579422c
...tree http://git.netsurf-browser.org/netsurf.git/tree/1f24336d6c3c496ac020981c4e1907508579422c

The branch, master has been updated
       via  1f24336d6c3c496ac020981c4e1907508579422c (commit)
       via  09cce349da9cad23e5475e3974dab50b7a947201 (commit)
      from  c9384d65f6fb5d6c661f9f65c4b60956e7d4bc1a (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=1f24336d6c3c496ac020981c4e1907508579422c
commit 1f24336d6c3c496ac020981c4e1907508579422c
Author: Daniel Silverstone <dsilvers at digital-scurf.org>
Commit: Daniel Silverstone <dsilvers at digital-scurf.org>

    curl: Change where we lodge `inside_curl`
    
    Because we need to be slightly more careful now, lodge ourselves
    `inside_curl` whenever we might be processing via the cURL messages
    or similar.
    
    Signed-off-by: Daniel Silverstone <dsilvers at digital-scurf.org>

diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 18eba12..0ab0b6c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -1222,6 +1222,7 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
 	}
 
 	/* do any possible work on the current fetches */
+	inside_curl = true;
 	do {
 		codem = curl_multi_perform(fetch_curl_multi, &running);
 		if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
@@ -1245,6 +1246,7 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
 		}
 		curl_msg = curl_multi_info_read(fetch_curl_multi, &queue);
 	}
+	inside_curl = false;
 }
 
 
@@ -1334,9 +1336,6 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	CURLcode code;
 	fetch_msg msg;
 
-	assert(inside_curl == false);
-	inside_curl = true;
-
 	/* ensure we only have to get this information once */
 	if (!f->http_code) {
 		code = curl_easy_getinfo(f->curl_handle, CURLINFO_HTTP_CODE,
@@ -1350,13 +1349,11 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	 */
 	if (f->http_code == 401) {
 		f->http_code = 0;
-		inside_curl = false;
 		return size * nmemb;
 	}
 
 	if (f->abort || (!f->had_headers && fetch_curl_process_headers(f))) {
 		f->stopped = true;
-		inside_curl = false;
 		return 0;
 	}
 
@@ -1366,7 +1363,6 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	msg.data.header_or_data.len = size * nmemb;
 	fetch_send_callback(&msg, f->fetch_handle);
 
-	inside_curl = false;
 	if (f->abort) {
 		f->stopped = true;
 		return 0;


commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=09cce349da9cad23e5475e3974dab50b7a947201
commit 09cce349da9cad23e5475e3974dab50b7a947201
Author: Daniel Silverstone <dsilvers at digital-scurf.org>
Commit: Daniel Silverstone <dsilvers at digital-scurf.org>

    dukky: Clean up our stacktrace reporting
    
    Signed-off-by: Daniel Silverstone <dsilvers at digital-scurf.org>

diff --git a/content/handlers/javascript/duktape/dukky.c b/content/handlers/javascript/duktape/dukky.c
index 4dc97aa..e7ffb0f 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -759,37 +759,12 @@ static duk_ret_t dukky_safe_get(duk_context *ctx, void *udata)
 static void dukky_dump_error(duk_context *ctx)
 {
 	/* stack is ..., errobj */
-	duk_idx_t stacktop = duk_get_top(ctx);
-	if (!duk_is_error(ctx, -1)) {
-		NSLOG(jserrors, WARNING, "Uncaught non-Error derived error in JS: %s", duk_safe_to_string(ctx, -1));
-	} else {
-#define GETTER(what)						\
-		if (duk_has_prop_string(ctx, stacktop - 1, what)) {	\
-			NSLOG(dukky, DEEPDEBUG, "Fetching " what); \
-			duk_dup(ctx, stacktop - 1);			\
-			if (duk_safe_call(ctx, dukky_safe_get, (void *)what, 1, 1) != DUK_EXEC_SUCCESS) { \
-				NSLOG(dukky, DEBUG, "Error fetching " what ": %s", duk_safe_to_string(ctx, -1)); \
-			} else { \
-				NSLOG(dukky, DEEPDEBUG, "Success fetching " what);	\
-			}						\
-		} else {						\
-			NSLOG(dukky, DEBUG, "Faking " what);		\
-			duk_push_string(ctx, "?" what "?");		\
-		}
-		GETTER("name");
-		GETTER("message");
-		GETTER("fileName");
-		GETTER("lineNumber");
-		GETTER("stack");
-		NSLOG(jserrors, DEBUG, "Uncaught error in JS: %s: %s",
-		      duk_safe_to_string(ctx, -5), duk_safe_to_string(ctx, -4));
-		NSLOG(jserrors, DEBUG, "              was at: %s line %s",
-		duk_safe_to_string(ctx, -3), duk_safe_to_string(ctx, -2));
-		NSLOG(jserrors, DEBUG, "         Stack trace: %s",
-		      duk_safe_to_string(ctx, -1));
-#undef GETTER
-	}
-	duk_set_top(ctx, stacktop);
+	duk_dup_top(ctx);
+	/* ..., errobj, errobj */
+	NSLOG(jserrors, WARNING, "Uncaught error in JS: %s", duk_safe_to_stacktrace(ctx, -1));
+	/* ..., errobj, errobj.stackstring */
+	duk_pop(ctx);
+	/* ..., errobj */
 }
 
 duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool reset_timeout)


-----------------------------------------------------------------------

Summary of changes:
 content/fetchers/curl.c                     |    8 ++----
 content/handlers/javascript/duktape/dukky.c |   37 +++++----------------------
 2 files changed, 8 insertions(+), 37 deletions(-)

diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 18eba12..0ab0b6c 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -1222,6 +1222,7 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
 	}
 
 	/* do any possible work on the current fetches */
+	inside_curl = true;
 	do {
 		codem = curl_multi_perform(fetch_curl_multi, &running);
 		if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
@@ -1245,6 +1246,7 @@ static void fetch_curl_poll(lwc_string *scheme_ignored)
 		}
 		curl_msg = curl_multi_info_read(fetch_curl_multi, &queue);
 	}
+	inside_curl = false;
 }
 
 
@@ -1334,9 +1336,6 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	CURLcode code;
 	fetch_msg msg;
 
-	assert(inside_curl == false);
-	inside_curl = true;
-
 	/* ensure we only have to get this information once */
 	if (!f->http_code) {
 		code = curl_easy_getinfo(f->curl_handle, CURLINFO_HTTP_CODE,
@@ -1350,13 +1349,11 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	 */
 	if (f->http_code == 401) {
 		f->http_code = 0;
-		inside_curl = false;
 		return size * nmemb;
 	}
 
 	if (f->abort || (!f->had_headers && fetch_curl_process_headers(f))) {
 		f->stopped = true;
-		inside_curl = false;
 		return 0;
 	}
 
@@ -1366,7 +1363,6 @@ static size_t fetch_curl_data(char *data, size_t size, size_t nmemb, void *_f)
 	msg.data.header_or_data.len = size * nmemb;
 	fetch_send_callback(&msg, f->fetch_handle);
 
-	inside_curl = false;
 	if (f->abort) {
 		f->stopped = true;
 		return 0;
diff --git a/content/handlers/javascript/duktape/dukky.c b/content/handlers/javascript/duktape/dukky.c
index 4dc97aa..e7ffb0f 100644
--- a/content/handlers/javascript/duktape/dukky.c
+++ b/content/handlers/javascript/duktape/dukky.c
@@ -759,37 +759,12 @@ static duk_ret_t dukky_safe_get(duk_context *ctx, void *udata)
 static void dukky_dump_error(duk_context *ctx)
 {
 	/* stack is ..., errobj */
-	duk_idx_t stacktop = duk_get_top(ctx);
-	if (!duk_is_error(ctx, -1)) {
-		NSLOG(jserrors, WARNING, "Uncaught non-Error derived error in JS: %s", duk_safe_to_string(ctx, -1));
-	} else {
-#define GETTER(what)						\
-		if (duk_has_prop_string(ctx, stacktop - 1, what)) {	\
-			NSLOG(dukky, DEEPDEBUG, "Fetching " what); \
-			duk_dup(ctx, stacktop - 1);			\
-			if (duk_safe_call(ctx, dukky_safe_get, (void *)what, 1, 1) != DUK_EXEC_SUCCESS) { \
-				NSLOG(dukky, DEBUG, "Error fetching " what ": %s", duk_safe_to_string(ctx, -1)); \
-			} else { \
-				NSLOG(dukky, DEEPDEBUG, "Success fetching " what);	\
-			}						\
-		} else {						\
-			NSLOG(dukky, DEBUG, "Faking " what);		\
-			duk_push_string(ctx, "?" what "?");		\
-		}
-		GETTER("name");
-		GETTER("message");
-		GETTER("fileName");
-		GETTER("lineNumber");
-		GETTER("stack");
-		NSLOG(jserrors, DEBUG, "Uncaught error in JS: %s: %s",
-		      duk_safe_to_string(ctx, -5), duk_safe_to_string(ctx, -4));
-		NSLOG(jserrors, DEBUG, "              was at: %s line %s",
-		duk_safe_to_string(ctx, -3), duk_safe_to_string(ctx, -2));
-		NSLOG(jserrors, DEBUG, "         Stack trace: %s",
-		      duk_safe_to_string(ctx, -1));
-#undef GETTER
-	}
-	duk_set_top(ctx, stacktop);
+	duk_dup_top(ctx);
+	/* ..., errobj, errobj */
+	NSLOG(jserrors, WARNING, "Uncaught error in JS: %s", duk_safe_to_stacktrace(ctx, -1));
+	/* ..., errobj, errobj.stackstring */
+	duk_pop(ctx);
+	/* ..., errobj */
 }
 
 duk_int_t dukky_pcall(duk_context *ctx, duk_size_t argc, bool reset_timeout)


-- 
NetSurf Browser



More information about the netsurf-commits mailing list