[gPXE-devel] [PATCH 1/2] [tcp] Prevent duplicate xfer_shutdown

Guo-Fu Tseng cooldavid at cooldavid.org
Mon Jul 19 04:48:27 EDT 2010


On Mon, 19 Jul 2010 09:08:33 +0100, Michael Brown wrote
> On Monday 19 Jul 2010 03:21:12 Guo-Fu Tseng wrote:
> >   * Closes the data transfer interface.
> >   */
> >  static void tcp_xfer_shutdown ( struct tcp_connection *tcp, int rc ) {
> > +	if ( tcp->flags & TCP_XFER_CLOSED )
> > +		return;
> > +
> >  	/* Close data transfer interface */
> >  	xfer_nullify ( &tcp->xfer );
> >  	xfer_close ( &tcp->xfer, rc );
> 
> This seems redundant; the xfer interface is designed so that it is 
> safe to call xfer_nullify() and xfer_close() multiple times, and the 
> xfer_nullify() would in any case ensure that you would not receive any 
> further xfer_close() messages.  What is this patch trying to achieve?
> 
> Michael
Indeed.
This patch should be redundant!
Thank you for reminding. :)

Guo-Fu Tseng



More information about the gPXE-devel mailing list