From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web12.6944.1646400926917922820 for ; Fri, 04 Mar 2022 05:35:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jDJS6/Lt; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646400926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7/AaGn8Ew7f3vn9AP3auI2dE4aZ8oNFSBqHPxTlbXyM=; b=jDJS6/Ltfpz2Ps+7z1GtHWkvu05s8unuJn4tlwddMGwgabFTOHgCePJnwrP+i2IOeal8gl Z5thVN67f5w8Dpl4ewKWFX0JKn/ZXwmpn5w9hincyxx33eSaaHl2sD5X0vGOIRIk9OXcNN ZhYK1kEr2vYLlBghLjwazqktPXm2xDM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-157-V5x35-68P3eUB_89tX80NQ-1; Fri, 04 Mar 2022 08:35:23 -0500 X-MC-Unique: V5x35-68P3eUB_89tX80NQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B67781091DA1 for ; Fri, 4 Mar 2022 13:35:22 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.39.194.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E1D37B5F1; Fri, 4 Mar 2022 13:35:21 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [PATCH 2/4] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL Date: Fri, 4 Mar 2022 14:34:29 +0100 Message-Id: <20220304133431.53378-3-osteffen@redhat.com> In-Reply-To: <20220304133431.53378-1-osteffen@redhat.com> References: <20220304133431.53378-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=osteffen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="US-ASCII" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 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 --- 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 =3D HttpConfigData->HttpVersion;=0D HttpInstance->TimeOutMillisec =3D HttpConfigData->TimeOutMillisec;= =0D HttpInstance->LocalAddressIsIPv6 =3D HttpConfigData->LocalAddressIsIPv= 6;=0D + HttpInstance->ConnectionClose =3D FALSE;=0D =20=0D if (HttpConfigData->LocalAddressIsIPv6) {=0D CopyMem (=0D @@ -440,7 +441,8 @@ EfiHttpRequest ( //=0D ReConfigure =3D FALSE;=0D } else {=0D - if ((HttpInstance->RemotePort =3D=3D RemotePort) &&=0D + if ((HttpInstance->ConnectionClose =3D=3D FALSE) &&=0D + (HttpInstance->RemotePort =3D=3D RemotePort) &&=0D (AsciiStrCmp (HttpInstance->RemoteHost, HostName) =3D=3D 0) &&= =0D (!HttpInstance->UseHttps || (HttpInstance->UseHttps &&=0D !TlsConfigure &&=0D @@ -649,6 +651,8 @@ EfiHttpRequest ( }=0D }=0D =20=0D + HttpInstance->ConnectionClose =3D FALSE;=0D +=0D //=0D // Transmit the request message.=0D //=0D 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;=0D EFI_TCP6_RECEIVE_DATA Tcp6TlsRxData;=0D BOOLEAN TlsIsRxDone;=0D +=0D + BOOLEAN ConnectionClose;=0D } HTTP_PROTOCOL;=0D =20=0D typedef struct {=0D --=20 2.35.1