]> code.citadel.org Git - citadel.git/commitdiff
* Finished the overhaul. Now to tune...
authorArt Cancro <ajc@citadel.org>
Sat, 4 Dec 1999 21:56:59 +0000 (21:56 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 4 Dec 1999 21:56:59 +0000 (21:56 +0000)
webcit/ChangeLog
webcit/context_loop.c

index b7155f4595fee681d2f06578d98e1fa0b46cd0c4..c4a2470a87ec324ccc0eb0e8ca48f5b75ffad75e 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 1.112  1999/12/04 21:56:59  ajc
+* Finished the overhaul.  Now to tune...
+
 Revision 1.111  1999/12/03 17:59:53  ajc
 * BROKEN BUILD.  Wrote most of the session removal code, but some of it is
   pseudocode so the build is currently broken.
@@ -331,5 +334,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
-
index fce94fb86c928463a84e5408474e5b98f2943f03..3f6055a9a3670bd8d02d8543f095952e575993c3 100644 (file)
@@ -47,7 +47,7 @@ pthread_key_t MyConKey;                         /* TSD key for MySession() */
 
 void do_housekeeping(void)
 {
-       struct wcsession *sptr, *session_to_kill;
+       struct wcsession *sptr, *ss, *session_to_kill;
 
        do {
                session_to_kill = NULL;
@@ -62,7 +62,17 @@ void do_housekeeping(void)
 
                        /* Remove sessions flagged for kill */
                        if (sptr->killthis) {
-                               remove session from linked list
+
+                               /* remove session from linked list */
+                               if (sptr == SessionList) {
+                                       SessionList = SessionList->next;
+                               }
+                               else for (ss=SessionList;ss!=NULL;ss=ss->next) {
+                                       if (ss->next == sptr) {
+                                               ss->next = ss->next->next;
+                                       }
+                               }
+
                                session_to_kill = sptr;
                                goto BREAKOUT;
                        }
@@ -209,8 +219,6 @@ void context_loop(int sock)
        int got_cookie = 0;
        struct wcsession *TheSession, *sptr;
 
-       fprintf(stderr, "Reading request from socket %d\n", sock);
-
        /*
         * Find out what it is that the web browser is asking for
         */
@@ -308,7 +316,7 @@ void context_loop(int sock)
        pthread_setspecific(MyConKey, (void *)TheSession);
        TheSession->http_sock = sock;
        TheSession->lastreq = time(NULL);                       /* log */
-       fprintf(stderr, "Transaction: %s\n", req->line);
+       fprintf(stderr, "%s\n", req->line);
        session_loop(req);              /* perform the requested transaction */
        pthread_mutex_unlock(&TheSession->SessionMutex);        /* unbind */
 
@@ -323,7 +331,5 @@ void context_loop(int sock)
         * Now our HTTP connection is done.  Close the socket and exit this
         * function, so the worker thread can handle a new HTTP connection.
         */
-       printf("   Closing socket %d ... ret=%d\n", sock,
-              lingering_close(sock));
-       return;
+       lingering_close(sock);
 }