]> code.citadel.org Git - citadel.git/blobdiff - citadel/context.h
Use IOBuffer with its StrBuf + const char* inside instead of having two of them
[citadel.git] / citadel / context.h
index 7a71d3b96eb04c79bed04a840b071a75995f5ec9..3c47c62c39b3bd98afa83d201c345d1efd9f92a1 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: sysdep_decls.h 7265 2009-03-25 23:18:46Z dothebart $ */
 
 #ifndef CONTEXT_H
 #define CONTEXT_H
@@ -28,13 +27,13 @@ struct CitContext {
        int state;              /* thread state (see CON_ values below) */
        int kill_me;            /* Set to nonzero to flag for termination */
 
-       const char *Pos;        /* Our read position inside of the ReadBuf */
-       StrBuf *ReadBuf;        /* Our block buffered read buffer */
-       StrBuf *MigrateBuf;        /* Our block buffered read buffer */
+       IOBuffer SendBuf, /* Our write Buffer */
+               RecvBuf, /* Our block buffered read buffer */
+               SBuf; /* Our block buffered read buffer for clients */
 
-       const char *sPos;        /* Our read position inside of the ReadBuf */
-       StrBuf *sReadBuf;        /* Our block buffered read buffer */
+       StrBuf *MigrateBuf;        /* Our block buffered read buffer */
        StrBuf *sMigrateBuf;        /* Our block buffered read buffer */
+
        int client_socket;
        int is_local_socket;    /* set to 1 if client is on unix domain sock */
        /* Redirect this session's output to a memory buffer? */
@@ -64,6 +63,7 @@ struct CitContext {
        int cs_clientdev;       /* client developer ID */
        int cs_clienttyp;       /* client type code */
        int cs_clientver;       /* client version number */
+       char cs_clientinfo[256];/* if its a unix domain socket, some info for logging. */
        uid_t cs_UDSclientUID;  /* the uid of the client when talking via UDS */
        char cs_clientname[32]; /* name of client software */
        char cs_host[64];       /* host logged in from */
@@ -158,6 +158,9 @@ void InitializeMasterCC(void);
 void dead_session_purge(int force);
 void set_async_waiting(struct CitContext *ccptr);
 
+/* forcibly close and flush fd's on shutdown */
+void terminate_stuck_sessions(void);
+
 /* Deprecated, user CtdlBumpNewMailCounter() instead */
 void BumpNewMailCounter(long) __attribute__ ((deprecated));