Fixed to keep reading data until the SSL internal buffer is empty.
Before this fix only 2048 bytes were read,
the rest were buffered inside SSL until another message arrived!!!
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 66112a2..c5a6f40 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -1998,6 +1998,7 @@
 			break;
 
 #ifdef LWS_OPENSSL_SUPPORT
+read_pending:
 		if (wsi->ssl)
 			eff_buf.token_len = SSL_read(wsi->ssl, buf, sizeof buf);
 		else
@@ -2070,6 +2071,11 @@
 			eff_buf.token = NULL;
 			eff_buf.token_len = 0;
 		}
+
+#ifdef LWS_OPENSSL_SUPPORT
+		if (wsi->ssl && SSL_pending(wsi->ssl))
+			goto read_pending;
+#endif
 		break;
 	}