//
     // Check whether we need to create Tls child and open the TLS protocol.
     //
+    if (HttpInstance->UseHttps && !HttpInstance->TlsAlreadyCreated) {
+      // Create TLS child for this HTTP instance.
+      Status = TlsCreateChild (HttpInstance);
+      if (EFI_ERROR (Status)) {
         return EFI_DEVICE_ERROR;
       }

Considering we're not creating TlsChildHandle anymore, we should probably 
rename TlsCreateChild() to TlsCreateHandle(). Also update the comments 
accordingly.

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael Brown
Sent: Friday, January 5, 2024 9:12 AM
To: abner.ch...@amd.com; devel@edk2.groups.io
Cc: Kasbekar, Saloni <saloni.kasbe...@intel.com>; Clark-williams, Zachary 
<zachary.clark-willi...@intel.com>; Nickle Wang <nick...@nvidia.com>; Igor 
Kulchytskyy <ig...@ami.com>
Subject: Re: [edk2-devel] [PATCH 1/5] NetwokrPkg/HttpDxe: Refactor 
TlsCreateChild

On 05/01/2024 08:37, abner.ch...@amd.com wrote:
> From: Abner Chang <abner.ch...@amd.com>
> 
> - Use HTTP instance as the parameter for TlsCreateChild function.
> - Install TLS protocol on the HTTP instance thats create TLS child.

Logic looks good to me, just some minor cosmetic comments.

Commit title has "NetwokrPkg" typo, should be "NetworkPkg".

> -  @return  The child handle with opened EFI_TLS_PROTOCOL and 
> EFI_TLS_CONFIGURATION_PROTOCOL.
> +  @return  EFI_SUCCESS        TLS child handle is returned in 
> HttpInstance->TlsChildHandle
> +                              with opened EFI_TLS_PROTOCOL and 
> EFI_TLS_CONFIGURATION_PROTOCOL.

Comment refers to TlsChildHandle, which no longer exists after this patch.

> -  @return  The child handle with opened EFI_TLS_PROTOCOL and 
> EFI_TLS_CONFIGURATION_PROTOCOL.
> +  @return  EFI_SUCCESS        TLS child handle is returned in 
> HttpInstance->TlsChildHandle
> +                              with opened EFI_TLS_PROTOCOL and 
> EFI_TLS_CONFIGURATION_PROTOCOL.

As above.

Reviewed-by: Michael Brown <mc...@ipxe.org>

Michael








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113321): https://edk2.groups.io/g/devel/message/113321
Mute This Topic: https://groups.io/mt/103539578/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to