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

[+] Some more debug output

[*] Fixed (I hope) deadlock in dap_client_pvt
parent 3fabe301
No related branches found
No related tags found
No related merge requests found
Pipeline #6350 passed with stage
in 18 seconds
...@@ -2,7 +2,7 @@ project(cellframe-sdk C) ...@@ -2,7 +2,7 @@ project(cellframe-sdk C)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CELLFRAME_SDK_NATIVE_VERSION "2.6-38") set(CELLFRAME_SDK_NATIVE_VERSION "2.6-39")
add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"") add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"")
set(DAPSDK_MODULES "") set(DAPSDK_MODULES "")
......
...@@ -181,13 +181,22 @@ static void s_http_error(dap_events_socket_t * a_es, int a_errno) ...@@ -181,13 +181,22 @@ static void s_http_error(dap_events_socket_t * a_es, int a_errno)
l_errbuf[0] = '\0'; l_errbuf[0] = '\0';
if (a_errno == ETIMEDOUT){ if (a_errno == ETIMEDOUT){
strncpy(l_errbuf,"Connection timeout", sizeof (l_errbuf)-1); strncpy(l_errbuf,"Connection timeout", sizeof (l_errbuf)-1);
}else if (a_errno == ECONNREFUSED){
strncpy(l_errbuf,"Connection refused", sizeof (l_errbuf)-1);
}else if (a_errno == EHOSTDOWN){
strncpy(l_errbuf,"Host is down", sizeof (l_errbuf)-1);
}else if (a_errno == EHOSTUNREACH){
strncpy(l_errbuf,"No route to host", sizeof (l_errbuf)-1);
}else if (a_errno == EREMOTEIO){
strncpy(l_errbuf,"Remote I/O error", sizeof (l_errbuf)-1);
}else if(a_errno) }else if(a_errno)
strerror_r(a_errno, l_errbuf, sizeof (l_errbuf)); strerror_r(a_errno, l_errbuf, sizeof (l_errbuf));
else else
strncpy(l_errbuf,"Unknown Error", sizeof (l_errbuf)-1); strncpy(l_errbuf,"Unknown Error", sizeof (l_errbuf)-1);
if (a_es->flags & DAP_SOCK_CONNECTING)
if (a_es->flags & DAP_SOCK_CONNECTING){
log_it(L_WARNING, "Socket connecting error: %s (code %d)" , l_errbuf, a_errno); log_it(L_WARNING, "Socket connecting error: %s (code %d)" , l_errbuf, a_errno);
else }else
log_it(L_WARNING, "Socket error: %s (code %d)" , l_errbuf, a_errno); log_it(L_WARNING, "Socket error: %s (code %d)" , l_errbuf, a_errno);
dap_client_http_pvt_t * l_client_http_internal = PVT(a_es); dap_client_http_pvt_t * l_client_http_internal = PVT(a_es);
...@@ -226,6 +235,7 @@ static void s_client_http_delete(dap_client_http_pvt_t * a_http_pvt) ...@@ -226,6 +235,7 @@ static void s_client_http_delete(dap_client_http_pvt_t * a_http_pvt)
for( size_t i = 0; i < a_http_pvt->request_custom_headers_count; i++) { for( size_t i = 0; i < a_http_pvt->request_custom_headers_count; i++) {
DAP_DELETE( a_http_pvt->request_custom_headers[i]); DAP_DELETE( a_http_pvt->request_custom_headers[i]);
} }
a_http_pvt->request_custom_headers = NULL;
//DAP_DELETE( l_client_http_pvt->request_custom_headers); //DAP_DELETE( l_client_http_pvt->request_custom_headers);
} }
......
...@@ -704,12 +704,13 @@ static void s_request_error(int a_err_code, void * a_obj) ...@@ -704,12 +704,13 @@ static void s_request_error(int a_err_code, void * a_obj)
dap_client_pvt_hh_unlock(); dap_client_pvt_hh_unlock();
return; return;
} }
dap_client_pvt_hh_unlock();
if(a_client_internal && a_client_internal->request_error_callback && a_client_internal->client) if(a_client_internal && a_client_internal->request_error_callback && a_client_internal->client)
{ {
if(a_client_internal && a_client_internal->request_error_callback && a_client_internal->client && a_client_internal->client->_internal) if(a_client_internal && a_client_internal->request_error_callback && a_client_internal->client && a_client_internal->client->_internal)
a_client_internal->request_error_callback(a_client_internal->client, a_err_code); a_client_internal->request_error_callback(a_client_internal->client, a_err_code);
} }
dap_client_pvt_hh_unlock();
} }
/** /**
...@@ -884,10 +885,6 @@ static void s_enc_init_response(dap_client_t * a_client, void * a_response, size ...@@ -884,10 +885,6 @@ static void s_enc_init_response(dap_client_t * a_client, void * a_response, size
static void s_enc_init_error(dap_client_t * a_client, int a_err_code) static void s_enc_init_error(dap_client_t * a_client, int a_err_code)
{ {
dap_client_pvt_t * l_client_pvt = DAP_CLIENT_PVT(a_client); dap_client_pvt_t * l_client_pvt = DAP_CLIENT_PVT(a_client);
if (!dap_client_pvt_check(l_client_pvt) ){
// Response received after client_pvt was deleted
return;
}
//dap_client_internal_t * l_client_internal = dap_CLIENT_INTERNAL(a_client); //dap_client_internal_t * l_client_internal = dap_CLIENT_INTERNAL(a_client);
log_it(L_ERROR, "ENC: Can't init ecnryption session, err code %d", a_err_code); log_it(L_ERROR, "ENC: Can't init ecnryption session, err code %d", a_err_code);
...@@ -999,10 +996,6 @@ static void s_stream_ctl_error(dap_client_t * a_client, int a_error) ...@@ -999,10 +996,6 @@ static void s_stream_ctl_error(dap_client_t * a_client, int a_error)
log_it(L_WARNING, "STREAM_CTL error %d", a_error); log_it(L_WARNING, "STREAM_CTL error %d", a_error);
dap_client_pvt_t * l_client_pvt = DAP_CLIENT_PVT(a_client); dap_client_pvt_t * l_client_pvt = DAP_CLIENT_PVT(a_client);
if (!dap_client_pvt_check(l_client_pvt) ){
// Response received after client_pvt was deleted
return;
}
if (a_error == ETIMEDOUT) { if (a_error == ETIMEDOUT) {
l_client_pvt->last_error = ERROR_NETWORK_CONNECTION_TIMEOUT; l_client_pvt->last_error = ERROR_NETWORK_CONNECTION_TIMEOUT;
......
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