[Jifty-commit] r4614 - in jifty/trunk: lib/Jifty/Plugin
lib/Jifty/Plugin/Recorder/Command
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Dec 4 01:41:52 EST 2007
Author: sartak
Date: Tue Dec 4 01:41:51 2007
New Revision: 4614
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/Recorder.pm
jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm
Log:
r48566 at onn: sartak | 2007-12-04 01:41:37 -0500
Freeze and thaw the CGI object, because it can be a glob that upsets YAML
Wrap the YAML generation in eval {} too, because it is upsettable :)
Modified: jifty/trunk/lib/Jifty/Plugin/Recorder.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Recorder.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Recorder.pm Tue Dec 4 01:41:51 2007
@@ -7,6 +7,7 @@
use Time::HiRes 'time';
use YAML;
use Jifty::Util;
+use Storable 'nfreeze';
our $VERSION = 0.01;
@@ -52,11 +53,14 @@
my $handler = shift;
my $cgi = shift;
- my $delta = time - $self->start;
- my $request = { cgi => $cgi, ENV => \%ENV, time => $delta };
- my $yaml = YAML::Dump($request);
+ eval {
+ my $delta = time - $self->start;
+ my $request = { cgi => nfreeze($cgi), ENV => \%ENV, time => $delta };
+ my $yaml = YAML::Dump($request);
+
+ print { $self->loghandle } $yaml;
+ };
- eval { print { $self->loghandle } $yaml };
Jifty->log->error("Unable to append to request log: $@") if $@;
}
Modified: jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm Tue Dec 4 01:41:51 2007
@@ -10,6 +10,7 @@
use base qw/App::CLI::Command/;
use Time::HiRes 'sleep';
+use Storable 'thaw';
our $start = time; # for naming log files
our $path = 'log/playback';
@@ -168,6 +169,8 @@
$set_num,
$req_num;
+ $request->{cgi} = thaw($request->{cgi});
+
$self->play_request($request, $filename);
}
}
More information about the Jifty-commit
mailing list