Stas Bekman wrote:
eps com estem wrote:

Hi, i had already tested the $r->read but it did not work, now i have found why.
$r->read(my $buffer, $len)
only works if $buffer is a string.
$r->read($ref->{buffer}, $len)
does not work, as $ref->{buffer} is empty. And that was what i was using, so i though a
long time ago it was some kind of windows-problem.
Using directly a string it works, thanks!


You are correct, it should work just as well. Let's fix that.

Please apply this patch. It should fix the problem. It'll go into cvs once I complete the testing. I've also updated the rest of ($filter|$bucket|etc)->read() functions. Let us know whether it has solved the problem for you as well.


What happens is that when you pass an autovivified hash value, it doesn't have any entry yet, not even undef. So in order to set it one must run the magic set, which we didn't.

Index: xs/Apache/RequestIO/Apache__RequestIO.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
retrieving revision 1.52
diff -u -r1.52 Apache__RequestIO.h
--- xs/Apache/RequestIO/Apache__RequestIO.h 2 Jul 2004 23:20:47 -0000 1.52
+++ xs/Apache/RequestIO/Apache__RequestIO.h 12 Jul 2004 07:10:21 -0000
@@ -199,6 +199,9 @@
sv_setpvn(buffer, "", 0);
}


+    /* must run any set magic */
+    SvSETMAGIC(buffer);
+
     return nrd;
 }

@@ -253,6 +256,9 @@
     else {
         sv_setpvn(bufsv, "", 0);
     }
+
+    /* must run any set magic */
+    SvSETMAGIC(bufsv);

     return newSViv(total);
 }


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