libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Reading data from named pipe


From: Alex Reynolds
Subject: [libmicrohttpd] Reading data from named pipe
Date: Mon, 27 Mar 2017 11:03:45 -0700

I have an API that reads a subset of data from an archive and writes it to a FILE*. I can use this API to write this data subset to a temporary file via mkstemp() and fdopen().

I am currently using MHD_create_response_from_callback() to read chunks of bytes from this temporary file and write them to the web client. This works well on small files.

To avoid the I/O cost of writing a larger temporary file, and then reading from it, I set up a named pipe via mkfifo() and a FILE* that points to it. When I have MHD_create_response_from_callback() try to read from this named pipe, in the same way that it is set up to read from the temporary file, the server and client hang.

If this is possible, what is the correct way to serve data from a named pipe?

Regards,
Alex

reply via email to

[Prev in Thread] Current Thread [Next in Thread]