]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blobdiff - zephyr/zhm/queue.c
passes gcc -Wall with no warnings other than des cryppt C_block sadness and getsid...
[1ts-debian.git] / zephyr / zhm / queue.c
index 27e7ca2343a0f58b72560a9a1f949b5fec3a67f7..b028f7cc754d92944cd936eab9df818a4fd3b53c 100644 (file)
@@ -14,7 +14,7 @@
 
 #ifndef lint
 #ifndef SABER
-static char rcsid_queue_c[] = "$Id$";
+static const char rcsid_queue_c[] = "$Id$";
 #endif /* SABER */
 #endif /* lint */
 
@@ -31,9 +31,10 @@ static Queue *hm_queue;
 static int retransmits_enabled = 0;
 
 static Queue *find_notice_in_queue(ZNotice_t *notice);
-static Code_t dump_queue(void);
 static void queue_timeout(void *arg);
 
+extern void new_server(char *);
+
 int rexmit_times[] = { 2, 2, 4, 4, 8, -1 };
 
 #ifdef DEBUG
@@ -82,7 +83,13 @@ add_notice_to_queue(ZNotice_t *notice,
            free(entry->packet);
        } else {
            entry->reply = *repl;
-           LIST_INSERT(&hm_queue, entry);
+           /*LIST_INSERT(&hm_queue, entry);*/
+
+           (entry)->next = *(&hm_queue);
+           if (*&hm_queue) ((*(&hm_queue))->prev_p = &(entry)->next);
+           (*&hm_queue) = (entry);
+           (entry)->prev_p = (&hm_queue);
+               
        }
        entry->timer = (retransmits_enabled) ?
            timer_set_rel(rexmit_times[0], queue_timeout, entry) : NULL;
@@ -107,7 +114,9 @@ remove_notice_from_queue(ZNotice_t *notice,
     if (entry->timer)
        timer_reset(entry->timer);
     free(entry->packet);
-    LIST_DELETE(entry);
+    /*LIST_DELETE(entry);*/
+    *(entry)->prev_p = (entry)->next;
+    if((entry)->next) ((entry)->next->prev_p = (entry)->prev_p);
 #ifdef DEBUG
     dump_queue();
 #endif /* DEBUG */