mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Incoming messages should be dispatched first before being forwarded
It's a cheap sanity check
This commit is contained in:
parent
b97f8dc7d6
commit
1d26957b3b
@ -517,6 +517,10 @@ static void tmate_snapshot(__unused struct tmate_session *session,
|
||||
void tmate_dispatch_daemon_message(struct tmate_session *session,
|
||||
struct tmate_unpacker *uk)
|
||||
{
|
||||
/* We make a copy because we are mutating it */
|
||||
struct tmate_unpacker uk_copy = *uk;
|
||||
uk = &uk_copy;
|
||||
|
||||
int cmd = unpack_int(uk);
|
||||
switch (cmd) {
|
||||
#define dispatch(c, f) case c: f(session, uk); break
|
||||
|
@ -8,8 +8,8 @@ static void on_daemon_decoder_read(void *userdata, struct tmate_unpacker *uk)
|
||||
{
|
||||
struct tmate_session *session = userdata;
|
||||
|
||||
tmate_send_websocket_daemon_msg(session, uk);
|
||||
tmate_dispatch_daemon_message(session, uk);
|
||||
tmate_send_websocket_daemon_msg(session, uk);
|
||||
}
|
||||
|
||||
static int on_ssh_channel_read(__unused ssh_session _session,
|
||||
|
Loading…
x
Reference in New Issue
Block a user