mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
This prevents DoS when connected to a malicious ethstats server. Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
parent
1bd4eaab88
commit
84e19a7b7f
1 changed files with 3 additions and 0 deletions
|
|
@ -57,6 +57,8 @@ const (
|
|||
txChanSize = 4096
|
||||
// chainHeadChanSize is the size of channel listening to ChainHeadEvent.
|
||||
chainHeadChanSize = 10
|
||||
|
||||
messageSizeLimit = 15 * 1024 * 1024
|
||||
)
|
||||
|
||||
type consensusEngine interface {
|
||||
|
|
@ -129,6 +131,7 @@ type connWrapper struct {
|
|||
}
|
||||
|
||||
func newConnectionWrapper(conn *websocket.Conn) *connWrapper {
|
||||
conn.SetReadLimit(messageSizeLimit)
|
||||
return &connWrapper{conn: conn}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue