Ilya Obshadko wrote:
> 
> Hello,
> 
>   I've discovered the following. Suggest that you use Apache::Request
>   object in both fixup handler and registry script. So we have:
> 
>     1) unpredictable segmentation faults

I had the same problem. I think there must be some problems in libapreq
(which Apache::Request uses). I was in a hurry when I ran into the
problem, so I just coded around it by writing Perl equivalents of the
functions I needed from Apache::Request.

Eventually (in my copious spare time), I'll take some time and see if I
can scrounge through a core dump to see what's going on.

>     2) when parsing POST data, only first-time call (in fixup handler)
>        produces correct results, the other one returns crap.

You'll get this behavior whether you're getting the POST data from
Apache::Request, or just the request object's content() call. The
problem is that the C API call that these functions use
(ap_read_client_block, I believe) can only be called once per request. 

The way I've gotten around this limitation is to parse all the GET and
POST data into a hash reference in the first handler, and then use the
$r->pnotes method to pass the parameters from handler to handler (If
you're addicted to CGI.pm, you can use the hash reference as the
argument to CGI->new in your content handler and get the same results as
if CGI handled the parameter parsing itself.)

Good luck,

-- 
Kevin  | "Though there are ... few restrictions on the vote nowadays ... 
Murphy | some standards are still upheld ... at last report, the votes 
       | from the entire God-forsaken state of Texas are still thrown, 
       | uncounted and burning, into the River Charles." - T.H. Zweibel

Reply via email to