1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vlib/io: fix reader bugs, make read_all take a config struct (#7361)

This commit is contained in:
Emily Hudson
2020-12-16 17:22:26 +00:00
committed by GitHub
parent 1a2c7cd336
commit 553ecf63e7
10 changed files with 227 additions and 75 deletions

View File

@@ -398,7 +398,7 @@ fn (req &Request) http_do(host string, method Method, path string) ?Response {
mut client := net.dial_tcp(host)?
// TODO this really needs to be exposed somehow
client.write(s.bytes())?
mut bytes := io.read_all(client)?
mut bytes := io.read_all(reader: client)?
client.close()
return parse_response(bytes.bytestr())
}

View File

@@ -95,7 +95,7 @@ pub fn (mut c Client) quit() ? {
// expect_reply checks if the SMTP server replied with the expected reply code
fn (c Client) expect_reply(expected ReplyCode) ? {
bytes := io.read_all(c.conn)?
bytes := io.read_all(reader: c.conn)?
str := bytes.bytestr().trim_space()
$if smtp_debug? {