dynamic modifier management for the rack plugin

This commit is contained in:
roberto@mrspurr
2012-06-10 11:50:14 +02:00
parent 4ca33d3f88
commit b4e41532eb
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -196,6 +196,7 @@ success:
}
if (modifier != -1) {
fill_plugin_table(modifier, up);
up->modifier1 = modifier;
}
else {
fill_plugin_table(up->modifier1, up);
+3 -2
View File
@@ -3,6 +3,7 @@
extern struct uwsgi_server uwsgi;
extern struct uwsgi_rack ur;
extern struct uwsgi_plugin rack_plugin;
#define uwsgi_rack_api(x, y, z) rb_define_module_function(rb_uwsgi_embedded, x, y, z)
@@ -683,7 +684,7 @@ VALUE uwsgi_ruby_register_rpc(int argc, VALUE *argv, VALUE *class) {
void *func = (void *) argv[1];
if (uwsgi_register_rpc(name, 7, rb_argc, func)) {
if (uwsgi_register_rpc(name, rack_plugin.modifier1, rb_argc, func)) {
clear:
rb_raise(rb_eRuntimeError, "unable to register rpc function");
return Qnil;
@@ -702,7 +703,7 @@ VALUE uwsgi_ruby_register_signal(VALUE *class, VALUE signum, VALUE sigkind, VALU
uint8_t uwsgi_signal = NUM2INT(signum);
char *signal_kind = RSTRING_PTR(sigkind);
if (uwsgi_register_signal(uwsgi_signal, signal_kind, (void *) rbhandler, 7)) {
if (uwsgi_register_signal(uwsgi_signal, signal_kind, (void *) rbhandler, rack_plugin.modifier1)) {
rb_raise(rb_eRuntimeError, "unable to register signal %d", uwsgi_signal);
return Qnil;
}
+2 -1
View File
@@ -3,6 +3,7 @@
extern struct uwsgi_server uwsgi;
struct uwsgi_rack ur;
struct uwsgi_plugin rack_plugin;
struct uwsgi_option uwsgi_rack_options[] = {
@@ -511,7 +512,7 @@ ready:
rb_define_method(ur.rb_uwsgi_io_class, "read", rb_uwsgi_io_read, -2);
rb_define_method(ur.rb_uwsgi_io_class, "rewind", rb_uwsgi_io_rewind, 0);
struct uwsgi_app *ua = uwsgi_add_app(ur.app_id, 7, (char*)"", 0, NULL, NULL);
struct uwsgi_app *ua = uwsgi_add_app(ur.app_id, rack_plugin.modifier1, (char*)"", 0, NULL, NULL);
ua->started_at = now;
ua->startup_time = uwsgi_now() - now;