X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fio.c;h=b3724b5ffaf566cc51322d023961f2a945c2aa7a;hb=4e4313a0162999f961db391a2dcf943128040e56;hp=39fd75e657526cc7ea4a45f1a53eac330f1c9a91;hpb=491e8bc8e7a9b1d312256817c0b8be7e05b127be;p=plomrogue diff --git a/src/client/io.c b/src/client/io.c index 39fd75e..b3724b5 100644 --- a/src/client/io.c +++ b/src/client/io.c @@ -1,4 +1,9 @@ -/* src/client/io.c */ +/* src/client/io.c + * + * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3 + * or any later version. For details on its copyright, license, and warranties, + * see the file NOTICE in the root directory of the PlomRogue source package. + */ #define _POSIX_C_SOURCE 1 /* PIPE_BUF */ #include "io.h" @@ -232,9 +237,10 @@ static void test_ping_pong(time_t last_server_answer_time) { static uint8_t ping_sent = 0; time_t now = time(0); - if (ping_sent && last_server_answer_time > now - 3) - { - ping_sent = 0; + if (ping_sent && last_server_answer_time > now - 3) /* Re-set if last */ + { /* ping was answered */ + ping_sent = 0; /* with server */ + return; /* activity. */ } if (!ping_sent && last_server_answer_time < now - 3) {