1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Avoid sending innapropriate client_left() msgs to proxy

This commit is contained in:
Nicolas Viennot 2016-01-02 22:19:06 -05:00
parent 52f686b621
commit 3ad79d43f9
2 changed files with 10 additions and 0 deletions

View File

@ -196,6 +196,8 @@ void tmate_notify_client_join(__unused struct tmate_session *session,
if (!tmate_has_proxy())
return;
c->flags |= CLIENT_TMATE_NOTIFIED_JOIN;
pack(array, 5);
pack(int, TMATE_CTL_CLIENT_JOIN);
pack(int, c->id);
@ -212,6 +214,11 @@ void tmate_notify_client_left(__unused struct tmate_session *session,
if (!tmate_has_proxy())
return;
if (!(c->flags & CLIENT_TMATE_NOTIFIED_JOIN))
return;
c->flags &= ~CLIENT_TMATE_NOTIFIED_JOIN;
pack(array, 2);
pack(int, TMATE_CTL_CLIENT_LEFT);
pack(int, c->id);

3
tmux.h
View File

@ -1280,6 +1280,9 @@ struct client {
#define CLIENT_256COLOURS 0x20000
#define CLIENT_IDENTIFIED 0x40000
#define CLIENT_STATUSFORCE 0x80000
#ifdef TMATE_SLAVE
#define CLIENT_TMATE_NOTIFIED_JOIN 0x10000000
#endif
int flags;
struct key_table *keytable;