EFIAPI\r
EfiHttpConfigure (\r
IN EFI_HTTP_PROTOCOL *This,\r
- IN EFI_HTTP_CONFIG_DATA *HttpConfigData\r
+ IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL\r
) \r
{\r
HTTP_PROTOCOL *HttpInstance;\r
HTTP_TOKEN_WRAP *Wrap;\r
CHAR8 *FileUrl;\r
UINTN RequestMsgSize;\r
+ EFI_HANDLE ImageHandle;\r
\r
//\r
// Initializations\r
//\r
// Use TlsSb to create Tls child and open the TLS protocol.\r
//\r
+ if (HttpInstance->LocalAddressIsIPv6) {\r
+ ImageHandle = HttpInstance->Service->Ip6DriverBindingHandle;\r
+ } else {\r
+ ImageHandle = HttpInstance->Service->Ip4DriverBindingHandle;\r
+ }\r
+\r
HttpInstance->TlsChildHandle = TlsCreateChild (\r
- HttpInstance->Service->ImageHandle,\r
+ ImageHandle,\r
+ &(HttpInstance->TlsSb),\r
&(HttpInstance->Tls),\r
&(HttpInstance->TlsConfiguration)\r
);\r
// We receive part of header of next HTTP msg.\r
//\r
if (HttpInstance->NextMsg != NULL) {\r
- HttpMsg->BodyLength = MIN ((UINTN) (HttpInstance->NextMsg - (CHAR8 *) Fragment.Bulk), HttpMsg->BodyLength);\r
+ HttpMsg->BodyLength = MIN ((UINTN) HttpInstance->NextMsg - (UINTN) Fragment.Bulk, HttpMsg->BodyLength);\r
CopyMem (HttpMsg->Body, Fragment.Bulk, HttpMsg->BodyLength);\r
\r
HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength;\r
CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen);\r
HttpInstance->CacheOffset = 0;\r
\r
- HttpInstance->NextMsg = HttpInstance->CacheBody + (UINTN) (HttpInstance->NextMsg - (CHAR8 *) (Fragment.Bulk + HttpMsg->BodyLength));\r
+ HttpInstance->NextMsg = HttpInstance->CacheBody + ((UINTN) HttpInstance->NextMsg - (UINTN) (Fragment.Bulk + HttpMsg->BodyLength));\r
}\r
} else {\r
HttpMsg->BodyLength = MIN (Fragment.Len, (UINT32) HttpMsg->BodyLength);\r