How cmarin00000/boanrust works
Boa is an event-driven HTTP server: it accepts client connections, parses requests, maps URIs to files or CGI programs, and returns responses. The repository also contains a small Rust migration crate, but its implementation is not described by the README or shown in the excerpts. The C server’s detailed internal call flow is only partly evidenced, so uncertain links are dashed rather than presented as verified calls.
Main entry points: request.c Connection Handling · alias.c URI Translation · select.c Socket Event Loop · get.c Static File Service
Components 22
Server Runtime
- Server Startup
boa-0.94.13/src/boa.c - Socket Event Loop
boa-0.94.13/src/select.c - Connection Handling
boa-0.94.13/src/request.c - Request Queues
boa-0.94.13/src/queue.c
Request Handling
- Request Reading
boa-0.94.13/src/read.c - HTTP Parsing
boa-0.94.13/src/request.c - HTTP Responses
boa-0.94.13/src/response.c - Buffered Output
boa-0.94.13/src/buffer.c
Content Delivery
- URI Translation
boa-0.94.13/src/alias.c - Path Guard
BoaNRust/src/lib.rs - Static File Service
boa-0.94.13/src/get.c - Directory Listings
boa-0.94.13/src/index_dir.c - MIME Lookup
boa-0.94.13/src/hash.c - CGI Execution
boa-0.94.13/src/cgi.c - CGI Headers
boa-0.94.13/src/cgi_header.c
Configuration and Support
- Config Parsing
boa-0.94.13/src/y.tab.c - Config Lexer
boa-0.94.13/src/lex.yy.c - Server Configuration
boa-0.94.13/src/config.c - Request Logging
boa-0.94.13/src/log.c
Rust Migration
- Rust Entry Point
BoaNRust/src/main.rs - Path Guard Interface
BoaNRust/boa_pathguard.h
Other components
- HTTP Client
Connections 21
- HTTP Client → Server Startup: opens connection
- Server Startup → Socket Event Loop: starts loop
- Socket Event Loop → Connection Handling: dispatches sockets
- Connection Handling → Request Queues: enqueues requests
boa-0.94.13/src/request.c - Connection Handling → HTTP Responses: sends overload response
boa-0.94.13/src/request.c - Socket Event Loop → Request Reading: dispatches I/O
- Request Reading → HTTP Parsing: provides request data
- Server Configuration → Config Parsing: parses configuration
- Config Parsing → Config Lexer: requests tokens
- HTTP Parsing → URI Translation: resolves request path
- URI Translation → Path Guard: validates path
- URI Translation → Static File Service: selects file
- Static File Service → MIME Lookup: looks up type
- Static File Service → Directory Listings: lists directory
- URI Translation → CGI Execution: selects script
- CGI Execution → CGI Headers: processes output headers
- CGI Execution → HTTP Responses: produces response
- HTTP Responses → Buffered Output: writes response
- Connection Handling → Buffered Output: flushes output
boa-0.94.13/src/request.c - Connection Handling → Request Logging: records errors
- Rust Entry Point → Path Guard Interface: uses interface