NetworkPkg: Fix protocol handler service in HttpDxe.

When we create a HTTP driver service binding private
instance, there may be different DriverBindingHandle
for Ipv4 or Ipv6, so it is essential to distinguish
the HttpService image which will be used in open
protocol or close protocol.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Sriram Subramanian <sriram-s@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This commit is contained in:
Zhang, Lubo
2017-01-22 09:40:30 +08:00
committed by Jiaxin Wu
parent f3fa35a002
commit 7cf59c854f
5 changed files with 54 additions and 47 deletions

View File

@@ -249,6 +249,7 @@ EfiHttpRequest (
HTTP_TOKEN_WRAP *Wrap;
CHAR8 *FileUrl;
UINTN RequestMsgSize;
EFI_HANDLE ImageHandle;
//
// Initializations
@@ -371,8 +372,14 @@ EfiHttpRequest (
//
// Use TlsSb to create Tls child and open the TLS protocol.
//
if (HttpInstance->LocalAddressIsIPv6) {
ImageHandle = HttpInstance->Service->Ip6DriverBindingHandle;
} else {
ImageHandle = HttpInstance->Service->Ip4DriverBindingHandle;
}
HttpInstance->TlsChildHandle = TlsCreateChild (
HttpInstance->Service->ImageHandle,
ImageHandle,
&(HttpInstance->Tls),
&(HttpInstance->TlsConfiguration)
);