How ezlippi/tinyhttpd works
This repository is a small educational HTTP server. Its main workflow accepts HTTP requests, parses and routes them to either static-file serving or CGI execution, then returns a response to the client. The README documents additional error responses and CGI behavior; the source excerpt is partial, so uncertain lower-level call wiring is omitted.
Main entry points: httpd.c Request routing · htdocs Document root
Components 12
HTTP server
- Server main loop
httpd.c - Socket startup
httpd.c - Request routing
httpd.c - Socket line reader
httpd.c
Response handling
- Static file handler
httpd.c - File output
httpd.c - HTTP error responses
httpd.c - Document root
htdocs
CGI execution
- CGI process runner
httpd.c - CGI examples
htdocs
Other components
- HTTP client
- Perl CGI runtime
Connections 14
- Server main loop → Socket startup: starts listener
- HTTP client → Server main loop: sends request
- Server main loop → Request routing: dispatches request
- Request routing → Socket line reader: reads request lines
- Request routing → Static file handler: serves static request
- Request routing → CGI process runner: runs CGI request
- Request routing → HTTP error responses: reports request errors
- Static file handler → Document root: opens requested file
- Static file handler → File output: writes file contents
- File output → HTTP client: sends file response
- CGI process runner → CGI examples: executes script
- CGI process runner → Perl CGI runtime: invokes CGI runtime
- CGI process runner → HTTP client: forwards CGI output
- HTTP error responses → HTTP client: sends error response