char *request_buffer;
};
-static struct io_op *write_reply(struct io_conn *conn, struct client *client);
-static struct io_op *read_body(struct io_conn *conn, struct client *client)
+static struct io_plan *write_reply(struct io_conn *conn, struct client *client);
+static struct io_plan *read_body(struct io_conn *conn, struct client *client)
{
assert(client->len <= REQUEST_MAX);
return io_read(client->request_buffer, client->len,
io_next(conn, write_reply, client));
}
-static struct io_op *read_header(struct io_conn *conn, struct client *client)
+static struct io_plan *read_header(struct io_conn *conn, struct client *client)
{
return io_read(&client->len, sizeof(client->len),
io_next(conn, read_body, client));
}
/* once we're done, loop again. */
-static struct io_op *write_complete(struct io_conn *conn, struct client *client)
+static struct io_plan *write_complete(struct io_conn *conn, struct client *client)
{
completed++;
return read_header(conn, client);
}
-static struct io_op *write_reply(struct io_conn *conn, struct client *client)
+static struct io_plan *write_reply(struct io_conn *conn, struct client *client)
{
return io_write(&client->len, sizeof(client->len),
io_next(conn, write_complete, client));
write(timeout[1], "1", 1);
}
-static struct io_op *do_timeout(struct io_conn *conn, char *buf)
+static struct io_plan *do_timeout(struct io_conn *conn, char *buf)
{
return io_break(conn, NULL);
}
-static struct io_op *do_timeout_read(struct io_conn *conn, char *buf)
+static struct io_plan *do_timeout_read(struct io_conn *conn, char *buf)
{
return io_read(buf, 1, io_next(conn, do_timeout, buf));
}