| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-23 15:09:16 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-08-23 15:09:16 +0200 |
| commit | ba71528805f777871f52fc278858f56677307064 (patch) | |
| tree | 2536578a90bf79918941b5d12b12dca4872d1f14 /src/main.c | |
| parent | 8314e55911cee7c64a94d7e7092b69b51b805c93 (diff) | |
Fixes connection test.
Sending the test request made the connection test be considered valid.
Woops.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -169,25 +169,30 @@ static int event_handling_loop timeouts += 1; /* 1200 timeouts => 5min */ - if ((timeouts == 1200) && (JH_irc_test_connection(irc) != 0)) + if (timeouts >= 1200) { - JH_S_ERROR(stderr, "Timed out due to fail connection test."); + if (JH_irc_is_testing_connection(irc)) + { + JH_S_ERROR + ( + stderr, + "Timed out due to lack of response to connection test." + ); - JH_irc_finalize(irc); + JH_irc_finalize(irc); - return -1; - } - else if (timeouts >= 1500) - { - JH_S_ERROR - ( - stderr, - "Timed out due to lack of response to connection test." - ); + return -1; + } + else if (JH_irc_start_connection_test(irc) < 0) + { + JH_S_ERROR(stderr, "Timed out due to failed connection test."); + + JH_irc_finalize(irc); - JH_irc_finalize(irc); + return -1; + } - return -1; + timeouts = 0; } } else |


