1 /* 2 * h_mode.c 3 * 4 * (C)2005-2011 by Marc Huber <Marc.Huber@web.de> 5 * All rights reserved. 6 * 7 * $Id: h_mode.c,v 1.11 2015/03/14 06:11:25 marc Exp marc $ 8 * 9 */ 10 11 #include "headers.h" 12 #include <ctype.h> 13 14 static const char rcsid[] __attribute__ ((used)) = "$Id: h_mode.c,v 1.11 2015/03/14 06:11:25 marc Exp marc $"; 15 h_mode(struct context * ctx,char * arg)16void h_mode(struct context *ctx, char *arg) 17 { 18 DebugIn(DEBUG_COMMAND); 19 20 #ifdef WITH_ZLIB 21 if (ctx->allow_mode_z && tolower((int) *arg) == 'z') { 22 ctx->mode = 'z'; 23 replyf(ctx, MSG_200_transfer_mode, "DEFLATE"); 24 } else 25 #endif 26 if (tolower((int) *arg) == 's') { 27 ctx->mode = 's'; 28 replyf(ctx, MSG_200_transfer_mode, "STREAM"); 29 } else 30 reply(ctx, MSG_501_Unknown_transfer_mode); 31 32 33 DebugOut(DEBUG_COMMAND); 34 } 35