#include <sys/wait.h>
#include <stdio.h>
-static struct io_op *start_ok(struct io_conn *conn, int *state)
+static struct io_plan start_ok(struct io_conn *conn, int *state)
{
ok1(*state == 0);
(*state)++;
{
ok1(*state == 1);
(*state)++;
- io_break(state + 1, NULL);
+ io_break(state + 1, NULL, NULL);
+}
+
+static void init_conn(int fd, int *state)
+{
+ if (!io_new_conn(fd, start_ok, finish_ok, state))
+ abort();
}
static int make_listen_fd(const char *port, struct addrinfo **info)
plan_tests(9);
fd = make_listen_fd("65001", &addrinfo);
ok1(fd >= 0);
- l = io_new_listener(fd, start_ok, finish_ok, &state);
+ l = io_new_listener(fd, init_conn, &state);
ok1(l);
fflush(stdout);
if (!fork()) {