Hard limits moved to limits.h
Limits used with SO_[RCV|SEND]BUF moved from gw.h to limits.h and renamed so that the prefix is MXS_.
This commit is contained in:
@ -41,15 +41,6 @@ MXS_BEGIN_DECLS
|
|||||||
// network buffer is 32K
|
// network buffer is 32K
|
||||||
#define MAX_BUFFER_SIZE 32768
|
#define MAX_BUFFER_SIZE 32768
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration for send and receive socket buffer sizes for
|
|
||||||
* backend and cleint connections.
|
|
||||||
*/
|
|
||||||
#define GW_BACKEND_SO_SNDBUF (128 * 1024)
|
|
||||||
#define GW_BACKEND_SO_RCVBUF (128 * 1024)
|
|
||||||
#define GW_CLIENT_SO_SNDBUF (128 * 1024)
|
|
||||||
#define GW_CLIENT_SO_RCVBUF (128 * 1024)
|
|
||||||
|
|
||||||
#define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR)
|
#define GW_NOINTR_CALL(A) do { errno = 0; A; } while (errno == EINTR)
|
||||||
|
|
||||||
bool gw_daemonize(void);
|
bool gw_daemonize(void);
|
||||||
|
@ -18,12 +18,49 @@
|
|||||||
|
|
||||||
MXS_BEGIN_DECLS
|
MXS_BEGIN_DECLS
|
||||||
|
|
||||||
// This file defines hard limits of MaxScale.
|
/**
|
||||||
|
* @file lmits.h
|
||||||
|
*
|
||||||
|
* This file contains defines for hard limits of MaxScale.
|
||||||
|
*/
|
||||||
|
|
||||||
// Thread information is stored in a bitmask whose size must be a
|
|
||||||
// multiple of 8. The bitmask is indexed using the thread id that start
|
/**
|
||||||
// from 1. Hence, the hard maximum number of threads must be a
|
* MXS_BACKEND_SO_RCVBUF
|
||||||
// multiple of 8 minus 1.
|
*
|
||||||
|
* The value used when setting SO_RCVBUF of backend sockets.
|
||||||
|
*/
|
||||||
|
#define MXS_BACKEND_SO_RCVBUF (128 * 1024)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MSX_BACKEND_SO_SNDBUF
|
||||||
|
*
|
||||||
|
* The value used when setting SO_SNDBUF of backend sockets.
|
||||||
|
*/
|
||||||
|
#define MXS_BACKEND_SO_SNDBUF (128 * 1024)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MXS_CLIENT_SO_RCVBUF
|
||||||
|
*
|
||||||
|
* The value used when setting SO_RCVBUF of client sockets.
|
||||||
|
*/
|
||||||
|
#define MXS_CLIENT_SO_RCVBUF (128 * 1024)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MXS_CLIENT_SO_SNDBUF
|
||||||
|
*
|
||||||
|
* The value used when setting SO_SNDBUF of client sockets.
|
||||||
|
*/
|
||||||
|
#define MXS_CLIENT_SO_SNDBUF (128 * 1024)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MXS_MAX_THREADS
|
||||||
|
*
|
||||||
|
* Thread information is stored in a bitmask whose size must be a
|
||||||
|
* multiple of 8. The bitmask is indexed using the thread id that start
|
||||||
|
* from 1. Hence, the hard maximum number of threads must be a
|
||||||
|
* multiple of 8 minus 1.
|
||||||
|
*/
|
||||||
#define MXS_MAX_THREADS 255
|
#define MXS_MAX_THREADS 255
|
||||||
|
|
||||||
MXS_END_DECLS
|
MXS_END_DECLS
|
||||||
|
@ -3101,7 +3101,7 @@ dcb_accept(DCB *listener, GWPROTOCOL *protocol_funcs)
|
|||||||
conn_open[c_sock] = true;
|
conn_open[c_sock] = true;
|
||||||
#endif /* FAKE_CODE */
|
#endif /* FAKE_CODE */
|
||||||
/* set nonblocking */
|
/* set nonblocking */
|
||||||
sendbuf = GW_CLIENT_SO_SNDBUF;
|
sendbuf = MXS_CLIENT_SO_SNDBUF;
|
||||||
|
|
||||||
if (setsockopt(c_sock, SOL_SOCKET, SO_SNDBUF, &sendbuf, optlen) != 0)
|
if (setsockopt(c_sock, SOL_SOCKET, SO_SNDBUF, &sendbuf, optlen) != 0)
|
||||||
{
|
{
|
||||||
@ -3109,7 +3109,7 @@ dcb_accept(DCB *listener, GWPROTOCOL *protocol_funcs)
|
|||||||
errno, strerror_r(errno, errbuf, sizeof(errbuf)));
|
errno, strerror_r(errno, errbuf, sizeof(errbuf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
sendbuf = GW_CLIENT_SO_RCVBUF;
|
sendbuf = MXS_CLIENT_SO_RCVBUF;
|
||||||
|
|
||||||
if (setsockopt(c_sock, SOL_SOCKET, SO_RCVBUF, &sendbuf, optlen) != 0)
|
if (setsockopt(c_sock, SOL_SOCKET, SO_RCVBUF, &sendbuf, optlen) != 0)
|
||||||
{
|
{
|
||||||
|
@ -323,7 +323,7 @@ gw_do_connect_to_backend(char *host, int port, int *fd)
|
|||||||
/* prepare for connect */
|
/* prepare for connect */
|
||||||
setipaddress(&serv_addr.sin_addr, host);
|
setipaddress(&serv_addr.sin_addr, host);
|
||||||
serv_addr.sin_port = htons(port);
|
serv_addr.sin_port = htons(port);
|
||||||
bufsize = GW_BACKEND_SO_SNDBUF;
|
bufsize = MXS_BACKEND_SO_SNDBUF;
|
||||||
|
|
||||||
if (setsockopt(so, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)) != 0)
|
if (setsockopt(so, SOL_SOCKET, SO_SNDBUF, &bufsize, sizeof(bufsize)) != 0)
|
||||||
{
|
{
|
||||||
@ -340,7 +340,7 @@ gw_do_connect_to_backend(char *host, int port, int *fd)
|
|||||||
close_socket(so);
|
close_socket(so);
|
||||||
goto return_rv;
|
goto return_rv;
|
||||||
}
|
}
|
||||||
bufsize = GW_BACKEND_SO_RCVBUF;
|
bufsize = MXS_BACKEND_SO_RCVBUF;
|
||||||
|
|
||||||
if (setsockopt(so, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)) != 0)
|
if (setsockopt(so, SOL_SOCKET, SO_RCVBUF, &bufsize, sizeof(bufsize)) != 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user