* Original startup thread becomes a worker thread after initialization.
authorArt Cancro <ajc@citadel.org>
Sat, 20 Mar 2004 05:03:14 +0000 (05:03 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 20 Mar 2004 05:03:14 +0000 (05:03 +0000)
  Doing otherwise turns it into a zombie (at least on Linux) and possibly
  leads to other problems
* Filter out NOOP's received in chat

webcit/ChangeLog
webcit/paging.c
webcit/webserver.c

index a1cc91fcba0403899484eed95d8380563574d56b..74e7fa14109837aab41a1bdfe959a3d789c6f966 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 505.20  2004/03/20 05:03:14  ajc
+* Original startup thread becomes a worker thread after initialization.
+  Doing otherwise turns it into a zombie (at least on Linux) and possibly
+  leads to other problems
+* Filter out NOOP's received in chat
+
 Revision 505.19  2004/03/18 04:32:24  ajc
 * Removed the language in README.TXT which told everyone that chat wouldn't
   work with a non-local Citadel server, because that's no longer true.
@@ -1740,4 +1746,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 7b149e93281ddee47f58512c0ae541dba593c436..6a3625d33d5a88ad30457c3ec7678ca36bc7890c 100644 (file)
@@ -337,52 +337,55 @@ void chat_recv(void) {
                        extract_token(cl_user, buf, 0, '|');
                        extract_token(cl_text, buf, 1, '|');
 
-                       wprintf("parent.chat_transcript.document.write('");
+                       if (strcasecmp(cl_text, "NOOP")) {
 
-                       if (strcasecmp(cl_user, WC->last_chat_user)) {
-                               wprintf("<TABLE border=0 WIDTH=100%% "
-                                       "CELLSPACING=1 CELLPADDING=0 "
-                                       "BGCOLOR=&quot;#FFFFFF&quot;>"
-                                       "<TR><TD></TR></TD></TABLE>"
-                               );
-
-                       }
-
-                       wprintf("<TABLE border=0 WIDTH=100%% "
-                               "CELLSPACING=0 CELLPADDING=0 "
-                               "BGCOLOR=&quot;#EEEEEE&quot;>");
-
-                       wprintf("<TR><TD>");
-
-                       if (!strcasecmp(cl_user, ":")) {
-                               wprintf("<I>");
-                       }
+                               wprintf("parent.chat_transcript.document.write('");
+       
+                               if (strcasecmp(cl_user, WC->last_chat_user)) {
+                                       wprintf("<TABLE border=0 WIDTH=100%% "
+                                               "CELLSPACING=1 CELLPADDING=0 "
+                                               "BGCOLOR=&quot;#FFFFFF&quot;>"
+                                               "<TR><TD></TR></TD></TABLE>"
+                                       );
+       
+                               }
 
-                       if (strcasecmp(cl_user, WC->last_chat_user)) {
-                               wprintf("<B>");
+                               wprintf("<TABLE border=0 WIDTH=100%% "
+                                       "CELLSPACING=0 CELLPADDING=0 "
+                                       "BGCOLOR=&quot;#EEEEEE&quot;>");
+       
+                               wprintf("<TR><TD>");
+       
+                               if (!strcasecmp(cl_user, ":")) {
+                                       wprintf("<I>");
+                               }
 
-                               if (!strcasecmp(cl_user, WC->wc_username)) {
-                                       wprintf("<FONT COLOR=&quot;#FF0000&quot;>");
+                               if (strcasecmp(cl_user, WC->last_chat_user)) {
+                                       wprintf("<B>");
+       
+                                       if (!strcasecmp(cl_user, WC->wc_username)) {
+                                               wprintf("<FONT COLOR=&quot;#FF0000&quot;>");
+                                       }
+                                       else {
+                                               wprintf("<FONT COLOR=&quot;#0000FF&quot;>");
+                                       }
+                                       jsescputs(cl_user);
+       
+                                       wprintf("</FONT>: </B>");
                                }
                                else {
-                                       wprintf("<FONT COLOR=&quot;#0000FF&quot;>");
+                                       wprintf("&nbsp;&nbsp;&nbsp;");
+                               }
+                               jsescputs(cl_text);
+                               if (!strcasecmp(cl_user, ":")) {
+                                       wprintf("</I>");
                                }
-                               jsescputs(cl_user);
-
-                               wprintf("</FONT>: </B>");
-                       }
-                       else {
-                               wprintf("&nbsp;&nbsp;&nbsp;");
-                       }
-                       jsescputs(cl_text);
-                       if (!strcasecmp(cl_user, ":")) {
-                               wprintf("</I>");
-                       }
 
-                       wprintf("</TD></TR></TABLE>");
-                       wprintf("'); \n");
+                               wprintf("</TD></TR></TABLE>");
+                               wprintf("'); \n");
 
-                       strcpy(WC->last_chat_user, cl_user);
+                               strcpy(WC->last_chat_user, cl_user);
+                       }
                }
 
                wprintf("parent.chat_transcript.scrollTo(999999,999999);\">\n");
index 199379dc567273d733da9d50d5502408ac31f659..824d812a8ed2f4328a68574e4163349361808f41 100644 (file)
@@ -311,8 +311,8 @@ int main(int argc, char **argv)
                spawn_another_worker_thread();
        }
 
-       /* now the original thread can go away. */
-       pthread_exit(NULL);
+       /* now the original thread becomes another worker */
+       worker_entry();
        return 0;
 }