You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2005/05/16 01:00:10 UTC
svn commit: r170276 - /httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm
Author: joes
Date: Sun May 15 16:00:09 2005
New Revision: 170276
URL: http://svn.apache.org/viewcvs?rev=170276&view=rev
Log:
Simplify the code a bit while looking for the domain/path bug.
Modified:
httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm
Modified: httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm?rev=170276&r1=170275&r2=170276&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm (original)
+++ httpd/apreq/trunk/glue/perl/lib/Apache2/Cookie.pm Sun May 15 16:00:09 2005
@@ -13,15 +13,11 @@
sub new {
my ($class, $r, %attrs) = @_;
- my $name = delete $attrs{name};
- my $value = delete $attrs{value};
- $name = delete $attrs{-name} unless defined $name;
- $value = delete $attrs{-value} unless defined $value;
+ my $name = delete $attrs{name} || delete $attrs{-name};
+ my $value = delete $attrs{value} || delete $attrs{-value};
return unless defined $name and defined $value;
- my $cookie = $class->make($r->pool, $name,
- $class->freeze($value));
-
+ my $cookie = $class->make($r->pool, $name, $class->freeze($value));
while(my ($k, $v) = each %attrs) {
$k =~ s/^-//;
$cookie->$k($v);
@@ -29,7 +25,6 @@
return $cookie;
}
-
sub fetch {
my $class = shift;
my $req = shift;
@@ -39,12 +34,13 @@
$usage: attempt to fetch global Apache2::RequestUtil->request failed: $@.
EOD
}
- $req = APR::Request::Apache2->handle($req) unless $req->isa("APR::Request");
+ $req = APR::Request::Apache2->handle($req)
+ unless $req->isa("APR::Request");
+
my $jar = $req->jar or return;
$jar->cookie_class(__PACKAGE__);
return wantarray ? %$jar : $jar;
}
-
sub set_attr {
my ($cookie, %attrs) = @_;