diff --git a/CHANGELOG.md b/CHANGELOG.md index 28926d2..9732416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - provide signal handlers so we shut down properly when INCLUDE_BREAKPAD active - send status code and reason in close message - Add pause/resume heartBeatTimer -- parodus event handler to listen to interface_down and interface_up event -- Pause connection retry during interface_down event +- fix so that parodus can be killed, even if in a connection fail loop ## [1.0.2] - 2019-02-08 - Refactored connection.c and updated corresponding unit tests diff --git a/src/connection.c b/src/connection.c index 54656c8..213da88 100644 --- a/src/connection.c +++ b/src/connection.c @@ -556,7 +556,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx, { int rtn; - while (true) + while (!g_shutdown) { set_extra_headers (ctx); @@ -571,6 +571,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx, return false; //find_server again // else retry } + return false; } @@ -615,8 +616,8 @@ int createNopollConnection(noPollCtx *ctx) set_current_server (&conn_ctx); if (keep_trying_to_connect (&conn_ctx, &backoff_timer)) break; - // retry dns query - + if (g_shutdown) + return nopoll_false; // If interface down event is set, stop retry // and wait till interface is up again. if(get_interface_down_event()) { @@ -629,6 +630,7 @@ int createNopollConnection(noPollCtx *ctx) ((header_info_t *)(&conn_ctx.header_info))->conveyHeader = getWebpaConveyHeader(); ParodusInfo("Received reconnect_reason as:%s\n", reconnect_reason); } + // retry dns query } if(conn_ctx.current_server->allow_insecure <= 0)