Hello there. I've been using CGI.pm with the CVS Apache2 module, and
found out that read_from_client doesn't quite work -- it sometimes
blocks the socket, but most of the time just returns an empty list.

As the new Apache->request provide a 'content' method already, I patched
it so it tests for the method, and prefers it if it is available.

Thanks,
/Autrijus/

--- CGI.old     Fri May 24 00:18:47 2002
+++ CGI.pm      Fri May 24 00:21:49 2002
@@ -450,12 +450,20 @@
       }
 
       if ($meth eq 'POST') {
-         $self->read_from_client(\*STDIN,\$query_string,$content_length,0)
-             if $content_length > 0;
-         # Some people want to have their cake and eat it too!
-         # Uncomment this line to have the contents of the query string
-         # APPENDED to the POST data.
-         # $query_string .= (length($query_string) ? '&' : '') . $ENV{'QUERY_STRING'} 
if defined $ENV{'QUERY_STRING'};
+         if ($MOD_PERL and Apache->request->can('content')) {
+           $query_string = Apache->request->content;
+           # Uncomment this line to have the contents of the query string
+           # APPENDED to the POST data.
+           # $query_string .= (length($query_string) ? '&' : '') . 
+Apache->request->args if defined Apache->request->args;
+         }
+         else {
+           $self->read_from_client(\*STDIN,\$query_string,$content_length,0)
+               if $content_length > 0;
+           # Some people want to have their cake and eat it too!
+           # Uncomment this line to have the contents of the query string
+           # APPENDED to the POST data.
+           # $query_string .= (length($query_string) ? '&' : '') . 
+$ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'};
+         }
          last METHOD;
       }
 

Attachment: msg02770/pgp00000.pgp
Description: PGP signature

Reply via email to