aboutsummaryrefslogtreecommitdiff
path: root/client-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-11 17:18:35 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-11 17:18:35 +0000
commitf0635717b3e840a72a962a2014b18d84fac4c83a (patch)
tree579ab8805cc7d6784fb6c567dad3322a7b2a976e /client-fn.c
parent60db6e3df471142e4ee7773b9b4e9b0135d61dfc (diff)
downloadrtmux-f0635717b3e840a72a962a2014b18d84fac4c83a.tar.gz
rtmux-f0635717b3e840a72a962a2014b18d84fac4c83a.tar.bz2
rtmux-f0635717b3e840a72a962a2014b18d84fac4c83a.zip
Switch tmux to use imsg. This is the last major change to make the
client-server protocol more resilient and make the protocol versioning work properly. In future, the only things requiring a protocol version bump will be changes in the message structs, and (when both client and server have this change) mixing different versions should nicely report an error message. As a side effect this also makes the code tidier, fixes a problem with the way errors reported during server startup were handled, and supports fd passing (which will be used in future). Looked over by eric@, thanks. Please note that mixing a client with this change with an older server or vice versa may cause tmux to crash or hang - tmux should be completely exited before upgrading.
Diffstat (limited to 'client-fn.c')
-rw-r--r--client-fn.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/client-fn.c b/client-fn.c
index 129c6871..789ac427 100644
--- a/client-fn.c
+++ b/client-fn.c
@@ -66,14 +66,7 @@ void
client_write_server(
struct client_ctx *cctx, enum msgtype type, void *buf, size_t len)
{
- struct hdr hdr;
-
- hdr.type = type;
- hdr.size = len;
- buffer_write(cctx->srv_out, &hdr, sizeof hdr);
-
- if (buf != NULL && len > 0)
- buffer_write(cctx->srv_out, buf, len);
+ imsg_compose(&cctx->ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len);
}
void