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

Michael Brown mbrown at fensystems.co.uk
Mon Jul 19 04:08:33 EDT 2010


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


More information about the gPXE-devel mailing list