Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/5cfe0dfffcf423c411004ac565959c686bfb24c9
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/5cfe0dfffcf423c411004ac565959c686bfb24c9
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/5cfe0dfffcf423c411004ac565959c686bfb24c9

The branch, master has been updated
       via  5cfe0dfffcf423c411004ac565959c686bfb24c9 (commit)
       via  083ba385d70a6fbc0c89ffbc42f66d035a856139 (commit)
       via  50ff8433da5aa19c70459e5370cc1744917a9000 (commit)
       via  89e468422d8a885030120396b69e0fe488041aca (commit)
       via  5a028f61d3968a90870706e272bf4e1cd91dde5c (commit)
      from  21bbda23fa27561e8f52daff1adb2403c4e86019 (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=5cfe0dfffcf423c411004ac565959c686bfb24c9
commit 5cfe0dfffcf423c411004ac565959c686bfb24c9
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    fetchers: Apply cleaner ring handling mechanic to other fetchers
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index 8e6305d..8316d15 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -246,6 +246,7 @@ static void fetch_data_poll(lwc_string *scheme)
 {
        fetch_msg msg;
        struct fetch_data_context *c, *next;
+       bool was_last_item = false;
        
        if (ring == NULL) return;
        
@@ -314,14 +315,28 @@ static void fetch_data_poll(lwc_string *scheme)
                 * processing this item may have added to the ring.
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->parent_fetch);
                fetch_free(c->parent_fetch);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_data_register(void)
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index b5b4221..ede001f 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -792,6 +792,7 @@ static void fetch_file_process(struct fetch_file_context 
*ctx)
 static void fetch_file_poll(lwc_string *scheme)
 {
        struct fetch_file_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -819,14 +820,28 @@ static void fetch_file_poll(lwc_string *scheme)
                 * processing this item may have added to the ring.
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_file_register(void)
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index 9b3f28c..286f99e 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -434,6 +434,7 @@ static void fetch_resource_abort(void *ctx)
 static void fetch_resource_poll(lwc_string *scheme)
 {
        struct fetch_resource_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -461,14 +462,28 @@ static void fetch_resource_poll(lwc_string *scheme)
                 * as processing this item may have added to the ring
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_resource_register(void)


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=083ba385d70a6fbc0c89ffbc42f66d035a856139
commit 083ba385d70a6fbc0c89ffbc42f66d035a856139
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    fetch: Automatically handle fetches which fail to finish
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/fetch.c b/content/fetch.c
index 2ac86a8..94654fc 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -98,6 +98,7 @@ struct fetch {
        int fetcherd;           /**< Fetcher descriptor for this fetch */
        void *fetcher_handle;   /**< The handle for the fetcher. */
        bool fetch_is_active;   /**< This fetch is active. */
+       fetch_msg_type last_msg;/**< The last message sent for this fetch */
        struct fetch *r_prev;   /**< Previous active fetch in ::fetch_ring. */
        struct fetch *r_next;   /**< Next active fetch in ::fetch_ring. */
 };
@@ -593,6 +594,20 @@ void fetch_abort(struct fetch *f)
 /* exported interface documented in content/fetch.h */
 void fetch_free(struct fetch *f)
 {
+       if (f->last_msg < FETCH_MIN_FINISHED_MSG) {
+               /* We didn't finish, so tell our user that an error occurred */
+               fetch_msg msg;
+
+               msg.type = FETCH_ERROR;
+               msg.data.error = "FetchFailedToFinish";
+
+               NSLOG(fetch, CRITICAL,
+                     "During the fetch of %s, the fetcher did not finish.",
+                     nsurl_access(f->url));
+
+               fetch_send_callback(&msg, f);
+       }
+
        NSLOG(fetch, DEBUG,
              "Freeing fetch %p, fetcher %p",
              f,
@@ -788,6 +803,7 @@ fetch_multipart_data_new_kv(struct fetch_multipart_data 
**list,
 void
 fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
 {
+       fetch->last_msg = msg->type;
        fetch->callback(msg, fetch->p);
 }
 
diff --git a/content/fetch.h b/content/fetch.h
index 9e80b26..817d5e2 100644
--- a/content/fetch.h
+++ b/content/fetch.h
@@ -39,19 +39,27 @@ struct ssl_cert_info;
  */
 typedef enum {
        FETCH_PROGRESS,
+       FETCH_CERTS,
        FETCH_HEADER,
        FETCH_DATA,
+       /* Anything after here is a completed fetch of some kind. */
        FETCH_FINISHED,
        FETCH_TIMEDOUT,
        FETCH_ERROR,
        FETCH_REDIRECT,
        FETCH_NOTMODIFIED,
-       FETCH_CERTS,
        FETCH_AUTH,
        FETCH_CERT_ERR,
        FETCH_SSL_ERR
 } fetch_msg_type;
 
+/** Minimum finished message type.
+ *
+ * If a fetch does not progress this far, it's an error and the fetch machinery
+ * will send FETCH_ERROR to the llcache on fetch_free()
+ */
+#define FETCH_MIN_FINISHED_MSG FETCH_FINISHED
+
 /**
  * Fetcher message data
  */
diff --git a/resources/FatMessages b/resources/FatMessages
index 5953574..5197ffb 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -1133,6 +1133,9 @@ it.all.FetchErrorTitle:Errore durante il recupero della 
pagina
 en.all.FetchErrorDescription:An error occurred when connecting to %s
 it.all.FetchErrorDescription:Si è verificato un errore durante la connessione 
a %s
 
+# Generic fetcher failure (really a programming error)
+en.all.FetchFailedToFinish:The fetcher for this request failed to complete
+
 
 # SSL certificate viewer
 # ======================


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=50ff8433da5aa19c70459e5370cc1744917a9000
commit 50ff8433da5aa19c70459e5370cc1744917a9000
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    browser_window: Use messages for unknown errors
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 9d8e276..e128852 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -1289,6 +1289,8 @@ browser_window__handle_error(struct browser_window *bw,
 
        if (message == NULL) {
                message = messages_get_errorcode(code);
+       } else {
+               message = messages_get(message);
        }
 
        if (c == bw->loading_content) {


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=89e468422d8a885030120396b69e0fe488041aca
commit 89e468422d8a885030120396b69e0fe488041aca
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    about: Correct handling of ring in fetch_about_poll
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 02bac81..4b8562c 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -1644,6 +1644,7 @@ static void fetch_about_abort(void *ctx)
 static void fetch_about_poll(lwc_string *scheme)
 {
        struct fetch_about_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -1671,14 +1672,28 @@ static void fetch_about_poll(lwc_string *scheme)
                 * as processing this item may have added to the ring
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=5a028f61d3968a90870706e272bf4e1cd91dde5c
commit 5a028f61d3968a90870706e272bf4e1cd91dde5c
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    test: Another corestring
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/test/corestrings.c b/test/corestrings.c
index 8690d82..711bdca 100644
--- a/test/corestrings.c
+++ b/test/corestrings.c
@@ -40,7 +40,7 @@
  *
  * This is used to test all the out of memory paths in initialisation.
  */
-#define CORESTRING_TEST_COUNT 480
+#define CORESTRING_TEST_COUNT 481
 
 START_TEST(corestrings_test)
 {


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

Summary of changes:
 content/fetch.c             |   16 ++++++++++++++++
 content/fetch.h             |   10 +++++++++-
 content/fetchers/about.c    |   17 ++++++++++++++++-
 content/fetchers/data.c     |   17 ++++++++++++++++-
 content/fetchers/file.c     |   17 ++++++++++++++++-
 content/fetchers/resource.c |   17 ++++++++++++++++-
 desktop/browser_window.c    |    2 ++
 resources/FatMessages       |    3 +++
 test/corestrings.c          |    2 +-
 9 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/content/fetch.c b/content/fetch.c
index 2ac86a8..94654fc 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -98,6 +98,7 @@ struct fetch {
        int fetcherd;           /**< Fetcher descriptor for this fetch */
        void *fetcher_handle;   /**< The handle for the fetcher. */
        bool fetch_is_active;   /**< This fetch is active. */
+       fetch_msg_type last_msg;/**< The last message sent for this fetch */
        struct fetch *r_prev;   /**< Previous active fetch in ::fetch_ring. */
        struct fetch *r_next;   /**< Next active fetch in ::fetch_ring. */
 };
@@ -593,6 +594,20 @@ void fetch_abort(struct fetch *f)
 /* exported interface documented in content/fetch.h */
 void fetch_free(struct fetch *f)
 {
+       if (f->last_msg < FETCH_MIN_FINISHED_MSG) {
+               /* We didn't finish, so tell our user that an error occurred */
+               fetch_msg msg;
+
+               msg.type = FETCH_ERROR;
+               msg.data.error = "FetchFailedToFinish";
+
+               NSLOG(fetch, CRITICAL,
+                     "During the fetch of %s, the fetcher did not finish.",
+                     nsurl_access(f->url));
+
+               fetch_send_callback(&msg, f);
+       }
+
        NSLOG(fetch, DEBUG,
              "Freeing fetch %p, fetcher %p",
              f,
@@ -788,6 +803,7 @@ fetch_multipart_data_new_kv(struct fetch_multipart_data 
**list,
 void
 fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
 {
+       fetch->last_msg = msg->type;
        fetch->callback(msg, fetch->p);
 }
 
diff --git a/content/fetch.h b/content/fetch.h
index 9e80b26..817d5e2 100644
--- a/content/fetch.h
+++ b/content/fetch.h
@@ -39,19 +39,27 @@ struct ssl_cert_info;
  */
 typedef enum {
        FETCH_PROGRESS,
+       FETCH_CERTS,
        FETCH_HEADER,
        FETCH_DATA,
+       /* Anything after here is a completed fetch of some kind. */
        FETCH_FINISHED,
        FETCH_TIMEDOUT,
        FETCH_ERROR,
        FETCH_REDIRECT,
        FETCH_NOTMODIFIED,
-       FETCH_CERTS,
        FETCH_AUTH,
        FETCH_CERT_ERR,
        FETCH_SSL_ERR
 } fetch_msg_type;
 
+/** Minimum finished message type.
+ *
+ * If a fetch does not progress this far, it's an error and the fetch machinery
+ * will send FETCH_ERROR to the llcache on fetch_free()
+ */
+#define FETCH_MIN_FINISHED_MSG FETCH_FINISHED
+
 /**
  * Fetcher message data
  */
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 02bac81..4b8562c 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -1644,6 +1644,7 @@ static void fetch_about_abort(void *ctx)
 static void fetch_about_poll(lwc_string *scheme)
 {
        struct fetch_about_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -1671,14 +1672,28 @@ static void fetch_about_poll(lwc_string *scheme)
                 * as processing this item may have added to the ring
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index 8e6305d..8316d15 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -246,6 +246,7 @@ static void fetch_data_poll(lwc_string *scheme)
 {
        fetch_msg msg;
        struct fetch_data_context *c, *next;
+       bool was_last_item = false;
        
        if (ring == NULL) return;
        
@@ -314,14 +315,28 @@ static void fetch_data_poll(lwc_string *scheme)
                 * processing this item may have added to the ring.
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->parent_fetch);
                fetch_free(c->parent_fetch);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_data_register(void)
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index b5b4221..ede001f 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -792,6 +792,7 @@ static void fetch_file_process(struct fetch_file_context 
*ctx)
 static void fetch_file_poll(lwc_string *scheme)
 {
        struct fetch_file_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -819,14 +820,28 @@ static void fetch_file_poll(lwc_string *scheme)
                 * processing this item may have added to the ring.
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_file_register(void)
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index 9b3f28c..286f99e 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -434,6 +434,7 @@ static void fetch_resource_abort(void *ctx)
 static void fetch_resource_poll(lwc_string *scheme)
 {
        struct fetch_resource_context *c, *next;
+       bool was_last_item = false;
 
        if (ring == NULL) return;
 
@@ -461,14 +462,28 @@ static void fetch_resource_poll(lwc_string *scheme)
                 * as processing this item may have added to the ring
                 */
                next = c->r_next;
+               was_last_item = next == c;
 
                fetch_remove_from_queues(c->fetchh);
                fetch_free(c->fetchh);
 
+               /* Having called into the fetch machinery, our ring might
+                * have been updated
+                */
+               if (was_last_item) {
+                       /* We were previously the last item in the ring
+                        * so let's reset to the head of the ring
+                        * and try again
+                        */
+                       c = ring;
+               } else {
+                       c = next;
+               }
+
                /* 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);
+       } while (ring != NULL);
 }
 
 nserror fetch_resource_register(void)
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 9d8e276..e128852 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -1289,6 +1289,8 @@ browser_window__handle_error(struct browser_window *bw,
 
        if (message == NULL) {
                message = messages_get_errorcode(code);
+       } else {
+               message = messages_get(message);
        }
 
        if (c == bw->loading_content) {
diff --git a/resources/FatMessages b/resources/FatMessages
index 5953574..5197ffb 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -1133,6 +1133,9 @@ it.all.FetchErrorTitle:Errore durante il recupero della 
pagina
 en.all.FetchErrorDescription:An error occurred when connecting to %s
 it.all.FetchErrorDescription:Si è verificato un errore durante la connessione 
a %s
 
+# Generic fetcher failure (really a programming error)
+en.all.FetchFailedToFinish:The fetcher for this request failed to complete
+
 
 # SSL certificate viewer
 # ======================
diff --git a/test/corestrings.c b/test/corestrings.c
index 8690d82..711bdca 100644
--- a/test/corestrings.c
+++ b/test/corestrings.c
@@ -40,7 +40,7 @@
  *
  * This is used to test all the out of memory paths in initialisation.
  */
-#define CORESTRING_TEST_COUNT 480
+#define CORESTRING_TEST_COUNT 481
 
 START_TEST(corestrings_test)
 {


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to