]> code.citadel.org Git - citadel.git/commitdiff
* Moved global march list into per-session context
authorArt Cancro <ajc@citadel.org>
Mon, 6 Dec 1999 02:05:34 +0000 (02:05 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 6 Dec 1999 02:05:34 +0000 (02:05 +0000)
webcit/ChangeLog
webcit/roomops.c
webcit/webcit.h

index e0cf82c7cd2e4ca31ad933a8e758b5a26b1e5f6d..31e2c29d478235547744a10dc05beadb7e9a439d 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 1.116  1999/12/06 02:05:33  ajc
+* Moved global march list into per-session context
+
 Revision 1.115  1999/12/05 18:38:02  ajc
 * Auto-scaling worker thread pool size
 
@@ -344,4 +347,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 6e8cc089830082fc42749dbceb8d09bb71c91319..3a295478ebd38434c0f980e589116c6ee17af65f 100644 (file)
 
 
 
-
-/*
- * This struct holds a list of rooms for <G>oto operations.
- */
-struct march {
-       struct march *next;
-       char march_name[32];
-       int march_floor;
-       int march_order;
-};
-
-/* 
- * This struct holds a list of rooms for client display.
- * (oooh, a tree!)
- */
-struct roomlisting {
-       struct roomlisting *lnext;
-       struct roomlisting *rnext;
-       char rlname[64];
-       unsigned rlflags;
-       int rlfloor;
-       int rlorder;
-};
-
-
 char floorlist[128][256];
 
-struct march *march = NULL;
 
 /*
  * load the list of floors
@@ -87,17 +61,17 @@ void remove_march(char *aaa)
 {
        struct march *mptr, *mptr2;
 
-       if (march == NULL)
+       if (WC->march == NULL)
                return;
 
-       if (!strcasecmp(march->march_name, aaa)) {
-               mptr = march->next;
-               free(march);
-               march = mptr;
+       if (!strcasecmp(WC->march->march_name, aaa)) {
+               mptr = WC->march->next;
+               free(WC->march);
+               WC->march = mptr;
                return;
        }
-       mptr2 = march;
-       for (mptr = march; mptr != NULL; mptr = mptr->next) {
+       mptr2 = WC->march;
+       for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
                if (!strcasecmp(mptr->march_name, aaa)) {
                        mptr2->next = mptr->next;
                        free(mptr);
@@ -474,10 +448,10 @@ char *pop_march(int desired_floor)
        struct march *mptr = NULL;
 
        strcpy(TheRoom, "_BASEROOM_");
-       if (march == NULL)
+       if (WC->march == NULL)
                return (TheRoom);
 
-       for (mptr = march; mptr != NULL; mptr = mptr->next) {
+       for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
                weight = 0;
                if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
                        weight = weight + 10000;
@@ -516,7 +490,7 @@ void gotonext(void)
         * If it is, pop the first room off the list and go there.
         */
 
-       if (march == NULL) {
+       if (WC->march == NULL) {
                serv_puts("LKRN");
                serv_gets(buf);
                if (buf[0] == '1')
@@ -526,10 +500,10 @@ void gotonext(void)
                                extract(mptr->march_name, buf, 0);
                                mptr->march_floor = extract_int(buf, 2);
                                mptr->march_order = extract_int(buf, 3);
-                               if (march == NULL) {
-                                       march = mptr;
+                               if (WC->march == NULL) {
+                                       WC->march = mptr;
                                } else {
-                                       mptr2 = march;
+                                       mptr2 = WC->march;
                                        while (mptr2->next != NULL)
                                                mptr2 = mptr2->next;
                                        mptr2->next = mptr;
@@ -541,10 +515,10 @@ void gotonext(void)
                mptr = (struct march *) malloc(sizeof(struct march));
                mptr->next = NULL;
                strcpy(mptr->march_name, "_BASEROOM_");
-               if (march == NULL) {
-                       march = mptr;
+               if (WC->march == NULL) {
+                       WC->march = mptr;
                } else {
-                       mptr2 = march;
+                       mptr2 = WC->march;
                        while (mptr2->next != NULL)
                                mptr2 = mptr2->next;
                        mptr2->next = mptr;
@@ -555,7 +529,7 @@ void gotonext(void)
  */
                remove_march(WC->wc_roomname);
        }
-       if (march != NULL) {
+       if (WC->march != NULL) {
                strcpy(next_room, pop_march(-1));
        } else {
                strcpy(next_room, "_BASEROOM_");
index 5d5c867e817e5bfb1b2f411c299547a2ccca5e57..121ecbcf8b357db1b62bde92664737283514b59f 100644 (file)
@@ -61,6 +61,35 @@ struct serv_info {
 
 
 
+/*
+ * This struct holds a list of rooms for <G>oto operations.
+ */
+struct march {
+       struct march *next;
+       char march_name[32];
+       int march_floor;
+       int march_order;
+};
+
+/* 
+ * This struct holds a list of rooms for client display.
+ * (oooh, a tree!)
+ */
+struct roomlisting {
+       struct roomlisting *lnext;
+       struct roomlisting *rnext;
+       char rlname[64];
+       unsigned rlflags;
+       int rlfloor;
+       int rlorder;
+};
+
+
+
+
+
+
+
 /*
  * One of these is kept for each active Citadel session.
  * HTTP transactions are bound to one at a time.
@@ -88,6 +117,7 @@ struct wcsession {
         pthread_mutex_t SessionMutex;  /* mutex for exclusive access */
         time_t lastreq;                        /* Timestamp of most recent HTTP */
        int killthis;                   /* Nonzero == purge this session */
+       struct march *march;            /* march mode room list */
 };