diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-11-30 01:05:03 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-11-30 01:05:03 +0000 |
commit | e2d68ee657d35f062d1794de5d5ce852d478d746 (patch) | |
tree | cbb8a243a8a311b73ee68caf2a365ac00da3aa49 /src/clients.h | |
parent | only recv if buffer is not full (diff) |
buffer size can now be configured
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@18 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/clients.h')
-rw-r--r-- | src/clients.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/clients.h b/src/clients.h index 5253b35..a6337c3 100644 --- a/src/clients.h +++ b/src/clients.h @@ -37,15 +37,18 @@ typedef struct { int fd_[2]; - u_int8_t write_buf_[2][BUFFER_LENGTH]; - u_int32_t write_buf_len_[2]; + buffer_t write_buf_[2]; + u_int32_t write_buf_offset_[2]; } client_t; void clients_delete_element(void* e); -typedef slist_t clients_t; +typedef struct { + slist_t list_; + int32_t buffer_size_; +} clients_t; -int clients_init(clients_t* list); +int clients_init(clients_t* list, int32_t buffer_size); void clients_clear(clients_t* list); int clients_add(clients_t* list, int fd, const tcp_endpoint_t remote_end, const tcp_endpoint_t source_end); void clients_remove(clients_t* list, int fd); |