public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ye, Ting" <ting.ye@intel.com>
To: "Fu, Siyuan" <siyuan.fu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: Re: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if connect/accept is timeout.
Date: Tue, 12 Dec 2017 07:33:42 +0000	[thread overview]
Message-ID: <BC0C045B0E2A584CA4575E779FA2C12A1A981E7D@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20171205063352.17476-1-siyuan.fu@intel.com>

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



      parent reply	other threads:[~2017-12-12  7:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BC0C045B0E2A584CA4575E779FA2C12A1A981E7D@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox