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:
@@ -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())
|
||||
}
|
||||
|
@@ -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? {
|
||||
|
Reference in New Issue
Block a user