~stacyharper/bonsai

85e31796dc4d796bf4dd20aa770728cc3a7ecb51 — Stacy Harper 2 months ago 3016982
Minimize socket conversation line count
2 files changed, 2 insertions(+), 7 deletions(-)

M cmd/bonsaictl/main.ha
M cmd/bonsaid/cmd.ha
M cmd/bonsaictl/main.ha => cmd/bonsaictl/main.ha +0 -5
@@ 111,17 111,12 @@ fn send(
		let resp = strings::fromutf8(line);
		let resp = strings::cut(resp, " ");
		switch (resp.0) {
		case "hello" =>
			fmt::fprintf(&buf, "hello ")!;
			fmt::fprintfln(&buf, resp.1)!;
		case "end" =>
			free(line);
			break;
		case =>
			break;
		};

		free(line);
	};

	fmt::print(strio::string(&buf))!;

M cmd/bonsaid/cmd.ha => cmd/bonsaid/cmd.ha +2 -2
@@ 75,7 75,7 @@ fn exec_event(serv: *server, client: *client, args: []str) (void | cmderror) = {

	let buf = bufio::dynamic(io::mode::WRITE);

	fmt::fprint(&buf, "done\nend\n")?;
	fmt::fprint(&buf, "end\n")?;
	writebuf(client, bufio::buffer(&buf));
};



@@ 98,7 98,7 @@ fn exec_context(serv: *server, client: *client, args: []str) (void | cmderror) =

	let buf = bufio::dynamic(io::mode::WRITE);

	fmt::fprint(&buf, "done\nend\n")?;
	fmt::fprint(&buf, "end\n")?;
	writebuf(client, bufio::buffer(&buf));
};