aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/plugin_transport_http_client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index b4e743371..eaf84006f 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -76,7 +76,7 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
76 * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok 76 * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok
77 */ 77 */
78static int 78static int
79client_schedule (struct Plugin *plugin) 79client_schedule (struct Plugin *plugin, int now)
80{ 80{
81 fd_set rs; 81 fd_set rs;
82 fd_set ws; 82 fd_set ws;
@@ -112,6 +112,9 @@ client_schedule (struct Plugin *plugin)
112 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1); 112 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1);
113 else 113 else
114 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, to); 114 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, to);
115 if (now == GNUNET_YES)
116 timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 1);
117
115 if (mret != CURLM_OK) 118 if (mret != CURLM_OK)
116 { 119 {
117 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"), 120 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("%s failed at %s:%d: `%s'\n"),
@@ -153,7 +156,7 @@ client_send (struct Session *s, struct HTTP_Message *msg)
153 curl_easy_pause(s->client_put, CURLPAUSE_CONT); 156 curl_easy_pause(s->client_put, CURLPAUSE_CONT);
154 } 157 }
155 158
156 client_schedule (s->plugin); 159 client_schedule (s->plugin, GNUNET_YES);
157 160
158 return GNUNET_OK; 161 return GNUNET_OK;
159} 162}
@@ -209,7 +212,7 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
209 } 212 }
210 } 213 }
211 while (mret == CURLM_CALL_MULTI_PERFORM); 214 while (mret == CURLM_CALL_MULTI_PERFORM);
212 client_schedule (plugin); 215 client_schedule (plugin, GNUNET_NO);
213} 216}
214 217
215int 218int
@@ -289,7 +292,7 @@ client_disconnect (struct Session *s)
289 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 292 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK;
290 } 293 }
291 294
292 plugin->client_perform_task = GNUNET_SCHEDULER_add_now(client_run, plugin); 295 client_schedule (plugin, GNUNET_YES);
293 296
294 return res; 297 return res;
295} 298}