Skip to content
Snippets Groups Projects
Commit e3e81759 authored by Dmitriy A. Gerasimov's avatar Dmitriy A. Gerasimov
Browse files

Merge branch 'master' of https://gitlab.demlabs.net/cellframe/cellframe-sdk into release-2.8

parents 8c378a2d 57299015
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,10 @@ static bool s_timer_timeout_check(void * a_arg)
assert(l_worker);
if(dap_events_socket_check_unsafe(l_worker, l_es) ){
if ((l_es->type != DESCRIPTOR_TYPE_SOCKET_CLIENT) && (l_es->type != DESCRIPTOR_TYPE_SOCKET_UDP)) {
log_it(L_CRITICAL, "Timer esocket wrong argument: socket %d type %d, ignore this timeout...", l_es->socket, l_es->type);
return false;
}
dap_client_http_pvt_t * l_http_pvt = PVT(l_es);
log_it(L_WARNING,"Connection timeout for request http://%s:%u/%s, possible network problems or host is down",
l_http_pvt->uplink_addr, l_http_pvt->uplink_port, l_http_pvt->path);
......@@ -131,7 +135,11 @@ static bool s_timer_timeout_check(void * a_arg)
l_http_pvt->were_callbacks_called = true;
}
l_http_pvt->is_closed_by_timeout = true;
l_es->flags |= DAP_SOCK_SIGNAL_CLOSE;
log_it(L_INFO, "Close %s sock %u type %d by timeout",
l_es->remote_addr_str ? l_es->remote_addr_str : "", l_es->socket, l_es->type);
dap_events_socket_remove_and_delete_unsafe(l_es, true);
} else {
log_it(L_INFO, "Socket %d type %d already disposed", l_es->socket, l_es->type);
}
return false;
}
......
......@@ -1466,7 +1466,7 @@ bool dap_events_socket_check_unsafe(dap_worker_t * a_worker,dap_events_socket_t
if ( a_worker->esockets){
dap_events_socket_t * l_es = NULL;
pthread_rwlock_rdlock(&a_worker->esocket_rwlock);
HASH_FIND(hh_worker,a_worker->esockets,&a_es, sizeof(a_es), l_es );
HASH_FIND(hh_worker,a_worker->esockets,&a_es, sizeof(void*), l_es );
pthread_rwlock_unlock(&a_worker->esocket_rwlock);
return l_es == a_es;
}else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment