diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-07-28 22:12:16 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-07-28 22:12:16 +0000 |
commit | d637cb33da212a74636984be0ce9dfface6be6b4 (patch) | |
tree | 414de53bc14b91edcda17ee2cb99cf081440a2de /client-fn.c | |
parent | f5c0695605f65b7b8d0c41e0816186e979c3e130 (diff) |
Sync OpenBSD patchset 181:
Make all messages sent between the client and server fixed size.
This is the first of two changes to make the protocol more resilient and less
sensitive to other changes in the code, particularly with commands. The client
now packs argv into a buffer and sends it to the server for parsing, rather
than doing it itself and sending the parsed command data.
As a side-effect this also removes a lot of now-unused command marshalling
code.
Mixing a server without this change and a client with or vice versa will cause
tmux to hang or crash, please ensure that tmux is entirely killed before
upgrading.
Diffstat (limited to 'client-fn.c')
-rw-r--r-- | client-fn.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/client-fn.c b/client-fn.c index 2e3ca11b..3030d3d3 100644 --- a/client-fn.c +++ b/client-fn.c @@ -1,4 +1,4 @@ -/* $Id: client-fn.c,v 1.6 2009-03-04 17:24:07 nicm Exp $ */ +/* $Id: client-fn.c,v 1.7 2009-07-28 22:12:16 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -74,19 +74,3 @@ client_write_server( if (buf != NULL && len > 0) buffer_write(cctx->srv_out, buf, len); } - -void -client_write_server2(struct client_ctx *cctx, - enum hdrtype type, void *buf1, size_t len1, void *buf2, size_t len2) -{ - struct hdr hdr; - - hdr.type = type; - hdr.size = len1 + len2; - buffer_write(cctx->srv_out, &hdr, sizeof hdr); - - if (buf1 != NULL && len1 > 0) - buffer_write(cctx->srv_out, buf1, len1); - if (buf2 != NULL && len2 > 0) - buffer_write(cctx->srv_out, buf2, len2); -} |