From 2ff217cb185cb01a3891cb98a84671eaf4459a42 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 8 May 2002 14:02:02 +0000 Subject: [PATCH] Minor fix to previous fix - use the right variable! svn path=/trunk/icecast/; revision=3291 --- src/source.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/source.c b/src/source.c index d4dba06b..c8ee35bb 100644 --- a/src/source.c +++ b/src/source.c @@ -220,6 +220,9 @@ void *source_main(void *arg) if (sbytes >= 0) { client->con->sent_bytes += sbytes; if(sbytes != bytes) { + /* We didn't send the entire buffer. Leave it for + * the moment, handle it in the next iteration. + */ client->pos += sbytes; refbuf_queue_insert(&client->queue, abuf); data_done = 1; @@ -255,7 +258,8 @@ void *source_main(void *arg) sbytes = sock_write_bytes(client->con->sock, refbuf->data, refbuf->len); if (sbytes >= 0) { client->con->sent_bytes += sbytes; - if(sbytes != bytes) { + if(sbytes != refbuf->len) { + /* Didn't send the entire buffer, queue it */ client->pos = sbytes; refbuf_addref(refbuf); refbuf_queue_insert(&client->queue, abuf); -- GitLab