applications list is now shared

This commit is contained in:
roberto@debian32
2011-08-12 08:08:39 +02:00
parent 287df9ef86
commit a19b392ba6
42 changed files with 1193 additions and 446 deletions
+12 -4
View File
@@ -26,7 +26,7 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
PyObject *app_list = NULL, *applications = NULL;
int id = uwsgi.apps_cnt;
int id = uwsgi_apps_cnt;
int multiapp = 0;
#ifdef UWSGI_ASYNC
@@ -47,7 +47,7 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
}
wi = &uwsgi.apps[id];
wi = &uwsgi_apps[id];
memset(wi, 0, sizeof(struct uwsgi_app));
wi->mountpoint = mountpoint;
@@ -310,7 +310,7 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
uwsgi.default_app = id;
}
uwsgi.apps_cnt++;
uwsgi_apps_cnt++;
uwsgi_rawlog("\n");
@@ -328,6 +328,14 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
}
}
// check if we need to emulate fork() COW
if (uwsgi.mywid == 0) {
for(i=1;i<=uwsgi.numproc;i++) {
memcpy(&uwsgi.workers[i].apps[id], &uwsgi.workers[0].apps[id], sizeof(struct uwsgi_app));
uwsgi.workers[i].apps_cnt = uwsgi_apps_cnt;
}
}
return id;
doh:
@@ -423,7 +431,7 @@ PyObject *uwsgi_uwsgi_loader(void *arg1) {
tmp_callable = PyDict_GetItemString(wsgi_dict, quick_callable);
quick_callable[strlen(quick_callable)] = '(';
if (tmp_callable) {
return python_call(tmp_callable, PyTuple_New(0), 0);
return python_call(tmp_callable, PyTuple_New(0), 0, NULL);
}
}