Commit a5af4b17 authored by Rusty Russell's avatar Rusty Russell

ccan/io: remove IO_IDLE state.

Use a NULL io pointer instead to indicate an idle connection.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent f6f11f6b
...@@ -230,7 +230,8 @@ struct io_plan io_idle(void) ...@@ -230,7 +230,8 @@ struct io_plan io_idle(void)
struct io_plan plan; struct io_plan plan;
plan.pollflag = 0; plan.pollflag = 0;
plan.state = IO_IDLE; plan.state = IO_IO;
plan.io = NULL;
return plan; return plan;
} }
...@@ -241,7 +242,7 @@ void io_wake(struct io_conn *conn, struct io_plan plan) ...@@ -241,7 +242,7 @@ void io_wake(struct io_conn *conn, struct io_plan plan)
/* It might have finished, but we haven't called its finish() yet. */ /* It might have finished, but we haven't called its finish() yet. */
if (conn->plan.state == IO_FINISHED) if (conn->plan.state == IO_FINISHED)
return; return;
assert(conn->plan.state == IO_IDLE); assert(!conn->plan.io);
conn->plan = plan; conn->plan = plan;
backend_wakeup(conn); backend_wakeup(conn);
} }
......
...@@ -36,7 +36,6 @@ enum io_result { ...@@ -36,7 +36,6 @@ enum io_result {
enum io_state { enum io_state {
IO_IO, IO_IO,
IO_IDLE,
IO_FINISHED IO_FINISHED
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment