Hi Silvio,

Sorry, that won't work. To send compressed replies *and* use sendfile()
the only way would be to have the gzip'ed file already on disk. (You'll
still need to set the right content encoding, and you must then _also_
have an uncompressed version of the file on disk in case a client does
not support compression.)

Happy hacking!

Christian

On 1/5/19 12:23 AM, silvioprog wrote:
> Hello dudes,
> 
> firstly, thanks Christian for indicating the MHD_fd* functions, I
> upgraded my library to use them! :-)
> 
> Now I have a new challenge. I'm going to create two new examples for MHD
> (issue #4914), however, I have a question. Is there any chance to use
> zlib to compress data when creating a response via
> MHD_create_response_from_fd_at_offset64()? I tried that, but it seems
> its internal read() cannot  be intercepted (to compress data on demand
> using zlib's compress2()). I would like to "intercept" the internal
> MHD's file_reader() (response.c:572) to reuse it instead of rewriting a
> new one, because the original already handles the reading in any
> supported platform.
> 
> Thanks in advance for any help!
> 
> --
> Silvio Clécio

Attachment: 0x939E6BE1E29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to