1 /*
2  * h_abor.c
3  *
4  * (C)1998-2011 by Marc Huber <Marc.Huber@web.de>
5  * All rights reserved.
6  *
7  * $Id: h_abor.c,v 1.10 2015/03/14 06:11:25 marc Exp marc $
8  *
9  */
10 
11 #include "headers.h"
12 
13 static const char rcsid[] __attribute__ ((used)) = "$Id: h_abor.c,v 1.10 2015/03/14 06:11:25 marc Exp marc $";
14 
h_abor(struct context * ctx,char * arg)15 void h_abor(struct context *ctx, char *arg __attribute__ ((unused)))
16 {
17     DebugIn(DEBUG_COMMAND);
18 
19     if (ctx->dfn > -1) {
20 	ftp_log(ctx, LOG_TRANSFER, "X");
21 	if (ctx->transfer_in_progress)
22 	    reply(ctx, MSG_426_Transfer_aborted);
23 	reply(ctx, MSG_226_ABOR_successful);
24     } else
25 	reply(ctx, MSG_225_ABOR_successful);
26     cleanup_data(ctx, ctx->dfn);
27     cleanup_file(ctx, ctx->ffn);
28     ctx->dbuf = buffer_free_all(ctx->dbuf);
29     DebugOut(DEBUG_COMMAND);
30 }
31