src/server/daemon/httplistener.c

changeset 37
360b9aabe17e
parent 36
450d2d5f4735
child 38
d07810b02147
--- a/src/server/daemon/httplistener.c	Sat Oct 06 13:00:07 2012 +0200
+++ b/src/server/daemon/httplistener.c	Sat Dec 15 16:05:03 2012 +0100
@@ -84,11 +84,20 @@
     }
     
     newls->cfg = conf->cfg;
-    newls->default_vs.vs_name = conf->vs.ptr;
+    newls->default_vs.vs_name = conf->vs.ptr;  
     newls->port = fl->port;
     newls->server_socket = fl->server_socket;
+    newls->ref = 2; // 1 reference is fl->next
+    
     newls->session_handler = fl->session_handler; // TODO
-    newls->ref = 2; // 1 reference is fl->next
+    
+    // the listener threadpool might be changed
+    if(conf->threadpool.ptr != NULL) {
+        newls->threadpool = get_threadpool(conf->threadpool);
+    }
+    if(newls->threadpool == NULL) {
+        newls->threadpool = get_default_threadpool();
+    }
     
     // create acceptor threads
     newls->acceptors = calloc(newls->nacceptors, sizeof(void*));
@@ -129,6 +138,13 @@
 
     HttpListener *listener = malloc(sizeof(HttpListener));
     listener->name = conf->name;
+    listener->default_vs.vs_name = conf->vs.ptr;
+    if(conf->threadpool.ptr != NULL) {
+        listener->threadpool = get_threadpool(conf->threadpool);
+    }
+    if(listener->threadpool == NULL) {
+        listener->threadpool = get_default_threadpool();
+    }
     //listener->session_handler = create_basic_session_handler();
     listener->session_handler = create_event_session_handler();
     listener->nacceptors = conf->nacceptors;

mercurial