mirror of https://github.com/acidanthera/audk.git
RedfishPkg/RedfishRestExDxe:Simplify status check
Remove redundant determine statements. No functional change. Cc: Abner Chang <abner.chang@hpe.com> Cc: Nickle Wang <nickle.wang@hpe.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
This commit is contained in:
parent
772c5bb8dc
commit
7709988dd8
|
@ -44,7 +44,7 @@ ResetHttpTslSession (
|
|||
}
|
||||
|
||||
/**
|
||||
This function check
|
||||
This function check Http receive status.
|
||||
|
||||
@param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
|
||||
REST service.
|
||||
|
@ -67,37 +67,34 @@ RedfishCheckHttpReceiveStatus (
|
|||
|
||||
if (!EFI_ERROR (HttpIoReceiveStatus)) {
|
||||
ReturnStatus = EFI_SUCCESS;
|
||||
} else if (EFI_ERROR (HttpIoReceiveStatus) && (HttpIoReceiveStatus != EFI_CONNECTION_FIN)) {
|
||||
} else if (HttpIoReceiveStatus != EFI_CONNECTION_FIN) {
|
||||
if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY) == 0) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n", __FUNCTION__));
|
||||
Instance->Flags |= RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY;
|
||||
gBS->Stall (500);
|
||||
Status = ResetHttpTslSession (Instance);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
} else {
|
||||
if (!EFI_ERROR (Status)) {
|
||||
return EFI_NOT_READY;
|
||||
}
|
||||
} else {
|
||||
|
||||
DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
|
||||
}
|
||||
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
} else {
|
||||
if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
}
|
||||
} else {
|
||||
if (HttpIoReceiveStatus == EFI_CONNECTION_FIN) {
|
||||
if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
|
||||
Status = ResetHttpTslSession (Instance);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
return EFI_NOT_READY;
|
||||
Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
|
||||
Status = ResetHttpTslSession (Instance);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
|
||||
ReturnStatus = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
return EFI_NOT_READY;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue