1
Fork 0

transport: add config options (unimplemented)

This commit is contained in:
Drew DeVault 2023-02-12 12:14:19 +01:00
parent 0e4277ded9
commit fa4defb964

View file

@ -6,6 +6,48 @@ use strconv;
use strings; use strings;
use types; use types;
// Configures the transport mode.
//
// For clients, if set to "none", no transport decoding is performed on the
// response body, and the user must read the Transport-Encoding header and
// decode it themselves. If set to "auto", [[response]].body will be decoded
// according to the response's Transport-Encoding header. Most users will want
// this to be set to "auto".
//
// For servers, if set to "auto", net::http will examine the Transport-Encoding
// header and apply the appropriate transport encoding. If set to "none", the
// response body will be sent directly to the client with no further processing.
export type transport_mode = enum {
AUTO = 0,
NONE,
};
// Configures the content mode.
//
// For clients, if set to "none", no content decoding is performed on the
// response body, and the user must read the Content-Encoding header and decode
// it themselves. If set to "auto", [[response]].body will be decoded according
// to the response's Content-Encoding header. Most users will want this to be
// set to "auto".
//
// For servers, if set to "auto", net::http will examine the Content-Encoding
// header and apply the appropriate content encoding. If set to "none", the
// response body will be sent directly to the client with no further processing.
export type content_mode = enum {
AUTO = 0,
NONE,
};
// Describes an HTTP [[client]]'s transport configuration for a given request.
export type transport = struct {
// Desired Transport-Encoding configuration, see [[transport_mode]] for
// details.
transport: transport_mode,
// Desired Content-Encoding configuration, see [[content_mode]] for
// details.
content: content_mode,
};
export fn new_reader( export fn new_reader(
conn: io::handle, conn: io::handle,
resp: *response, resp: *response,