fixed --rails wirh ruby 1.9.2

This commit is contained in:
roberto@oneiric64
2011-12-08 18:36:40 +01:00
parent 46108f8d0c
commit 613f2ed939
+15 -2
View File
@@ -286,9 +286,19 @@ void uwsgi_rack_init_apps(void) {
ur.dispatcher = Qnil;
if (rb_funcall(ac, rb_intern("const_defined?"), 1, ID2SYM(rb_intern("Dispatcher"))) == Qtrue) {
VALUE ac_dispatcher = rb_const_get(ac, rb_intern("Dispatcher"));
if (rb_respond_to(ac_dispatcher, rb_intern("call")) || rb_respond_to(ac_dispatcher, ID2SYM(rb_intern("call")))) {
ur.dispatcher = rb_funcall( rb_const_get(ac, rb_intern("Dispatcher")), rb_intern("new"), 0);
VALUE acd_instance_methods = rb_funcall( ac_dispatcher, rb_intern("instance_methods"), 0);
VALUE acim_call = rb_funcall( acd_instance_methods, rb_intern("include?"), 1, ID2SYM(rb_intern("call")));
if (acim_call == Qfalse) {
acim_call = rb_funcall( acd_instance_methods, rb_intern("include?"), 1, rb_str_new2("call"));
}
if (acim_call == Qtrue) {
ur.dispatcher = rb_funcall( ac_dispatcher, rb_intern("new"), 0);
}
}
@@ -311,6 +321,8 @@ void uwsgi_rack_init_apps(void) {
exit(1);
}
rb_gc_register_address(&ur.dispatcher);
goto ready;
}
@@ -569,6 +581,7 @@ int uwsgi_rack_request(struct wsgi_request *wsgi_req) {
goto clear;
}
if (TYPE(ret) == T_ARRAY) {
if (RARRAY_LEN(ret) != 3) {
uwsgi_log("Invalid RACK response size: %d\n", RARRAY_LEN(ret));