* fixes
[citadel.git] / webcit / context_loop.c
index 452edd2f0ba87bb87f1f55ad213a44bef7689c28..41d39bd1e37169381e58a3c659f49d1a7e9d1bec 100644 (file)
@@ -92,15 +92,21 @@ void do_housekeeping(void)
                pthread_mutex_lock(&sessions_to_kill->SessionMutex);
                close(sessions_to_kill->serv_sock);
                close(sessions_to_kill->chat_sock);
-               if (sessions_to_kill->preferences != NULL) {
-                       free(sessions_to_kill->preferences);
-               }
+//             if (sessions_to_kill->preferences != NULL) {
+//                     free(sessions_to_kill->preferences);
+//             }
                if (sessions_to_kill->cache_fold != NULL) {
                        free(sessions_to_kill->cache_fold);
                }
                free_attachments(sessions_to_kill);
                free_march_list(sessions_to_kill);
-               clear_substs(sessions_to_kill);
+               DeleteHash(&(sessions_to_kill->hash_prefs));
+               DeleteHash(&(sessions_to_kill->IconBarSetttings));
+               FreeStrBuf(&(sessions_to_kill->UrlFragment1));
+               FreeStrBuf(&(sessions_to_kill->UrlFragment2));
+               FreeStrBuf(&(sessions_to_kill->WBuf));
+               FreeStrBuf(&(sessions_to_kill->HBuf));
+
                pthread_mutex_unlock(&sessions_to_kill->SessionMutex);
                sptr = sessions_to_kill->next;
                free(sessions_to_kill);
@@ -372,10 +378,16 @@ void context_loop(int sock)
                strcpy(ptr+1, ptr+8);
        }
 
-       /** Begin parsing the request. */
-
        safestrncpy(buf, req->line, sizeof buf);
-       lprintf(5, "HTTP: %s\n", buf);
+       /** Begin parsing the request. */
+#ifdef TECH_PREVIEW
+       if ((strncmp(req->line+4, "/sslg", 5) != 0) &&
+           (strncmp(req->line+4, "/wholist_section", 16) != 0)) {
+#endif
+               lprintf(5, "HTTP: %s\n", buf);
+#ifdef TECH_PREVIEW
+       }
+#endif
 
        /** Check for bogus requests */
        if (is_bogus(buf)) {
@@ -471,9 +483,13 @@ void context_loop(int sock)
 
                strcpy(TheSession->httpauth_user, httpauth_user);
                strcpy(TheSession->httpauth_pass, httpauth_pass);
+               TheSession->hash_prefs = NewHash(1,NULL);       /* Get a hash table for the user preferences */
                pthread_mutex_init(&TheSession->SessionMutex, NULL);
                pthread_mutex_lock(&SessionListMutex);
+               TheSession->urlstrings = NULL;
+               TheSession->vars = NULL;
                TheSession->nonce = rand();
+               TheSession->WBuf = NULL;
                TheSession->next = SessionList;
                SessionList = TheSession;
                pthread_mutex_unlock(&SessionListMutex);
@@ -490,6 +506,9 @@ void context_loop(int sock)
         */
        pthread_mutex_lock(&TheSession->SessionMutex);          /* bind */
        pthread_setspecific(MyConKey, (void *)TheSession);
+       
+       TheSession->urlstrings = NewHash(1,NULL);
+       TheSession->vars = NewHash(1,NULL);
        TheSession->http_sock = sock;
        TheSession->lastreq = time(NULL);                       /* log */
        TheSession->gzip_ok = gzip_ok;
@@ -503,6 +522,12 @@ void context_loop(int sock)
 #ifdef ENABLE_NLS
        stop_selected_language();                               /* unset locale */
 #endif
+       DeleteHash(&TheSession->urlstrings);
+       DeleteHash(&TheSession->vars);
+       FreeStrBuf(&TheSession->WBuf);
+       FreeStrBuf(&TheSession->HBuf);
+       
+       
        pthread_mutex_unlock(&TheSession->SessionMutex);        /* unbind */
 
        /* Free the request buffer */
@@ -516,5 +541,6 @@ void context_loop(int sock)
         * Free up any session-local substitution variables which
         * were set during this transaction
         */
-       clear_local_substs();
+       
+       
 }