From 6a845827645eaf52d5d5cfa98ab4243ee4f5fa3e Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 19 Sep 2019 16:37:45 -0700 Subject: [PATCH] Dropped autofragmentation size to 5k on Linux, until we figure out why on old hardware on linux, OpenSSL tends to corrupt TLS if we try to encode a large fragment --- microscript/ILibDuktape_HttpStream.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/microscript/ILibDuktape_HttpStream.c b/microscript/ILibDuktape_HttpStream.c index 4c4ebbd..415892c 100644 --- a/microscript/ILibDuktape_HttpStream.c +++ b/microscript/ILibDuktape_HttpStream.c @@ -3973,7 +3973,12 @@ int ILibDuktape_httpStream_webSocket_EncodedUnshiftSink(ILibDuktape_DuplexStream ILibTransport_DoneState ILibDuktape_httpStream_webSocket_DecodedWriteSink(ILibDuktape_DuplexStream *stream, char *buffer, int bufferLen, void *user) { ILibDuktape_WebSocket_State *state = (ILibDuktape_WebSocket_State*)user; - int maxsize = 15000; +#if defined(_POSIX) + int maxsize = 5000; // Temporary Work-around until we figure out why on linux on old hardware, sending fragments bigger than this can cause OpenSSL to corrupt the TLS packet +#else + int maxsize = bufferLen; +#endif + int sendSize = 0; if (bufferLen < maxsize) {