chiark / gitweb /
wip compile
[innduct.git] / backends / innduct.c
index 018d6bca9adfdba6d6bf37b2501365d8f9218612..8942f6e560ed4247f45823d812e6dec69e27361f 100644 (file)
@@ -270,6 +270,8 @@ static void queue_check_input_done(void);
 static void postfork(const char *what);
 static void postfork_inputfile(InputFile *ipf);
 
+static void open_defer(void);
+
 /*----- configuration options -----*/
 
 static char *sitename, *feedfile;
@@ -738,6 +740,12 @@ static void *connchild_event(oop_source *lp, int fd, oop_event e, void *u) {
   connect_attempt_discard();
 }
 
+static int allow_connect_start(void) {
+  return conns.count < max_connections
+    && !connecting_child
+    && !until_connect;
+}
+
 static void connect_start(void) {
   assert(!connecting_sockets[0]);
   assert(!connecting_sockets[1]);
@@ -861,8 +869,7 @@ static void check_master_queue(void) {
        spare--;
       }
       conn_maybe_write(use);
-    } else if (conns.count < max_connections &&
-            !connecting_child && !until_connect) {
+    } else if (allow_connect_start()) {
       until_connect= reconnect_delay_periods;
       connect_start();
       break;
@@ -1013,8 +1020,8 @@ static void conn_make_some_xmits(Conn *conn) {
     if (conn->xmitu+5 > CONNIOVS)
       break;
 
-    Article *art= LIST_REMHEAD(priority);
-    if (!art) art= LIST_REMHEAD(waiting);
+    Article *art= LIST_REMHEAD(conn->priority);
+    if (!art) art= LIST_REMHEAD(conn->waiting);
     if (!art) break;
 
     if (art->state >= art_Wanted || (conn->stream && nocheck)) {
@@ -1056,7 +1063,7 @@ static void conn_make_some_xmits(Conn *conn) {
       XMIT_LITERAL("\r\n");
 
       assert(art->state == art_Unchecked);
-      art->ipf->counts[art->state][RCI_sent]++;
+      art->ipf->counts[art->state][RC_sent]++;
       LIST_ADDTAIL(conn->sent, art);
     }
   }