]> git.ozlabs.org Git - ccan/commitdiff
ccan/io: remove conn arg from io_plan constructors.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 14 Oct 2013 10:58:35 +0000 (21:28 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 14 Oct 2013 10:58:35 +0000 (21:28 +1030)
No longer needed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14 files changed:
ccan/io/_info
ccan/io/io.c
ccan/io/io.h
ccan/io/test/run-01-start-finish.c
ccan/io/test/run-02-read.c
ccan/io/test/run-03-readpartial.c
ccan/io/test/run-04-writepartial.c
ccan/io/test/run-05-write.c
ccan/io/test/run-06-idle.c
ccan/io/test/run-07-break.c
ccan/io/test/run-10-many.c
ccan/io/test/run-12-bidir.c
ccan/io/test/run-13-all-idle.c
ccan/io/test/run-15-timeout.c

index e7dfe9da7b817190ab1c97ab3fb2578b6bde07e5..150b93e5be9c5d0a7ebd0c7cdf30724246628dde 100644 (file)
  * {
  *     assert(c == b->reader);
  *     b->len = sizeof(b->inbuf);
  * {
  *     assert(c == b->reader);
  *     b->len = sizeof(b->inbuf);
- *     return io_read_partial(c, b->inbuf, &b->len, wake_writer, b);
+ *     return io_read_partial(b->inbuf, &b->len, wake_writer, b);
  * }
  *
  * static struct io_plan wake_writer(struct io_conn *c, struct stdin_buffer *b)
  * {
  *     assert(c == b->reader);
  *     io_wake(b->writer, write_to_child, b);
  * }
  *
  * static struct io_plan wake_writer(struct io_conn *c, struct stdin_buffer *b)
  * {
  *     assert(c == b->reader);
  *     io_wake(b->writer, write_to_child, b);
- *     return io_idle(c);
+ *     return io_idle();
  * }
  *
  * static void reader_exit(struct io_conn *c, struct stdin_buffer *b)
  * }
  *
  * static void reader_exit(struct io_conn *c, struct stdin_buffer *b)
@@ -61,7 +61,7 @@
  * {
  *     assert(c == b->writer);
  *     io_wake(b->reader, read_stdin, b);
  * {
  *     assert(c == b->writer);
  *     io_wake(b->reader, read_stdin, b);
- *     return io_idle(c);
+ *     return io_idle();
  * }
  *
  * static struct io_plan write_to_child(struct io_conn *conn,
  * }
  *
  * static struct io_plan write_to_child(struct io_conn *conn,
  *     assert(conn == b->writer);
  *     if (!b->reader)
  *             return io_close(conn, NULL);
  *     assert(conn == b->writer);
  *     if (!b->reader)
  *             return io_close(conn, NULL);
- *     return io_write(conn, b->inbuf, b->len, wake_reader, b);
+ *     return io_write(b->inbuf, b->len, wake_reader, b);
  * }
  *
  * static struct io_plan start_writer(struct io_conn *conn,
  *                                   struct stdin_buffer *b)
  * {
  *     assert(conn == b->writer);
  * }
  *
  * static struct io_plan start_writer(struct io_conn *conn,
  *                                   struct stdin_buffer *b)
  * {
  *     assert(conn == b->writer);
- *     return io_idle(conn);
+ *     return io_idle();
  * }
  *
  * static void fail_child_write(struct io_conn *conn, struct stdin_buffer *b)
  * }
  *
  * static void fail_child_write(struct io_conn *conn, struct stdin_buffer *b)
  *     }
  *
  *     b->rlen = b->max - b->off;
  *     }
  *
  *     b->rlen = b->max - b->off;
- *     return io_read_partial(conn, b->buf + b->off, &b->rlen,
- *                            read_from_child, b);
+ *     return io_read_partial(b->buf + b->off, &b->rlen, read_from_child, b);
  * }
  *
  * // Feed a program our stdin, gather its stdout, print that at end.
  * }
  *
  * // Feed a program our stdin, gather its stdout, print that at end.
