httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r164891 - /httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm
Date Tue, 26 Apr 2005 21:37:42 GMT
Author: joes
Date: Tue Apr 26 14:37:42 2005
New Revision: 164891

URL: http://svn.apache.org/viewcvs?rev=164891&view=rev
Log:
Promote upload() to APR::Request.

Modified:
    httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm

Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm
URL: http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm?rev=164891&r1=164890&r2=164891&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pm Tue Apr 26 14:37:42 2005
@@ -15,6 +15,22 @@
     return $fh;
 }
 
+sub APR::Request::upload {
+    my $req = shift;
+    my $body = $req->body or return;
+    $body->param_class(__PACKAGE__);
+    if (@_) {
+        my @uploads = grep $_->upload, $body->get(@_);
+        return wantarray ? @uploads : $uploads[0];
+    }
+
+    return map { $_->upload ? $_->name : () } values %$body
+        if wantarray;
+
+   return $body->uploads($req->pool);
+
+}
+
 package APR::Request::Brigade;
 push our(@ISA), "APR::Brigade";
 



Mime
View raw message