+ return(0); /* probably ok */
+}
+
+
+
+/*
+ * This loop gets called once for every HTTP connection made to WebCit. At
+ * this entry point we have an HTTP socket with a browser allegedly on the
+ * other end, but we have not yet bound to a WebCit session.
+ *
+ * The job of this function is to locate the correct session and bind to it,
+ * or create a session if necessary and bind to it, then run the WebCit
+ * transaction loop. Afterwards, we unbind from the session. When this
+ * function returns, the worker thread is then free to handle another
+ * transaction.
+ */
+void context_loop(int sock)
+{
+ struct httprequest *req = NULL;
+ struct httprequest *last = NULL;
+ struct httprequest *hptr;
+ char buf[SIZ], hold[SIZ];
+ int desired_session = 0;
+ int got_cookie = 0;
+ int gzip_ok = 0;
+ struct wcsession *TheSession, *sptr;
+ char httpauth_string[SIZ];
+ char httpauth_user[SIZ];
+ char httpauth_pass[SIZ];
+ char *ptr = NULL;
+
+ strcpy(httpauth_string, "");
+ strcpy(httpauth_user, DEFAULT_HTTPAUTH_USER);
+ strcpy(httpauth_pass, DEFAULT_HTTPAUTH_PASS);