X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=innduct.h;h=273fb5ec7758df00f196a34dfe8580621b45c5c4;hb=e5fb267af59e9beea66c88e32d9809824c062886;hp=fc04d8a6688d93ba10c65d352e5ccc57f54077ff;hpb=c2ec61d4f426a04f288559c5ad50df822b7dcfb8;p=innduct.git diff --git a/innduct.h b/innduct.h index fc04d8a..273fb5e 100644 --- a/innduct.h +++ b/innduct.h @@ -84,8 +84,10 @@ #define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v); -#define FOR_CONN(conn) \ - for ((conn)=LIST_HEAD(conns); (conn); (conn)=LIST_NEXT((conn))) +#define FOR_LIST_NODE(nodevar, list) \ + for ((nodevar)=LIST_HEAD(list); (nodevar); (nodevar)=LIST_NEXT((nodevar))) + +#define FOR_CONN(conn) FOR_LIST_NODE(conn, conns) /*----- doubly linked lists -----*/ @@ -327,7 +329,8 @@ char *xasprintf(const char *fmt, ...) PRINTF(1,2); int close_perhaps(int *fd); void xclose(int fd, const char *what, const char *what2); void xclose_perhaps(int *fd, const char *what, const char *what2); -pid_t xfork(const char *what); +pid_t xfork(const char *what); /* also runs postfork in child */ +pid_t xfork_bare(const char *what); void on_fd_read_except(int fd, oop_call_fd callback); void cancel_fd_read_except(int fd); @@ -391,6 +394,10 @@ void conn_dispose(Conn *conn); void vconnfail(Conn *conn, const char *fmt, va_list al) PRINTF(2,0); void connfail(Conn *conn, const char *fmt, ...) PRINTF(2,3); +void notice_conns_more(const char *new_kind); +void notice_conns_fewer(void); +void notice_conns_stats(void); + int allow_connect_start(void); void connect_start(void);