summaryrefslogtreecommitdiff
path: root/htetc
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-02 20:53:04 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-02 20:53:04 -0700
commit07d63243b070962b8fcf8e6b59128ccf1305f8f8 (patch)
treedcdb4222d2f34795aa539123e89ce0eaf8cb2848 /htetc
parente881063d6e46d991003cf8fae96d8d36780fedcd (diff)
FS/FS/Trace.pm
Diffstat (limited to 'htetc')
-rw-r--r--htetc/handler.pl21
1 files changed, 21 insertions, 0 deletions
diff --git a/htetc/handler.pl b/htetc/handler.pl
index cea3661..77b9346 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;
}