diff --git a/sbotc.c b/sbotc.c index db3bdff..c2d2942 100644 --- a/sbotc.c +++ b/sbotc.c @@ -776,7 +776,6 @@ static enum stream_state muxrpc_write_sink_1(struct boxs *bs, int infd, if (sz < 0) err(1, "read"); if (sz == 0) { ps_write(bs, "true", 4, pkt_type_json, req_id, true, true); - ps_goodbye(bs); return stream_state_ended_ok; } ps_write(bs, buf, sz, ptype, req_id, true, false); @@ -1172,6 +1171,7 @@ do_tcp_connect: if (rc < 0) warnx("tcsetattr"); } + ps_goodbye(&bs); bs_end(&bs); close(s); return rc;