--- loncom/xml/lonxml.pm 2005/02/26 05:37:23 1.357 +++ loncom/xml/lonxml.pm 2005/02/28 22:17:09 1.358 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.357 2005/02/26 05:37:23 albertel Exp $ +# $Id: lonxml.pm,v 1.358 2005/02/28 22:17:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -358,8 +358,8 @@ sub xmlparse { my @stack = (); my @parstack = (); - &initdepth; - + &initdepth(); + &init_alarm(); my $finaloutput = &inner_xmlparse($target,\@stack,\@parstack,\@pars, $safeeval,\%style_for_target); @@ -792,6 +792,28 @@ sub default_homework_load { } } +{ + my $alarm_depth; + sub init_alarm { + alarm(0); + $alarm_depth=0; + } + + sub start_alarm { + if ($alarm_depth<1) { + my $old=alarm($Apache::lonnet::perlvar{'lonScriptTimeout'}); + if ($old) { + &Apache::lonxml::error("Cancelled an alarm of $old, this shouldn't occur."); + } + } + $alarm_depth++; + } + + sub end_alarm { + $alarm_depth--; + if ($alarm_depth<1) { alarm(0); } + } +} my $metamode_was; sub startredirection { if (!$Apache::lonxml::redirection) { @@ -1267,7 +1289,8 @@ sub handler { $Apache::lonxml::debug=$ENV{'user.debug'}; if ($ENV{'browser.mathml'}) { - &Apache::loncommon::content_type($request,'text/xml'); + #&Apache::loncommon::content_type($request,'text/xml'); + &Apache::loncommon::content_type($request,'text/html'); } else { &Apache::loncommon::content_type($request,'text/html'); }