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 2004/02/28 06:16:11 UTC
cvs commit: httpd-apreq-2/glue/perl/xsbuilder/Apache/Request Apache__Request.h
joes 2004/02/27 21:16:11
Modified: glue/perl/t/response/TestApReq request.pm
glue/perl/xsbuilder/Apache/Request Apache__Request.h
Log:
Let ->link work across mount points by resorting to apr_file_copy in such situations
Revision Changes Path
1.7 +2 -2 httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
Index: request.pm
===================================================================
RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- request.pm 9 Feb 2004 21:58:37 -0000 1.6
+++ request.pm 28 Feb 2004 05:16:11 -0000 1.7
@@ -23,14 +23,14 @@
}
elsif ($test eq 'upload') {
my ($upload) = values %{$req->upload};
-# unlink("/tmp/foo");
+# unlink("/home/joe/tmp/foo");
my $bb = $upload->bb;
while (my $b = $bb->first) {
$b->read(my $buffer);
$r->print($buffer);
$b->remove;
}
-# $upload->link("/tmp/foo");
+# $upload->link("/home/joe/tmp/foo");
}
return 0;
1.18 +9 -1 httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h
Index: Apache__Request.h
===================================================================
RCS file: /home/cvs/httpd-apreq-2/glue/perl/xsbuilder/Apache/Request/Apache__Request.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Apache__Request.h 17 Oct 2003 14:23:29 -0000 1.17
+++ Apache__Request.h 28 Feb 2004 05:16:11 -0000 1.18
@@ -158,8 +158,9 @@
if (f == NULL) {
apr_off_t len;
apr_status_t s;
+
s = apr_file_open(&f, name, APR_CREATE | APR_EXCL | APR_WRITE |
- APR_READ | APR_BINARY | APR_BUFFERED,
+ APR_READ | APR_BINARY | APR_BUFFERED,
APR_OS_DEFAULT,
apreq_env_pool(env));
if (s != APR_SUCCESS ||
@@ -173,6 +174,13 @@
if (PerlLIO_link(fname, name) >= 0)
XSRETURN_YES;
+ else {
+ apr_status_t s = apr_file_copy(fname, name,
+ APR_OS_DEFAULT,
+ apreq_env_pool(env));
+ if (s == APR_SUCCESS)
+ XSRETURN_YES;
+ }
XSRETURN_UNDEF;
}