| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-19 12:36:48 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-19 12:36:48 +0200 |
| commit | 8314e55911cee7c64a94d7e7092b69b51b805c93 (patch) | |
| tree | 3bdf2ec907893f31c82e9fb02f9d01de5553e2cf | |
| parent | 64275e09a21aa78076c1aaefc015e96c2864847b (diff) | |
Adds timeout to connection test.
I didn't check if libircclient could detect the lack of connection
during the test, but since implementing that timeout is way easier than
expected (and prevents spamming connection tests), I simply added it.
| -rw-r--r-- | src/main.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -169,9 +169,21 @@ static int event_handling_loop timeouts += 1; /* 1200 timeouts => 5min */ - if ((timeouts >= 1200) && (JH_irc_test_connection(irc) != 0)) + if ((timeouts == 1200) && (JH_irc_test_connection(irc) != 0)) { - JH_S_ERROR(stderr, "Timed out."); + JH_S_ERROR(stderr, "Timed out due to fail connection test."); + + JH_irc_finalize(irc); + + return -1; + } + else if (timeouts >= 1500) + { + JH_S_ERROR + ( + stderr, + "Timed out due to lack of response to connection test." + ); JH_irc_finalize(irc); |


