]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg: Add URI configuration form to HTTP boot driver.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.c
index 165e95cc50a9d8290d92f36e00ba15a26af1afbe..579b9e46627070e26ab1f990df973c36f573e4f8 100644 (file)
@@ -2,7 +2,7 @@
   Miscellaneous routines for HttpDxe driver.\r
 \r
 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -568,13 +568,9 @@ HttpCloseTcpRxEvent (
   )\r
 {\r
   HTTP_PROTOCOL            *HttpInstance;\r
-  EFI_TCP4_IO_TOKEN        *Rx4Token;\r
-  EFI_TCP6_IO_TOKEN        *Rx6Token;\r
 \r
   ASSERT (Wrap != NULL);\r
   HttpInstance   = Wrap->HttpInstance;\r
-  Rx4Token       = NULL;\r
-  Rx6Token       = NULL;\r
   \r
   if (HttpInstance->LocalAddressIsIPv6) {\r
     if (Wrap->TcpWrap.Rx6Token.CompletionToken.Event != NULL) {\r
@@ -2027,7 +2023,7 @@ HttpGenRequestString (
   //\r
   // Calculate HTTP message length.\r
   //\r
-  MsgSize = Message->BodyLength + HTTP_MAXIMUM_METHOD_LEN + AsciiStrLen (Url) + \r
+  MsgSize = Message->BodyLength + HTTP_METHOD_MAXIMUM_LEN + AsciiStrLen (Url) +\r
             AsciiStrLen (HTTP_VERSION_CRLF_STR) + HttpHdrSize;\r
   Request = AllocateZeroPool (MsgSize);\r
   if (Request == NULL) {\r
@@ -2040,13 +2036,13 @@ HttpGenRequestString (
   //\r
   switch (Message->Data.Request->Method) {\r
   case HttpMethodGet:\r
-    StrLength = sizeof (HTTP_GET_STR) - 1;\r
-    CopyMem (RequestPtr, HTTP_GET_STR, StrLength);\r
+    StrLength = sizeof (HTTP_METHOD_GET) - 1;\r
+    CopyMem (RequestPtr, HTTP_METHOD_GET, StrLength);\r
     RequestPtr += StrLength;\r
     break;\r
   case HttpMethodHead:\r
-    StrLength = sizeof (HTTP_HEAD_STR) - 1;\r
-    CopyMem (RequestPtr, HTTP_HEAD_STR, StrLength);\r
+    StrLength = sizeof (HTTP_METHOD_HEAD) - 1;\r
+    CopyMem (RequestPtr, HTTP_METHOD_HEAD, StrLength);\r
     RequestPtr += StrLength;\r
     break;\r
   default:\r
@@ -2054,6 +2050,10 @@ HttpGenRequestString (
     goto Exit;\r
   }\r
 \r
+  StrLength = AsciiStrLen(" ");\r
+  CopyMem (RequestPtr, " ", StrLength);\r
+  RequestPtr += StrLength;\r
+\r
   StrLength = AsciiStrLen (Url);\r
   CopyMem (RequestPtr, Url, StrLength);\r
   RequestPtr += StrLength;\r