mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-27 18:20:04 +00:00
Compare commits
7 Commits
v1.1.5
...
event_hand
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c99132287 | ||
|
|
680b0471ab | ||
|
|
4bd5223f08 | ||
|
|
c7c6fb4926 | ||
|
|
f4b2c252ae | ||
|
|
8794ce2092 | ||
|
|
9a2613c0da |
@@ -22,7 +22,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
- Update retry timestamp in connection-health-file
|
||||
- fix so that parodus can be killed, even if in a connection fail loop
|
||||
- provide signal handlers so we shut down properly when INCLUDE_BREAKPAD active
|
||||
- send status code and reason in websocket close message
|
||||
- send status code and reason in websocket close message
|
||||
- dont try to install handler for signal 9
|
||||
|
||||
## [1.0.2] - 2019-02-08
|
||||
- Refactored connection.c and updated corresponding unit tests
|
||||
|
||||
@@ -169,10 +169,11 @@ void createSocketConnection(void (* initKeypress)())
|
||||
seshat_registered = __registerWithSeshat();
|
||||
}
|
||||
|
||||
// If interface down event is set, wait till interface is up again.
|
||||
if (get_interface_down_event ())
|
||||
if (0 != wait_while_interface_down ())
|
||||
break;
|
||||
|
||||
|
||||
if(get_close_retry())
|
||||
{
|
||||
ParodusInfo("close_retry is %d, hence closing the connection and retrying\n", get_close_retry());
|
||||
|
||||
@@ -610,6 +610,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx,
|
||||
|
||||
if (rtn == CONN_WAIT_ACTION_RETRY) // if redirected or build_headers
|
||||
continue;
|
||||
|
||||
// If interface down event is set, stop retry
|
||||
// and wait till interface is up again.
|
||||
if(get_interface_down_event()) {
|
||||
@@ -625,6 +626,7 @@ int keep_trying_to_connect (create_connection_ctx_t *ctx,
|
||||
!= BACKOFF_DELAY_TAKEN) // shutdown or cond wait error
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rtn == CONN_WAIT_RETRY_DNS)
|
||||
return false; //find_server again
|
||||
// else retry
|
||||
@@ -641,18 +643,19 @@ int wait_while_interface_down()
|
||||
close_and_unref_connection (get_global_conn());
|
||||
set_global_conn(NULL);
|
||||
|
||||
pthread_mutex_lock(get_interface_down_mut());
|
||||
while (!get_interface_down_event ()) {
|
||||
while (get_interface_down_event ()) {
|
||||
|
||||
pthread_mutex_lock(get_interface_down_mut());
|
||||
rtn = pthread_cond_wait(get_interface_down_con(), get_interface_down_mut());
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
|
||||
if (rtn != 0)
|
||||
ParodusError
|
||||
("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
|
||||
if ((rtn != 0) || g_shutdown) {
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
ParodusError("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
|
||||
|
||||
if ((rtn != 0) || g_shutdown)
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -697,6 +700,7 @@ int createNopollConnection(noPollCtx *ctx)
|
||||
set_current_server (&conn_ctx);
|
||||
if (keep_trying_to_connect (&conn_ctx, &backoff_timer))
|
||||
break;
|
||||
|
||||
// retry dns query
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ int main( int argc, char **argv)
|
||||
signal(SIGINT, sig_handler);
|
||||
signal(SIGUSR1, sig_handler);
|
||||
signal(SIGUSR2, sig_handler);
|
||||
signal(SIGKILL, sig_handler);
|
||||
signal(SIGQUIT, sig_handler);
|
||||
signal(SIGHUP, sig_handler);
|
||||
signal(SIGALRM, sig_handler);
|
||||
|
||||
Reference in New Issue
Block a user