chiark / gitweb /
Write a pidfile on request, and delete it when finished.
[tripe] / tripe.h
diff --git a/tripe.h b/tripe.h
index 9f7fd5d719ff9678102e258b7c807847e13886f8..7f5e48c1bae6ea465983791e2af4f7f5ef7c7e96 100644 (file)
--- 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 */