Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/40c68aaf980f6d62b3167855444c686851223221
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/40c68aaf980f6d62b3167855444c686851223221
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/40c68aaf980f6d62b3167855444c686851223221

The branch, vince/curlapiupdates has been updated
  discards  22418d22f21af33ec5d009da585c74cf41181bdd (commit)
  discards  f6fd9ecd49e16a9bc6ddfa0fd601d5a38cf2ad65 (commit)
       via  40c68aaf980f6d62b3167855444c686851223221 (commit)
       via  84b6300ebd815dc13db542a85e7a653a28a2c080 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (22418d22f21af33ec5d009da585c74cf41181bdd)
            \
             N -- N -- N (40c68aaf980f6d62b3167855444c686851223221)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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=40c68aaf980f6d62b3167855444c686851223221
commit 40c68aaf980f6d62b3167855444c686851223221
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    always user a reference to mime multipart data

diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index 38c8c0e..c4eb5df 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -1011,13 +1011,9 @@ fetch_curl_postdata_convert(CURL *chandle,
                                goto convert_failed;
                        }
 
-               } else if(value_len > sizeof (struct curl_mime_ctx)) {
+               } else {
                        /* make the curl mime reference the existing multipart
                         * data which requires use of a callback and context.
-                        * The use of existing data rather than allowing it to
-                        * be copied into the curl mime handler is only
-                        * efficient if the data is larger than a callback
-                        * context.
                         */
                        struct curl_mime_ctx *cb_ctx;
                        cb_ctx = malloc(sizeof(struct curl_mime_ctx));
@@ -1037,12 +1033,6 @@ fetch_curl_postdata_convert(CURL *chandle,
                                free(cb_ctx);
                                goto convert_failed;
                        }
-               } else {
-                       /* data copied into the curl mime context */
-                       code=curl_mime_data(part, multipart->value, value_len);
-                       if (code != CURLE_OK) {
-                               goto convert_failed;
-                       }
                }
        }
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=84b6300ebd815dc13db542a85e7a653a28a2c080
commit 84b6300ebd815dc13db542a85e7a653a28a2c080
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    address jmb review comments

diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index c892429..38c8c0e 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -425,6 +425,42 @@ static void fetch_curl_free_postdata(struct fetch_postdata 
*postdata)
 }
 
 /**
+ *construct a new fetch structure
+ */
+static struct curl_fetch_info *fetch_alloc(void)
+{
+       struct curl_fetch_info *fetch;
+       fetch = malloc(sizeof (*fetch));
+       if (fetch == NULL)
+               return NULL;
+
+       fetch->curl_handle = NULL;
+       fetch->sent_ssl_chain = false;
+       fetch->had_headers = false;
+       fetch->abort = false;
+       fetch->stopped = false;
+       fetch->only_2xx = false;
+       fetch->downgrade_tls = false;
+       fetch->headers = NULL;
+       fetch->url = NULL;
+       fetch->host = NULL;
+       fetch->location = NULL;
+       fetch->content_length = 0;
+       fetch->http_code = 0;
+       fetch->cookie_string = NULL;
+       fetch->realm = NULL;
+       fetch->last_progress_update = 0;
+       fetch->postdata = NULL;
+       fetch->curl_postdata = NULL;
+
+       /* Clear certificate chain data */
+       memset(fetch->cert_data, 0, sizeof(fetch->cert_data));
+       fetch->cert_depth = -1;
+
+       return fetch;
+}
+
+/**
  * Start fetching data for the given URL.
  *
  * The function returns immediately. The fetch may be queued for later
@@ -458,44 +494,24 @@ fetch_curl_setup(struct fetch *parent_fetch,
        struct curl_slist *slist;
        int i;
 
-       fetch = malloc(sizeof (*fetch));
+       fetch = fetch_alloc();
        if (fetch == NULL)
-               return 0;
-
-       fetch->fetch_handle = parent_fetch;
+               return NULL;
 
        NSLOG(netsurf, INFO, "fetch %p, url '%s'", fetch, nsurl_access(url));
 
-       /* construct a new fetch structure */
-       fetch->curl_handle = NULL;
-       fetch->sent_ssl_chain = false;
-       fetch->had_headers = false;
-       fetch->abort = false;
-       fetch->stopped = false;
        fetch->only_2xx = only_2xx;
        fetch->downgrade_tls = downgrade_tls;
