Reviewed-by: Wu Jiaxin <[email protected]>
> -----Original Message----- > From: Fu Siyuan [mailto:[email protected]] > Sent: Tuesday, December 5, 2017 2:34 PM > To: [email protected] > Cc: Wu, Jiaxin <[email protected]>; Ye, Ting <[email protected]> > Subject: [Patch] MdeModulePkg/TcpIoLib: Cancel TCP token if > connect/accept is timeout. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan <[email protected]> > Cc: Wu Jiaxin <[email protected]> > Cc: Ye Ting <[email protected]> > --- > 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 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

