my ($param, $value)
= map { $self->unescape_uri($_) }
- split( /=/, $item );
+ split( /=/, $item, 2 );
$param = $self->unescape_uri($item) unless defined $param;
my $len = length($buffer);
my $wrote = syswrite STDOUT, $buffer;
+ if ( !defined $wrote && $! == EWOULDBLOCK ) {
+ # Unable to write on the first try, will retry in the loop below
+ $wrote = 0;
+ }
+
if ( defined $wrote && $wrote < $len ) {
# We didn't write the whole buffer
while (1) {
sub unescape_uri {
my ( $self, $str ) = @_;
-
- $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
- $str =~ s/\+/ /g;
-
+
+ $str =~ s/(?:%([0-9A-Fa-f]{2})|\+)/defined $1 ? chr(hex($1)) : ' '/eg;
+
return $str;
}