* just calculate the language for non-static requests; else we will run this useless...
authorWilfried Göesgens <willi@citadel.org>
Thu, 5 Nov 2009 22:22:19 +0000 (22:22 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 5 Nov 2009 22:22:19 +0000 (22:22 +0000)
struct change -> make clean

webcit/context_loop.c
webcit/gettext.c
webcit/webcit.h

index 4c322eb7c3866249a978d2971b64d9b95f51ba30..43adf38dd536b6eed464f2c850599b9486687e93 100644 (file)
@@ -177,7 +177,7 @@ wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
        return TheSession;
 }
 
-wcsession *CreateSession(int Lockable, wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t *ListMutex)
+wcsession *CreateSession(int Lockable, int Static, wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t *ListMutex)
 {
        wcsession *TheSession;
        lprintf(3, "Creating a new session\n");
@@ -203,7 +203,7 @@ wcsession *CreateSession(int Lockable, wcsession **wclist, ParsedHttpHdrs *Hdr,
        else {
                TheSession->wc_session = Hdr->HR.desired_session;
        }
-
+       Hdr->HR.Static = Static;
        session_new_modules(TheSession);
 
        if (Lockable) {
@@ -487,7 +487,7 @@ void context_loop(ParsedHttpHdrs *Hdr)
        {
                wcsession *Bogus;
 
-               Bogus = CreateSession(0, NULL, Hdr, NULL);
+               Bogus = CreateSession(0, 1, NULL, Hdr, NULL);
 
                do_404();
 
@@ -505,7 +505,7 @@ void context_loop(ParsedHttpHdrs *Hdr)
        if ((Hdr->HR.Handler != NULL) && ((Hdr->HR.Handler->Flags & ISSTATIC) != 0))
        {
                wcsession *Static;
-               Static = CreateSession(0, NULL, Hdr, NULL);
+               Static = CreateSession(0, 1, NULL, Hdr, NULL);
                
                Hdr->HR.Handler->F();
 
@@ -540,7 +540,7 @@ void context_loop(ParsedHttpHdrs *Hdr)
         * Create a new session if we have to
         */
        if (TheSession == NULL) {
-               TheSession = CreateSession(1, &SessionList, Hdr, &SessionListMutex);
+               TheSession = CreateSession(1, 0, &SessionList, Hdr, &SessionListMutex);
 
                if ((StrLength(Hdr->c_username) == 0) && (!Hdr->HR.DontNeedAuth)) {
 
index 9d50582f14b5ac4cad0f0f3b98586627fc57efe8..e38d269ac25bb35c76ce31ec798bdf9c60a2f928 100644 (file)
@@ -436,7 +436,8 @@ SessionNewModule_GETTEXT
 (wcsession *sess)
 {
 #ifdef ENABLE_NLS
-       if (sess->Hdr->HR.browser_language != NULL) {
+       if (!sess->Hdr->HR.Static && 
+           (sess->Hdr->HR.browser_language != NULL)) {
                httplang_to_locale(sess->Hdr->HR.browser_language, sess);
        }
 #endif
index 745b152a312a26e247d069b084c15541fcbea042..3dc49116f4a6856c8d5b0dd120b3afce1330392d 100644 (file)
@@ -379,6 +379,7 @@ typedef struct _HdrRefs {
        int gzip_ok;                            /* Nonzero if Accept-encoding: gzip */
        int prohibit_caching;
        int dav_depth;
+       int Static;
 
        /* these are references into Hdr->HTTPHeaders, so we don't need to free them. */
        StrBuf *ContentType;