Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/client.toit
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,12 @@ class Client:
if connection_ and connection_.is-open_:
if location.can-reuse-connection connection_.location_:
connection_.drain_ // Remove any remnants of previous requests.
return true
// Hostname etc. didn't match so we need a new connection.
connection_.close
connection_ = null
// The 'drain' may have closed the connection. Check again.
if connection_ and connection_.is-open_: return true
else:
// Hostname etc. didn't match so we need a new connection.
connection_.close
connection_ = null
socket/tcp.Socket := interface_.tcp-connect location.host location.port
if location.use-tls:
// Wrap the socket in TLS.
Expand Down
Loading