Hi,
I'm trying to write an input filter that will read the request body data, do some transformation, and then write the output to a file using mod_dav:
<Location /davtest/> DAV on PerlInputFilterHandler FileDataLog::input </Location>
The problem I'm having is that whenever I try to PUT a file that contains null characters (\0), the data that's written to the file is not the data that is printed from the filter. I've set up a basic filter to simply send the data it reads on to the next stage in order to troubleshoot:
while($f->read(my $buffer, 16)) { print STDERR unpack('H*', $buffer), "\n"; $f->print($buffer) }
but I can't seem to get it to work. Here is an example via a telnet session:
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. PUT /members/jeff/test HTTP/1.1 Host: 127.0.0.1:9080 Content-Length: 11
shouldn't this be 12 ;)
[EMAIL PROTECTED] HTTP/1.1 204 No Content Date: Mon, 15 Mar 2004 20:51:26 GMT Server: Apache/2.0.48 (Unix) Content-Length: 0 Connection: close Content-Type: text/plain; charset=ISO-8859-1
The filter seems to be sending the correct data along: [EMAIL PROTECTED] jeff]# tail /usr/local/apache2/logs/error_log 3132330134353600373839
1 2 3 \1 4 5 6 \0 7 8 9
but the file does not have the correct data:
[EMAIL PROTECTED] jeff]# od -x test 0000000 3231 0133 3534 0036 0001 0000 0000013
Any help would be greatly appreciated.
I've reproduced the problem, please stay tuned for the fix.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html