[edk2] [Patch] NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData

Jiaxin Wu posted 1 patch 7 years, 4 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
NetworkPkg/HttpDxe/HttpImpl.c | 4 ++++
1 file changed, 4 insertions(+)
[edk2] [Patch] NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData
Posted by Jiaxin Wu 7 years, 4 months ago
Cc: Ye Ting <ting.ye@intel.com>
Cc: Jin Eric <eric.jin@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index e0fecac..442397c 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -149,10 +149,14 @@ EfiHttpConfigure (
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL && HttpInstance->Service != NULL);
 
   if (HttpConfigData != NULL) {
 
+    if (HttpConfigData->HttpVersion == HttpVersionUnsupported) {
+      return EFI_UNSUPPORTED;
+    }
+
     //
     // Now configure this HTTP instance.
     //
     if (HttpInstance->State != HTTP_STATE_UNCONFIGED) {
       return EFI_ALREADY_STARTED;
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch] NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData
Posted by Ye, Ting 7 years, 4 months ago
Hi Jiaxin,

I think it might be better to use >= to reject other invalid value of HTTP version. Any different opinion? 

Thanks,
Ting

-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, August 09, 2017 10:36 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Jin, Eric <eric.jin@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] NetworkPkg/HttpDxe: Handle the HttpVersionUnsupported in the HttpConfigData

Cc: Ye Ting <ting.ye@intel.com>
Cc: Jin Eric <eric.jin@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/HttpDxe/HttpImpl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index e0fecac..442397c 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -149,10 +149,14 @@ EfiHttpConfigure (
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL && HttpInstance->Service != NULL);
 
   if (HttpConfigData != NULL) {
 
+    if (HttpConfigData->HttpVersion == HttpVersionUnsupported) {
+      return EFI_UNSUPPORTED;
+    }
+
     //
     // Now configure this HTTP instance.
     //
     if (HttpInstance->State != HTTP_STATE_UNCONFIGED) {
       return EFI_ALREADY_STARTED;
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel