mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-28 02:20:02 +00:00
Compare commits
7 Commits
xmidt_send
...
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
|
- Update retry timestamp in connection-health-file
|
||||||
- fix so that parodus can be killed, even if in a connection fail loop
|
- 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
|
- 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
|
## [1.0.2] - 2019-02-08
|
||||||
- Refactored connection.c and updated corresponding unit tests
|
- Refactored connection.c and updated corresponding unit tests
|
||||||
|
|||||||
@@ -169,10 +169,11 @@ void createSocketConnection(void (* initKeypress)())
|
|||||||
seshat_registered = __registerWithSeshat();
|
seshat_registered = __registerWithSeshat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If interface down event is set, wait till interface is up again.
|
||||||
if (get_interface_down_event ())
|
if (get_interface_down_event ())
|
||||||
if (0 != wait_while_interface_down ())
|
if (0 != wait_while_interface_down ())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(get_close_retry())
|
if(get_close_retry())
|
||||||
{
|
{
|
||||||
ParodusInfo("close_retry is %d, hence closing the connection and retrying\n", 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
|
if (rtn == CONN_WAIT_ACTION_RETRY) // if redirected or build_headers
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If interface down event is set, stop retry
|
// If interface down event is set, stop retry
|
||||||
// and wait till interface is up again.
|
// and wait till interface is up again.
|
||||||
if(get_interface_down_event()) {
|
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
|
!= BACKOFF_DELAY_TAKEN) // shutdown or cond wait error
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtn == CONN_WAIT_RETRY_DNS)
|
if (rtn == CONN_WAIT_RETRY_DNS)
|
||||||
return false; //find_server again
|
return false; //find_server again
|
||||||
// else retry
|
// else retry
|
||||||
@@ -641,18 +643,19 @@ int wait_while_interface_down()
|
|||||||
close_and_unref_connection (get_global_conn());
|
close_and_unref_connection (get_global_conn());
|
||||||
set_global_conn(NULL);
|
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());
|
rtn = pthread_cond_wait(get_interface_down_con(), get_interface_down_mut());
|
||||||
|
pthread_mutex_unlock (get_interface_down_mut());
|
||||||
|
|
||||||
if (rtn != 0)
|
if (rtn != 0)
|
||||||
ParodusError
|
ParodusError("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
|
||||||
("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
|
|
||||||
if ((rtn != 0) || g_shutdown) {
|
if ((rtn != 0) || g_shutdown)
|
||||||
pthread_mutex_unlock (get_interface_down_mut());
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock (get_interface_down_mut());
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -697,6 +700,7 @@ int createNopollConnection(noPollCtx *ctx)
|
|||||||
set_current_server (&conn_ctx);
|
set_current_server (&conn_ctx);
|
||||||
if (keep_trying_to_connect (&conn_ctx, &backoff_timer))
|
if (keep_trying_to_connect (&conn_ctx, &backoff_timer))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// retry dns query
|
// retry dns query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ int main( int argc, char **argv)
|
|||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
signal(SIGUSR1, sig_handler);
|
signal(SIGUSR1, sig_handler);
|
||||||
signal(SIGUSR2, sig_handler);
|
signal(SIGUSR2, sig_handler);
|
||||||
signal(SIGKILL, sig_handler);
|
|
||||||
signal(SIGQUIT, sig_handler);
|
signal(SIGQUIT, sig_handler);
|
||||||
signal(SIGHUP, sig_handler);
|
signal(SIGHUP, sig_handler);
|
||||||
signal(SIGALRM, sig_handler);
|
signal(SIGALRM, sig_handler);
|
||||||
|
|||||||
Reference in New Issue
Block a user