From nobody Tue May 14 02:19:18 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+87591+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+87591+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647351769; cv=none; d=zohomail.com; s=zohoarc; b=EpogE7gMZpGYsCuwqUHRtGUUHAeQKKN5Kbo4BGK4F61oiBimB5FJeOdfZM+cMdeofi8lJZaa+Ns6RrE/HC9ZGXAJuvDC4+J1+kA9lEZzLlnNW+34AS3/cF6j0bFMY0DpzBzJPgi+6FSu+KpPGZbVqn0KiHFtigR3sQiJNgS7b/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647351769; 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=6sOo3JZ27splJiTg+d+IhBEf4IDmRvw7Ypc/qqFd1LU=; b=E4QRNGzgSkDnkc5OpyYYW1KT+ROTr7P691EAZvGIcIrEE6R3jKKNybAUkSMK7z2cPoYuSFVsZVXfkqlfm/V2EeIHCdvYZYW4u6u1VkMN1s6EglGpyNmtdm2EwiciWL1kJ/watMxFBKb/s6393T+x6rIFr+gvtzaM9xF6+zkkpQw= 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+87591+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 1647351769255778.0205194718645; Tue, 15 Mar 2022 06:42:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9GN8YY1788612xj86rHBqpnp; Tue, 15 Mar 2022 06:42:48 -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.11036.1647351762260113190 for ; Tue, 15 Mar 2022 06:42: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-441-nhytyhXhPbqYDjf5Y7IYWg-1; Tue, 15 Mar 2022 09:42:38 -0400 X-MC-Unique: nhytyhXhPbqYDjf5Y7IYWg-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 2FADA3811F22 for ; Tue, 15 Mar 2022 13:42:38 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA79D4082387; Tue, 15 Mar 2022 13:42:37 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v3 1/5] NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring Date: Tue, 15 Mar 2022 14:42:25 +0100 Message-Id: <20220315134229.391909-2-osteffen@redhat.com> In-Reply-To: <20220315134229.391909-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220315134229.391909-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: hyvjRCMMZtPFwFCbmNTWN59Dx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647351768; bh=v2mY8Kl1bvYjJe7bJzQDvix/Zq7ZP74MwNkLKnZpmzo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qBA+eI4EOMtddahPP0h05rvllt6/wrJr5PdtDOyQP5TM8DknHa3ZlW0xbDwWwZTMvqM t3ixreP7p7XbdDcSsxs1w/ulAzOzVnb5aB12BEk+jCyXx1UjB1rMPNz8Zs3duryL5mieB WaMt2gzLx7G5URFZGG1fHzvOpPam5bJqts4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647351771281100005 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: Gerd Hoffmann --- 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 (#87591): https://edk2.groups.io/g/devel/message/87591 Mute This Topic: https://groups.io/mt/89797767/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 02:19:18 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+87593+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+87593+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647351765; cv=none; d=zohomail.com; s=zohoarc; b=WL964OTwNnATSpHmPCa2pWU+i236iPK0CkqJNe7Yx6EbpbP7CLvHvz5eGSWM7CPVBV0kNUB3a3DzAryZ7gVYdMeKl22GhFx2zD0c8YV1vJtKuoMfV852/zGh+ps6PNnooEM7EzDE0ffOmay9pwsPEzzgCZVskFaQFBSJOXEQhnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647351765; 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=IAXwMBMwc5fgxPdQNOD3Dz3MoAEt3uvDV5gpLjKXy4M=; b=hR25zSve5SUOtVdMCJytqRTS5jqIWQI3jo8yfhTbVbZb216DKK84ZF6jdf2J8A5WYxubfJTgvsa3YrlpKBTDBhdIm7mqThXBjKHeOvsF/v7RcBxovuAHaqPyjupsgSgGB16RKInOUtwYL3NcrA2a8OGm8sJBULnfdBPEfbZVJtM= 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+87593+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 1647351765011460.98652354172407; Tue, 15 Mar 2022 06:42:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Qxs2YY1788612xP00xW5O2kt; Tue, 15 Mar 2022 06:42: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.web10.11052.1647351762726299205 for ; Tue, 15 Mar 2022 06:42: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-499-wN1NybaLMNajfYD63NGWvw-1; Tue, 15 Mar 2022 09:42:39 -0400 X-MC-Unique: wN1NybaLMNajfYD63NGWvw-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 E8A051C05AD3 for ; Tue, 15 Mar 2022 13:42:38 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DE434082387; Tue, 15 Mar 2022 13:42:38 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v3 2/5] NetworkPkg/HttpDxe: Decofigure Tcp6 before reconfiguring Date: Tue, 15 Mar 2022 14:42:26 +0100 Message-Id: <20220315134229.391909-3-osteffen@redhat.com> In-Reply-To: <20220315134229.391909-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220315134229.391909-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: jVE9r4ESrNL9B92AwrLVM0k2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647351764; bh=FpIpUXa+yuam4/s/5GuCZQNzid7u7UeGdWJP2yR/yVM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XO6zAnrBed0e7t/UEJhAMUyNI8Yi7GE53XtsbO1dYik/2l5deNT/pfLc+SQTpa3sSd8 GIYL551aNMIilr2QwcmuK5U5FaiI0WwPqi76FhUGvPYLEiJk5IMVkfmVBqxy6Uj3s9RTN q4lcMo30inhnYpvWDFLIIiFlULsYXYrssuY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647351766042100006 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: Gerd Hoffmann --- 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 (#87593): https://edk2.groups.io/g/devel/message/87593 Mute This Topic: https://groups.io/mt/89797770/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 02:19:18 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+87595+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+87595+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647351764; cv=none; d=zohomail.com; s=zohoarc; b=RGfm9DZQcBzdvHtKgGBgArLvZP2tSqpTYXwI/cqNE8nnPaq9VTnKh2uAF7ajwRettYBJWyBVETAv5dwbksHEj06P+xpty/EXjvi6Fn+EXlpAOgSU7/Y/bSgtDZGolpQGQkIY6ljunNSc69UkHDd5pGuC1D2KY0LUjIbq0oPKkHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647351764; 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=vzSwe860nRf7oQ4BwwoS2jeUMDXWgSE6fFZ6Oof561A=; b=L8APqgJjy6phAjTd8I0wDnBL/tJPuRlC8JwjlH98T3Sy0aa65DaWqpwZvdtGNvtOK2MpvcDyGqZ+ZksIfS94pPvWcs9Z3MR4D5RdIzYzsUSXk75g99mNEOtH+E28wt0Pt9xL278dnMF+We3d91MPQJ1qjgRdtqnsZJYGpsdBaEU= 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+87595+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 1647351764868318.12119633461305; Tue, 15 Mar 2022 06:42:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id lhEMYY1788612xZp9pGpNZv6; Tue, 15 Mar 2022 06:42: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.web12.10814.1647351763317765999 for ; Tue, 15 Mar 2022 06:42: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-453-ba1eiOakOJ-KJxuyz1kvJA-1; Tue, 15 Mar 2022 09:42:40 -0400 X-MC-Unique: ba1eiOakOJ-KJxuyz1kvJA-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 A7DD029ABA2A for ; Tue, 15 Mar 2022 13:42:39 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2EB894082387; Tue, 15 Mar 2022 13:42:39 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v3 3/5] NetworkPkg/HttpDxe: Add ConnectionClose flag fo HTTP_PROTOCOL Date: Tue, 15 Mar 2022 14:42:27 +0100 Message-Id: <20220315134229.391909-4-osteffen@redhat.com> In-Reply-To: <20220315134229.391909-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220315134229.391909-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: lKDbnJ8n8QKUi4ZTZNadUNHkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647351764; bh=5ppRt4yxPAkpTnJ7gb+RwYod6vIttHJIbti3BOxRKEw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=ntS1H0WDsX+mAWh0exIxdnciBid1MM+Zt1bDzgZQ8zTKOoQqxtC1mexYl/X8m9cW+2G TCf5k4kL50xZMkU2Eptw4ItpCzACr2AFrF7PQ0PkzHH5uCpXQW1l1eU76YvDPNhYo6omS BWqU5thN7ys8n38mn+nl0rb/Yd9vdkTS2Qs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647351766032100003 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: Gerd Hoffmann --- 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 (#87595): https://edk2.groups.io/g/devel/message/87595 Mute This Topic: https://groups.io/mt/89797772/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 02:19:18 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+87594+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+87594+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647351765; cv=none; d=zohomail.com; s=zohoarc; b=RqGazyBgDVHtUdhk82u/s3tgZpgcAfs0PlPee9DB7dVxIdrpjJEKqF80CC1UhKk/uHUt9O9HRCtMkRqj+EDfvCAjMIPi9t459/TVKBOIeaVHfZ4MmIvRH3Ivo2F0U76AzabwOPlfo0uRpUrsdhcSpHW1Ak5VnruTFT0q4PMlWVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647351765; 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=771lV3+OtlDx3aZsY3Ch3ZC5XrLFU+HXe8nwO43lzs0=; b=gxHARx0Fa7F12IlJ+EC004KvG1vvdyKk0kZ/COiK5xfUOscjC2M7w+B3wFRN4xCYK5wjF9wZmLC9UNNKdSwW73NovtzkNMotl+zu4sogbro4EDXJf9OHmEPzf1Tznuj1CkrG+1HZiaWklBGcMvFbSdZfOQoaL5M8J1jOX2PT1rM= 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+87594+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 1647351765906687.194208069338; Tue, 15 Mar 2022 06:42:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zEZHYY1788612xvGTz5f1VpE; Tue, 15 Mar 2022 06:42:45 -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.web11.11010.1647351762646861135 for ; Tue, 15 Mar 2022 06:42: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-608-Tr-iHEKaOD6rmITUrq0VIA-1; Tue, 15 Mar 2022 09:42:40 -0400 X-MC-Unique: Tr-iHEKaOD6rmITUrq0VIA-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 6756B2999B3B for ; Tue, 15 Mar 2022 13:42:40 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2124408238D; Tue, 15 Mar 2022 13:42:39 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v3 4/5] NetworkPkg/HttpDxe: Detect 'Connection: close' header Date: Tue, 15 Mar 2022 14:42:28 +0100 Message-Id: <20220315134229.391909-5-osteffen@redhat.com> In-Reply-To: <20220315134229.391909-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220315134229.391909-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: yFxOwgcmyBblcdVtfk83MVKRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647351765; bh=j17plf4Y+u5YmGIyLVHwCsQY19h+XHs81HD3BgXBKAU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qN02Mr6GWL1UydBSeCA0HrwoN8FzsF3uZByiav+/1cFv8d8h5+CrhQR1kYDJ9Iio3K7 LNnTvknsAkf2OgxsAX77cKQqJGb047lkQreReVmuipkBiIDAhXs3L4aoRb4NhnHrblUKr hXP09rKEyhwzFaw1y0mMum+laZvBiDkncaY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647351769208100002 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: Gerd Hoffmann --- 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 (#87594): https://edk2.groups.io/g/devel/message/87594 Mute This Topic: https://groups.io/mt/89797771/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 02:19:18 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+87596+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+87596+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1647351765; cv=none; d=zohomail.com; s=zohoarc; b=k+J+K/uuLinodjNUU0r7o2hKsYbdgnxhu839+18X2s0kerrV5FuKdab8WT/xXz/KFBXr1Qj16kUXKwDEBMB24ZiEuvuJHfjHENRkF/xFWr8TLAxUsZPxh0JKBKDXRivQmOUTu1JPBedwuPo0zMNQmIi0q7cck78hL145AN9ne/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1647351765; 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=/TKDqXLUa1aLgHf7ddzzEuMvyov+u5OgzfGCxljQBBw=; b=EwOQDtYC9PXvbeoIZs6H3q8fM70Mm6QBuigSuWh/xVYtV3MnClRrZ7Ht4UYwMC8U++l3yhqM7GyVRkCwmKZbVWPmqhDCygzeTKzhKndFUs9jDGxwLoEXIEpdOw8pR5QvskAdUYLWN2C4SgKwfV51M8McvYs9Iac3V4M18QNDWA8= 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+87596+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 1647351765704977.4205165215363; Tue, 15 Mar 2022 06:42:45 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mArBYY1788612xvgQhrI3x2Y; Tue, 15 Mar 2022 06:42:45 -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.10815.1647351763391584407 for ; Tue, 15 Mar 2022 06:42:43 -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-13-55sm2rT8NM2bsAr-1neRBg-1; Tue, 15 Mar 2022 09:42:41 -0400 X-MC-Unique: 55sm2rT8NM2bsAr-1neRBg-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 2821383DD2B for ; Tue, 15 Mar 2022 13:42:41 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.195.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id A35F84082387; Tue, 15 Mar 2022 13:42:40 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v3 5/5] NetworkPkg/HttpDxe: Detect HTTP/1.0 servers Date: Tue, 15 Mar 2022 14:42:29 +0100 Message-Id: <20220315134229.391909-6-osteffen@redhat.com> In-Reply-To: <20220315134229.391909-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220315134229.391909-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: u0Yjzp3xeEsbjcWPHIR6fzHdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647351765; bh=p3Ltjpf/Dns05gArNm9qTky/W9CqueTUdiGLyrkVfUI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=dDbdBa2DvAZ145DbZGr36QNuvbvxvV4aV+1iTqEEMysSEImC/sA6cXyuBe0G1sUnFAu Vt7OXNwwjfI1avzuP+HH8EDlyG4K+N8xQdACxEMG2MUGCvnOwNvxgxB+T70WE/eYG1ZHh n8dPCPiU13Dx8mUp8EK5xOcYqHhb/fuMFVk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1647351766031100002 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: Gerd Hoffmann --- 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 (#87596): https://edk2.groups.io/g/devel/message/87596 Mute This Topic: https://groups.io/mt/89797773/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-