public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.
@ 2017-12-05  6:33 Fu Siyuan
  2017-12-12  6:22 ` Wu, Jiaxin
  2017-12-12  7:33 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Fu Siyuan @ 2017-12-05  6:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wu Jiaxin, Ye Ting

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
---
 MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
index 17183e1a6c..2e59b680bf 100644
--- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
+++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to access TCP service.
 
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at<BR>
@@ -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;
-- 
2.13.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.
  2017-12-05  6:33 [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout Fu Siyuan
@ 2017-12-12  6:22 ` Wu, Jiaxin
  2017-12-12  7:33 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2017-12-12  6:22 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>


> -----Original Message-----
> From: Fu Siyuan [mailto:siyuan.fu@intel.com]
> Sent: Tuesday, December 5, 2017 2:34 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>
> Subject: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if
> connect/accept is timeout.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> ---
>  MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
> b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
> index 17183e1a6c..2e59b680bf 100644
> --- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
> +++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
> @@ -2,7 +2,7 @@
>    This library is used to share code between UEFI network stack modules.
>    It provides the helper routines to access TCP service.
> 
> -Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
>  This program and the accompanying materials
>  are licensed and made available under the terms and conditions of the BSD
> License
>  which accompanies this distribution.  The full text of the license may be
> found at<BR>
> @@ -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;
> --
> 2.13.0.windows.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.
  2017-12-05  6:33 [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout Fu Siyuan
  2017-12-12  6:22 ` Wu, Jiaxin
@ 2017-12-12  7:33 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-12-12  7:33 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Wu, Jiaxin

Hi Siyuan,

You might need write a log message for this patch, what do you think? Others are good to me.

Reviewed-by: Ye Ting <ting.ye@intel.com>

Best Regards,
Ting

-----Original Message-----
From: Fu Siyuan [mailto:siyuan.fu@intel.com] 
Sent: Tuesday, December 5, 2017 2:34 PM
To: edk2-devel@lists.01.org
Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>
Subject: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
---
 MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
index 17183e1a6c..2e59b680bf 100644
--- a/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
+++ b/MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.c
@@ -2,7 +2,7 @@
   This library is used to share code between UEFI network stack modules.
   It provides the helper routines to access TCP service.
 
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at<BR> @@ -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;
--
2.13.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-12  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05  6:33 [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout Fu Siyuan
2017-12-12  6:22 ` Wu, Jiaxin
2017-12-12  7:33 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox