tDon't fix curl_multi_perform with socket actions - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 67a979d0d52b3e6b4d626b88bd6c30f4b838061b
(DIR) parent 0e22f437d27b6e6d722def9c12982dd6fbfd91d0
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Thu, 5 Nov 2020 23:49:08 -0800
Don't fix curl_multi_perform with socket actions
Diffstat:
M src/network.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/network.c b/src/network.c
t@@ -1235,6 +1235,8 @@ void CurlInit(CurlConnection *conn)
conn->StripChar = '\r';
conn->data_size = 0;
conn->headers = NULL;
+ conn->timer_cb = NULL;
+ conn->socket_cb = NULL;
}
void CloseCurlConnection(CurlConnection *conn)
t@@ -1355,7 +1357,12 @@ gboolean OpenCurlConnection(CurlConnection *conn, char *URL, char *body,
conn->data_size = 0;
conn->headers = g_ptr_array_new_with_free_func(g_free);
conn->running = TRUE;
- return CurlConnectionPerform(conn, &still_running, err);
+ if (conn->timer_cb) {
+ /* If we set a callback, we must not do _perform, but wait for the cb */
+ return TRUE;
+ } else {
+ return CurlConnectionPerform(conn, &still_running, err);
+ }
} else {
g_set_error_literal(err, DOPE_CURLM_ERROR, 0, _("Could not init curl"));
return FALSE;