~apreiml/hare-ssh

9f154d4ea0ccceb120785aba99b9d2c2825fbe3e — Drew DeVault 1 year, 8 months ago 1876cdf
all: strings::fromutf8 changes upstream
4 files changed, 14 insertions(+), 4 deletions(-)

M format/ssh/util.ha
M net/ssh/agent/proto.ha
M net/ssh/client.ha
M net/ssh/proto.ha
M format/ssh/util.ha => format/ssh/util.ha +6 -1
@@ 14,7 14,12 @@ fn readu32(src: io::handle) (u32 | error) = {
};

fn readstr(src: io::handle) (str | error) = {
	return strings::fromutf8(readslice(src)?);
	match (strings::fromutf8(readslice(src)?)) {
	case let s: str =>
		return s;
	case =>
		return invalid;
	};
};

fn readslice(src: io::handle) ([]u8 | error) = {

M net/ssh/agent/proto.ha => net/ssh/agent/proto.ha +6 -1
@@ 138,7 138,12 @@ fn readu32(src: io::handle) (u32 | invalid) = {
};

fn readstr(src: io::handle) (str | invalid) = {
	return strings::fromutf8(readslice(src)?);
	match (strings::fromutf8(readslice(src)?)) {
	case let s: str =>
		return s;
	case =>
		return invalid;
	};
};

fn readslice(src: io::handle) ([]u8 | invalid) = {

M net/ssh/client.ha => net/ssh/client.ha +1 -1
@@ 135,7 135,7 @@ fn client_verexch(client: *client) (void | error) = {
	const version = client.rbuf[..i];
	client.rptr = i + 2;

	const version = match (strings::try_fromutf8(version)) {
	const version = match (strings::fromutf8(version)) {
	case let s: str =>
		yield s;
	case =>

M net/ssh/proto.ha => net/ssh/proto.ha +1 -1
@@ 71,7 71,7 @@ fn writeslice(out: io::handle, slice: []u8) (void | io::error) = {

fn readstr(src: *bufio::memstream) (str | protoerror) = {
	const slice = readslice(src)?;
	match (strings::try_fromutf8(slice)) {
	match (strings::fromutf8(slice)) {
	case let s: str =>
		return s;
	case =>