summaryrefslogtreecommitdiffhomepage
path: root/svr-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-07-25 15:44:25 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-07-25 15:44:25 +0000
commite3e4445dc1e86652d1e855bd320f8077523d2d59 (patch)
treef269a94ae31377093d06b59afe17ba38865f22a6 /svr-runopts.c
parent2d4d9627a21f11a3e5caa17149e5391e71af256b (diff)
Add -W <windowsize> argument and document it.
--HG-- extra : convert_revision : 98d4c0f15480bf749c451034cbc565d7e9d3b8dc
Diffstat (limited to 'svr-runopts.c')
-rw-r--r--svr-runopts.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/svr-runopts.c b/svr-runopts.c
index dde0b07..f78461b 100644
--- a/svr-runopts.c
+++ b/svr-runopts.c
@@ -80,6 +80,7 @@ static void printhelp(const char * progname) {
#ifdef INETD_MODE
"-i Start for inetd\n"
#endif
+ "-W <receive_window_buffer> (default %d, larger may be faster)\n"
#ifdef DEBUG_TRACE
"-v verbose\n"
#endif
@@ -90,7 +91,7 @@ static void printhelp(const char * progname) {
#ifdef DROPBEAR_RSA
RSA_PRIV_FILENAME,
#endif
- DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE);
+ DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE, DEFAULT_RECV_WINDOW);
}
void svr_getopts(int argc, char ** argv) {
@@ -128,6 +129,8 @@ void svr_getopts(int argc, char ** argv) {
#ifndef DISABLE_SYSLOG
svr_opts.usingsyslog = 1;
#endif
+ opts.recv_window = DEFAULT_RECV_WINDOW;
+ char* recv_window_arg = NULL;
#ifdef ENABLE_SVR_REMOTETCPFWD
opts.listen_fwd_all = 0;
#endif
@@ -204,6 +207,9 @@ void svr_getopts(int argc, char ** argv) {
case 'w':
svr_opts.norootlogin = 1;
break;
+ case 'W':
+ next = &recv_window_arg;
+ break;
#if defined(ENABLE_SVR_PASSWORD_AUTH) || defined(ENABLE_SVR_PAM_AUTH)
case 's':
svr_opts.noauthpass = 1;
@@ -265,8 +271,17 @@ void svr_getopts(int argc, char ** argv) {
svr_opts.bannerfile);
}
buf_setpos(svr_opts.banner, 0);
- }
+ }
+
+ if (recv_window_arg)
+ {
+ opts.recv_window = atol(recv_window_arg);
+ if (opts.recv_window == 0)
+ {
+ dropbear_exit("Bad recv window '%s'", recv_window_arg);
+ }
+ }
}
static void addportandaddress(char* spec) {