]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-14-duplex-both-read.c
Revert "io: closing one side of a duplex connection closes both."
[ccan] / ccan / io / test / run-14-duplex-both-read.c
index 366f1d44bbaafdf65c09baa1942a490df6c60053..d1868e2ee63e562f319e7963bfa10c6f0bacaa2b 100644 (file)
@@ -12,8 +12,6 @@
 #define PORT "65014"
 #endif
 
-#define is_idle(conn) ((conn)->plan.io == NULL)
-
 struct data {
        struct io_listener *l;
        int state;
@@ -30,16 +28,7 @@ static void finish_ok(struct io_conn *conn, struct data *d)
 static struct io_plan end(struct io_conn *conn, struct data *d)
 {
        d->state++;
-
-       /* last one out closes. */
-       if (conn == d->c1 && is_idle(d->c2))
-               return io_close();
-
-       /* last one out closes. */
-       if (conn == d->c2 && is_idle(d->c1))
-               return io_close();
-
-       return io_idle();
+       return io_close();
 }
 
 static struct io_plan make_duplex(struct io_conn *conn, struct data *d)