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:
Tobias Brunner
2015-05-22 10:40:15 +02:00
parent e94aae83d3
commit d8fe354a0e
3 changed files with 320 additions and 287 deletions
+9 -9
View File
@@ -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_ */