[edk2] [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

Jiaxin Wu posted 1 patch 7 years, 8 months ago
Failed in applying to current master (apply log)
MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
[edk2] [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength
Posted by Jiaxin Wu 7 years, 8 months ago
Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to
return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at<BR>
 http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
     return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
     return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
-- 
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] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength
Posted by Fu, Siyuan 7 years, 8 months ago
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

-----Original Message-----
From: Wu, Jiaxin 
Sent: 2017年2月8日 12:58
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>  This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at<BR>  http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
     return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + 
+ Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN 
+ *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
     return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, 
+ ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
--
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] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength
Posted by Ye, Ting 7 years, 8 months ago
Reviewed-by: Ye Ting <ting.ye@intel.com>


-----Original Message-----
From: Wu, Jiaxin 
Sent: Wednesday, February 08, 2017 12:58 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch] MdeModulePkg/DxeHttpLib: Correct the return status for the HTTP Port/ContentLength

Replace AsciiStrDecimalToUintn with AsciiStrDecimalToUintnS to return the correct status for the HTTP Port/ContentLength.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index a4579bf..ff7e799 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1,10 +1,10 @@
 /** @file
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to parse the HTTP message byte stream.
 
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>  This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at<BR>  http://opensource.org/licenses/bsd-license.php
@@ -719,13 +719,12 @@ HttpUrlGetPort (
   if (EFI_ERROR (Status)) {
     return Status;
   }
 
   PortString[ResultLength] = '\0';
-  *Port = (UINT16) AsciiStrDecimalToUintn (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset);
 
-  return  EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Url + 
+ Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, (UINTN 
+ *) Port);
 }
 
 /**
   Get the Path from a HTTP URL.
 
@@ -930,12 +929,11 @@ HttpIoParseContentLengthHeader (
   Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH);
   if (Header == NULL) {
     return EFI_NOT_FOUND;
   }
 
-  *ContentLength = AsciiStrDecimalToUintn (Header->FieldValue);
-  return EFI_SUCCESS;
+  return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, 
+ ContentLength);
 }
 
 /**
 
   Check whether the HTTP message is using the "chunked" transfer-coding.
--
1.9.5.msysgit.1

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