From 7bd16386d28cf35a9ead3ca48c31c019ebbdafd5 Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Thu, 28 Jan 2021 23:39:21 +0800 Subject: [PATCH] server: increase max length of base path to 128 --- README.md | 2 +- man/ttyd.1 | 2 +- man/ttyd.man.md | 2 +- src/server.c | 2 +- src/server.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f3f236c..07db6a1 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ OPTIONS: -o, --once Accept only one client and exit on disconnection -B, --browser Open terminal with the default system browser -I, --index Custom index.html path - -b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here) + -b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128) -P, --ping-interval Websocket ping interval(sec) (default: 300) -6, --ipv6 Enable IPv6 support -S, --ssl Enable SSL diff --git a/man/ttyd.1 b/man/ttyd.1 index 83e8f63..000cb45 100644 --- a/man/ttyd.1 +++ b/man/ttyd.1 @@ -97,7 +97,7 @@ Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt/LEDE, Windows .PP \-b, \-\-base\-path - Expected base path for requests coming from a reverse proxy (eg: /mounted/here) + Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128) .PP \-P, \-\-ping\-interval diff --git a/man/ttyd.man.md b/man/ttyd.man.md index 5da4c95..b90cd97 100644 --- a/man/ttyd.man.md +++ b/man/ttyd.man.md @@ -65,7 +65,7 @@ ttyd 1 "September 2016" ttyd "User Manual" Custom index.html path -b, --base-path - Expected base path for requests coming from a reverse proxy (eg: /mounted/here) + Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128) -P, --ping-interval Websocket ping interval(sec) (default: 300) diff --git a/src/server.c b/src/server.c index 70b0864..08457a9 100644 --- a/src/server.c +++ b/src/server.c @@ -115,7 +115,7 @@ static void print_help() { " -o, --once Accept only one client and exit on disconnection\n" " -B, --browser Open terminal with the default system browser\n" " -I, --index Custom index.html path\n" - " -b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here)\n" + " -b, --base-path Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)\n" #if LWS_LIBRARY_VERSION_NUMBER >= 4000000 " -P, --ping-interval Websocket ping interval(sec) (default: 300)\n" #endif diff --git a/src/server.h b/src/server.h index 784d445..6789475 100644 --- a/src/server.h +++ b/src/server.h @@ -62,7 +62,7 @@ struct pss_tty { int initial_cmd_index; bool authenticated; char address[50]; - char path[20]; + char path[128]; struct lws *wsi; char *buffer; -- 2.43.4