~sircmpwn/hare-ssh

0b95f7dc320b11f912dcc23bf249563233c2f794 — Drew DeVault a month ago 46f9fee
net::ssh::client: don't close connection on finish
2 files changed, 2 insertions(+), 2 deletions(-)

M cmd/ssh/main.ha
M net/ssh/client.ha
M cmd/ssh/main.ha => cmd/ssh/main.ha +1 -0
@@ 5,6 5,7 @@ use os;

export fn main() void = {
	const conn = dial::dial("tcp", os::args[1], "ssh")!;
	defer io::close(conn);
	const client = ssh::newclient(conn)!;
	defer ssh::client_finish(&client);


M net/ssh/client.ha => net/ssh/client.ha +1 -2
@@ 33,10 33,9 @@ export fn newclient(conn: io::handle) (client | io::error) = {
	};
};

// Frees resources associated with this client. Closes the underlying
// Frees resources associated with this client. Does not close the underlying
// connection.
export fn client_finish(client: *client) void = {
	io::close(client.conn)!;
	free(client.rbuf);
};