This is NULL.\r
HttpConfigData is NULL.\r
HttpConfigData->AccessPoint is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources.\r
@retval EFI_NOT_STARTED The HTTP instance is not configured.\r
\r
**/\r
\r
if (HttpInstance->LocalAddressIsIPv6) {\r
Http6AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv6_ACCESS_POINT));\r
+ if (Http6AccessPoint == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
CopyMem (\r
Http6AccessPoint,\r
&HttpInstance->Ipv6Node,\r
HttpConfigData->AccessPoint.IPv6Node = Http6AccessPoint;\r
} else {\r
Http4AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv4_ACCESS_POINT));\r
+ if (Http4AccessPoint == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
CopyMem (\r
Http4AccessPoint,\r
&HttpInstance->IPv4Node,\r
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
//\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
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
goto Error1;\r
}\r
}\r
-\r
+ \r
//\r
// Create request message.\r
//\r
goto Error;\r
}\r
\r
+ ASSERT (HttpHeaders != NULL);\r
+\r
//\r
// Cache the part of body.\r
//\r
HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
ASSERT (HttpInstance != NULL);\r
\r
- if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED || (HttpInstance->Tcp4 == NULL && \r
- HttpInstance->Tcp6 == NULL)) {\r
+ if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {\r
return EFI_NOT_STARTED;\r
}\r
\r
if (HttpInstance->LocalAddressIsIPv6) {\r
+ if (HttpInstance->Tcp6 == NULL) {\r
+ return EFI_NOT_STARTED;\r
+ }\r
Status = HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);\r
} else {\r
+ if (HttpInstance->Tcp4 == NULL) {\r
+ return EFI_NOT_STARTED;\r
+ }\r
Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);\r
}\r
\r