From 66b1193cfd3070bc1746ddce691e1784f0f04395 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Sat, 27 Feb 2021 07:15:10 +0200
Subject: [PATCH 1/1] GmRequest: Handling early termination
IssueID #181
src/gmrequest.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gmrequest.c b/src/gmrequest.c
index f4d770ab..0208dc94 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -227,7 +227,12 @@ static int processIncomingData_GmRequest_(iGmRequest *d, const iBlock *data) {
static void readIncoming_GmRequest_(iGmRequest *d, iTlsRequest *req) {
lock_Mutex(d->mtx);
iGmResponse *resp = d->resp;
/* The request has already finished or been aborted (e.g., invalid header). */
delete_Block(readAll_TlsRequest(req));
unlock_Mutex(d->mtx);
return;
iBlock * data = readAll_TlsRequest(req);
const int ubits = processIncomingData_GmRequest_(d, data);
iBool notifyUpdate = (ubits & 1) != 0;
@@ -552,7 +557,7 @@ void submit_GmRequest(iGmRequest *d) {
remove_Block(&path->chars, 0, 1);
}
#endif
iFile * f = new_File(path);
iFile *f = new_File(path);
if (open_File(f, readOnly_FileMode)) {
/* TODO: Check supported file types: images, audio */
/* TODO: Detect text files based on contents? E.g., is the content valid UTF-8. */
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).