Skip to content

Commit 9189cdd

Browse files
committed
if curl asks for a 0ms timer, literally set a 0ms timer
this avoids the chance that we call curl_multi_socket_action before curl_multi_add_handle has returned
1 parent e769eff commit 9189cdd

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/httprequest.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2018 Fanout, Inc.
2+
* Copyright (C) 2012-2022 Fanout, Inc.
33
*
44
* This file is part of Zurl.
55
*
@@ -777,22 +777,14 @@ class CurlConnectionManager : public QObject
777777
Q_UNUSED(multi);
778778

779779
if(timeout_ms >= 0)
780-
log_debug("timerFunction: wake up in %dms", (int)timeout_ms);
781-
else
782-
log_debug("timerFunction: cancel timer");
783-
784-
if(timeout_ms == -1)
785-
{
786-
if(timer)
787-
timer->stop();
788-
}
789-
else if(timeout_ms == 0)
790780
{
791-
timer_timeout();
781+
log_debug("timerFunction: wake up in %dms", (int)timeout_ms);
782+
timer->start((int)timeout_ms);
792783
}
793784
else
794785
{
795-
timer->start((int)timeout_ms);
786+
log_debug("timerFunction: cancel timer");
787+
timer->stop();
796788
}
797789
}
798790

0 commit comments

Comments
 (0)