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.web08.9888.1647955843096792589 for ; Tue, 22 Mar 2022 06:30:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gjEUfAFq; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: osteffen@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647955842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OFByqjpIa9+GFrIimYkvVHSYeNzA/F3q3aqYLG5XwMw=; b=gjEUfAFqDSaehK0La+0Nij1zIYT1zHm6AccLwvU18hcqE05BPSOmneLRDkNLfdk2fnWL8O 1Hpn3Rn4Mv2cQi+JXFfzVUBYNo+F18xWf4Qa1B4IbpmMfnZq2YnFD5/nJQGnaZcB5SLThE kYXfnSnKzICPYqnjjp+QPweaiMEaDTc= 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 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) 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: [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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=osteffen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2720 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 --- 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; 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 = HttpConfigData->HttpVersion; HttpInstance->TimeOutMillisec = HttpConfigData->TimeOutMillisec; HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6; + HttpInstance->ConnectionClose = FALSE; if (HttpConfigData->LocalAddressIsIPv6) { CopyMem ( @@ -440,7 +441,8 @@ EfiHttpRequest ( // ReConfigure = FALSE; } else { - if ((HttpInstance->RemotePort == RemotePort) && + if ((HttpInstance->ConnectionClose == FALSE) && + (HttpInstance->RemotePort == RemotePort) && (AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) && (!HttpInstance->UseHttps || (HttpInstance->UseHttps && !TlsConfigure && @@ -649,6 +651,8 @@ EfiHttpRequest ( } } + HttpInstance->ConnectionClose = FALSE; + // // Transmit the request message. // -- 2.35.1