From 80ae4eeb240c76200bd77d48f5156b363e567a95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi
Date: Tue, 3 Nov 2020 21:44:34 +0200
Subject: [PATCH 1/1] GmResponse: Fixed parsing of the response
In some cases an empty in the server response would cause GmResponse to treat the entire header as invalid.
Also, TlsRequest was not handling closing of the TLS/SSL connection if the socket still remained open. This caused GmRequest to wait until the timeout before it realized the full response had been received.
IssueID #22
lib/the_Foundation | 2 +-
res/about/version.gmi | 4 ++++
src/gmrequest.c | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/the_Foundation b/lib/the_Foundation
index 52fc0ee9..1b2c8527 160000
--- a/lib/the_Foundation
+++ b/lib/the_Foundation
@@ -1 +1 @@
-Subproject commit 52fc0ee9c948ddfbd5918ce1449ab32b910c005d
+Subproject commit 1b2c85274687bd2aea29917bffc71f62c3f3a4dc
diff --git a/res/about/version.gmi b/res/about/version.gmi
index ead4d5d2..e1abe34b 100644
--- a/res/about/version.gmi
+++ b/res/about/version.gmi
@@ -6,6 +6,10 @@
+## 0.7.2
+* Fixed parsing of the server's response. In some cases it was possible that the response was only partially read.
+* Fixed handling of TLS/SSL connection being closed without the socket being closed.
diff --git a/src/gmrequest.c b/src/gmrequest.c
index bb6ac23e..f15d80f1 100644
--- a/src/gmrequest.c
+++ b/src/gmrequest.c
@@ -256,7 +256,7 @@ static void readIncoming_GmRequest_(iAnyObject *obj) {
notifyDone = iTrue;
}
const int code = toInt_String(&d->resp.meta);
if (code == 0 || cstr_String(&d->resp.meta)[2] != ' ') {
if (code == 0) {
clear_String(&d->resp.meta);
d->resp.statusCode = invalidHeader_GmStatusCode;
d->state = finished_GmRequestState;
--
2.25.1
text/plain
This content has been proxied by September (3851b).