summaryrefslogtreecommitdiff
path: root/channels.h
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-09-20 05:47:25 +0000
committerDamien Miller <djm@mindrot.org>2020-09-20 16:16:46 +1000
commit107eb3eeafcd390e1fa7cc7672a05e994d14013e (patch)
treeb7957a7b8b6e4ff24a31de33b7ce537e509e8c4b /channels.h
parentacfe2ac5fe033e227ad3a56624fbbe4af8b5da04 (diff)
upstream: cap channel input buffer size at 16MB; avoids high memory use
when peer advertises a large window but is slow to consume the data we send (e.g. because of a slow network) reported by Pierre-Yves David fix with & ok markus@ OpenBSD-Commit-ID: 1452771f5e5e768876d3bfe2544e3866d6ade216
Diffstat (limited to 'channels.h')
-rw-r--r--channels.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/channels.h b/channels.h
index ee818880e..74e9b3f87 100644
--- a/channels.h
+++ b/channels.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.h,v 1.134 2020/07/05 23:59:45 djm Exp $ */ 1/* $OpenBSD: channels.h,v 1.135 2020/09/20 05:47:25 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -223,6 +223,9 @@ struct Channel {
223/* Read buffer size */ 223/* Read buffer size */
224#define CHAN_RBUF (16*1024) 224#define CHAN_RBUF (16*1024)
225 225
226/* Maximum channel input buffer size */
227#define CHAN_INPUT_MAX (16*1024*1024)
228
226/* Hard limit on number of channels */ 229/* Hard limit on number of channels */
227#define CHANNELS_MAX_CHANNELS (16*1024) 230#define CHANNELS_MAX_CHANNELS (16*1024)
228 231