chiark / gitweb /
rm some todos
[innduct.git] / backends / innduct.c
index 8104fee469826eb8e83f0b0480e3ecdfd35ab660..d59d888362c3fd838ecab027abec067ab0826f37 100644 (file)
  *  with GPLv3.  If not then please let me know.  -Ian Jackson.)
  */
 
-/*
- * todo
- *
- *  don't mind reconnecting if we just disconnected due to idle
- *  some weird disconnection event still investigating
- */
-
 /*
  * Newsfeeds file entries should look like this:
  *     host.name.of.site[/exclude,exclude,...]\
@@ -511,6 +504,7 @@ struct Conn {
   ISNODE(Conn);
   int fd; /* may be 0, meaning closed (during construction/destruction) */
   oop_read *rd; /* likewise */
+  int oopwriting; /* since on_fd is not idempotent */
   int max_queue, stream;
   const char *quitting;
   int since_activity; /* periods */
@@ -1547,12 +1541,16 @@ static void conn_maybe_write(Conn *conn)  {
     conn_make_some_xmits(conn);
     if (!conn->xmitu) {
       loop->cancel_fd(loop, conn->fd, OOP_WRITE);
+      conn->oopwriting= 0;
       return;
     }
 
     void *rp= conn_write_some_xmits(conn);
     if (rp==OOP_CONTINUE) {
-      loop->on_fd(loop, conn->fd, OOP_WRITE, conn_writeable, conn);
+      if (!conn->oopwriting) {
+       loop->on_fd(loop, conn->fd, OOP_WRITE, conn_writeable, conn);
+       conn->oopwriting= 1;
+      }
       return;
     } else if (rp==OOP_HALT) {
       return;