httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject [patch] $r->upload($upload)
Date Thu, 17 May 2001 16:49:19 GMT
similar to the $r->parms($parms) patch, allows $r->upload to be set from
another Apache::Upload object.   i'll commit later, if there are no
objections..

Index: Request/Request.xs
===================================================================
RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
retrieving revision 1.13
diff -u -r1.13 Request.xs
--- Request/Request.xs	2001/04/03 19:21:37	1.13
+++ Request/Request.xs	2001/05/17 03:37:04
@@ -335,16 +335,23 @@
     }
 
 void
-ApacheRequest_upload(req, name=NULL)
+ApacheRequest_upload(req, sv=Nullsv)
     Apache::Request req
-    char *name
+    SV *sv
 
     PREINIT:
     ApacheUpload *uptr;
 
     PPCODE:
+    if (sv && SvOBJECT(sv) && sv_isa(sv, "Apache::Upload")) {
+        req->upload = (ApacheUpload *)SvIV((SV*)SvRV(sv));
+        XSRETURN_EMPTY;
+    }
     ApacheRequest_parse(req);
     if (GIMME == G_SCALAR) {
+        STRLEN n_a;
+        char *name = sv ? SvPV(sv, n_a) : NULL;
+
 	if (name) {
 	    uptr = ApacheUpload_find(req->upload, name);
 	    if (!uptr) {





Mime
View raw message