Age | Commit message (Collapse) | Author | |
---|---|---|---|
2023-08-07 | Improve HTTP request parsing and pass cookies to CGI scriptsHEADmaster | cflip | |
The HTTP request parser has been mostly rewritten, and now it is able to parse header lines. This makes it possible to get the cookie string from the request and pass it to CGI scripts, which was needed for the cflip forum to retain login status. It is now possible to run the forum through cfws, log in and submit threads and posts! | |||
2023-07-14 | Run executable files as CGI scripts | cflip | |
Now if the server encounters an executable file that doesn't have a .php extension, it will run it as a CGI script. There should maybe be better heuristics for determining whether a file actually is a CGI script (sometimes files copied from Windows can be marked as executable) but this works for now. | |||
2023-07-14 | Add verbose flag and command line help message | cflip | |
2023-07-09 | Gracefully shut down server when interrupted with Ctrl+C | cflip | |
2023-06-08 | Check file extension for NULL | cflip | |
2023-06-08 | Support multiple index file names (such as index.php) | cflip | |
2023-06-08 | Support POST requests for PHP scripts | cflip | |
This makes it possible to both read from and write to the standard I/O in php-cgi so that the request body can be written to its stdin and the script can access POST request data. Unfortunately, this isn't quite enough for the user login on the cflip forum to work, since cookies (and other HTTP headers) aren't passed to the script yet. | |||
2023-06-08 | Parse HTTP POST requests and request body | cflip | |
2023-06-08 | Unset QUERY_STRING environment variable after running CGI script | cflip | |
This prevents an issue where the previous query string would persist on requests without a query string. | |||
2023-06-06 | Ignore SIGPIPE signals when writing to a closed socket | cflip | |
2023-06-03 | Respond with 501 Not Implemented for unknown request methods | cflip | |
2023-06-01 | Remove extra test files | cflip | |
2023-06-01 | Remove ClangFormat and ClangTidy files | cflip | |
These were leftovers from the C++ version of this project. It might still be nice to have a formatter and static analyzer, but the configurations in those files didn't work well with the new C port. | |||
2023-06-01 | Send the proper MIME type when serving static filesc-rewrite | cflip | |
2023-06-01 | Allow query strings to be read by PHP scripts | cflip | |
php-cgi is now run without any command line arguments and information such as the script filename and the query string are passed in via environment variables. | |||
2023-06-01 | Parse query string from HTTP requests | cflip | |
2023-05-30 | Move request handling code out of net.c and into the main file | cflip | |
2023-05-30 | Reads from files or pipes into a buffer instead of char-by-char | cflip | |
This makes it possible to load image files, and doesn't spam write() as much. | |||
2023-05-30 | Refactor response building code | cflip | |
This new strategy involves finding the local file path for the given URI, determining what method to use to fulfill the request (read file from disk, use php-cgi, or error), then it writes the response to the client socket. | |||
2023-05-29 | Hacks to make it possible to serve PHP pages | cflip | |
The most significant change is that the functions for reading a file and such write directly to the socket instead of attempting to fill buffers. | |||
2023-05-29 | Don't force C'89 standard | cflip | |
There are a bunch of helpful standard library functions that I am missing out on (most notably popen) | |||
2023-05-27 | Split cfws.c into multiple files | cflip | |
2023-05-27 | Add Vim tags and swap files to .gitignore | cflip | |
2023-05-27 | Build with debug symbols enabled | cflip | |
2023-05-27 | Load and serve files from the filesystem | cflip | |
2023-05-08 | Begin rewriting cfws in C | cflip | |
2022-09-30 | Respond with a different content type depending on file extension | cflip | |
2022-09-22 | Add install target to Makefile | cflip | |
2022-09-20 | Validate CGI script paths before starting up the server | cflip | |
This still doesn't throw up an error when attepting to run scripts without the leading './', but it's a start | |||
2022-09-19 | Add a simple Perl script that prints out all environment varaiables | cflip | |
This can be used to view the values of environment variables passed to CGI scripts. | |||
2022-09-19 | Add ClangTidy configuration and apply fixes | cflip | |
2022-09-19 | Add ClangFormat configuration and reformat files | cflip | |
2022-09-19 | Improve Makefile build system | cflip | |
Building each source file as a separate object makes it faster to compile when only changing one source file, and also allows you to compile with multiple threads when building the whole project. | |||
2022-09-19 | Implement the PATH_INFO and QUERY_STRING CGI environment variables | cflip | |
This allows scripts to differentiate between the requested path and the query parameters. | |||
2022-09-19 | Refactor the CGIScript class a bit | cflip | |
This allows the user of the class to set environment variables before opening the pipe to the script. | |||
2022-09-19 | Add abstractions to automatically unset environment variables | cflip | |
The PATH_INFO environment variable has also been added. | |||
2022-09-17 | Set SO_REUSEADDR and SO_REUSEPORT socket options | cflip | |
This allows the server to reuse the same address and port when repeatedly running and stopping the server while testing things instead of quitting with the "Address already in use" error. | |||
2022-09-17 | Call them CGI scripts instead of executables | cflip | |
2022-09-17 | Make a nice wrapper class for running CGI scripts | cflip | |
2022-09-17 | Set a few environment variables for CGI scripts | cflip | |
2022-09-17 | Pass HTTP headers from CGI output into our HttpResponse class | cflip | |
2022-09-15 | Add an option to serve CGI exectuables | cflip | |
2022-09-15 | Add HTTP 500 Internal Server Error | cflip | |
2022-09-15 | Add simple argument parsing for specifying port number | cflip | |
2022-09-15 | Start serving files from the filesystem | cflip | |
2022-09-14 | Fix a few compiler-dependent errors | cflip | |
2022-07-07 | Implement simple URI parsing for multiple pages | cflip | |
2022-07-07 | Don't print HTTP requests to the console | cflip | |
2022-07-07 | Ignore Visual Studio Code files | cflip | |
2022-07-07 | Reply with a different message and response code depending on language | cflip | |