]> code.citadel.org Git - citadel.git/blobdiff - citadel/context.h
* Rewrote vCtdlLogPrintf() to NOT use any buffers at all, only v*printf() type functi...
[citadel.git] / citadel / context.h
index ddf8d6ca136f57d8c550eb969ce46a6d2f9e8d9f..7a71d3b96eb04c79bed04a840b071a75995f5ec9 100644 (file)
@@ -38,9 +38,7 @@ struct CitContext {
        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? */
-       char *redirect_buffer;          /* the buffer */
-       size_t redirect_len;            /* length of data in buffer */
-       size_t redirect_alloc;          /* length of allocated buffer */
+       StrBuf *redirect_buffer;                /* the buffer */
 #ifdef HAVE_OPENSSL
        SSL *ssl;
        int redirect_ssl;
@@ -156,7 +154,6 @@ void RemoveContext (struct CitContext *);
 CitContext *CreateNewContext (void);
 void context_cleanup(void);
 void kill_session (int session_to_kill);
-INLINE void become_session(struct CitContext *which_con);
 void InitializeMasterCC(void);
 void dead_session_purge(int force);
 void set_async_waiting(struct CitContext *ccptr);
@@ -171,4 +168,22 @@ int CtdlTerminateOtherSession (int session_num);
 #define TERM_ALLOWED   0x02
 #define TERM_KILLED    0x03
 #define TERM_NOTALLOWED -1
+
+/*
+ * Bind a thread to a context.  (It's inline merely to speed things up.)
+ */
+static INLINE void become_session(CitContext *which_con) {
+/*
+       pid_t tid = syscall(SYS_gettid);
+*/
+       citthread_setspecific(MyConKey, (void *)which_con );
+/*
+       CtdlLogPrintf(CTDL_DEBUG, "[%d]: Now doing %s\n", 
+                     (int) tid, 
+                     ((which_con != NULL) && (which_con->ServiceName != NULL)) ? 
+                     which_con->ServiceName:"");
+*/
+}
+
+
 #endif /* CONTEXT_H */