Plumb transport config through to [[do]]
This commit is contained in:
parent
c63af5d3ec
commit
5d39543fcf
|
@ -48,6 +48,7 @@ fn new_request(client: *client, method: str, target: *uri::uri) request = {
|
||||||
method = method,
|
method = method,
|
||||||
target = alloc(uri::dup(target)),
|
target = alloc(uri::dup(target)),
|
||||||
header = header_dup(&client.default_header),
|
header = header_dup(&client.default_header),
|
||||||
|
transport = null,
|
||||||
body = void,
|
body = void,
|
||||||
};
|
};
|
||||||
if (req.target.port == 0) {
|
if (req.target.port == 0) {
|
||||||
|
|
|
@ -33,6 +33,18 @@ export fn do(client: *client, req: *request) (response | error) = {
|
||||||
fmt::fprintf(&file, "\r\n")?;
|
fmt::fprintf(&file, "\r\n")?;
|
||||||
bufio::flush(&file)?;
|
bufio::flush(&file)?;
|
||||||
|
|
||||||
|
const trans = match (req.transport) {
|
||||||
|
case let t: *transport =>
|
||||||
|
yield t;
|
||||||
|
case =>
|
||||||
|
yield &client.default_transport;
|
||||||
|
};
|
||||||
|
// TODO: Implement None
|
||||||
|
assert(trans.request_transport == transport_mode::AUTO);
|
||||||
|
assert(trans.response_transport == transport_mode::AUTO);
|
||||||
|
assert(trans.request_content == content_mode::AUTO);
|
||||||
|
assert(trans.response_content == content_mode::AUTO);
|
||||||
|
|
||||||
match (req.body) {
|
match (req.body) {
|
||||||
case let body: io::handle =>
|
case let body: io::handle =>
|
||||||
io::copy(conn, body)?;
|
io::copy(conn, body)?;
|
||||||
|
|
Loading…
Reference in a new issue