From nobody Tue May 14 20:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87831+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87831+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647955837; cv=none; d=zohomail.com; s=zohoarc; b=ebazsD4Bt31il3YZhX8vd2Tm7koVV0bhH+xMobquxAd6pwwLUEbRuBl7V5wbDBBsLXRvbYa5y94pPsMnOlZ+k9RrjbuV3ED4H+O3Qi4m8WwOw4bSu021vLBAtuojBNN6Jf81XpJOUyEniDuQt4TcOukEKgMwzhgrGbNVQTBJccw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647955837; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=WUmyioFEQBjdJpM1lYTdrp7KWY91DGs+FMCxCClqvMM=; b=Nur7TAxEMKJgK4neLONvF9QKwUwO8DtlCaNKHNXp93coZBZExYIUwEP8boa/yCz6/p4nIufzY1LXOhYjgbTnMDZWs63/JGgBNfgLA+ZYx4qbNev5hMjQ2hRJdjLVqwzz2EmxOHOlFHJqMTGaKdiblNqbwbwgkHGKf7cb+iA3mDc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87831+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1647955837911198.62787758081583; Tue, 22 Mar 2022 06:30:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KmSIYY1788612x14UTAcvdGb; Tue, 22 Mar 2022 06:30:37 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.9871.1647955834924461563 for ; Tue, 22 Mar 2022 06:30:35 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-JuUXuhexOeOuNB8Va030gw-1; Tue, 22 Mar 2022 09:30:30 -0400 X-MC-Unique: JuUXuhexOeOuNB8Va030gw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3494982A682; Tue, 22 Mar 2022 13:30:30 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15D8B400E54D; Tue, 22 Mar 2022 13:30:28 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [edk2-devel] [PATCH v3 1/5] NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring Date: Tue, 22 Mar 2022 14:30:04 +0100 Message-Id: <20220322133008.152037-2-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osteffen@redhat.com X-Gm-Message-State: tOhsQzrnE6uOOHiDbTHhxY4Ix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647955837; bh=JtfH5WkONEQIg3y9uaL/4v4v+17q6ZzvlDSPdZjsOEQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=cZmzPSfHQ3N7v+LMlv0DmOt1qVWrWfdfVA6eB0pHF5lfllgokkV9QHI4BKRWQAw3mMT Nczw+8vBEi7jMSJT2qOHqizu3kSROK3T5qBrv4ayIpEP2tb5pmaMDGsbNJNhzRmR1TgUB 1mk/TYGnBFyvsDdcy4mXUhMpSN0ecpOZNnI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647955840478100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 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 Reviewed-by: Maciej Rabeda --- NetworkPkg/HttpDxe/HttpProto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 9457dd2623d3..cd54c574044b 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -1086,6 +1086,18 @@ HttpConfigureTcp4 ( Tcp4Option->EnableNagle =3D TRUE; Tcp4CfgData->ControlOption =3D Tcp4Option; =20 + if ((HttpInstance->State =3D=3D HTTP_STATE_TCP_CONNECTED) || + (HttpInstance->State =3D=3D HTTP_STATE_TCP_CLOSED)) + { + Status =3D HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4(NULL) - %r\n", Status)); + return Status; + } + + HttpInstance->State =3D HTTP_STATE_TCP_UNCONFIGED; + } + Status =3D HttpInstance->Tcp4->Configure (HttpInstance->Tcp4, Tcp4CfgDat= a); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "HttpConfigureTcp4 - %r\n", Status)); --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87831): https://edk2.groups.io/g/devel/message/87831 Mute This Topic: https://groups.io/mt/89951841/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 20:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87832+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87832+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647955838; cv=none; d=zohomail.com; s=zohoarc; b=FPNC2nJyf9wRkWslkAV8BMnrCAo6V38QwiU0JumXOEoqVGuh4Qw/xFwrJw9w2kWt5itDFqkpbK9kBcLmTtymONMHHcXUOcf0myB3406/DWGNW4DlaHqLXmAkuT4xH5BwPAquX+YHIlDSPHtFdz5Fq8LXAgkRtkEl146R3bfAPIE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647955838; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=aAyrKJhjjyEhp6G3FfzBaU9FJvqHLeuQkHa8o93SVyw=; b=WNxok1sJzBrSCP/GshKaLYWTU8qTlbA89E0ixNjIX1rFC41eGwPHz1tpza6a55OpVSolCAC4UikW8gfzC68ToR3b3ueLEs7xGQYbSEIPImOiFHkGE6V/KCx6fjBfZKVCwkr4YvgY2HBrDBEVa3acUUsd758z3M6wZBRIy5WWrrU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87832+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1647955838023903.3302582062096; Tue, 22 Mar 2022 06:30:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UTppYY1788612xvoCZVS2JrK; Tue, 22 Mar 2022 06:30:37 -0700 X-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.web08.9886.1647955834925403734 for ; Tue, 22 Mar 2022 06:30:35 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-nOpeYlSHMzOKptaPHUACxw-1; Tue, 22 Mar 2022 09:30:32 -0400 X-MC-Unique: nOpeYlSHMzOKptaPHUACxw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B343B106655A; Tue, 22 Mar 2022 13:30:31 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7557340CF900; Tue, 22 Mar 2022 13:30:30 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [edk2-devel] [PATCH v3 2/5] NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring Date: Tue, 22 Mar 2022 14:30:05 +0100 Message-Id: <20220322133008.152037-3-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osteffen@redhat.com X-Gm-Message-State: UwD6eEOs5z6JJM9c30ExmuzJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647955837; bh=iOjBYPwzmr1tFp/obuUcpcAVSm0TY9prMt5xTi3AXQc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=pPV3sylyI6liaY0vUQbLL++dzAPhhLylveYRrkuMydNImKa4Ix8eHV+47wQUspDW+xW h4eyzKu49YhKlHRXgWbko0O7aC1+qK9/WsaYYxclRS/mzIKJsyytfppqj3xJM8j7GK9LF 4Kcg4H9IpfSbBTZR79RezDtHdVNqJJqjebg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647956741590100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 Check if the state of the HTTP instance is HTTP_STATE_TCP_CONNECTED, or HTTP_STATE_TCP_CLOSED and de-configure the Tcp6 instance before configuring it again. Signed-off-by: Oliver Steffen Reviewed-by: Maciej Rabeda --- NetworkPkg/HttpDxe/HttpProto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index cd54c574044b..33ae622c3f0b 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -1168,6 +1168,18 @@ HttpConfigureTcp6 ( Tcp6Option->KeepAliveInterval =3D HTTP_KEEP_ALIVE_INTERVAL; Tcp6Option->EnableNagle =3D TRUE; =20 + if ((HttpInstance->State =3D=3D HTTP_STATE_TCP_CONNECTED) || + (HttpInstance->State =3D=3D HTTP_STATE_TCP_CLOSED)) + { + Status =3D HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6(NULL) - %r\n", Status)); + return Status; + } + + HttpInstance->State =3D HTTP_STATE_TCP_UNCONFIGED; + } + Status =3D HttpInstance->Tcp6->Configure (HttpInstance->Tcp6, Tcp6CfgDat= a); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "HttpConfigureTcp6 - %r\n", Status)); --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87832): https://edk2.groups.io/g/devel/message/87832 Mute This Topic: https://groups.io/mt/89951842/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 20:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87836+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87836+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647955844; cv=none; d=zohomail.com; s=zohoarc; b=Yg89IpnjqyJC8uLCDifq7+lQq/kVyODhtIMhN+DdFjl7aGVI/GKDpPDvO+HZZqR/5V3DpvGxvZBtI59ttV74KVcmnnv3jyJ9D6RR/JjCnIXUmWcvfS66ay/oi5Ehn6wJYbvA19xlUiO8xOu0jgfplEF9QwD13ZIFdBKnVdoOwKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647955844; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=2eV1zVA7+3xEp0x9HE0Pn3LTwVuUvsygY1VPFF/8klY=; b=DfGwA6J+rqlhqMjUEQ8Yw8041c7reipNHY2rOpLM3+JbK/xqeBswNxhs0uy22UfzYPVlAJpxd8vFOLmjxwERdSZO/ygl8p0Z4GPnNDK2ezlwQhe7C6FoRqx8xfBbJLnJTfAM1ZjlIPZbGqg2OhRERuCNsgXWC7vFqfyR/0zp97U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87836+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1647955844321949.0366209836875; Tue, 22 Mar 2022 06:30:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id YqKoYY1788612xFFvP6GKkBi; Tue, 22 Mar 2022 06:30:44 -0700 X-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.web08.9888.1647955843096792589 for ; Tue, 22 Mar 2022 06:30:43 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-VGho3cxGN7C7CnwrKGbeVQ-1; Tue, 22 Mar 2022 09:30:37 -0400 X-MC-Unique: VGho3cxGN7C7CnwrKGbeVQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D01611C01E82; Tue, 22 Mar 2022 13:30:33 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1097F40CF900; Tue, 22 Mar 2022 13:30:31 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [edk2-devel] [PATCH v3 3/5] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL Date: Tue, 22 Mar 2022 14:30:06 +0100 Message-Id: <20220322133008.152037-4-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osteffen@redhat.com X-Gm-Message-State: wxTxXM36xxECbGj4DfjljOmgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647955844; bh=TYaTXdUv1djOoyFp+/BvPmtcYl5Gl1ypwOYDHcVw7Gw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ODdiQeCsRFgNuP9t1LN1/ffCj24WNLeTaZpxyfxCAUsD9VBEPOOYrv4CjuiDPZf0kCL Gq2GgFVkktN9kSHfn7O99MFwIQH8vlD+RlCdTaknc+l/nDpUMh9QW0e9qnWfq8Ft84X34 AbIPQpSvfqIosgpUp1kwQ7xNOJD90UrT6FY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647955846297100009 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 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 Reviewed-by: Maciej Rabeda --- NetworkPkg/HttpDxe/HttpProto.h | 2 ++ NetworkPkg/HttpDxe/HttpImpl.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h index 8ed99c7a02d3..620eb3915843 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; =20 typedef struct { diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index d64cd9e965c0..d8b014c94f3a 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -161,6 +161,7 @@ EfiHttpConfigure ( HttpInstance->HttpVersion =3D HttpConfigData->HttpVersion; HttpInstance->TimeOutMillisec =3D HttpConfigData->TimeOutMillisec; HttpInstance->LocalAddressIsIPv6 =3D HttpConfigData->LocalAddressIsIPv= 6; + HttpInstance->ConnectionClose =3D FALSE; =20 if (HttpConfigData->LocalAddressIsIPv6) { CopyMem ( @@ -440,7 +441,8 @@ EfiHttpRequest ( // ReConfigure =3D FALSE; } else { - if ((HttpInstance->RemotePort =3D=3D RemotePort) && + if ((HttpInstance->ConnectionClose =3D=3D FALSE) && + (HttpInstance->RemotePort =3D=3D RemotePort) && (AsciiStrCmp (HttpInstance->RemoteHost, HostName) =3D=3D 0) && (!HttpInstance->UseHttps || (HttpInstance->UseHttps && !TlsConfigure && @@ -649,6 +651,8 @@ EfiHttpRequest ( } } =20 + HttpInstance->ConnectionClose =3D FALSE; + // // Transmit the request message. // --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87836): https://edk2.groups.io/g/devel/message/87836 Mute This Topic: https://groups.io/mt/89951850/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 20:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87834+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87834+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647955843; cv=none; d=zohomail.com; s=zohoarc; b=UBPsfuwY8sTFIjqCV29UOhZmftdx1MdT2XIVa9/WM6RsQbTU0/Yvt+ACCATOTK6/9fIB1LlYqjFSZa9pj6PpEJQ3NIW1/6FFydqJDL4IG9nkT7+UjFPFuiI+P42ZJpEFAX4gh2sRrlFJmrbzu5ZeHXZRtOBiWKu/Q8pGS1n/VC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647955843; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=nPaoxUbU/AuFCPQZeotpsl/PGTRpVr34lxp4JG0/2n8=; b=c7wwOx812AfDGUYshyB1S9rUesdDSmCRs2vlrRaVzrkeiyHfZc6A3wf0iX4JOzep1cgvBSZFv8imFyXNULLNktl1tJPg3BaGQXGwq3bqwDQQp/4XM9fnagg+DBU7D3szXyrTB8wK9baXRvVx4eoIyo8V5G9FuKWeQ0DnZl0vais= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87834+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1647955843162546.4929013385944; Tue, 22 Mar 2022 06:30:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id P9KgYY1788612xcgsXkOqMSu; Tue, 22 Mar 2022 06:30:42 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.9875.1647955841572732868 for ; Tue, 22 Mar 2022 06:30:41 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-EtTEogfpMdGfjaIgmYyCdw-1; Tue, 22 Mar 2022 09:30:36 -0400 X-MC-Unique: EtTEogfpMdGfjaIgmYyCdw-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0F2682A682; Tue, 22 Mar 2022 13:30:35 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3452B40CF900; Tue, 22 Mar 2022 13:30:34 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [edk2-devel] [PATCH v3 4/5] NetworkPkg/HttpDxe: Detect 'Connection: close' header Date: Tue, 22 Mar 2022 14:30:07 +0100 Message-Id: <20220322133008.152037-5-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osteffen@redhat.com X-Gm-Message-State: uoi4XRhfB07MtBWon7EWwdzkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647955842; bh=m/LuqnbAR7gdeiAG8qxARYAjGEOLbqhYZ2F/lqYn/XA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=RJkVcxANuhiRYaTltpBXgSSVC8aSl/3Iq3nHJRsVPHULTmPoaiS5mKG9wMAjleFhBt/ pOJGJUPIsnB03sWdODke8DUi//dsb02kmKdouLtFNT59splCx4Nli4F3eBMCgWKjhDnWS KO6M6i0Tb9qGz0msOAEQbZTAPVV1YI+fj/4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647955844254100004 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 Force connection close before the next request if the server sends the 'Connection: close' header. Signed-off-by: Oliver Steffen Reviewed-by: Maciej Rabeda --- NetworkPkg/HttpDxe/HttpImpl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index d8b014c94f3a..d40d55ac92ad 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -994,6 +994,7 @@ HttpResponseWorker ( UINTN HdrLen; NET_FRAGMENT Fragment; UINT32 TimeoutValue; + UINTN index; =20 if ((Wrap =3D=3D NULL) || (Wrap->HttpInstance =3D=3D NULL)) { return EFI_INVALID_PARAMETER; @@ -1200,6 +1201,16 @@ HttpResponseWorker ( FreePool (HttpHeaders); HttpHeaders =3D NULL; =20 + for (index =3D 0; index < HttpMsg->HeaderCount; ++index) { + if ((AsciiStriCmp ("Connection", HttpMsg->Headers[index].FieldName= ) =3D=3D 0) && + (AsciiStriCmp ("close", HttpMsg->Headers[index].FieldValue) = =3D=3D 0)) + { + DEBUG ((DEBUG_VERBOSE, "Http: 'Connection: close' header receive= d.\n")); + HttpInstance->ConnectionClose =3D TRUE; + break; + } + } + // // Init message-body parser by header information. // --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87834): https://edk2.groups.io/g/devel/message/87834 Mute This Topic: https://groups.io/mt/89951848/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 14 20:12:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87835+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87835+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647955843; cv=none; d=zohomail.com; s=zohoarc; b=U4baTwmgE6fgorXSfjB9ji28/U7qOzA/FGyrwK+NLxl9Ot9Fgn97Ghnh6LtexIQAOE5KuwHtORdhSyZzi9IGxc7WTshCof30qyPiKtycbyBHufD8+GxGnKkFAk7fnq3SFDDwy8+YZ+AZTK1uMZ4XdNNRFZ3AqmtTRt07JwyjvQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647955843; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=6MxuKIoSE0fTNOl21bkOvCR5LrGN+fZgn/HMRxzs3dI=; b=Z/k88ut0PczZQfRXOnn3Y+i/sumrDpcdE8vruTwNrAOcmtEZEH8ZxtvOm0zgn7gyiCMahW9v6ilsKpGg1bz0QSbLNU67O7NRPKubbI9K/Vd/glYg66+EcXee0ON+FRF8KZLmdhxyn1r1IaOAMDlRrsGmqctczFSavdwvydUp0zE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87835+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1647955843257491.74686618241526; Tue, 22 Mar 2022 06:30:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id bQMRYY1788612xwMRbuQvPV9; Tue, 22 Mar 2022 06:30:42 -0700 X-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.9771.1647955842053401887 for ; Tue, 22 Mar 2022 06:30:42 -0700 X-Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-575-xY2r7-yePPO758DYQsjpRg-1; Tue, 22 Mar 2022 09:30:37 -0400 X-MC-Unique: xY2r7-yePPO758DYQsjpRg-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 592A92A2AD63; Tue, 22 Mar 2022 13:30:37 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1681D400E875; Tue, 22 Mar 2022 13:30:35 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: maciej.rabeda@linux.intel.com, jiaxin.wu@intel.com, siyuan.fu@intel.com, kraxel@redhat.com, Oliver Steffen Subject: [edk2-devel] [PATCH v3 5/5] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers Date: Tue, 22 Mar 2022 14:30:08 +0100 Message-Id: <20220322133008.152037-6-osteffen@redhat.com> In-Reply-To: <20220322133008.152037-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220322133008.152037-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osteffen@redhat.com X-Gm-Message-State: uVlfGIX7MVmQ6VXll9Rs4yXBx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647955842; bh=lNXZ+QkeZvvZMOqhjnUHEN7sLtoDei1K13/+vSSBFlM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=lmq6i9stCsUxGUUnmzLtXgjXykvtHYb6/GoZrnYr5dgXKRBy+DxGFkehvRKV/SunVsT Bh+emRIEHVC7O823GTou68uj6Z1+mks7zmJdn5bhqmbbbsWk735d4dd7w52sCb1wesCPv v6vjqrdWX23sJXrgqcL18Nu7oUX6SOuurt0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647955844236100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 Force connection close before the next request if the server identifies as version 1.0. Signed-off-by: Oliver Steffen Reviewed-by: Maciej Rabeda --- NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index d40d55ac92ad..623e029c606e 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -1105,6 +1105,14 @@ HttpResponseWorker ( HttpInstance->CacheLen =3D BodyLen; } =20 + // + // Check server's HTTP version. + // + if (AsciiStrnCmp (HttpHeaders, "HTTP/1.0", AsciiStrLen ("HTTP/1.0")) = =3D=3D 0) { + DEBUG ((DEBUG_VERBOSE, "HTTP: Server version is 1.0. Setting Connect= ion close.\n")); + HttpInstance->ConnectionClose =3D TRUE; + } + // // Search for Status Code. // --=20 2.35.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87835): https://edk2.groups.io/g/devel/message/87835 Mute This Topic: https://groups.io/mt/89951849/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-