1 /* 2 * h_noop.c 3 * (C)1998-2011 by Marc Huber <Marc.Huber@web.de> 4 * 5 * $Id: h_noop.c,v 1.11 2015/03/14 06:11:25 marc Exp marc $ 6 * 7 */ 8 9 #include "headers.h" 10 11 static const char rcsid[] __attribute__ ((used)) = "$Id: h_noop.c,v 1.11 2015/03/14 06:11:25 marc Exp marc $"; 12 h_noop(struct context * ctx,char * arg)13void h_noop(struct context *ctx, char *arg __attribute__ ((unused))) 14 { 15 struct timeval *tv = NULL; 16 time_t left = -1; 17 18 if (ctx->idle_timeout && (tv = io_sched_peek_time(ctx->io, ctx))) 19 left = tv->tv_sec - io_now.tv_sec; 20 21 if (!tv || left < 0) 22 reply(ctx, MSG_200_Command_okay); 23 else if (left == 1) 24 reply(ctx, MSG_200_Command_okay_remaining_1); 25 else 26 replyf(ctx, MSG_200_Command_okay_remaining_n, left); 27 } 28