summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorOliver Steffen <osteffen@redhat.com>2022-03-22 14:30:04 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-11 15:12:46 +0000
commit38a9afd0fb0eda06a4fb9c3efd5bd2d191fe87b1 (patch)
tree56ce2ad5e7aef5576a3caa5db43e3d0569c86459 /NetworkPkg
parent35a4b63247cb4e42f3484dcf2b45ce9a4360596e (diff)
downloadedk2-38a9afd0fb0eda06a4fb9c3efd5bd2d191fe87b1.tar.gz
edk2-38a9afd0fb0eda06a4fb9c3efd5bd2d191fe87b1.tar.bz2
edk2-38a9afd0fb0eda06a4fb9c3efd5bd2d191fe87b1.zip
NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720 Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or HTTP_STATE_TCP_CLOSED and de-configure the Tcp4 instance before configuring it again. 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/HttpProto.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 9457dd2623..cd54c57404 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1086,6 +1086,18 @@ HttpConfigureTcp4 (
Tcp4Option->EnableNagle = TRUE;
Tcp4CfgData->ControlOption = Tcp4Option;
+ if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
+ (HttpInstance->State == HTTP_STATE_TCP_CLOSED))
+ {
+ Status = HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, NULL);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4(NULL) - %r\n", Status));
+ return Status;
+ }
+
+ HttpInstance->State = HTTP_STATE_TCP_UNCONFIGED;
+ }
+
Status = HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, Tcp4CfgData);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4 - %r\n", Status));