X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fio%2Fbenchmarks%2Frun-length-prefix.c;fp=ccan%2Fio%2Fbenchmarks%2Frun-length-prefix.c;h=2ed9c72933f18d9a15a01f2c711752d0a103e61e;hb=625bae8f5720d3ad3253ea9b26ad68abcd81bde5;hp=74290fd8079ed8dfdbf79c137f393cef82ca4735;hpb=42762758d98feb08b861361b7f695de2cad26b07;p=ccan diff --git a/ccan/io/benchmarks/run-length-prefix.c b/ccan/io/benchmarks/run-length-prefix.c index 74290fd8..2ed9c729 100644 --- a/ccan/io/benchmarks/run-length-prefix.c +++ b/ccan/io/benchmarks/run-length-prefix.c @@ -25,28 +25,28 @@ struct client { char *request_buffer; }; -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) +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(conn, client->request_buffer, client->len, write_reply, client); } -static struct io_plan *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(conn, &client->len, sizeof(client->len), read_body, client); } /* once we're done, loop again. */ -static struct io_plan *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_plan *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(conn, &client->len, sizeof(client->len), write_complete, client); @@ -112,12 +112,12 @@ static void sigalarm(int sig) write(timeout[1], "1", 1); } -static struct io_plan *do_timeout(struct io_conn *conn, char *buf) +static struct io_plan do_timeout(struct io_conn *conn, char *buf) { return io_break(conn, buf, NULL, NULL); } -static struct io_plan *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(conn, buf, 1, do_timeout, buf); }