diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-02 15:07:41 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-02 15:07:41 +0200 |
commit | 54ecf03f9ed055c8a84475eee0d5a50bb16eeb61 (patch) | |
tree | 0a9a83c189f0a76adf52b3bd1e46b308d14c3a8a /src/gmrequest.c | |
parent | 849fd39d08bd4164ed486c2f4addc2cab7a85f9c (diff) |
GmRequest: Don't remain locked while running MIME hooks
Diffstat (limited to 'src/gmrequest.c')
-rw-r--r-- | src/gmrequest.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gmrequest.c b/src/gmrequest.c index 572e6a5c..a1284078 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c | |||
@@ -260,18 +260,20 @@ static void requestFinished_GmRequest_(iGmRequest *d, iTlsRequest *req) { | |||
260 | set_String(&d->resp->meta, errorMessage_TlsRequest(req)); | 260 | set_String(&d->resp->meta, errorMessage_TlsRequest(req)); |
261 | } | 261 | } |
262 | checkServerCertificate_GmRequest_(d); | 262 | checkServerCertificate_GmRequest_(d); |
263 | unlock_Mutex(d->mtx); | ||
263 | /* Check for mimehooks. */ | 264 | /* Check for mimehooks. */ |
264 | if (d->isRespFiltered && d->state == finished_GmRequestState) { | 265 | if (d->isRespFiltered && d->state == finished_GmRequestState) { |
265 | iBlock *xbody = tryFilter_MimeHooks(mimeHooks_App(), &d->resp->meta, &d->resp->body); | 266 | iBlock *xbody = tryFilter_MimeHooks(mimeHooks_App(), &d->resp->meta, &d->resp->body); |
266 | if (xbody) { | 267 | if (xbody) { |
268 | lock_Mutex(d->mtx); | ||
267 | clear_String(&d->resp->meta); | 269 | clear_String(&d->resp->meta); |
268 | clear_Block(&d->resp->body); | 270 | clear_Block(&d->resp->body); |
269 | d->state = receivingHeader_GmRequestState; | 271 | d->state = receivingHeader_GmRequestState; |
270 | processIncomingData_GmRequest_(d, xbody); | 272 | processIncomingData_GmRequest_(d, xbody); |
271 | d->state = finished_GmRequestState; | 273 | d->state = finished_GmRequestState; |
274 | unlock_Mutex(d->mtx); | ||
272 | } | 275 | } |
273 | } | 276 | } |
274 | unlock_Mutex(d->mtx); | ||
275 | iNotifyAudience(d, finished, GmRequestFinished); | 277 | iNotifyAudience(d, finished, GmRequestFinished); |
276 | } | 278 | } |
277 | 279 | ||