mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 05:01:36 +00:00
fixed rack build
This commit is contained in:
@@ -180,6 +180,7 @@ int uwsgi_python_init() {
|
||||
|
||||
Py_OptimizeFlag = up.optimize;
|
||||
|
||||
uwsgi_log("AAAA\n");
|
||||
Py_Initialize();
|
||||
|
||||
|
||||
@@ -243,10 +244,14 @@ void uwsgi_python_atexit() {
|
||||
// this time we use this higher level function
|
||||
// as this code can be executed in a signal handler
|
||||
|
||||
uwsgi_log("FOO 0\n");
|
||||
|
||||
if (!Py_IsInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uwsgi_log("FOO\n");
|
||||
|
||||
if (uwsgi.has_threads)
|
||||
PyGILState_Ensure();
|
||||
// no need to worry about freeing memory
|
||||
@@ -1092,6 +1097,7 @@ void uwsgi_python_master_fixup(int step) {
|
||||
|
||||
void uwsgi_python_enable_threads() {
|
||||
|
||||
uwsgi_log("ALEE\n");
|
||||
PyEval_InitThreads();
|
||||
if (pthread_key_create(&up.upt_save_key, NULL)) {
|
||||
uwsgi_error("pthread_key_create()");
|
||||
|
||||
@@ -819,22 +819,6 @@ VALUE init_rack_app( VALUE script ) {
|
||||
return RARRAY_PTR(rackup)[0] ;
|
||||
}
|
||||
|
||||
int uwsgi_rack_xml(char *node, char *content) {
|
||||
|
||||
int error;
|
||||
|
||||
if (!strcmp("rack", node)) {
|
||||
ur.dispatcher = rb_protect(init_rack_app, rb_str_new2(content), &error);
|
||||
if (ur.dispatcher != Qnil) {
|
||||
rb_gc_register_address(&ur.dispatcher);
|
||||
uwsgi_log("Rack application ready\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int uwsgi_rack_magic(char *mountpoint, char *lazy) {
|
||||
|
||||
if (!strcmp(lazy+strlen(lazy)-3, ".ru")) {
|
||||
@@ -1026,7 +1010,6 @@ struct uwsgi_plugin rack_plugin = {
|
||||
|
||||
.init_apps = uwsgi_rack_init_apps,
|
||||
//.mount_app = uwsgi_rack_mount_app,
|
||||
.manage_xml = uwsgi_rack_xml,
|
||||
|
||||
.magic = uwsgi_rack_magic,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user