aboutsummaryrefslogtreecommitdiff
path: root/networks/plaintext_buffered.c
diff options
context:
space:
mode:
Diffstat (limited to 'networks/plaintext_buffered.c')
-rw-r--r--networks/plaintext_buffered.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/networks/plaintext_buffered.c b/networks/plaintext_buffered.c
index 99bd085..6f5016c 100644
--- a/networks/plaintext_buffered.c
+++ b/networks/plaintext_buffered.c
@@ -108,6 +108,8 @@ void * plaintext_buffered_send_thread(void *handle) {
if (read_buffer_index + len > PLAINTEXT_BUFFERED_LEN)
len = PLAINTEXT_BUFFERED_LEN - read_buffer_index;
+ if (len > PLAINTEXT_BUFFERED_LEN/2 && PLAINTEXT_BUFFERED_LEN > 1)
+ len = PLAINTEXT_BUFFERED_LEN/2;
ssize_t res;
do {