diff options
author | Karl Ramm <kcr@mit.edu> | 2008-01-21 07:57:32 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2008-01-21 07:57:32 +0000 |
commit | ee442551e1531712226a3a3ba26afff466100bb5 (patch) | |
tree | d7907b07baecce7abe3940bec566b3bf56596f2f /zhm/queue.c | |
parent | e6fb0737027ee97d911e8d507b1db37446067d10 (diff) |
passes gcc -Wall with no warnings other than des cryppt C_block sadness and getsid problem
Diffstat (limited to 'zhm/queue.c')
-rw-r--r-- | zhm/queue.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/zhm/queue.c b/zhm/queue.c index 27e7ca2..b028f7c 100644 --- a/zhm/queue.c +++ b/zhm/queue.c @@ -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 */ |