|
|
@@ -6,6 +6,7 @@ import (
|
|
6
|
6
|
"io"
|
|
7
|
7
|
|
|
8
|
8
|
"github.com/9seconds/mtg/v2/essentials"
|
|
|
9
|
+ "github.com/9seconds/mtg/v2/mtglib/internal/tls"
|
|
9
|
10
|
)
|
|
10
|
11
|
|
|
11
|
12
|
func Relay(ctx context.Context, log Logger, telegramConn, clientConn essentials.Conn) {
|
|
|
@@ -35,7 +36,7 @@ func Relay(ctx context.Context, log Logger, telegramConn, clientConn essentials.
|
|
35
|
36
|
}
|
|
36
|
37
|
|
|
37
|
38
|
func pump(log Logger, src, dst essentials.Conn, direction string) {
|
|
38
|
|
- var buf [copyBufferSize]byte
|
|
|
39
|
+ var buf [tls.MaxRecordPayloadSize]byte
|
|
39
|
40
|
|
|
40
|
41
|
defer src.CloseRead() //nolint: errcheck
|
|
41
|
42
|
defer dst.CloseWrite() //nolint: errcheck
|