]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
Fix issue that calling GetS3MemoryInfo() with wrong order.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index c5b2be430e29261f7e6eab37585347af95d3e673..588e1bb6499e155dbf8d07da89fa3b5e92c13976 100644 (file)
@@ -2,6 +2,7 @@
   Implementation of EFI_HTTP_PROTOCOL protocol interfaces.\r
 \r
   Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -227,7 +228,6 @@ EfiHttpRequest (
   UINTN                         UrlLen;\r
   CHAR16                        *HostNameStr;\r
   HTTP_TOKEN_WRAP               *Wrap;\r
-  HTTP_TCP_TOKEN_WRAP           *TcpWrap;\r
   CHAR8                         *FileUrl;\r
   \r
   if ((This == NULL) || (Token == NULL)) {\r
@@ -275,15 +275,14 @@ EfiHttpRequest (
     return EFI_ACCESS_DENIED;   \r
   }  \r
 \r
-  Url         = NULL;\r
   HostName    = NULL;\r
   Wrap        = NULL;\r
   HostNameStr = NULL;\r
-  TcpWrap     = NULL;\r
 \r
   //\r
   // Parse the URI of the remote host.\r
   //\r
+  Url = HttpInstance->Url;\r
   UrlLen = StrLen (Request->Url) + 1;\r
   if (UrlLen > HTTP_URL_BUFFER_LEN) {\r
     Url = AllocateZeroPool (UrlLen);\r
@@ -316,7 +315,7 @@ EfiHttpRequest (
   Configure   = TRUE;\r
   ReConfigure = TRUE;  \r
 \r
-  if (HttpInstance->RemoteHost == NULL && HttpInstance->RemotePort == 0) {\r
+  if (HttpInstance->RemoteHost == NULL) {\r
     //\r
     // Request() is called the first time. \r
     //\r
@@ -373,6 +372,7 @@ EfiHttpRequest (
       if (HttpInstance->RemoteHost != NULL) {\r
         FreePool (HttpInstance->RemoteHost);\r
         HttpInstance->RemoteHost = NULL;\r
+        HttpInstance->RemotePort = 0;\r
       }\r
     }\r
   } \r
@@ -502,6 +502,8 @@ EfiHttpRequest (
     goto Error5;    \r
   }\r
 \r
+  DispatchDpc ();\r
+\r
   return EFI_SUCCESS;\r
 \r
 Error5:\r
@@ -1330,6 +1332,7 @@ EfiHttpPoll (
   )\r
 {\r
   HTTP_PROTOCOL                 *HttpInstance;\r
+  EFI_STATUS                    Status;\r
 \r
   if (This == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -1346,5 +1349,9 @@ EfiHttpPoll (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  return HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);\r
+  Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);\r
+\r
+  DispatchDpc ();\r
+\r
+  return Status;\r
 }\r