From nobody Tue Feb 10 09:24:30 2026 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+87353+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+87353+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646745681; cv=none; d=zohomail.com; s=zohoarc; b=Tgqdqk4dTY5qJvPZZkG8cPI7OcJxcX70zv8F7vdDUZ2lvp37CWhAkHrpWKTgbgrxJVUnpxRsUzS3zHSf+bhpKdheyqdbONkXxvcvLWiwntbez/vWLkmaZxt6swAYbP8cBxPN6o/URUnHvnwTe2oPhuE6YsmU8Js7wjKzvhbUkOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646745681; 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=WgzWQl1ejf4Yv4VyKwjnPS8w1OQm4wcxv5zBkc1XT/Y=; b=Gqic6BXmnvWajILh0ASZX+C0NdH9qJuSoE8ZnEHa2rYvA2fj6sAduj3/UlSsrlv1yu/iOuxmBLG6ED34wgQzz/VZPEILimHqiN2XZ5J2dZ7wIueyyAI158lMA67XceXlQ7v8z72ZLODxoGZFuVrA1zZr9FzqY62Zb3N+y+cCYFE= 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+87353+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 1646745681688673.8943864130406; Tue, 8 Mar 2022 05:21:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ta5vYY1788612xfGRZ7HAGTX; Tue, 08 Mar 2022 05:21:21 -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.web08.7652.1646745679333592196 for ; Tue, 08 Mar 2022 05:21:19 -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-589-bdWVjHSmMYKgUU_0KhEVlQ-1; Tue, 08 Mar 2022 08:21:17 -0500 X-MC-Unique: bdWVjHSmMYKgUU_0KhEVlQ-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F7D5FC83 for ; Tue, 8 Mar 2022 13:21:16 +0000 (UTC) X-Received: from osteffen-laptop.fritz.box (unknown [10.39.193.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F4E17C0E7; Tue, 8 Mar 2022 13:21:15 +0000 (UTC) From: "Oliver Steffen" To: devel@edk2.groups.io Cc: Oliver Steffen Subject: [edk2-devel] [PATCH v2 3/4] NetworkPkg/HttpDxe: Detect 'Connection: close' header Date: Tue, 8 Mar 2022 14:21:03 +0100 Message-Id: <20220308132104.407800-4-osteffen@redhat.com> In-Reply-To: <20220308132104.407800-1-osteffen@redhat.com> References: <20220304130403.47832-1-osteffen@redhat.com> <20220308132104.407800-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: xaVAi0jvYU0MQo7CulODHJ56x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646745681; bh=NTcUciSs3yiU4UMeFsrd1kEKl9dwrOlFp8FsE28OozM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=adiaZGM5qzeodUqMq5IkoacT3Q1wN/u1dvY/ZJ/aC5lcpFfHoDUmEciKDVLTf0z64+k yh7CzRjGevhBvR+FbU4diHcOFCzT79fBCX0Z9xl9auQ7e2ZmpkcJYXkiWBkIzPPzq7Pr/ WAcFPshze0zLZIWQ1Hn6jOyu0wWe4s+vuC8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646746583582100001 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 (#87353): https://edk2.groups.io/g/devel/message/87353 Mute This Topic: https://groups.io/mt/89636385/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-