* check for WC in conditionals...
authorWilfried Göesgens <willi@citadel.org>
Sun, 24 May 2009 22:02:46 +0000 (22:02 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 24 May 2009 22:02:46 +0000 (22:02 +0000)
* create session header hashlist earlier so it frees the first http line on exit

webcit/auth.c
webcit/context_loop.c
webcit/messages.c

index a751b89d8137e778860537a9422a3020d01e19c3..22dbcfbf29911dba2adc680d3c004189487f6a80 100644 (file)
@@ -882,21 +882,25 @@ void changepw(void)
 
 int ConditionalAide(StrBuf *Target, WCTemplputParams *TP)
 {
-       return (WC->is_aide == 0);
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WC->is_aide == 0) : 0;
 }
 
 int ConditionalRoomAide(StrBuf *Target, WCTemplputParams *TP)
 {
-       return (WC->is_room_aide == 0);
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WCC->is_room_aide == 0) : 0;
 }
 
-int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) {
-  return (WC->logged_in == 0);
+int ConditionalIsLoggedIn(StrBuf *Target, WCTemplputParams *TP) 
+{
+       wcsession *WCC = WC;
+       return (WCC != NULL)? (WCC->logged_in == 0) : 0;
 }
 int ConditionalRoomAcessDelete(StrBuf *Target, WCTemplputParams *TP)
 {
        wcsession *WCC = WC;
-       return ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) );
+       return (WCC != NULL)? ( (WCC->is_room_aide) || (WCC->is_mailbox) || (WCC->room_flags2 & QR2_COLLABDEL) ) : 0;
 }
 
 
index abe5dd3635e4f2bcda6e7d379816ddd3b5a2e3e5..6c07a9c095e3a6d998479998a73dd610e75fde45 100644 (file)
@@ -243,7 +243,6 @@ int ReadHttpSubject(ParsedHttpHdrs *Hdr, StrBuf *Line, StrBuf *Buf)
                Hdr->HR.DontNeedAuth = (Hdr->HR.Handler->Flags & ISSTATIC) != 0;
        }
 
-       Hdr->HTTPHeaders = NewHash(1, NULL);
        return 0;
 }
 
@@ -294,6 +293,7 @@ int ReadHTTPRequset (ParsedHttpHdrs *Hdr)
                        continue;
                }
                if (nLine == 1) {
+                       Hdr->HTTPHeaders = NewHash(1, NULL);
                        pHdr = (OneHttpHeader*) malloc(sizeof(OneHttpHeader));
                        memset(pHdr, 0, sizeof(OneHttpHeader));
                        pHdr->Val = Line;
index a3bca061a13ec2d54410d6b39015cfcdb7a03425..eb3f945709baba14f40e41896effd1f9f76313a9 100644 (file)
@@ -870,9 +870,9 @@ void readloop(long oper)
                WCC->wc_view = VIEW_MAILBOX;
 
        if (!WCC->is_ajax) {
-       output_headers(1, 1, 1, 0, 0, 0);
+               output_headers(1, 1, 1, 0, 0, 0);
        } else if (WCC->wc_view == VIEW_MAILBOX) {
-         jsonMessageListHdr();
+               jsonMessageListHdr();
        }
 
        switch (WCC->wc_view) {