Thanks.  This fixes the problem I was having.

Jeff


-----Original Message-----
From: Stas Bekman [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 7:52 PM
To: Stas Bekman
Cc: Jeff Finn; [EMAIL PROTECTED]
Subject: Re: [mp2] Trouble with Apache::Filter input and mod_dav


Stas Bekman wrote:
> Jeff Finn wrote:
>
>> 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.
[...]

Jeff,

The patch below should fix the problem. It'll be in cvs shortly. Please
confirm that it worked for you.

Index: src/modules/perl/modperl_filter.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.86
diff -u -r1.86 modperl_filter.c
--- src/modules/perl/modperl_filter.c   4 Mar 2004 06:01:07 -0000       1.86
+++ src/modules/perl/modperl_filter.c   16 Mar 2004 00:50:30 -0000
@@ -783,7 +783,7 @@
                                                    apr_size_t *len)
  {
      apr_bucket_alloc_t *ba = filter->f->c->bucket_alloc;
-    char *copy = apr_pstrndup(filter->pool, buf, *len);
+    char *copy = apr_pmemdup(filter->pool, buf, *len);
      apr_bucket *bucket = apr_bucket_transient_create(copy, *len, ba);
      /* MP_TRACE_f(MP_FUNC, "writing %d bytes: %s\n", *len, copy); */
      MP_TRACE_f(MP_FUNC, MP_FILTER_NAME_FORMAT


--
__________________________________________________________________
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

Reply via email to