[edk2-devel] [PATCH v2 4/4] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers

Oliver Steffen posted 4 patches 3 years, 11 months ago
There is a newer version of this series
[edk2-devel] [PATCH v2 4/4] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers
Posted by Oliver Steffen 3 years, 11 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Force connection close before the next request if
the server identifies as version 1.0.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d40d55ac92ad..623e029c606e 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -1105,6 +1105,14 @@ HttpResponseWorker (
       HttpInstance->CacheLen = BodyLen;
     }
 
+    //
+    // Check server's HTTP version.
+    //
+    if (AsciiStrnCmp (HttpHeaders, "HTTP/1.0", AsciiStrLen ("HTTP/1.0")) == 0) {
+      DEBUG ((DEBUG_VERBOSE, "HTTP: Server version is 1.0. Setting Connection close.\n"));
+      HttpInstance->ConnectionClose = TRUE;
+    }
+
     //
     // Search for Status Code.
     //
-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87354): https://edk2.groups.io/g/devel/message/87354
Mute This Topic: https://groups.io/mt/89636387/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 4/4] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers
Posted by Gerd Hoffmann 3 years, 11 months ago
On Tue, Mar 08, 2022 at 02:21:04PM +0100, Oliver Steffen wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720
> 
> Force connection close before the next request if
> the server identifies as version 1.0.
> 
> Signed-off-by: Oliver Steffen <osteffen@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87385): https://edk2.groups.io/g/devel/message/87385
Mute This Topic: https://groups.io/mt/89636387/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-