From: Matt Jordan Date: Fri, 4 Nov 2016 20:42:09 +0000 (-0500) Subject: res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems X-Git-Tag: 13.13.0-rc1~40^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e79acaeb750ba286786ad122ddf20e9c179c19cf;p=thirdparty%2Fasterisk.git res_http_websocket: Increase the buffer size for non-LOW_MEMORY systems Not surprisingly, using Respoke (and possibly other systems) it is possible to blow past the 16k limit for a WebSocket packet size. This patch bumps it up to 32k, which, at least for Respoke, is sufficient. For now. Because 32k is laughable on a LOW_MEMORY system (as is 16k, for that matter), this patch adds a LOW_MEMORY directive that sets the buffer to 8k for systems who have asked for their reduced memory availability to be considered. Change-Id: Id235902537091b58608196844dc4b045e383cd2e --- diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c index 5e0591b13a..71d838ad99 100644 --- a/res/res_http_websocket.c +++ b/res/res_http_websocket.c @@ -51,16 +51,29 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /*! \brief Number of buckets for registered protocols */ #define MAX_PROTOCOL_BUCKETS 7 +#ifdef LOW_MEMORY /*! \brief Size of the pre-determined buffer for WebSocket frames */ -#define MAXIMUM_FRAME_SIZE 16384 +#define MAXIMUM_FRAME_SIZE 8192 /*! \brief Default reconstruction size for multi-frame payload reconstruction. If exceeded the next frame will start a * payload. */ -#define DEFAULT_RECONSTRUCTION_CEILING 16384 +#define DEFAULT_RECONSTRUCTION_CEILING 8192 /*! \brief Maximum reconstruction size for multi-frame payload reconstruction. */ -#define MAXIMUM_RECONSTRUCTION_CEILING 16384 +#define MAXIMUM_RECONSTRUCTION_CEILING 8192 +#else +/*! \brief Size of the pre-determined buffer for WebSocket frames */ +#define MAXIMUM_FRAME_SIZE 32768 + +/*! \brief Default reconstruction size for multi-frame payload reconstruction. If exceeded the next frame will start a + * payload. + */ +#define DEFAULT_RECONSTRUCTION_CEILING 32768 + +/*! \brief Maximum reconstruction size for multi-frame payload reconstruction. */ +#define MAXIMUM_RECONSTRUCTION_CEILING 32768 +#endif /*! \brief Maximum size of a websocket frame header * 1 byte flags and opcode