Skip to content

Commit

Permalink
refactor: Match the protocol version between rtty and rttys
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Sep 15, 2021
1 parent a13b788 commit 1f4309b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rtty.c
Expand Up @@ -288,7 +288,7 @@ void rtty_exit(struct rtty *rtty)

static void rtty_register(struct rtty *rtty)
{
size_t len = 3 + strlen(rtty->devid);
size_t len = 4 + strlen(rtty->devid);
struct buffer *wb = &rtty->wb;

if (rtty->description)
Expand All @@ -300,6 +300,8 @@ static void rtty_register(struct rtty *rtty)
buffer_put_u8(wb, MSG_TYPE_REGISTER);
buffer_put_u16be(wb, len);

buffer_put_u8(wb, RTTY_PROTO_VER);

buffer_put_string(wb, rtty->devid);
buffer_put_u8(wb, '\0');

Expand Down
1 change: 1 addition & 0 deletions src/rtty.h
Expand Up @@ -37,6 +37,7 @@
#include "ssl/ssl.h"
#endif

#define RTTY_PROTO_VER 3
#define RTTY_MAX_TTY 10
#define RTTY_HEARTBEAT_INTEVAL 5.0
#define RTTY_TTY_TIMEOUT 600
Expand Down

0 comments on commit 1f4309b

Please sign in to comment.