14 #include <sys/types.h> 19 #define MIN_MSG_SIZE 12336 // sizeof(struct qb_ipc_connection_response) 20 #define MAX_MSG_SIZE 128*1024 // 128k default 33 static long long env_value = 0LL;
35 if (env_value == 0LL) {
41 max = QB_MAX(max, env_value);
42 crm_warn(
"Using %u as IPC buffer size because '%s' is not " 46 }
else if (env_value <= 0LL) {
48 max = QB_MAX(max, env_value);
49 crm_warn(
"Using %u as IPC buffer size because PCMK_" 55 max = QB_MAX(max, env_value);
56 crm_debug(
"Using %u as IPC buffer size because PCMK_" 60 }
else if (env_value > UINT_MAX) {
63 crm_debug(
"Using %u as IPC buffer size because PCMK_" 69 if (env_value > max) {
75 crm_debug(
"Using IPC buffer size %lld from %s (not %u)",
76 env_value, source, max);
90 static unsigned int default_size = 0;
92 if (default_size == 0) {
109 if (header == NULL) {
110 crm_err(
"IPC message without header");
114 crm_err(
"Filtering incompatible v%d IPC message (only versions <= %d supported)",
124 switch (client_type) {
129 #ifdef HAVE_GNUTLS_GNUTLS_H 130 case pcmk__client_tls:
Client uses TCP connection.
#define PCMK__ENV_IPC_BUFFER
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
unsigned int pcmk__ipc_buffer_size(unsigned int max)
const char * pcmk__env_option(const char *option)
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define crm_warn(fmt, args...)
bool pcmk__valid_ipc_header(const pcmk__ipc_header_t *header)
#define PCMK__IPC_VERSION
#define crm_debug(fmt, args...)
Wrappers for and extensions to libxml2.
unsigned int crm_ipc_default_buffer_size(void)
Return pacemaker's default IPC buffer size.
#define crm_err(fmt, args...)
const char * pcmk__client_type_str(uint64_t client_type)