From 58a7e4a4d7449d58732e024ea07ea3623c10d8de Mon Sep 17 00:00:00 2001 From: Nakidai Date: Sun, 1 Feb 2026 22:28:31 +0300 Subject: Fixes - Now code depends on config.h in Makefile - By default the smallest timeout is chosen for poll() - Somewhy there was sizeof(PEER_QUIT_MAX)... --- Makefile | 2 +- config.h | 2 +- loop.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 49a05b3..e70390f 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ OBJS += user.o OBJS += writef.o all: ${NAME} -${OBJS}: ircd.h +${OBJS}: ircd.h config.h ${NAME}: ${OBJS} ${CC} -o ${NAME} ${CFLAGS} ${LDFLAGS} ${OBJS} clean: diff --git a/config.h b/config.h index 1f18edd..394ac70 100644 --- a/config.h +++ b/config.h @@ -36,4 +36,4 @@ #define PEER_PINGTIMEOUT 120 #define PEER_PONGTIMEOUT 20 -#define POLL_TIMEOUT PEER_PINGTIMEOUT +#define POLL_TIMEOUT (PEER_PINGTIMEOUT < PEER_PONGTIMEOUT ? PEER_PINGTIMEOUT : PEER_PONGTIMEOUT) diff --git a/loop.c b/loop.c index c568c6f..84195eb 100644 --- a/loop.c +++ b/loop.c @@ -133,7 +133,7 @@ loop: { snprintf( peers[i].quit, - sizeof(PEER_QUIT_MAX), + PEER_QUIT_MAX, "Ping Timeout (%llu seconds)", now - peers[i].ping ); -- cgit 1.4.1