]> code.citadel.org Git - citadel.git/blobdiff - citadel/context.c
* Changed some instances of 'struct CitContext *CCC = CC;' to 'struct CitContext...
[citadel.git] / citadel / context.c
index b00f6c07c98bffab2183807f825f72e701b03a08..fb4a5dd11f9a68537204b958c5e7362a7b1aa750 100644 (file)
@@ -367,7 +367,6 @@ CitContext *CreateNewContext(void) {
                return NULL;
        }
        memset(me, 0, sizeof(CitContext));
-       
        /* Give the contaxt a name. Hopefully makes it easier to track */
        strcpy (me->user.fullname, "SYS_notauth");
        
@@ -439,6 +438,8 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        strcpy (sysname, "SYS_");
        strcat (sysname, name);
        len = cutuserkey(sysname);
+       memcpy(context->curr_user, sysname, len + 1);
+
        /* internal_create_user has the side effect of loading the user regardless of wether they
         * already existed or needed to be created
         */
@@ -455,6 +456,17 @@ void CtdlFillSystemContext(CitContext *context, char *name)
        }
 }
 
+/*
+ * flush it again...
+ */
+void CtdlClearSystemContext(void)
+{
+       CitContext *CCC = MyContext();
+
+       memset(CCC, 0, sizeof(CitContext));
+       citthread_setspecific(MyConKey, NULL);
+}
+
 /*
  * Cleanup any contexts that are left lying around
  */
@@ -583,22 +595,6 @@ void InitializeMasterCC(void) {
 
 
 
-/*
- * Bind a thread to a context.  (It's inline merely to speed things up.)
- */
-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:"");
-*/
-}
-
 
 /*
  * Set the "async waiting" flag for a session, if applicable