[Commits] [SCM] claws branch, litehtml, updated. 3.17.3-103-gae90b23

ticho at claws-mail.org ticho at claws-mail.org
Tue Jan 29 23:53:58 CET 2019


The branch, litehtml has been updated
       via  ae90b2372463c1a498938ce42b77ab7474e317b2 (commit)
      from  043c1f6e8668e95ce8ff779ec5275250196ef56b (commit)

Summary of changes:
 src/plugins/litehtml_viewer/http.cpp |   40 +++++++++++++++++-----------------
 src/plugins/litehtml_viewer/http.h   |    1 -
 2 files changed, 20 insertions(+), 21 deletions(-)


- Log -----------------------------------------------------------------
commit ae90b2372463c1a498938ce42b77ab7474e317b2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Jan 29 23:52:36 2019 +0100

    Make Litehtml's curl write function a regular function instead of a static member function of the http class

diff --git a/src/plugins/litehtml_viewer/http.cpp b/src/plugins/litehtml_viewer/http.cpp
index 12e8636..c6260b4 100644
--- a/src/plugins/litehtml_viewer/http.cpp
+++ b/src/plugins/litehtml_viewer/http.cpp
@@ -12,26 +12,7 @@ struct Data {
   size_t size;
 };
 
-http::http()
-{
-    curl = curl_easy_init();
-    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-    curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_GET_TIMEOUT);
-    curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
-    curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
-    curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
-    curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
-    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http::curl_write_data);
-    stream = NULL;
-}
-
-http::~http()
-{
-    curl_easy_cleanup(curl);
-    destroy_giostream();
-}
-
-size_t http::curl_write_data(char* ptr, size_t size, size_t nmemb, void* data_ptr) {
+static size_t write_data(char* ptr, size_t size, size_t nmemb, void* data_ptr) {
     struct Data* data = (struct Data *) data_ptr;
     size_t realsize = size * nmemb;
     
@@ -50,6 +31,25 @@ size_t http::curl_write_data(char* ptr, size_t size, size_t nmemb, void* data_pt
     return realsize;
 }
 
+http::http()
+{
+    curl = curl_easy_init();
+    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+    curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_GET_TIMEOUT);
+    curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
+    curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);
+    curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);
+    curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);
+    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
+    stream = NULL;
+}
+
+http::~http()
+{
+    curl_easy_cleanup(curl);
+    destroy_giostream();
+}
+
 void http::destroy_giostream() {
     debug_print("destroy_giostream called.\n");
     if (stream) {
diff --git a/src/plugins/litehtml_viewer/http.h b/src/plugins/litehtml_viewer/http.h
index d0ae4c8..0e36212 100644
--- a/src/plugins/litehtml_viewer/http.h
+++ b/src/plugins/litehtml_viewer/http.h
@@ -20,7 +20,6 @@ public:
     GInputStream *load_url(const gchar *url, GError **error);
 
 private:
-    static size_t curl_write_data(char* ptr, size_t size, size_t nmemb, void* data_ptr);
     void destroy_giostream();
 };
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list