mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.
This patch updates TcpIoConnect() and TcpIoAccept() that the Tcp.Cancel() should be invoked to cancel the corresponding request when timeout occurs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
parent
b5035efab4
commit
267345ff4f
|
@ -585,6 +585,11 @@ TcpIoConnect (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TcpIo->IsConnDone) {
|
if (!TcpIo->IsConnDone) {
|
||||||
|
if (TcpIo->TcpVersion == TCP_VERSION_4) {
|
||||||
|
Tcp4->Cancel (Tcp4, &TcpIo->ConnToken.Tcp4Token.CompletionToken);
|
||||||
|
} else {
|
||||||
|
Tcp6->Cancel (Tcp6, &TcpIo->ConnToken.Tcp6Token.CompletionToken);
|
||||||
|
}
|
||||||
Status = EFI_TIMEOUT;
|
Status = EFI_TIMEOUT;
|
||||||
} else {
|
} else {
|
||||||
Status = TcpIo->ConnToken.Tcp4Token.CompletionToken.Status;
|
Status = TcpIo->ConnToken.Tcp4Token.CompletionToken.Status;
|
||||||
|
@ -655,6 +660,11 @@ TcpIoAccept (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TcpIo->IsListenDone) {
|
if (!TcpIo->IsListenDone) {
|
||||||
|
if (TcpIo->TcpVersion == TCP_VERSION_4) {
|
||||||
|
Tcp4->Cancel (Tcp4, &TcpIo->ListenToken.Tcp4Token.CompletionToken);
|
||||||
|
} else {
|
||||||
|
Tcp6->Cancel (Tcp6, &TcpIo->ListenToken.Tcp6Token.CompletionToken);
|
||||||
|
}
|
||||||
Status = EFI_TIMEOUT;
|
Status = EFI_TIMEOUT;
|
||||||
} else {
|
} else {
|
||||||
Status = TcpIo->ListenToken.Tcp4Token.CompletionToken.Status;
|
Status = TcpIo->ListenToken.Tcp4Token.CompletionToken.Status;
|
||||||
|
|
Loading…
Reference in New Issue