X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/blobdiff_plain/832a2ab6980070401d02e0143a2bd3ece7a3e9db..06b2a088f26208fa8974f8326f01fdfa7908f08b:/tripe.h diff --git a/tripe.h b/tripe.h index 9f7fd5d7..7f5e48c1 100644 --- a/tripe.h +++ b/tripe.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: tripe.h,v 1.5 2001/02/16 21:41:43 mdw Exp $ + * $Id: tripe.h,v 1.6 2001/02/19 19:11:09 mdw Exp $ * * Main header file for TrIPE * @@ -29,6 +29,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: tripe.h,v $ + * Revision 1.6 2001/02/19 19:11:09 mdw + * Output buffering on admin connections. + * * Revision 1.5 2001/02/16 21:41:43 mdw * Major changes. See source files for details. * @@ -405,21 +408,34 @@ typedef struct peer { /* --- Admin structure --- */ +#define OBUFSZ 16384u + +typedef struct obuf { + struct obuf *next; /* Next buffer in list */ + char *p_in, *p_out; /* Pointers into the buffer */ + char buf[OBUFSZ]; /* The actual buffer */ +} obuf; + typedef struct admin { struct admin *next, *prev; /* Links to next and previous */ - selbuf b; /* Line buffer for commands */ - int fd; /* File descriptor for output */ + unsigned f; /* Various useful flags */ #ifndef NTRACE unsigned seq; /* Sequence number for tracing */ #endif char *pname; /* Peer name to create */ char *paddr; /* Address string to resolve */ + obuf *o_head, *o_tail; /* Output buffer list */ + selbuf b; /* Line buffer for commands */ + sel_file w; /* Selector for write buffering */ bres_client r; /* Background resolver task */ sel_timer t; /* Timer for resolver */ addr peer; /* Address to set */ size_t sasz; /* Size of the address */ } admin; +#define AF_DEAD 1u /* Destroy this admin block */ +#define AF_LOCK 2u /* Don't destroy it yet */ + /*----- Global variables --------------------------------------------------*/ extern sel_state sel; /* Global I/O event state */