NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Add ConnectionClose flag to HTTP_PROTOCOL.
This boolean is FALSE by default. If set to TRUE, a reconfigure
of the Http instance is forced on the next request. The flag
is then reset.

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Oliver Steffen 2022-03-22 14:30:06 +01:00 committed by mergify[bot]
parent 3974aa539e
commit c43ff5188d
2 changed files with 7 additions and 1 deletions

View File

@ -161,6 +161,7 @@ EfiHttpConfigure (
HttpInstance->HttpVersion = HttpConfigData->HttpVersion;
HttpInstance->TimeOutMillisec = HttpConfigData->TimeOutMillisec;
HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6;
HttpInstance->ConnectionClose = FALSE;
if (HttpConfigData->LocalAddressIsIPv6) {
CopyMem (
@ -440,7 +441,8 @@ EfiHttpRequest (
//
ReConfigure = FALSE;
} else {
if ((HttpInstance->RemotePort == RemotePort) &&
if ((HttpInstance->ConnectionClose == FALSE) &&
(HttpInstance->RemotePort == RemotePort) &&
(AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
(!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
@ -649,6 +651,8 @@ EfiHttpRequest (
}
}
HttpInstance->ConnectionClose = FALSE;
//
// Transmit the request message.
//

View File

@ -194,6 +194,8 @@ typedef struct _HTTP_PROTOCOL {
EFI_TCP6_IO_TOKEN Tcp6TlsRxToken;
EFI_TCP6_RECEIVE_DATA Tcp6TlsRxData;
BOOLEAN TlsIsRxDone;
BOOLEAN ConnectionClose;
} HTTP_PROTOCOL;
typedef struct {