perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Win32 fails filter\out_bbs_filebucket
Date Fri, 13 Aug 2004 17:23:04 GMT
Steve Hay wrote:
> Stas Bekman wrote:
> 
> 
>>Steve Hay wrote:
>> 
>>
>>
>>>error_log contains:
>>>
>>>[Fri Aug 13 17:48:59 2004] [error] [client 127.0.0.1] 
>>>Apache::RequestIO::sendfile: (720002) The system cannot find the file 
>>>specified.   at 
>>>   
>>>
>>
>>Steve, could you change the client t\filter\out_bbs_filebucket.t to pass 
>>a filename so that win32 will like it?
>>
>>       my $file = catfile $dir, "data_${size}k.txt";
>>
>>I don't know what sendfile wants on win32, does it want the file to be / 
>>separated?
>>
> 
> Ah ha!  That's it -- it works OK with this:
> 
> Index: t/filter/out_bbs_filebucket.t
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/t/filter/out_bbs_filebucket.t,v
> retrieving revision 1.1
> diff -u -u -r1.1 out_bbs_filebucket.t
> --- t/filter/out_bbs_filebucket.t       13 Aug 2004 01:51:15 -0000      1.1
> +++ t/filter/out_bbs_filebucket.t       13 Aug 2004 17:11:26 -0000
> @@ -33,6 +33,7 @@
>      my $data = "ABCD" x ($size * 256);
> 
>      my $file = catfile $dir, "data_${size}k.txt";
> +    $file =~ s/\\/\//g;
>      open my $fh, ">$file" or die "can't open $file: $!";
>      # need binmode on Win32 so as not to strip \r, which
>      # are included when sending with sendfile().

Good, but that's a workaround. Any idea why can't it open the win32 file?

static MP_INLINE
apr_status_t mpxs_Apache__RequestRec_sendfile(pTHX_ request_rec *r,
                                               const char *filename,
                                               apr_off_t offset,
                                               apr_size_t len)
{
     apr_size_t nbytes;
     apr_status_t rc;
     apr_file_t *fp;

     rc = apr_file_open(&fp, filename, APR_READ|APR_BINARY,
                        APR_OS_DEFAULT, r->pool);

that's where it fails. it's supposed to handle win32 files just fine.

please revert your patch and try this one:

Index: t/filter/TestFilter/out_bbs_filebucket.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_bbs_filebucket.pm,v
retrieving revision 1.1
diff -u -r1.1 out_bbs_filebucket.pm
--- t/filter/TestFilter/out_bbs_filebucket.pm   13 Aug 2004 01:51:14 
-0000     1.1
+++ t/filter/TestFilter/out_bbs_filebucket.pm   13 Aug 2004 17:21:51 -0000
@@ -58,6 +58,9 @@

      $r->content_type('text/plain');
      my $file = $r->args;
+    warn "file: $file\n";
+
+    $file =~ s|//|/|g; # sendfile wants a unix style separator?

      $r->sendfile($file);

what does warn say? Doesn't \\ => break things like C:\\?

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message