I'm trying to file upload and download in fastcgi.
To use sendfile() I need the web server's open socket to the client (browser).
fastcgi doesn't pass it to me (I don't think).
I'm clueless on how to get the browser's socket descriptor.
I'm also open to another approach without a redirect or opening a new connection.
help is appreciated
Remember that a socket and a file is mostly handled the same, so you can use the standard output file descriptor as output "socket" instead of a real socket: