MXS-2312: Use default network buffer sizes
Removed the hard-coded network buffer sizes. This effectively makes them configurable via the kernel.
This commit is contained in:
@ -22,21 +22,6 @@
|
||||
|
||||
MXS_BEGIN_DECLS
|
||||
|
||||
|
||||
/**
|
||||
* MXS_SO_RCVBUF
|
||||
*
|
||||
* The size of the network input buffer.
|
||||
*/
|
||||
#define MXS_SO_RCVBUF_SIZE (128 * 1024)
|
||||
|
||||
/**
|
||||
* MXS_SO_SNDBUF
|
||||
*
|
||||
* The size of the network output buffer.
|
||||
*/
|
||||
#define MXS_SO_SNDBUF_SIZE (128 * 1024)
|
||||
|
||||
/**
|
||||
* MXS_MAX_THREADS
|
||||
*
|
||||
|
@ -742,6 +742,7 @@ static int dcb_read_SSL(DCB* dcb, GWBUF** head)
|
||||
*/
|
||||
static GWBUF* dcb_basic_read_SSL(DCB* dcb, int* nsingleread)
|
||||
{
|
||||
const size_t MXS_SO_RCVBUF_SIZE = (128 * 1024);
|
||||
unsigned char temp_buffer[MXS_SO_RCVBUF_SIZE];
|
||||
GWBUF* buffer = NULL;
|
||||
|
||||
|
@ -945,13 +945,9 @@ void utils_end()
|
||||
|
||||
bool configure_network_socket(int so, int type)
|
||||
{
|
||||
int sndbufsize = MXS_SO_SNDBUF_SIZE;
|
||||
int rcvbufsize = MXS_SO_RCVBUF_SIZE;
|
||||
int one = 1;
|
||||
|
||||
if (setsockopt(so, SOL_SOCKET, SO_SNDBUF, &sndbufsize, sizeof(sndbufsize)) != 0
|
||||
|| setsockopt(so, SOL_SOCKET, SO_RCVBUF, &rcvbufsize, sizeof(rcvbufsize)) != 0
|
||||
|| (type != AF_UNIX && setsockopt(so, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) != 0))
|
||||
if (type != AF_UNIX && setsockopt(so, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) != 0)
|
||||
{
|
||||
MXS_ERROR("Failed to set socket option: %d, %s.", errno, mxs_strerror(errno));
|
||||
mxb_assert(!true);
|
||||
|
Reference in New Issue
Block a user