httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subra A Narayanan" <>
Subject Reading data from Request Body - Twice!!
Date Fri, 02 May 2008 18:17:54 GMT
Hello folks,

I really hope someone can point me in the correct direction here.

I have an apache module that receives data from clients in the request body
and saves the recvd data in a db. The client also sends the Content-MD5
header with the request which I want to verify by computing the MD5 of recvd
data and checking if the result is the same as the value of the Content-MD5
header. I want to just discard the data (not store it in the db) and return
an error if the MD5 check fails.

The client can send up to 4 GB data in the request. Which means I will have
to compute the MD5 incrementally in small chunks using the MD5_INIT,
MD5_UPDATE and MD5_FINAL routines. But this means that I would have already
read the request body once from start to end using the following functions:

int read_policy);
char *buffer, int bufsiz);

Now if the MD5 checksum passes and now I want to read the data again, how
would i do it? I cannot use the above function again, right?
'ap_should_client_block' has already told the client once to send the entire
data once.

Reading the data once, computing the MD5, caching it and then reusing the
cached data if the checksum passes is one option, but I dont want to do that
for a variety of reasons.

Is there any other way?

Thanks for any help.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message