index fe9fed4fc2350fef5ea28a46f6a0c162f1c2078e..bad069398e44eb6388d0bf0c2bd969c11764f7d9 100644 (file)
@@ -129,7 +129,7 @@ static enum io_result do_write(struct io_conn *conn)
 }
 
 /* Queue some data to be written. */
 }
 
 /* Queue some data to be written. */
-struct io_plan io_write_(struct io_conn *conn, const void *data, size_t len,
+struct io_plan io_write_(const void *data, size_t len,
                         struct io_plan (*cb)(struct io_conn *, void *),
                         void *arg)
 {
                         struct io_plan (*cb)(struct io_conn *, void *),
                         void *arg)
 {
@@ -160,7 +160,7 @@ static enum io_result do_read(struct io_conn *conn)
 }
 
 /* Queue a request to read into a buffer. */
 }
 
 /* Queue a request to read into a buffer. */
-struct io_plan io_read_(struct io_conn *conn, void *data, size_t len,
+struct io_plan io_read_(void *data, size_t len,
                        struct io_plan (*cb)(struct io_conn *, void *),
                        void *arg)
 {
                        struct io_plan (*cb)(struct io_conn *, void *),
                        void *arg)
 {
@@ -187,7 +187,7 @@ static enum io_result do_read_partial(struct io_conn *conn)
 }
 
 /* Queue a partial request to read into a buffer. */
 }
 
 /* Queue a partial request to read into a buffer. */
-struct io_plan io_read_partial_(struct io_conn *conn, void *data, size_t *len,
+struct io_plan io_read_partial_(void *data, size_t *len,
                                struct io_plan (*cb)(struct io_conn *, void *),
                                void *arg)
 {
                                struct io_plan (*cb)(struct io_conn *, void *),
                                void *arg)
 {
@@ -215,8 +215,7 @@ static enum io_result do_write_partial(struct io_conn *conn)
 }
 
 /* Queue a partial write request. */
 }
 
 /* Queue a partial write request. */
