- conn_check_work(last_assigned);
-}
-
-static void conn_assign_one_article(ConnList *connlist, Conn **last_assigned) {
- Conn *conn= connlist->head;
-
- LIST_REMOVE(*connlist, conn);
- Article *art= LIST_REMHEAD(queue);
- LIST_ADDTAIL(conn->queue, art);
- LIST_ADDTAIL(*conn_determine_right_list(conn), conn);
-
- /* This slightly odd arrangement is so that we call conn_check_work
- * once after filling the queue for a new connection in
- * check_master_queue, rather than for each article. */
- if (conn != *last_assigned && *last_assigned)
- conn_check_work(*last_assigned);
- *last_assigned= conn;
-}
-
-static ConnList *conn_determine_right_list(Conn *conn) {
- int inqueue= conn_owned_articles(conn);
- assert(inqueue <= max_queue_per_conn);
- if (inqueue == 0) return &idle;
- if (inqueue == conn->max_queue) return &full;
- return &working;