summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2017-12-05 14:22:48 +0800
committerFu Siyuan <siyuan.fu@intel.com>2017-12-12 15:50:31 +0800
commit267345ff4f309ad6d4a12b358e1746ba079092d9 (patch)
tree1a2fd5c94129253de56857da2bebc4684eb15936 /MdeModulePkg
parentb5035efab4c44dea1769034f1f9b23a49fe86f85 (diff)
downloadedk2-267345ff4f309ad6d4a12b358e1746ba079092d9.zip
edk2-267345ff4f309ad6d4a12b358e1746ba079092d9.tar.gz
edk2-267345ff4f309ad6d4a12b358e1746ba079092d9.tar.bz2
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
index a763757..fd85d0e 100644
--- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
+++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
@@ -585,6 +585,11 @@ TcpIoConnect (
}
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;
} else {
Status = TcpIo->ConnToken.Tcp4Token.CompletionToken.Status;
@@ -655,6 +660,11 @@ TcpIoAccept (
}
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;
} else {
Status = TcpIo->ListenToken.Tcp4Token.CompletionToken.Status;