From cc0fa8dee653eda51f1fc25d5588f51374cfd59c Mon Sep 17 00:00:00 2001 From: "roberto@centos64" Date: Sat, 18 Feb 2012 08:55:35 +0100 Subject: [PATCH] fixed rack build --- plugins/python/python_plugin.c | 6 ++++++ plugins/rack/rack_plugin.c | 17 ----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 14501311..f53d8d53 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -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()"); diff --git a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c index 27ab4fb3..6180f0a2 100644 --- a/plugins/rack/rack_plugin.c +++ b/plugins/rack/rack_plugin.c @@ -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,