Skip to content

Commit bc336cc

Browse files
author
Sebastiano Merlino
committed
Created remanaged mode to handle asynchrony.
Changed code in order to use multiple threads in remanaged mode.
1 parent 149077f commit bc336cc

File tree

3 files changed

+200
-56
lines changed

3 files changed

+200
-56
lines changed

src/httpserver/http_utils.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class http_utils
7676
{
7777
INTERNAL_SELECT = MHD_USE_SELECT_INTERNALLY,
7878
THREADS = MHD_USE_THREAD_PER_CONNECTION,
79-
POLL = MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL
79+
POLL = MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL,
80+
INTERNAL_REMANAGED = MHD_NO_FLAG
8081
};
8182

8283
enum policy_T

src/httpserver/webserver.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ namespace details
6262
class http_endpoint;
6363
struct modded_request;
6464
struct cache_manager;
65+
struct daemon_item;
6566
void unlock_cache_entry(cache_entry*);
6667
http_response* get_response(cache_entry*);
6768
}
@@ -353,7 +354,7 @@ class webserver
353354
std::map<int, std::pair<int, std::string> > q_keepalives_mem;
354355
pthread_rwlock_t comet_guard;
355356

356-
struct MHD_Daemon *daemon;
357+
std::vector<details::daemon_item*> daemons;
357358
std::vector<pthread_t> threads;
358359

359360
void init(http_resource* single_resource);

0 commit comments

Comments
 (0)