aboutsummaryrefslogtreecommitdiff
path: root/client-fn.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-14 21:04:04 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-14 21:04:04 +0000
commita9b6bfdddd570753e52dca73169f70864502c38c (patch)
treebc259ba79ba2ddddd5579857ccaad69eef5d55d4 /client-fn.c
parenta604dfbb979c994ee7fb068416e0b60c95ce2198 (diff)
downloadrtmux-a9b6bfdddd570753e52dca73169f70864502c38c.tar.gz
rtmux-a9b6bfdddd570753e52dca73169f70864502c38c.tar.bz2
rtmux-a9b6bfdddd570753e52dca73169f70864502c38c.zip
Sync OpenBSD patchset 243:
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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/client-fn.c b/client-fn.c
index f74564d1..3db69306 100644
--- a/client-fn.c
+++ b/client-fn.c
@@ -1,4 +1,4 @@
-/* $Id: client-fn.c,v 1.9 2009-07-30 20:57:39 tcunha Exp $ */
+/* $Id: client-fn.c,v 1.10 2009-08-14 21:04:04 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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