* here we need to look for StrBufNOTNULL too.
[citadel.git] / webcit / context_loop.c
index 17c549174ebc4f153ade571a6589bcaf3c0a610d..9c1dde0afe7f123332576b7f0aabbdf755661ccf 100644 (file)
@@ -158,6 +158,9 @@ wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
                            (!strcasecmp(ChrPtr(Hdr->c_password), ChrPtr(sptr->wc_password))) ) {
                                TheSession = sptr;
                        }
+                       if (TheSession == NULL)
+                               lprintf(1, "found sessionkey [%ld], but credentials for [%s|%s] didn't match\n",
+                                       Hdr->HR.SessionKey,ChrPtr(Hdr->c_username), ChrPtr(sptr->wc_username));
                        break;
                case AUTH_COOKIE:
                        /* If cookie-session, look for a session with matching session ID */
@@ -171,6 +174,9 @@ wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
                }
        }
        pthread_mutex_unlock(ListMutex);
+       if (TheSession == NULL)
+               lprintf(1, "didn't find sessionkey [%ld] for user [%s]\n",
+                       Hdr->HR.SessionKey,ChrPtr(Hdr->c_username));
        return TheSession;
 }
 
@@ -313,7 +319,7 @@ int ReadHttpSubject(ParsedHttpHdrs *Hdr, StrBuf *Line, StrBuf *Buf)
                break;
        } while (1);
        /* remove the handlername from the URL */
-       if (Pos != NULL) {
+       if ((Pos != NULL) && (Pos != StrBufNOTNULL)){
                StrBufCutLeft(Hdr->HR.ReqLine, 
                              Pos - ChrPtr(Hdr->HR.ReqLine));
        }