Skip to main content

Crate cgi_response

Crate cgi_response 

Source
Expand description

Parse a CGI child’s stdout into an http::Response, then stream the body through http_body::Body. The other half of a CGI gateway — building the RFC 3875 environment for the child — lives in the cgi-request crate; pair them when you need both directions.

See the crate-level README for what is and isn’t covered here.

Structs§

CgiResponseBody
Streaming body for a CGI response: yields the leftover bytes (from the post-header read) first, then reads the rest from the child’s stdout to EOF. A total_deadline caps the total streaming time; mid-body the next poll_frame past the deadline returns an io::Error.

Enums§

HeaderReadError
Errors from read_until_header_end.
ParseError
Errors from parse_response_headers.

Functions§

parse_response_headers
Build an http::response::Builder from an RFC 3875 header block. Status resolution:
read_until_header_end
Read from stdout until the RFC 3875 header / body separator (\r\n\r\n), or until deadline. Returns the header block (up to and including the separator), the leftover bytes that arrived in the same read() past the separator, and the still-open reader for downstream body streaming.