Skip to main content

Module record

Module record 

Source
Expand description

FastCGI 1.0 records, name-value pairs and CGI responses, shared by the responder and the client. Every length is checked against what the peer announced before anything is allocated for it.

Structs§

Record

Constants§

ABORT_REQUEST
BEGIN_REQUEST
CANT_MPX_CONN
DATA
END_REQUEST
GET_VALUES
GET_VALUES_RESULT
HEADER_LEN
KEEP_CONN
MAX_BODY_BYTES
Request body (STDIN) and response (STDOUT) bound.
MAX_CONTENT
Largest content a record can carry; stream data is split at a multiple of 8 below it.
MAX_PAIRS
MAX_PARAMS_BYTES
Total bytes of name-value pairs accepted for one request’s PARAMS stream.
MAX_STDERR_BYTES
OVERLOADED
PARAMS
REQUEST_COMPLETE
ROLE_AUTHORIZER
ROLE_FILTER
ROLE_RESPONDER
STDERR
STDIN
STDOUT
UNKNOWN_ROLE
UNKNOWN_TYPE
VERSION

Functions§

begin_request
body_text
Body bytes for an event: text when they are UTF-8, hex otherwise, and which.
build_cgi_response
A CGI response (RFC 3875 §6): Status:, the handler’s headers, a blank line, the body.
check_headers
Header names are HTTP tokens; values carry no line breaks or other controls.
decode_body
Body bytes from an action’s body and body_encoding.
decode_pairs
Decode name-value pairs. Names must be printable ASCII; values may be any bytes and are decoded lossily (a CGI value is text in practice).
encode
One record, padded to a multiple of 8 as the specification recommends.
encode_pairs
encode_stream
A whole stream (PARAMS, STDIN, STDOUT, STDERR): as many records as it takes, then the empty record that ends it.
end_request
parse_cgi_response
Parse a CGI response: header lines up to the first blank line (CRLF or LF), Status (default 200, or 302 with a Location), the rest the body.
protocol_status_name
read_record
Read one record. Ok(None) is a clean end of stream at a record boundary.
unknown_type