stroke: Dynamically resize stroke messages
The maximum size of a stroke message is currently 64k due to the 2 byte length field. Fixes #943.
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
/**
|
||||
* @file stroke_msg.h
|
||||
*
|
||||
* @brief Definition of stroke_msg_t.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015 Tobias Brunner
|
||||
* Copyright (C) 2006 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
*
|
||||
@@ -32,7 +26,10 @@
|
||||
*/
|
||||
#define STROKE_SOCKET IPSEC_PIDDIR "/charon.ctl"
|
||||
|
||||
#define STROKE_BUF_LEN 4096
|
||||
/**
|
||||
* Number of bytes by which the buffer is increased as needed
|
||||
*/
|
||||
#define STROKE_BUF_LEN_INC 1024
|
||||
|
||||
typedef enum list_flag_t list_flag_t;
|
||||
|
||||
@@ -371,7 +368,10 @@ struct stroke_msg_t {
|
||||
char *name;
|
||||
} counters;
|
||||
};
|
||||
char buffer[STROKE_BUF_LEN];
|
||||
/* length of the string buffer */
|
||||
u_int16_t buflen;
|
||||
/* string buffer */
|
||||
char buffer[];
|
||||
};
|
||||
|
||||
#endif /* STROKE_MSG_H_ */
|
||||
|
||||
Reference in New Issue
Block a user