From f1a3734d95835ae2caf89637bd90d7bc3bb16063 Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Wed, 13 Mar 2024 11:34:23 +0500 Subject: [PATCH] RTMP handshake fix, ReadFull now only reads upto C0C1 instead of waiting on full sequence --- rtmp/handshake.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtmp/handshake.go b/rtmp/handshake.go index a36bbfb..9c2f566 100644 --- a/rtmp/handshake.go +++ b/rtmp/handshake.go @@ -18,7 +18,7 @@ func DoHandshake(conn net.Conn) (hs_success bool) { // force handshake to finish in under 15 seconds (aribtrary) or throw an error conn.SetDeadline(time.Now().Add(15 * time.Second)) - if _, err := io.ReadFull(conn, C0C1C2); err != nil || C0C1C2[0] != 3 { + if _, err := io.ReadFull(conn, C0C1C2[:1+1536]); err != nil || C0C1C2[0] != 3 { return } copy(C0C1C2[1:1536], S0S1S2[1+1536:])