Re: getting data posted to site
On Thu, 29 Jun 2000, Scott Alexander wrote: > I'm trying to get the data that is posted from the browser durring a > request. > > if ($r->method ne 'GET') > { > $r->read($buffer,$r->header_in('Content-Length')); > #proccess data... > } > > The $r->read() hangs the request completely. I ran an strace on that normally happens because somebody already read the POST body. are you still having this problem? the best way to figure out who is doing this would be to use gdb: % gdb httpd (gdb) b ap_get_client_block (gdb) source mod_perl-x.xx/.gdbinit (gdb) run -X now make a request: (gdb) curinfo should show the current Perl filename:linenumber continue: (gdb) c and use curinfo the next time the breakpoint is hit.
Re: getting data posted to site
Scott Alexander wrote: > I'm trying to get the data that is posted from the browser durring a > request. > > if ($r->method ne 'GET') > { > $r->read($buffer,$r->header_in('Content-Length')); > #proccess data... > } There's a higher-level method for that, $r->content; I'd do something like this: if ($r->method eq 'POST' && $r->header_in('Content-type') =~ m!^application/x-www-form-urlencoded!) { my $data = $r->content; # process data ... } Although you should seriously consider using a higher-level interface, such as Apache::Request (downloadable from mod_perl's ftp server under the name "libapreq"), or CGI.pm. -- Roger Espel Llima, [EMAIL PROTECTED] http://www.iagora.com/~espel/index.html
getting data posted to site
I'm trying to get the data that is posted from the browser durring a request. if ($r->method ne 'GET') { $r->read($buffer,$r->header_in('Content-Length')); #proccess data... } The $r->read() hangs the request completely. I ran an strace on httpd -X and posted the request section to http://mail.thefriend.com/httpd.strace.txt if that helps anyone. Scott