]> code.citadel.org Git - citadel.git/blobdiff - webcit/context_loop.c
* temporary solution to our ser_readln migration: have a buffer on the session, read...
[citadel.git] / webcit / context_loop.c
index c844f65a74075df3f876029f66cd12ea26239dc2..39a85d5c94bd2392533d88849664257b2f91d12e 100644 (file)
@@ -52,6 +52,9 @@ void DestroySession(wcsession **sessions_to_kill)
        FreeStrBuf(&((*sessions_to_kill)->wc_roomname));
        FreeStrBuf(&((*sessions_to_kill)->httpauth_user));
        FreeStrBuf(&((*sessions_to_kill)->httpauth_pass));
+       FreeStrBuf(&((*sessions_to_kill)->ImportantMsg));
+       FreeStrBuf(&((*sessions_to_kill)->cs_inet_email));
+       FreeStrBuf(&((*sessions_to_kill)->MigrateReadLineBuf));
        free((*sessions_to_kill));
        (*sessions_to_kill) = NULL;
 }
@@ -514,6 +517,9 @@ void context_loop(int *sock)
                }
                else TheSession->httpauth_pass = NewStrBufPlain(httpauth_user, -1);
 
+               if (TheSession->MigrateReadLineBuf != NULL)
+                       FlushStrBuf(TheSession->MigrateReadLineBuf);
+               else TheSession->MigrateReadLineBuf = NewStrBuf();
                TheSession->CLineBuf = NewStrBuf();
                TheSession->hash_prefs = NewHash(1,NULL);       /* Get a hash table for the user preferences */
                pthread_mutex_init(&TheSession->SessionMutex, NULL);
@@ -537,6 +543,8 @@ void context_loop(int *sock)
        pthread_mutex_lock(&TheSession->SessionMutex);          /* bind */
        pthread_setspecific(MyConKey, (void *)TheSession);
        
+       if (TheSession->ImportantMsg == NULL)
+               TheSession->ImportantMsg = NewStrBuf();
        TheSession->urlstrings = NewHash(1,NULL);
        TheSession->vars = NewHash(1,NULL);
        TheSession->http_sock = *sock;