~stacyharper/bonsai

7392eea86ac92c92203ec05b83e32387acfa59e3 — Stacy Harper 12 days ago 85e3179
Fix some log priority
2 files changed, 6 insertions(+), 2 deletions(-)

M cmd/bonsaid/cmd.ha
M cmd/bonsaid/socket.ha
M cmd/bonsaid/cmd.ha => cmd/bonsaid/cmd.ha +1 -1
@@ 26,7 26,7 @@ fn strerror(err: cmderror) const str = {
};

fn exec(serv: *server, client: *client, cmd: str) (void | servererror) = {
	log::printfln("executing command: '{}'", cmd);
	log::printfln("received command: '{}'", cmd);
	const args = match (shlex::split(cmd)) {
	case shlex::syntaxerr =>
		log::println("error invalid command syntax", cmd);

M cmd/bonsaid/socket.ha => cmd/bonsaid/socket.ha +5 -1
@@ 110,7 110,7 @@ fn dispatch(serv: *server) bool = {
	match (poll::poll(serv.pollfd, poll::INDEF)) {
	case uint =>
		if (serv.pollfd[0].revents & event::POLLIN != 0) {
			log::println("socket client entrance");
			log::println("socket client entrance...");
			accept(serv);
		};
		if (serv.pollfd[1].revents & event::POLLIN != 0) {


@@ 190,17 190,21 @@ fn accept(serv: *server) void = {
fn dispatch_client(serv: *server, client: *client) void = {
	const pollfd = client.pollfd;
	if (pollfd.revents & event::POLLERR != 0) {
		log::println("client disconnection. error occured ?");
		disconnect(client);
		return;
	};
	if (pollfd.revents & event::POLLHUP != 0) {
		log::println("client disconnection...");
		disconnect(client);
		return;
	};
	if (pollfd.revents & event::POLLIN != 0) {
		log::println("reading socket message...");
		client_readable(serv, client);
	};
	if (pollfd.revents & event::POLLOUT != 0) {
		log::println("writing socket message...");
		client_writable(serv, client);
	};
};