Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/cellframe-sdk
  • MIKA83/cellframe-sdk
2 results
Show changes
Commits on Source (2)
......@@ -2,7 +2,7 @@ project(cellframe-sdk C)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_C_STANDARD 11)
set(CELLFRAME_SDK_NATIVE_VERSION "2.6-39")
set(CELLFRAME_SDK_NATIVE_VERSION "2.6-40")
add_definitions ("-DCELLFRAME_SDK_VERSION=\"${CELLFRAME_SDK_NATIVE_VERSION}\"")
set(DAPSDK_MODULES "")
......
......@@ -225,11 +225,12 @@ inline static bool _is_supported_user_agents_list_setted()
return cnt;
}
inline static void _set_only_write_http_client_state(dap_http_simple_t * a_simple)
inline static void s_set_writable_flags(dap_http_simple_t * a_simple)
{
// log_it(L_DEBUG,"_set_only_write_http_client_state");
a_simple->http_client->state_write=DAP_HTTP_CLIENT_STATE_START;
dap_events_socket_set_writable_mt(a_simple->worker, a_simple->http_client->esocket,true);
// log_it(L_DEBUG,"_set_only_write_http_client_state");
a_simple->http_client->state_write=DAP_HTTP_CLIENT_STATE_START;
dap_events_socket_set_writable_unsafe( a_simple->http_client->esocket,true);
}
static void _copy_reply_and_mime_to_response( dap_http_simple_t *a_simple )
......@@ -289,7 +290,8 @@ bool s_proc_queue_callback(dap_proc_thread_t * a_thread, void * a_arg )
if(header == NULL && is_unknown_user_agents_pass == false) {
const char error_msg[] = "Not found User-Agent HTTP header";
_write_response_bad_request(l_http_simple, error_msg);
_set_only_write_http_client_state( l_http_simple);
s_set_writable_flags( l_http_simple);
dap_proc_thread_assign_on_worker_inter(a_thread, l_http_simple->worker, l_http_simple->esocket);
return true;
}
......@@ -297,7 +299,8 @@ bool s_proc_queue_callback(dap_proc_thread_t * a_thread, void * a_arg )
log_it(L_DEBUG, "Not supported user agent in request: %s", header->value);
const char* error_msg = "User-Agent version not supported. Update your software";
_write_response_bad_request(l_http_simple, error_msg);
_set_only_write_http_client_state( l_http_simple);
s_set_writable_flags( l_http_simple);
dap_proc_thread_assign_on_worker_inter(a_thread, l_http_simple->worker, l_http_simple->esocket);
return true;
}
}
......@@ -313,7 +316,8 @@ bool s_proc_queue_callback(dap_proc_thread_t * a_thread, void * a_arg )
l_http_simple->http_client->reply_status_code = Http_Status_InternalServerError;
}
_set_only_write_http_client_state( l_http_simple);
s_set_writable_flags( l_http_simple);
dap_proc_thread_assign_on_worker_inter(a_thread, l_http_simple->worker, l_http_simple->esocket);
return true;
}
......@@ -348,7 +352,7 @@ static void s_http_client_headers_read( dap_http_client_t *a_http_client, void *
log_it(L_ERROR, "Not defined content-length %u in request", a_http_client->in_content_length);
} else {
log_it( L_DEBUG, "No data section, execution proc callback" );
dap_events_socket_set_writable_unsafe(a_http_client->esocket,false);
dap_events_socket_remove_from_worker_unsafe(l_http_simple->esocket ,l_http_simple->worker);
dap_proc_queue_add_callback_inter( l_http_simple->worker->proc_queue_input, s_proc_queue_callback, l_http_simple);
}
......