[edk2-devel] [PATCH 2/4] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL

Oliver Steffen posted 4 patches 3 years, 11 months ago
There is a newer version of this series
[edk2-devel] [PATCH 2/4] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL
Posted by Oliver Steffen 3 years, 11 months ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720

Add ConnectionClose flag fo 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>
---
 NetworkPkg/HttpDxe/HttpImpl.c  | 6 +++++-
 NetworkPkg/HttpDxe/HttpProto.h | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index d64cd9e965..d8b014c94f 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -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.

   //

diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h
index 8ed99c7a02..620eb39158 100644
--- a/NetworkPkg/HttpDxe/HttpProto.h
+++ b/NetworkPkg/HttpDxe/HttpProto.h
@@ -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 {

-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87285): https://edk2.groups.io/g/devel/message/87285
Mute This Topic: https://groups.io/mt/89555129/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/4] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL
Posted by Gerd Hoffmann 3 years, 11 months ago
  Hi,

> -      if ((HttpInstance->RemotePort == RemotePort) &&
> 
> +      if ((HttpInstance->ConnectionClose == FALSE) &&
> 
> +          (HttpInstance->RemotePort == RemotePort) &&

Adding a check for the port makes sense, but that change should also be
mentioned in the commit message (or splitted into a separate patch, but
that's probably overkill for a one-liner).

take care,
  Gerd



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