(really) fixed fibers plugin

This commit is contained in:
roberto@oneiric64
2011-12-26 08:18:01 +01:00
parent 2add03edb8
commit 6cceece3d7
3 changed files with 13 additions and 5 deletions
+3 -1
View File
@@ -58,11 +58,13 @@ void fiber_loop() {
uwsgi.schedule_to_main = fiber_schedule_to_main;
uwsgi.schedule_to_req = fiber_schedule_to_req;
ur.unprotected = 1;
rb_protect(protected_async_loop, 0, &error);
if (error) {
uwsgi_ruby_exception();
exit(1);
exit(1);
}
// never here
+8 -4
View File
@@ -590,7 +590,6 @@ int uwsgi_rack_request(struct wsgi_request *wsgi_req) {
rb_hash_aset(env, rb_str_new2("rack.errors"), rb_funcall( rb_const_get(rb_cObject, rb_intern("IO")), rb_intern("new"), 2, INT2NUM(2), rb_str_new("w",1) ));
ret = rb_protect( call_dispatch, env, &error);
if (error) {
uwsgi_ruby_exception();
@@ -674,9 +673,14 @@ int uwsgi_rack_request(struct wsgi_request *wsgi_req) {
}
}
else if (rb_respond_to( body, rb_intern("each") )) {
rb_protect( iterate_body, body, &error);
if (error) {
uwsgi_ruby_exception();
if (ur.unprotected) {
iterate_body(body);
}
else {
rb_protect( iterate_body, body, &error);
if (error) {
uwsgi_ruby_exception();
}
}
}
+2
View File
@@ -69,6 +69,8 @@ struct uwsgi_rack {
int rb_shell;
int app_id;
int unprotected;
struct uwsgi_string_list *rbrequire;
};