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>
UINTN HdrLen;\r
NET_FRAGMENT Fragment;\r
UINT32 TimeoutValue;\r
+ UINTN Index;\r
\r
if ((Wrap == NULL) || (Wrap->HttpInstance == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
FreePool (HttpHeaders);\r
HttpHeaders = NULL;\r
\r
+ for (Index = 0; Index < HttpMsg->HeaderCount; ++Index) {\r
+ if ((AsciiStriCmp ("Connection", HttpMsg->Headers[Index].FieldName) == 0) &&\r
+ (AsciiStriCmp ("close", HttpMsg->Headers[Index].FieldValue) == 0))\r
+ {\r
+ DEBUG ((DEBUG_VERBOSE, "Http: 'Connection: close' header received.\n"));\r
+ HttpInstance->ConnectionClose = TRUE;\r
+ break;\r
+ }\r
+ }\r
+\r
//\r
// Init message-body parser by header information.\r
//\r