X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htetc%2Fhandler.pl;h=77b93463fedbe25bbf365dea3922f32dc6d0ff25;hp=cea366134f8d734c4c93f10d46f4c6025715b690;hb=07d63243b070962b8fcf8e6b59128ccf1305f8f8;hpb=e881063d6e46d991003cf8fae96d8d36780fedcd diff --git a/htetc/handler.pl b/htetc/handler.pl index cea366134..77b93463f 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -5,6 +5,7 @@ package HTML::Mason; use strict; use warnings; use FS::Mason qw( mason_interps ); +use FS::Trace; #use vars qw($r); @@ -38,6 +39,8 @@ sub handler #($r) = @_; my $r = shift; + FS::Trace->log('protecting fds'); + #from rt/bin/webmux.pl(.in) if ( !$protect_fds && $ENV{'MOD_PERL'} && exists $ENV{'MOD_PERL_API_VERSION'} && $ENV{'MOD_PERL_API_VERSION'} >= 2 @@ -63,6 +66,8 @@ sub handler ###Module::Refresh->refresh;### + FS::Trace->log('setting content_type / headers'); + $r->content_type('text/html; charset=utf-8'); #$r->content_type('text/html; charset=iso-8859-1'); #eorar @@ -76,6 +81,8 @@ sub handler if ( $r->filename =~ /\/rt\// ) { #RT + FS::Trace->log('handling RT file'); + # We don't need to handle non-text, non-xml items return -1 if defined( $r->content_type ) && $r->content_type !~ m!(^text/|\bxml\b)!io; @@ -84,15 +91,20 @@ sub handler local $SIG{__WARN__}; local $SIG{__DIE__}; + FS::Trace->log('initializing RT'); my_rt_init(); + FS::Trace->log('setting RT interpreter'); $ah->interp($rt_interp); } else { + FS::Trace->log('handling Freeside file'); + local $SIG{__WARN__}; local $SIG{__DIE__}; + FS::Trace->log('initializing RT'); my_rt_init(); #we don't want the RT error handlers under FS @@ -102,10 +114,12 @@ sub handler undef($SIG{__DIE__}) if defined($SIG{__DIE__} ); } + FS::Trace->log('setting Freeside interpreter'); $ah->interp($fs_interp); } + FS::Trace->log('handling request'); my %session; my $status; eval { $status = $ah->handle_request($r); }; @@ -125,6 +139,13 @@ sub handler # ); # } + FS::Trace->log('done'); + + FS::Trace->dumpfile("%%%FREESIDE_EXPORT%%%/profile/$$.".time, $r->filename) + if FS::Trace->total > 5; #10? + + FS::Trace->reset; + $status; }