]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg: Httpboot will fail the 2nd time result by wrong TCP state.
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 2f4ce89ddbd1d05f1168cb66a10890a7787ffd20..4ad07d4f230b5cf72d0187c3ece1f225a66450fe 100644 (file)
@@ -317,7 +317,11 @@ EfiHttpRequest (
   if (EFI_ERROR (Status)) {\r
     RemotePort = HTTP_DEFAULT_PORT;\r
   }\r
-\r
+  //\r
+  // If Configure is TRUE, it indicates the first time to call Request();\r
+  // If ReConfigure is TRUE, it indicates the request URL is not same\r
+  // with the previous call to Request();\r
+  //\r
   Configure   = TRUE;\r
   ReConfigure = TRUE;  \r
 \r
@@ -427,7 +431,11 @@ EfiHttpRequest (
     //\r
     // The request URL is different from previous calls to Request(), close existing TCP instance.\r
     //\r
-    ASSERT (HttpInstance->Tcp4 != NULL &&HttpInstance->Tcp6 != NULL);\r
+    if (!HttpInstance->LocalAddressIsIPv6) {\r
+      ASSERT (HttpInstance->Tcp4 != NULL);\r
+    } else {\r
+      ASSERT (HttpInstance->Tcp6 != NULL);\r
+    }\r
     HttpCloseConnection (HttpInstance);\r
     EfiHttpCancel (This, NULL);\r
   }\r
@@ -445,13 +453,12 @@ EfiHttpRequest (
   Wrap->HttpInstance   = HttpInstance;\r
   Wrap->TcpWrap.Method = Request->Method;\r
 \r
-  if (Configure) {\r
-    Status = HttpInitTcp (HttpInstance, Wrap);\r
-    if (EFI_ERROR (Status)) {\r
-      goto Error2;\r
-    }\r
+  Status = HttpInitTcp (HttpInstance, Wrap, Configure);\r
+  if (EFI_ERROR (Status)) {\r
+    goto Error2;\r
+  }  \r
 \r
-  } else {\r
+  if (!Configure) {\r
     //\r
     // For the new HTTP token, create TX TCP token events.    \r
     //\r
@@ -460,7 +467,7 @@ EfiHttpRequest (
       goto Error1;\r
     }\r
   }\r
-\r
+  \r
   //\r
   // Create request message.\r
   //\r