RedfishPkg/RedfishRestExDxe: reset session when TCP timeout happens

Call ResetHttpTslSession() to reset HTTP session when TCP timeout
failure happens. So that application can perform retry to the same URI.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
This commit is contained in:
Nickle Wang 2023-07-13 15:01:47 +08:00 committed by mergify[bot]
parent dd49d448b0
commit 3399f64588
3 changed files with 20 additions and 2 deletions

View File

@ -4,6 +4,7 @@
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR> Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023, American Megatrends International LLC. Copyright (c) 2023, American Megatrends International LLC.
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
@ -12,8 +13,7 @@
#include "RedfishRestExInternal.h" #include "RedfishRestExInternal.h"
/** /**
Create a new TLS session becuase the previous on is closed. Create a new TLS session because the previous one is closed.
status.
@param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular @param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
REST service. REST service.

View File

@ -55,6 +55,20 @@ RedfishCheckHttpReceiveStatus (
IN EFI_STATUS HttpIoReceiveStatus IN EFI_STATUS HttpIoReceiveStatus
); );
/**
Create a new TLS session because the previous one is closed.
@param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
REST service.
@retval EFI_SUCCESS operation succeeded.
@retval EFI_ERROR Other errors.
**/
EFI_STATUS
ResetHttpTslSession (
IN RESTEX_INSTANCE *Instance
);
/** /**
This function send the HTTP request without body to see This function send the HTTP request without body to see
if the write to URL is permitted by Redfish service. This function if the write to URL is permitted by Redfish service. This function

View File

@ -188,6 +188,10 @@ ReSendRequest:;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
//
// Communication failure happens. Reset the session.
//
ResetHttpTslSession (Instance);
goto ON_EXIT; goto ON_EXIT;
} }