-       fetch->headers = NULL;
+       fetch->fetch_handle = parent_fetch;
        fetch->url = nsurl_ref(url);
        fetch->host = nsurl_get_component(url, NSURL_HOST);
        if (fetch->host == NULL) {
                goto failed;
        }
-
-       fetch->location = NULL;
-       fetch->content_length = 0;
-       fetch->http_code = 0;
-       fetch->cookie_string = NULL;
-       fetch->realm = NULL;
-       fetch->last_progress_update = 0;
        fetch->postdata = fetch_curl_alloc_postdata(post_urlenc, 
post_multipart);
        if (fetch->postdata == NULL) {
                goto failed;
        }
-       fetch->curl_postdata = NULL;
-
-       /* Clear certificate chain data */
-       memset(fetch->cert_data, 0, sizeof(fetch->cert_data));
-       fetch->cert_depth = -1;
 
 #define APPEND(list, value) \
        slist = curl_slist_append(list, value);         \
@@ -996,7 +1012,13 @@ fetch_curl_postdata_convert(CURL *chandle,
                        }
 
                } else if(value_len > sizeof (struct curl_mime_ctx)) {
-                       /* reference the existing multipart data */
+                       /* make the curl mime reference the existing multipart
+                        * data which requires use of a callback and context.
+                        * The use of existing data rather than allowing it to
+                        * be copied into the curl mime handler is only
+                        * efficient if the data is larger than a callback
+                        * context.
+                        */
                        struct curl_mime_ctx *cb_ctx;
                        cb_ctx = malloc(sizeof(struct curl_mime_ctx));
                        if (cb_ctx == NULL) {
@@ -1016,7 +1038,7 @@ fetch_curl_postdata_convert(CURL *chandle,
                                goto convert_failed;
                        }
                } else {
-                       /* simple copy data */
+                       /* data copied into the curl mime context */
                        code=curl_mime_data(part, multipart->value, value_len);
                        if (code != CURLE_OK) {
                                goto convert_failed;


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

Summary of changes:
 content/fetchers/curl.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c
index cae430d..c4eb5df 100644
--- a/content/fetchers/curl.c
+++ b/content/fetchers/curl.c
@@ -429,6 +429,7 @@ static void fetch_curl_free_postdata(struct fetch_postdata 
*postdata)
  */
 static struct curl_fetch_info *fetch_alloc(void)
 {
+       struct curl_fetch_info *fetch;
        fetch = malloc(sizeof (*fetch));
        if (fetch == NULL)
                return NULL;
@@ -438,10 +439,10 @@ static struct curl_fetch_info *fetch_alloc(void)
        fetch->had_headers = false;
        fetch->abort = false;
        fetch->stopped = false;
-       fetch->only_2xx = only_2xx;
-       fetch->downgrade_tls = downgrade_tls;
+       fetch->only_2xx = false;
+       fetch->downgrade_tls = false;
        fetch->headers = NULL;
-       fetch->url = NULL
+       fetch->url = NULL;
        fetch->host = NULL;
        fetch->location = NULL;
        fetch->content_length = 0;
@@ -499,6 +500,8 @@ fetch_curl_setup(struct fetch *parent_fetch,
 
        NSLOG(netsurf, INFO, "fetch %p, url '%s'", fetch, nsurl_access(url));
 
+       fetch->only_2xx = only_2xx;
+       fetch->downgrade_tls = downgrade_tls;
        fetch->fetch_handle = parent_fetch;
        fetch->url = nsurl_ref(url);
        fetch->host = nsurl_get_component(url, NSURL_HOST);


-- 
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to