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
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 is wouldn't use the thread pool
and process serially.
  • Loading branch information
jkrvivian committed Jul 22, 2019
1 parent 01630e7 commit f8a264b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion accelerator/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
#define TA_HOST "localhost"
#define TA_PORT "8000"
#define TA_THREAD_COUNT 10
#define IRI_HOST "localhost"
#define IRI_HOST "node1.puyuma.org"
#define IRI_PORT 14265
#define MILESTONE_DEPTH 3
#define FSIZE 11
Expand Down
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 f8a264b

Please sign in to comment.