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.web11.25369.1646654850099264742 for ; Mon, 07 Mar 2022 04:07:30 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P46utWjJ; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646654849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wAdnsGBZw/4l9AymIkOBBoDIU+Flw/hdpJTZA7gbsF0=; b=P46utWjJ/v8+OVdiiMG8YZYww+TKEr+WK36rjEsZnYRBH+1NZ4DeIW57/80LbgkKUWoWS1 9O/YuQxcujBvt5CbzQmFvN77W2QhTbcrr2zAETcjbYhG+9fY0LokBYE6L7yrw/lONuBmY7 rGFcU2XCaSWO2flE9r0OVWoac7wIAB4= 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-441-r_UUavL1NXaVABrctbhSrw-1; Mon, 07 Mar 2022 07:07:28 -0500 X-MC-Unique: r_UUavL1NXaVABrctbhSrw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B93E1006AA7 for ; Mon, 7 Mar 2022 12:07:27 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FD15797C4; Mon, 7 Mar 2022 12:07:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 104A81800608; Mon, 7 Mar 2022 13:07:24 +0100 (CET) Date: Mon, 7 Mar 2022 13:07:24 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io, osteffen@redhat.com Subject: Re: [edk2-devel] [PATCH 4/4] NetworkPkg/HttpDxe: Detect non-HTTP/1.1 servers Message-ID: <20220307120724.uismzhj2gaezgf25@sirius.home.kraxel.org> References: <20220304133431.53378-1-osteffen@redhat.com> <20220304133431.53378-5-osteffen@redhat.com> MIME-Version: 1.0 In-Reply-To: <20220304133431.53378-5-osteffen@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 04, 2022 at 02:34:31PM +0100, Oliver Steffen wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720 > > 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 = BodyLen; > > } > > > > + // > > + // Check server's HTTP version. > > + // > > + if (AsciiStrnCmp (HttpHeaders, HTTP_VERSION, AsciiStrLen (HTTP_VERSION)) != 0) { Better explicitly check for 1.0 here? That is the special case we are looking for here: http/1.0 has no pipelining, so we close the connection in that case. As long as edk2 has no support for http/2.0 it doesn't make a difference in practice though. > + DEBUG ((DEBUG_WARN, "HTTP: Server version is not 1.1. Setting Connection close.\n")); Same here, should better use DEBUG_VERBOSE. take care, Gerd