File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ where
101101 . or ( Err ( P2PStreamError :: HandshakeError ( P2PHandshakeError :: Timeout ) ) ) ?
102102 . ok_or ( P2PStreamError :: HandshakeError ( P2PHandshakeError :: NoResponse ) ) ??;
103103
104- // let's check the compressed length first, we will need to check again once confirming
105- // that it contains snappy-compressed data (this will be the case for all non-p2p messages).
104+ // Check that the uncompressed message length does not exceed the max payload size.
105+ // Note: The first message (Hello/Disconnect) is not snappy compressed. We will check the
106+ // decompressed length again for subsequent messages after the handshake.
106107 if first_message_bytes. len ( ) > MAX_PAYLOAD_SIZE {
107108 return Err ( P2PStreamError :: MessageTooBig {
108109 message_size : first_message_bytes. len ( ) ,
You can’t perform that action at this time.
0 commit comments