diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-01 21:24:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-01 21:24:33 +0000 |
commit | 11ee55e755af67dc9155e956b4569c8fdeb11848 (patch) | |
tree | a2b1b01c4ab9b446c4793dc56db215fa385432a3 /client.c | |
parent | 693231e8eb156b725c73e464600af029999b7e85 (diff) |
Prepare TERM in buffer before sending; this allows size to be part of cmd and prevents it being split. This is the only place this happens so remove it from todo.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: client.c,v 1.26 2008-05-31 20:04:15 nicm Exp $ */ +/* $Id: client.c,v 1.27 2008-06-01 21:24:33 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -44,6 +44,7 @@ client_init(const char *path, struct client_ctx *cctx, int start_server) size_t size; int mode; u_int retries; + struct buffer *b; retries = 0; retry: @@ -99,8 +100,12 @@ retry: data.sy = ws.ws_row; if (ttyname_r(STDIN_FILENO, data.tty, sizeof data.tty) != 0) fatal("ttyname_r failed"); - client_write_server(cctx, MSG_IDENTIFY, &data, sizeof data); - cmd_send_string(cctx->srv_out, getenv("TERM")); + + b = buffer_create(BUFSIZ); + cmd_send_string(b, getenv("TERM")); + client_write_server2(cctx, MSG_IDENTIFY, + &data, sizeof data, BUFFER_OUT(b), BUFFER_USED(b)); + buffer_destroy(b); } return (0); |