<> "Darren" == darren chamberlain <[EMAIL PROTECTED]> writes:

 Darren> Apache::Request retrieves the POSTed content, so if you try to get
 Darren> it, the server will hang, waiting for input. With Apache::Request,
 Darren> just call the
 Darren> $r->param method to fetch the data, and don't try to call it yourself.

 Yes I know that, I didn't try to read something (POST data from stdin) I try
 to write (print to stdout). BTW my code act the same if I use Apache::Request
 or not... And I forgot to say that I use CGI module in my handler, and that
 no other handler eat r->content ...
 
 Apache v1.3.9
 mod_perl v1.21
 CGI.pm v2.62
 
 This piece of code illustrate the pb (thanks to give me any hint):
 
#!/usr/local/bin/perl
# ------------------------------------------------------------------------
# Test.pm: Apache::CENA::Test
# ------------------------------------------------------------------------
package Apache::CENA::Test;

use diagnostics -verbose;
use strict; 
use Apache::Constants qw(:common);
use CGI qw(:html :form :cgi);

sub handler {
  my $r = shift;
  # Do not bother with HEAD requests
  return DECLINED if $r->header_only();
  # Do not bother with internal sub-requests
  return DECLINED unless $r->is_main();
  # Get POST content & GET args
  $r->log->info( "Getting args ... " );
  my %Args = ($r->args(), $r->content());
  my $this = $r->subprocess_env('SCRIPT_URL');
  $r->log->info( "Sending headers ... " );
  $r->content_type( 'text/html' );
  $r->send_http_header();
  $r->log->info( "Sending start_html ... " );
  # Hangs here in POST methods!!!
  $r->print( start_html(-title=> $this ));
  $r->print( h1( $this ), hr());
  map{ $r->print( "$_ = ", strong($Args{$_}), br());} keys %Args; 
  $r->print( 
            hr(),  
            a({-href=> "$this?get-arg1=1&get-arg2=2"}, 'GET' ), 
            start_form(-method => 'POST', 
                       -action => "$this?get-arg3=3&get-arg4=4"), 
            hidden( -name => 'post-content1', -default => 5 ),
            hidden( -name => 'post-content2', -default => 5 ),
            submit( 'POST', 'POST' ), 
            end_form(), 
            end_html()
           );
  $r->log->info( "Done" );
  return OK;
}

1;
# Test.pm ends here  ------------------------------------------------


-- 
 /   From the last station before the end of the neT   \
 \ Centre d'Etudes de la Navigation Aerienne,  div SSS /
 / 7, av edouard Belin - 31055 Toulouse CEDEX - France \
 \ Tel:(+33|0)5.62.25.95.22 | Fax:(+33|0)5.62.25.95.99 /

Reply via email to