summaryrefslogtreecommitdiffstats
path: root/src/buffio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffio.c')
-rw-r--r--src/buffio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buffio.c b/src/buffio.c
index 95e3dec..4771b1c 100644
--- a/src/buffio.c
+++ b/src/buffio.c
@@ -257,6 +257,7 @@ static void do_read(struct buffio *b) {
m = b->input_max_length-i;
s = read(b->ifd, b->input_buf+i, m);
+ buffio_set_readable(b, 0);
//daemon_log(LOG_INFO, "%p: Read %u (%u) bytes.", b, s, m);
if (s < 0) {
@@ -284,8 +285,6 @@ static void do_read(struct buffio *b) {
b->input_length += s;
buffio_normalize(b);
- buffio_set_readable(b, 0);
-
if (b->input_length)
buffio_sched_cb(b, BUFFIO_SCHED_CB_INPUT_READY);
}
@@ -310,6 +309,8 @@ static void do_write(struct buffio *b) {
m = b->output_max_length-b->output_index;
s = write(b->ofd, b->output_buf+b->output_index, m);
+ buffio_set_writable(b, 0);
+
//daemon_log(LOG_INFO, "%p: Wrote %u (%u) bytes.", b, s, m);
if (s < 0) {
@@ -338,7 +339,6 @@ static void do_write(struct buffio *b) {
b->output_length -= s;
buffio_normalize(b);
- buffio_set_writable(b, 0);
buffio_delay(b, s);
if (b->output_length < b->output_range)