Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
feat(server): Enable using thread for per request (#249)
Browse files Browse the repository at this point in the history
By setting the MHD_USE_THREAD_PER_CONNECTION flag would process
requests concurrently, otherwise it wouldn't use the thread pool
and process serially.
  • Loading branch information
jkrvivian authored and Wu Yu Wei committed Jul 22, 2019
1 parent 0336c2c commit 58841cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accelerator/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ status_t ta_http_start(ta_http_t *const http) {
}

http->daemon =
MHD_start_daemon(MHD_USE_AUTO_INTERNAL_THREAD | MHD_USE_ERROR_LOG | MHD_USE_DEBUG, atoi(http->core->info.port),
request_log, NULL, ta_http_handler, http, MHD_OPTION_END);
MHD_start_daemon(MHD_USE_AUTO_INTERNAL_THREAD | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_ERROR_LOG | MHD_USE_DEBUG,
atoi(http->core->info.port), request_log, NULL, ta_http_handler, http, MHD_OPTION_END);
if (http->daemon == NULL) {
log_error(http_logger_id, "[%s:%d:%s]\n", __func__, __LINE__, "SC_HTTP_OOM");
return SC_HTTP_OOM;
Expand Down

0 comments on commit 58841cc

Please sign in to comment.