From nobody Sun May 19 20:47:25 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+87284+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+87284+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646417806; cv=none; d=zohomail.com; s=zohoarc; b=H1M4I5r3ULyAjXv6UbGL2FMMkMHZSgW74ynIJ/C2oDs4IQRPiWVDtcY+M/eeS6NIToRVGAiTyx/s5mdCu/9Lmpqfu9ZyXg8gW+UV90PRC+w4VSgj5BkWhXD2MeusRu5MiJOY2ZHyoMgJb9kqCrwIDE6uyrSOMzNpFOpHMIsi8Bc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646417806; 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=SZ9wVhXLXoIze+3L+uY1/RqYuOLBPXFX7CQvaKLutFw=; b=HlrAIsUaAYJ98NEPpHEF7KoDGU0LA6AKS9c1H/p4c6m09fWmOW5k+n3I9Bf2OLvXbO0ZTUk/iyEQEgw9ilI9YV4vgszdopNUaHQOGACAE+Ba95uDRHJcgyvLq1MwB74jF4SsSdN937mGhWx1qulPp4CCHdWOywdh6bueZ2l/A8c= 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+87284+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 1646417806366277.12250730859546; Fri, 4 Mar 2022 10:16:46 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id f6d7YY1788612xQ2GtGdgem7; Fri, 04 Mar 2022 10:16:46 -0800 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.web09.6906.1646400926550513006 for ; Fri, 04 Mar 2022 05:35:27 -0800 X-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-563-HP3izbB7OICTgdD_zSiWFQ-1; Fri, 04 Mar 2022 08:35:22 -0500 X-MC-Unique: HP3izbB7OICTgdD_zSiWFQ-1 X-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 B55C4653 for ; Fri, 4 Mar 2022 13:35:21 +0000 (UTC) X-Received: from osteffen-laptop.redhat.com (unknown [10.39.194.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 106177B5F1; Fri, 4 Mar 2022 13:35:20 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH 1/4] NetworkPkg/HttpDxe: Decofigure Tcp4 before reconfiguring Date: Fri, 4 Mar 2022 14:34:28 +0100 Message-Id: <20220304133431.53378-2-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 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: YsgRjNeChWMIO7ftYUeTLGNdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646417806; bh=GfB9AxX6Ex6kOgLYV4CpEO/ljwWtw01MgfBtTPoZZg8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=QDRL8nSYstcfQSsVLYyeMejYWiecRM6ysPNjQ/78uB+39GXBJOqqw9iS1uu50WacujH NCaiSaYF53wxcljDGV9esjy5tNSlgVCPdcB4zg44gHY0y7PS3mW0MC5eYmkrKEGvvDoQL CZnvG97cz+JESWqxcxtpJraPSO6jU44yPIM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646417808276100006 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 --- NetworkPkg/HttpDxe/HttpProto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 =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 (#87284): https://edk2.groups.io/g/devel/message/87284 Mute This Topic: https://groups.io/mt/89555128/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 Sun May 19 20:47:25 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+87285+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+87285+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646417806; cv=none; d=zohomail.com; s=zohoarc; b=O5IqQKgPL1TbsM23WOrulDVwugKCQWtiAUjPWdtsb8BE56a8IDSVek4xDPN2VCNnO9/EnYs6KwkFbPDbOBt8eMuZv4tIAEjBHAFO9gSqYVog70LV6N7+6Qn6oH8ugp+nIA+inVTDdRDZ2nhF79FfVigoEWo7x3d7HphtDKFaEwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646417806; 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=qh8Q109C+2ibDCVhVKkdSnZlGbqaxp102PLQgpQ4DZI=; b=TVQsGSe+JGPte74tqRCOglHz4+sz7+EEgqJUKI2cj10PxUwV+SAnjVpukaUV3xXc/ss94yOZyhBwEaOqrXGcWv7WUm2oXBXI22kCdvDxHhZcXxhBr9Rs4rcnghIh9+FKlm4OrRcMCkz9nxYDBAA9vuASrjgN5rIADFBzRABqIAI= 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+87285+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 1646417806880961.1240681878662; Fri, 4 Mar 2022 10:16:46 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id rrlFYY1788612xzWwHrMgfCa; Fri, 04 Mar 2022 10:16:46 -0800 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.6944.1646400926917922820 for ; Fri, 04 Mar 2022 05:35:27 -0800 X-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 X-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) X-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: [edk2-devel] [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 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: Td7oMCq9CRxTq0UsxlkZXPLwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646417806; bh=YAF/Gr8WEcsICekh0OJcVt1b4Y9jiADpkvMUiXjsBPs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Qg6Qbhg1n1wUjN02Qxcsc4za3hpULkqcl/JNKORp86e1WVFaw/rJZCEJFs8yGiPO7Ir l7oaEdDkwmK7NJBOIyCoSIg2pFd5DYQcYC648OJklGjs4q8VEvGs2B+fq4THzge4IIkI0 bSOYbBxludUma+d8IRltppksDeR2cnABVpE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646418710509100005 Content-Type: text/plain; charset="utf-8" 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; 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. // 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; =20 typedef struct { --=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 (#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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 20:47:25 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+87286+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+87286+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646417807; cv=none; d=zohomail.com; s=zohoarc; b=PszJN/4reSYBYTWz2Y98hmWJFmLTYYeQasb6JWLmGx+acmrOJWCxF62FTc0QPZebR9j41tV8OsL4gGXedtk27naJwBkACerO9W/X2Gdxl4T4QfsBnHkHXbIRunw2kGQMjxuRdQzf/T+wvUuwuAcHW+JFLKaClDI8ikMMr+TzqiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646417807; 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=iI8qMz0PCVO1TdvtFXk9gqQIy8IGb1O+fjiMZqfL9p8=; b=Ly37RzrujEKrRyc6s60fVRcqJDD6Z7br2z1HQ4YcwO2LvT02WINcXRGPYCdSU4mNqzlli3sSiqbmY/tkuvjcCHzhad2YT0g0b19jyQC49dlN5kH8bLrA42UrbAAhchEA5SggZZPgqInPZ3jDGe29pVLGr0AUOiok/00LWa5Q92w= 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+87286+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 1646417807242497.14567799976567; Fri, 4 Mar 2022 10:16:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id CIjrYY1788612xaQTynY6mjE; Fri, 04 Mar 2022 10:16:46 -0800 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.6945.1646400929929638031 for ; Fri, 04 Mar 2022 05:35:30 -0800 X-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-533-6Vr7iAsEM5m0DSZRL_QBhg-1; Fri, 04 Mar 2022 08:35:28 -0500 X-MC-Unique: 6Vr7iAsEM5m0DSZRL_QBhg-1 X-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 2946F1800D50 for ; Fri, 4 Mar 2022 13:35:27 +0000 (UTC) X-Received: from osteffen-laptop.redhat.com (unknown [10.39.194.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F3F17B5F1; Fri, 4 Mar 2022 13:35:22 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH 3/4] NetworkPkg/HttpDxe: Detect 'Connection: close' header Date: Fri, 4 Mar 2022 14:34:30 +0100 Message-Id: <20220304133431.53378-4-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 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: QDJ8PM390ZhVbYRXa2j2Z98Nx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646417806; bh=vVB+dbFU25sbNpbYqkdaQskCIrSWV3KTf4mLEfeUUE0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=LnSFz/oUeCTFCSK+c6ntOqBg4BIZAlxq7CES3kzL+odS2KrS7zFtAoAcTaU81ZdEAKr LjL4edwMbHnc2Kig5i+Yz6hhR/zcEDiqLlDuA8Cy4jCjK/mhgOMs8086JiYOeEUAIE04P 1zGvg7v7EE9Wfm9InPAO2KxyaVxJLvWS4vw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646418710502100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 Force connecton close before the next request if the server sends the 'Connection: close' header. Signed-off-by: Oliver Steffen --- NetworkPkg/HttpDxe/HttpImpl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index d8b014c94f..a1a3eea585 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_WARN, "Http: 'Connection: close' header received.\= 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 (#87286): https://edk2.groups.io/g/devel/message/87286 Mute This Topic: https://groups.io/mt/89555130/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 Sun May 19 20:47:25 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+87287+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+87287+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646417807; cv=none; d=zohomail.com; s=zohoarc; b=XX6hBOIOlf1wBlEIItAL5rOJKX4XGTWmg7YLS2u2NmeRC7y/qsEJdfGVmA7AcVsk5xgKFNu9KCR5eK9fxczNNqWvRCYOs50Y7+k0h1Rtex7CjJ5oTnHZSJY0ocZijKd/fJxcqOc7td8i4vLL8O+q9l34xKHhwpYiB1t9tir2sjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646417807; 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=BqUrDmX0ROgXq65iSWJQlcNpkTdJUzEtcpaUZvQgoF8=; b=J1Yc29x+qCSde41DT00mh/ndJOHrGM5A75riElxzqadiwaa1m0nE7l9TzJk+H380K/XANW2JvV3tfk4lztf4FcJRc8M6gz3vlvM6ac0APzbt4nH1W9PYXTp4SKRVt+cLPXc1tYLehxKCcJdU4Tvxs/sT1BIQ11zxKMwPMyk4xig= 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+87287+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 164641780760848.201950123208235; Fri, 4 Mar 2022 10:16:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id L0T1YY1788612x2KdWbxFCuN; Fri, 04 Mar 2022 10:16:47 -0800 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.web09.6907.1646400932093587597 for ; Fri, 04 Mar 2022 05:35:32 -0800 X-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-586-LSEgup6KNy6Ok_UDfPvPKw-1; Fri, 04 Mar 2022 08:35:30 -0500 X-MC-Unique: LSEgup6KNy6Ok_UDfPvPKw-1 X-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 28BA9824FA7 for ; Fri, 4 Mar 2022 13:35:28 +0000 (UTC) X-Received: from osteffen-laptop.redhat.com (unknown [10.39.194.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76EF27B5F1; Fri, 4 Mar 2022 13:35:27 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH 4/4] NetworkPkg/HttpDxe: Detect non-HTTP/1.1 servers Date: Fri, 4 Mar 2022 14:34:31 +0100 Message-Id: <20220304133431.53378-5-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 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: SFM5kvwrmzlhFn6QbztFQJSvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646417807; bh=IickvFs+xKXpPJVfPSMZ9+gD0FxucYv7ktiNUZRM06Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=G0okBADLPyD1xHhx7TAgla5hkjIBcKPHM54XFUJh85qD2OhqtsMSbPPhujvhmJWniUQ bE/Klqn+omP9CfwYtOC2nuf+PEAssE2sbO2Iyej7ZJJ92BAzO6LdhrNj4bDTc5rtQ3M8N E/pavfsXINnb+QmKLv13lU1+7I6ddQi2Z6s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646418710497100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2720 Force connecton close before the next request if the server does not identify as version 1.1. Signed-off-by: Oliver Steffen --- NetworkPkg/HttpDxe/HttpImpl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index a1a3eea585..ea1ab60517 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_VERSION, AsciiStrLen (HTTP_VERSION= )) !=3D 0) { + DEBUG ((DEBUG_WARN, "HTTP: Server version is not 1.1. Setting Connec= tion 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 (#87287): https://edk2.groups.io/g/devel/message/87287 Mute This Topic: https://groups.io/mt/89555131/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-