mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-28 10:20:04 +00:00
Compare commits
4 Commits
parodus_de
...
event_hand
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c99132287 | ||
|
|
680b0471ab | ||
|
|
4bd5223f08 | ||
|
|
9a2613c0da |
@@ -169,6 +169,7 @@ 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;
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ int wait_connection_ready (create_connection_ctx_t *ctx)
|
|||||||
if(wait_status == 307 || wait_status == 302 || wait_status == 303) // only when there is a http redirect
|
if(wait_status == 307 || wait_status == 302 || wait_status == 303) // only when there is a http redirect
|
||||||
{
|
{
|
||||||
char *redirect_ptr = redirectURL;
|
char *redirect_ptr = redirectURL;
|
||||||
ParodusInfo("Received temporary redirection response message %s\n", redirectURL);
|
ParodusError("Received temporary redirection response message %s\n", redirectURL);
|
||||||
// Extract server Address and port from the redirectURL
|
// Extract server Address and port from the redirectURL
|
||||||
if (strncmp (redirect_ptr, "Redirect:", 9) == 0)
|
if (strncmp (redirect_ptr, "Redirect:", 9) == 0)
|
||||||
redirect_ptr += 9;
|
redirect_ptr += 9;
|
||||||
@@ -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
|
||||||
@@ -642,15 +644,17 @@ int wait_while_interface_down()
|
|||||||
set_global_conn(NULL);
|
set_global_conn(NULL);
|
||||||
|
|
||||||
while (get_interface_down_event ()) {
|
while (get_interface_down_event ()) {
|
||||||
|
|
||||||
pthread_mutex_lock(get_interface_down_mut());
|
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());
|
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)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -696,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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ void __report_log (noPollCtx * ctx, noPollDebugLevel level, const char * log_msg
|
|||||||
|
|
||||||
if (level == NOPOLL_LEVEL_DEBUG)
|
if (level == NOPOLL_LEVEL_DEBUG)
|
||||||
{
|
{
|
||||||
ParodusInfo("%s\n", log_msg);
|
//ParodusPrint("%s\n", log_msg);
|
||||||
}
|
}
|
||||||
if (level == NOPOLL_LEVEL_INFO)
|
if (level == NOPOLL_LEVEL_INFO)
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@ void __report_log (noPollCtx * ctx, noPollDebugLevel level, const char * log_msg
|
|||||||
}
|
}
|
||||||
if (level == NOPOLL_LEVEL_WARNING)
|
if (level == NOPOLL_LEVEL_WARNING)
|
||||||
{
|
{
|
||||||
ParodusInfo("%s\n", log_msg);
|
ParodusPrint("%s\n", log_msg);
|
||||||
}
|
}
|
||||||
if (level == NOPOLL_LEVEL_CRITICAL)
|
if (level == NOPOLL_LEVEL_CRITICAL)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user