Use a tailq of write buffers instead of a single one per connection.

This allows us to queue up multiple messages for writing like the
sudoers client supports.  Currently, each connection has its own
free list.  In the future we may want a single free list with low
and high water marks.
This commit is contained in:
Todd C. Miller
2021-04-06 14:30:16 -06:00
parent e3ff4e663c
commit 7bb5eef9d9
3 changed files with 76 additions and 28 deletions

View File

@@ -27,11 +27,13 @@
#define MESSAGE_SIZE_MAX (2 * 1024 * 1024)
struct connection_buffer {
TAILQ_ENTRY(connection_buffer) entries;
uint8_t *data;
unsigned int size;
unsigned int len;
unsigned int off;
};
TAILQ_HEAD(connection_buffer_list, connection_buffer);
/* logsrv_util.c */
struct iolog_file;