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

Commit 58841cc

Browse files
jkrvivianWu Yu Wei
authored andcommitted
feat(server): Enable using thread for per request (#249)
By setting the MHD_USE_THREAD_PER_CONNECTION flag would process requests concurrently, otherwise it wouldn't use the thread pool and process serially.
1 parent 0336c2c commit 58841cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

accelerator/http.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ status_t ta_http_start(ta_http_t *const http) {
377377
}
378378

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

0 commit comments

Comments
 (0)