diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-08 14:57:17 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-08 14:57:17 +0300 |
commit | fa75afdf7d9b9036dcaa373e01250cb68176488b (patch) | |
tree | e3f9d683b1425bdb198fcba2bde21abb59234e3b /src/gmrequest.c | |
parent | 66d425de8597cd9f88a2657505b7098d02cc9617 (diff) |
Cancel GmRequest from the main thread
Doing it in the SDL timer thread causes mutex lockups.
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r-- | src/gmrequest.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c index 9591885a..7cc8b897 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c | |||
@@ -120,12 +120,16 @@ void setUrl_GmRequest(iGmRequest *d, const iString *url) { | |||
120 | } | 120 | } |
121 | 121 | ||
122 | static uint32_t timedOutWhileReceivingBody_GmRequest_(uint32_t interval, void *obj) { | 122 | static uint32_t timedOutWhileReceivingBody_GmRequest_(uint32_t interval, void *obj) { |
123 | iGmRequest *d = obj; | 123 | /* Note: Called from SDL's timer thread. */ |
124 | cancel_TlsRequest(d->req); | 124 | postCommandf_App("gmrequest.timeout request:%p", obj); |
125 | iUnused(interval); | 125 | iUnused(interval); |
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | void cancel_GmRequest(iGmRequest *d) { | ||
130 | cancel_TlsRequest(d->req); | ||
131 | } | ||
132 | |||
129 | static void restartTimeout_GmRequest_(iGmRequest *d) { | 133 | static void restartTimeout_GmRequest_(iGmRequest *d) { |
130 | /* Note: `d` is currently locked. */ | 134 | /* Note: `d` is currently locked. */ |
131 | if (d->timeoutId) { | 135 | if (d->timeoutId) { |