From f8f14fab4d4a851c271528df8f0a33a2a17e5b04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 24 May 2009 22:02:46 +0000 Subject: [PATCH] * check for WC in conditionals... * create session header hashlist earlier so it frees the first http line on exit --- webcit/auth.c | 14 +++++++++----- webcit/context_loop.c | 2 +- webcit/messages.c | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/webcit/auth.c b/webcit/auth.c index a751b89d8..22dbcfbf2 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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; } diff --git a/webcit/context_loop.c b/webcit/context_loop.c index abe5dd363..6c07a9c09 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -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; diff --git a/webcit/messages.c b/webcit/messages.c index a3bca061a..eb3f94570 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -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) { -- 2.30.2