Permalink
Browse files

disable RubyTimeout if RubyTimeout >= Timeout.

  • Loading branch information...
1 parent fc5f6a4 commit cbe39d19bf521eedf37c5f966f4eba84b38f7db7 shugo committed Feb 18, 2006
Showing with 16 additions and 1 deletion.
  1. +16 −1 mod_ruby.c
View
@@ -1242,6 +1242,10 @@ static void *ruby_handler_internal(handler_internal_arg_t *iarg)
handler_0_arg_t arg;
int i, handlers_len;
char **handlers;
+ int timeout;
+#ifndef APACHE2
+ static int warned_timeout = 0;
+#endif
sconf = get_server_config(r->server);
dconf = get_dir_config(r);
@@ -1256,7 +1260,18 @@ static void *ruby_handler_internal(handler_internal_arg_t *iarg)
arg.handler = handlers[i];
arg.mid = mid;
ap_soft_timeout("call ruby handler", r);
- if ((state = run_safely(safe_level, sconf->timeout,
+ timeout = sconf->timeout;
+#ifndef APACHE2
+ if (timeout >= r->server->timeout) {
+ if (!warned_timeout)
+ ruby_log_error(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO,
+ r->server,
+ "disabled RubyTimeout: RubyTimeout >= Timeout");
+ timeout = 0;
+ warned_timeout = 1;
+ }
+#endif
+ if ((state = run_safely(safe_level, timeout,
ruby_handler_0, &arg, &ret)) == 0) {
iarg->retval = NUM2INT(ret);
}

0 comments on commit cbe39d1

Please sign in to comment.