-struct io_plan io_write_partial_(struct io_conn *conn,
-                                const void *data, size_t *len,
+struct io_plan io_write_partial_(const void *data, size_t *len,
                                 struct io_plan (*cb)(struct io_conn*, void *),
                                 void *arg)
 {
                                 struct io_plan (*cb)(struct io_conn*, void *),
                                 void *arg)
 {
@@ -233,7 +232,7 @@ struct io_plan io_write_partial_(struct io_conn *conn,
        return plan;
 }
 
        return plan;
 }
 
-struct io_plan io_idle(struct io_conn *conn)
+struct io_plan io_idle(void)
 {
        struct io_plan plan;
 
 {
        struct io_plan plan;
 
@@ -293,7 +292,7 @@ struct io_plan io_close(struct io_conn *conn, void *arg)
 }
 
 /* Exit the loop, returning this (non-NULL) arg. */
 }
 
 /* Exit the loop, returning this (non-NULL) arg. */
-struct io_plan io_break_(struct io_conn *conn, void *ret,
+struct io_plan io_break_(void *ret,
                         struct io_plan (*fn)(struct io_conn *, void *),
                         void *arg)
 {
                         struct io_plan (*fn)(struct io_conn *, void *),
                         void *arg)
 {
index a027fe714aa5dc5c26432c44f327c486ec0e9831..e48f15b52efe25643b64b533871a64778cdcba60 100644 (file)
@@ -127,7 +127,6 @@ void io_close_listener(struct io_listener *listener);
 
 /**
  * io_write - queue data to be written.
 
 /**
  * io_write - queue data to be written.
- * @conn: the current connection.
  * @data: the data buffer.
  * @len: the length to write.
  * @cb: function to call once it's done.
  * @data: the data buffer.
  * @len: the length to write.
  * @cb: function to call once it's done.
@@ -139,18 +138,17 @@ void io_close_listener(struct io_listener *listener);
  *
  * Note that the I/O may actually be done immediately.
  */
  *
  * Note that the I/O may actually be done immediately.
  */
-#define io_write(conn, data, len, cb, arg)                             \
-       io_write_((conn), (data), (len),                                \
+#define io_write(data, len, cb, arg)                                   \
+       io_write_((data), (len),                                        \
                  typesafe_cb_preargs(struct io_plan, void *,           \
                                      (cb), (arg), struct io_conn *),   \
                  (arg))
                  typesafe_cb_preargs(struct io_plan, void *,           \
                                      (cb), (arg), struct io_conn *),   \
                  (arg))
-struct io_plan io_write_(struct io_conn *conn, const void *data, size_t len,
+struct io_plan io_write_(const void *data, size_t len,
                         struct io_plan (*cb)(struct io_conn *, void *),
                         void *arg);
 
 /**
  * io_read - queue buffer to be read.
                         struct io_plan (*cb)(struct io_conn *, void *),
                         void *arg);
 
 /**
  * io_read - queue buffer to be read.
- * @conn: the current connection.
  * @data: the data buffer.
  * @len: the length to read.
  * @cb: function to call once it's done.
  * @data: the data buffer.
  * @len: the length to read.
  * @cb: function to call once it's done.
@@ -162,19 +160,18 @@ struct io_plan io_write_(struct io_conn *conn, const void *data, size_t len,
  *
  * Note that the I/O may actually be done immediately.
  */
  *
  * Note that the I/O may actually be done immediately.
  */
-#define io_read(conn, data, len, cb, arg)                              \
-       io_read_((conn), (data), (len),                                 \
+#define io_read(data, len, cb, arg)                                    \
+       io_read_((data), (len),                                         \
                 typesafe_cb_preargs(struct io_plan, void *,            \
                                     (cb), (arg), struct io_conn *),    \
                 (arg))
                 typesafe_cb_preargs(struct io_plan, void *,            \
                                     (cb), (arg), struct io_conn *),    \
                 (arg))
-struct io_plan io_read_(struct io_conn *conn, void *data, size_t len,
+struct io_plan io_read_(void *data, size_t len,
                        struct io_plan (*cb)(struct io_conn *, void *),
                        void *arg);
 
 
 /**
  * io_read_partial - queue buffer to be read (partial OK).
                        struct io_plan (*cb)(struct io_conn *, void *),
                        void *arg);
 
 
 /**
  * io_read_partial - queue buffer to be read (partial OK).
- * @conn: the current connection.
  * @data: the data buffer.
  * @len: the maximum length to read, set to the length actually read.
  * @cb: function to call once it's done.
  * @data: the data buffer.
  * @len: the maximum length to read, set to the length actually read.
  * @cb: function to call once it's done.
@@ -186,18 +183,17 @@ struct io_plan io_read_(struct io_conn *conn, void *data, size_t len,
  *
  * Note that the I/O may actually be done immediately.
  */
  *
  * Note that the I/O may actually be done immediately.
  */
-#define io_read_partial(conn, data, len, cb, arg)                      \
-       io_read_partial_((conn), (data), (len),                         \
+#define io_read_partial(data, len, cb, arg)                            \
+       io_read_partial_((data), (len),                                 \
                         typesafe_cb_preargs(struct io_plan, void *,    \
                                             (cb), (arg), struct io_conn *), \
                         (arg))
                         typesafe_cb_preargs(struct io_plan, void *,    \
                                             (cb), (arg), struct io_conn *), \
                         (arg))
-struct io_plan io_read_partial_(struct io_conn *conn, void *data, size_t *len,
+struct io_plan io_read_partial_(void *data, size_t *len,
                                struct io_plan (*cb)(struct io_conn *, void *),
                                void *arg);
 
 /**
  * io_write_partial - queue data to be written (partial OK).
                                struct io_plan (*cb)(struct io_conn *, void *),
                                void *arg);
 
 /**
  * io_write_partial - queue data to be written (partial OK).
- * @conn: the current connection.
  * @data: the data buffer.
  * @len: the maximum length to write, set to the length actually written.
  * @cb: function to call once it's done.
  * @data: the data buffer.
  * @len: the maximum length to write, set to the length actually written.
  * @cb: function to call once it's done.
@@ -209,26 +205,24 @@ struct io_plan io_read_partial_(struct io_conn *conn, void *data, size_t *len,
  *
  * Note that the I/O may actually be done immediately.
  */
  *
  * Note that the I/O may actually be done immediately.
  */
-#define io_write_partial(conn, data, len, cb, arg)                     \
-       io_write_partial_((conn), (data), (len),                        \
+#define io_write_partial(data, len, cb, arg)                           \
+       io_write_partial_((data), (len),                                \
                          typesafe_cb_preargs(struct io_plan, void *,   \
                                              (cb), (arg), struct io_conn *), \
                          (arg))
                          typesafe_cb_preargs(struct io_plan, void *,   \
                                              (cb), (arg), struct io_conn *), \
                          (arg))
-struct io_plan io_write_partial_(struct io_conn *conn,
-                                const void *data, size_t *len,
+struct io_plan io_write_partial_(const void *data, size_t *len,
                                 struct io_plan (*cb)(struct io_conn *, void*),
                                 void *arg);
 
 
 /**
  * io_idle - explicitly note that this connection will do nothing.
                                 struct io_plan (*cb)(struct io_conn *, void*),
                                 void *arg);
 
 
 /**
  * io_idle - explicitly note that this connection will do nothing.
- * @conn: the current connection.
  *
  * This indicates the connection is idle: some other function will
  * later call io_read/io_write etc. (or io_close) on it, in which case
  * it will do that.
  */
  *
  * This indicates the connection is idle: some other function will
  * later call io_read/io_write etc. (or io_close) on it, in which case
  * it will do that.
  */
-struct io_plan io_idle(struct io_conn *conn);
+struct io_plan io_idle(void);
 
 /**
  * io_timeout - set timeout function if the callback doesn't fire.
 
 /**
  * io_timeout - set timeout function if the callback doesn't fire.
@@ -299,7 +293,6 @@ void io_wake_(struct io_conn *conn,
 
 /**
  * io_break - return from io_loop()
 
 /**
  * io_break - return from io_loop()
- * @conn: the current connection.
  * @ret: non-NULL value to return from io_loop().
  * @cb: function to call once on return
  * @arg: @cb argument
  * @ret: non-NULL value to return from io_loop().
  * @cb: function to call once on return
  * @arg: @cb argument
@@ -310,12 +303,12 @@ void io_wake_(struct io_conn *conn,
  *
  * If io_loop() is called again, then @cb will be called.
  */
  *
  * If io_loop() is called again, then @cb will be called.
  */
-#define io_break(conn, ret, fn, arg)                                   \
-       io_break_((conn), (ret),                                        \
+#define io_break(ret, fn, arg)                                         \
+       io_break_((ret),                                                \
                  typesafe_cb_preargs(struct io_plan, void *,           \
                                      (fn), (arg), struct io_conn *),   \
                  (arg))
                  typesafe_cb_preargs(struct io_plan, void *,           \
                                      (fn), (arg), struct io_conn *),   \
                  (arg))
-struct io_plan io_break_(struct io_conn *conn, void *ret,
+struct io_plan io_break_(void *ret,
                         struct io_plan (*fn)(struct io_conn *, void *),
                         void *arg);
 
                         struct io_plan (*fn)(struct io_conn *, void *),
                         void *arg);
 
index 7c6ae4155f3b052202d6dfb55f02c0b77f28479d..b879a2c832fee1bcc0253bac85e6bb8a2eb3b692 100644 (file)
@@ -17,7 +17,7 @@ static void finish_ok(struct io_conn *conn, int *state)
 {
        ok1(*state == 1);
        (*state)++;
 {
        ok1(*state == 1);
        (*state)++;
-       io_break(conn, state + 1, NULL, NULL);
+       io_break(state + 1, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index 8b96f029825cdfc6490f3470593d448f2d7922dd..e5a6142c9677b411e96cc149180b250477bc95a8 100644 (file)
@@ -15,14 +15,14 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
 {
        ok1(d->state == 0);
        d->state++;
-       return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
+       return io_read(d->buf, sizeof(d->buf), io_close, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index e6e33e3d4baad6d6733bdac2a30de25af35bcb4a..0d5f636ebc6103e0b2504b3ab929644d6ecbf6fe 100644 (file)
@@ -17,14 +17,14 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
        ok1(d->state == 0);
        d->state++;
        d->bytes = sizeof(d->buf);
        ok1(d->state == 0);
        d->state++;
        d->bytes = sizeof(d->buf);
-       return io_read_partial(conn, d->buf, &d->bytes, io_close, d);
+       return io_read_partial(d->buf, &d->bytes, io_close, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index d4e33c9674ecf625edfedd42d703302bc14d85b9..5a5b2506e31525f2fd05b4d8ee05c26db6dbad6c 100644 (file)
@@ -16,14 +16,14 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
 {
        ok1(d->state == 0);
        d->state++;
-       return io_write_partial(conn, d->buf, &d->bytes, io_close, d);
+       return io_write_partial(d->buf, &d->bytes, io_close, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index ad6760e4f09a465baffc241f4bc3a67658497016..07cc3e0d0546cc42f7b8b399e8092f63c7caba4c 100644 (file)
@@ -16,14 +16,14 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
 {
        ok1(d->state == 0);
        d->state++;
-       return io_write(conn, d->buf, d->bytes, io_close, d);
+       return io_write(d->buf, d->bytes, io_close, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index 19d0f8b1a682ddf33f0d9331cb8be8a41d77cfcd..c5fab50b023b9f1cee6965e9b0541303d8a905fa 100644 (file)
@@ -20,7 +20,7 @@ static struct io_plan plan_read(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 2 || d->state == 3);
        d->state++;
 {
        ok1(d->state == 2 || d->state == 3);
        d->state++;
-       return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
+       return io_read(d->buf, sizeof(d->buf), io_close, d);
 }
 
 static struct io_plan start_waker(struct io_conn *conn, struct data *d)
 }
 
 static struct io_plan start_waker(struct io_conn *conn, struct data *d)
@@ -51,14 +51,14 @@ static struct io_plan start_idle(struct io_conn *conn, struct data *d)
        ok1(fd >= 0);
        ok1(io_new_conn(fd, start_waker, finish_waker, d));
 
        ok1(fd >= 0);
        ok1(io_new_conn(fd, start_waker, finish_waker, d));
 
-       return io_idle(conn);
+       return io_idle();
 }
 
 static void finish_idle(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 4);
        d->state++;
 }
 
 static void finish_idle(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 4);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index 5bc0e8c68be8ac4a89debb5f44e67ea3d0a47274..d789659175625da1078450db18912624930115e3 100644 (file)
@@ -15,14 +15,14 @@ static struct io_plan plan_read(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 1);
        d->state++;
 {
        ok1(d->state == 1);
        d->state++;
-       return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
+       return io_read(d->buf, sizeof(d->buf), io_close, d);
 }
 
 static struct io_plan start_break(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
 }
 
 static struct io_plan start_break(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
-       return io_break(conn, d, plan_read, d);
+       return io_break(d, plan_read, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
index 91b335e103216a4b371233d266a36cb0c8216e5f..95a716e2263d26bc65e91d82f818d6a29c276509 100644 (file)
@@ -22,16 +22,14 @@ static struct io_plan plan_read(struct io_conn *conn, struct buffer *buf)
 {
        assert(conn == buf->reader);
 
 {
        assert(conn == buf->reader);
 
-       return io_read(conn, &buf->buf, sizeof(buf->buf),
-                      poke_writer, buf);
+       return io_read(&buf->buf, sizeof(buf->buf), poke_writer, buf);
 }
 
 static struct io_plan plan_write(struct io_conn *conn, struct buffer *buf)
 {
        assert(conn == buf->writer);
 
 }
 
 static struct io_plan plan_write(struct io_conn *conn, struct buffer *buf)
 {
        assert(conn == buf->writer);
 
-       return io_write(conn, &buf->buf, sizeof(buf->buf),
-                       poke_reader, buf);
+       return io_write(&buf->buf, sizeof(buf->buf), poke_reader, buf);
 }
 
 static struct io_plan poke_writer(struct io_conn *conn, struct buffer *buf)
 }
 
 static struct io_plan poke_writer(struct io_conn *conn, struct buffer *buf)
@@ -45,7 +43,7 @@ static struct io_plan poke_writer(struct io_conn *conn, struct buffer *buf)
        io_wake(buf->writer, plan_write, buf);
 
        /* I'll wait until you wake me. */
        io_wake(buf->writer, plan_write, buf);
 
        /* I'll wait until you wake me. */
-       return io_idle(conn);
+       return io_idle();
 }
 
 static struct io_plan poke_reader(struct io_conn *conn, struct buffer *buf)
 }
 
 static struct io_plan poke_reader(struct io_conn *conn, struct buffer *buf)
@@ -58,7 +56,7 @@ static struct io_plan poke_reader(struct io_conn *conn, struct buffer *buf)
                return io_close(conn, NULL);
 
        /* I'll wait until you tell me to write. */
                return io_close(conn, NULL);
 
        /* I'll wait until you tell me to write. */
-       return io_idle(conn);
+       return io_idle();
 }
 
 static struct io_plan reader(struct io_conn *conn, struct buffer *buf)
 }
 
 static struct io_plan reader(struct io_conn *conn, struct buffer *buf)
@@ -66,7 +64,7 @@ static struct io_plan reader(struct io_conn *conn, struct buffer *buf)
        assert(conn == buf->reader);
 
        /* Wait for writer to tell us to read. */
        assert(conn == buf->reader);
 
        /* Wait for writer to tell us to read. */
-       return io_idle(conn);
+       return io_idle();
 }
 
 static struct buffer buf[NUM];
 }
 
 static struct buffer buf[NUM];
index 0cafb4f2454ac0f17bf489dc974129db82a96bca..5b39f38dbc1be78fc7ff26a35fe946203b67f712 100644 (file)
@@ -21,7 +21,7 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 static struct io_plan write_out(struct io_conn *conn, struct data *d)
 {
        d->state++;
 static struct io_plan write_out(struct io_conn *conn, struct data *d)
 {
        d->state++;
-       return io_write(conn, d->wbuf, sizeof(d->wbuf), io_close, d);
+       return io_write(d->wbuf, sizeof(d->wbuf), io_close, d);
 }
 
 static struct io_plan start_ok(struct io_conn *conn, struct data *d)
 }
 
 static struct io_plan start_ok(struct io_conn *conn, struct data *d)
@@ -33,7 +33,7 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
 
        memset(d->wbuf, 7, sizeof(d->wbuf));
        ok1(io_duplex(conn, write_out, finish_ok, d));
 
        memset(d->wbuf, 7, sizeof(d->wbuf));
        ok1(io_duplex(conn, write_out, finish_ok, d));
-       return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
+       return io_read(d->buf, sizeof(d->buf), io_close, d);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
index 178b68a8fc3e045eae109102e41c4552a4b6700a..f83fb31e46a245eeabc854ea7afe9d9deb44d0eb 100644 (file)
@@ -9,7 +9,7 @@
 
 static struct io_plan start(struct io_conn *conn, void *unused)
 {
 
 static struct io_plan start(struct io_conn *conn, void *unused)
 {
-       return io_idle(conn);
+       return io_idle();
 }
 
 int main(void)
 }
 
 int main(void)
index 5e94b8c0168cc22cac6d36c9b4b4e7dc2a6524d1..2f5c60ac7893d79af3787302287c032513e00419 100644 (file)
@@ -35,14 +35,14 @@ static struct io_plan start_ok(struct io_conn *conn, struct data *d)
        ok1(d->state == 0);
        d->state++;
        io_timeout(conn, time_from_usec(d->timeout_usec), timeout, d);
        ok1(d->state == 0);
        d->state++;
        io_timeout(conn, time_from_usec(d->timeout_usec), timeout, d);
-       return io_read(conn, d->buf, sizeof(d->buf), no_timeout, d);
+       return io_read(d->buf, sizeof(d->buf), no_timeout, d);
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 2);
        d->state++;
 }
 
 static void finish_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 2);
        d->state++;
-       io_break(conn, d, NULL, NULL);
+       io_break(d, NULL, NULL);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)