httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Mooney" <rjmoo...@aboveground.cx>
Subject Duplicating POST data between modules?
Date Fri, 21 Dec 2001 05:20:49 GMT

Is there any way to "peek" at client data from a module?  I.e. read without 
removing it?  Specifically, I want my module to be able to read any POST 
data, and allow mod_cgi to process normally.  Using the sample code below, 
mod_cgi does not read any input from STDIN. 

static int response_handler(request_rec *r)
{
   int result;
   char dumpbuf[HUGE_STRING_LEN];

   if ((result = ap_setup_client_block(r, REQUEST_CHUNK_PASS)) != OK)
      return result;

   if (!ap_should_client_block(r)) return DECLINED;

   while((result = ap_get_client_block(r, dumpbuf, HUGE_STRING_LEN - 1)) > 0)
   {
      dumpbuf[result] = 0;
      fprintf(stderr, "dumpbuf: %s\n", dumpbuf);
   }

   if (result < 0) return HTTP_BAD_REQUEST;

   return DECLINED;
}

I was under the impression REQUEST_CHUNK_PASS did what I was looking for, but
this is not the case.  mod_cgi can read the POST data until I call ap_get_
client_block(), after which... nothing.

I'm using Apache 1.3.22.

Thanks in advance,

- Rob

--
Robert Mooney (rjmooney@aboveground.cx)
www: http://www.aboveground.cx/~rjmooney/ 

Mime
View raw message