summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorOliver Steffen <osteffen@redhat.com>2022-03-22 14:30:07 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-11 15:12:46 +0000
commit753fd319e22c6d900c7c77d025bfc33976534e7f (patch)
treeb327227ce4bd121211799642d7b4487c5466174a /NetworkPkg
parentc43ff5188d7e75292ecdee734db64c5b42a7a313 (diff)
downloadedk2-753fd319e22c6d900c7c77d025bfc33976534e7f.tar.gz
edk2-753fd319e22c6d900c7c77d025bfc33976534e7f.tar.bz2
edk2-753fd319e22c6d900c7c77d025bfc33976534e7f.zip
NetworkPkg/HttpDxe: Detect 'Connection: close' header
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720 Force connection close before the next request if the server sends the 'Connection: close' header. Signed-off-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpDxe/HttpImpl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d8b014c94f..4ec2e8f667 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -994,6 +994,7 @@ HttpResponseWorker (
UINTN HdrLen;
NET_FRAGMENT Fragment;
UINT32 TimeoutValue;
+ UINTN Index;
if ((Wrap == NULL) || (Wrap->HttpInstance == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -1200,6 +1201,16 @@ HttpResponseWorker (
FreePool (HttpHeaders);
HttpHeaders = NULL;
+ for (Index = 0; Index < HttpMsg->HeaderCount; ++Index) {
+ if ((AsciiStriCmp ("Connection", HttpMsg->Headers[Index].FieldName) == 0) &&
+ (AsciiStriCmp ("close", HttpMsg->Headers[Index].FieldValue) == 0))
+ {
+ DEBUG ((DEBUG_VERBOSE, "Http: 'Connection: close' header received.\n"));
+ HttpInstance->ConnectionClose = TRUE;
+ break;
+ }
+ }
+
//
// Init message-body parser by header information.
//