Skip Menu |

This queue is for tickets about the PlRPC CPAN distribution.

Report information
The Basics
Id: 41916
Status: new
Priority: 0/
Queue: PlRPC

People
Owner: Nobody in particular
Requestors: anthony [...] derobert.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in:
  • 0.2001
  • 0.2003
  • 0.2004
  • 0.2010
  • 0.2011
  • 0.2012
  • 0.2013
  • 0.2014
  • 0.2015
  • 0.2016
  • 0.2017
  • 0.2018
  • 0.2019
  • 0.2020
Fixed in: (no value)



Subject: [PATCH] Allow different serialization engines
Currently, PlRPC only allows the use of Storable to serialize data. Storable is fast and available on every Perl install, but suffers some problems: o Extreme difficulty talking to the server with anything but Perl. o Storable (and normally Perl) versions must match, or things may break. To resolve those, it'd be nice to be able to plug in a different serialization engine. This patch: a. Modularizes the serialization engine, into a module providing a 'encode' and a 'decode' method. b. Adds two such modules: one for Storable (behaves exactly the same as pre-patch, I believe) and one for YAML. This patch looks much larger than it is due to renaming RPC::PlServer::Comm.pm to RPC::PlComm::Base.pm.
Subject: serialization-options.diff

Message body is not shown because it is too large.

Subject: [PATCH] Fix max message size (apply after previous patch)
The attached patch makes setting max message size to 0 mean unlimited again. Also added tests to confirm.
Index: trunk/t/client-yaml.t =================================================================== --- trunk/t/client-yaml.t (revision 3588) +++ trunk/t/client-yaml.t (revision 3589) @@ -7,7 +7,7 @@ require "t/lib.pl"; -my $numTests = 10; +my $numTests = 11; my $numTest = 0; Index: trunk/t/client.t =================================================================== --- trunk/t/client.t (revision 3588) +++ trunk/t/client.t (revision 3589) @@ -7,7 +7,7 @@ require "t/lib.pl"; -my $numTests = 10; +my $numTests = 11; my $numTest = 0; Index: trunk/t/lib.pl =================================================================== --- trunk/t/lib.pl (revision 3588) +++ trunk/t/lib.pl (revision 3589) @@ -55,6 +55,11 @@ $result = eval { $calculator->divide(27, 0) }; Test($@ and $@ =~ /zero/); + my $expect = join(q{}, 'a'..'daaa'); + $result = eval { $calculator->huge_result }; + Test($result and $result eq $expect) + or print "huge result failed: $@\n"; + ($client, $calculator); } Index: trunk/t/crypt.t =================================================================== --- trunk/t/crypt.t (revision 3588) +++ trunk/t/crypt.t (revision 3589) @@ -13,7 +13,7 @@ require "t/lib.pl"; -my $numTests = 18; +my $numTests = 20; my $numTest = 0; my $hostkey = 'b3a6d83ef3187ac4'; Index: trunk/t/methods.t =================================================================== --- trunk/t/methods.t (revision 3588) +++ trunk/t/methods.t (revision 3589) @@ -7,7 +7,7 @@ require "t/lib.pl"; -my $numTests = 11; +my $numTests = 12; my $numTest = 0; @@ -27,7 +27,8 @@ 'add' => 1, 'multiply' => 1, 'divide' => 1, - 'subtract' => 1 + 'subtract' => 1, + 'huge_result' => 1, } } } ] Index: trunk/t/server =================================================================== --- trunk/t/server (revision 3588) +++ trunk/t/server (revision 3589) @@ -58,7 +58,13 @@ $result / $divisor; } +sub huge_result { + my $self = shift; + join(q{}, 'a'..'daaa'); +} + + package CalcServer; use vars qw($VERSION @ISA); Index: trunk/t/base.t =================================================================== --- trunk/t/base.t (revision 3588) +++ trunk/t/base.t (revision 3589) @@ -2,7 +2,7 @@ use strict; print "1..6\n"; -my $ok = require RPC::PlServer::Comm; +my $ok = require RPC::PlComm::Base; printf("%sok 1\n", ($ok ? "" : "not ")); $ok = require RPC::PlServer; printf("%sok 2\n", ($ok ? "" : "not ")); Index: trunk/t/compress.t =================================================================== --- trunk/t/compress.t (revision 3588) +++ trunk/t/compress.t (revision 3589) @@ -13,7 +13,7 @@ require "t/lib.pl"; -my $numTests = 18; +my $numTests = 20; my $numTest = 0; # Create a configfile with compression Index: trunk/lib/RPC/PlComm/Base.pm =================================================================== --- trunk/lib/RPC/PlComm/Base.pm (revision 3588) +++ trunk/lib/RPC/PlComm/Base.pm (revision 3589) @@ -57,8 +57,9 @@ if (my $cipher = $attr->{'cipher'}) { $self->{'cipher'} = $cipher; } - if (my $maxmessage = $attr->{'maxmessage'}) { - $self->{'maxmessage'} = $maxmessage; + + if (defined $attr->{'maxmessage'}) { + $self->{'maxmessage'} = $attr->{'maxmessage'}; } $self;