A program implementing the CGI for the purpose of storing images and data.
- Parameters
-
argc | The count of command line arguments passed by the web server to the CGI (us). |
argv | The command line argument strings. |
envp | The system environment variables as key=value pairs. |
- Returns
- Exit status.
- See also
- https://en.wikipedia.org/wiki/Common_Gateway_Interface
A lambda function for writing the Http_parser::files data to file storage. MIME types are checked with magic numbers in the data to confirm a match before writing. Non-matches are skipped.
Using a lambda makes it convenient to use a thread for this task.
The write_files lambda function is called in its own thread to permit the HTTP transaction to conclude (by sending the response) as early as possible.