|
From: | shishi-commit |
Subject: | Fix. |
Date: | Thu, 18 Dec 2003 08:23:53 +0100 |
Commit from jas | 2003-12-18 08:23 CET |
Fix.
Module | File name | Revision | |||
---|---|---|---|---|---|
shishi | src/shishid.c | 1.76 | >>> | 1.77 |
shishi/src/shishid.c 1.76 >>> 1.77 |
---|
Line 268 |
printf ("Listening on %d ports...\n", maxfd); } |
+ /* Destroy listenspec element and return pointer to element before the + removed element, or NULL if the first element was removed (or the + destroyed list element wasn't in the list). */ |
static struct listenspec * kdc_close (struct listenspec *ls) { |
Line 292 |
if (ls->str) free (ls->str); |
- tmp = ls->next; |
+ for (tmp = listenspec; tmp && tmp->next != ls; tmp = tmp->next) + ; + if (tmp) + tmp->next = ls->next; |
free (ls); |
Line 304 |
{ struct listenspec *ls = listenspec; |
- while (ls) - ls = kdc_close (ls); - - listenspec = NULL; |
+ while (ls->next) + ls = kdc_close (ls->next); + listenspec = kdc_close (ls); |
} static void |
Line 502 |
static void kdc_loop (void) { |
- struct listenspec *ls, *last; |
+ struct listenspec *ls; |
fd_set readfds; int maxfd = 0, i; int rc; |
Line 533 |
continue; } |
- for (ls = listenspec, last = NULL; ls; last = ls, ls = ls->next) |
+ for (ls = listenspec; ls; ls = ls->next) |
if (FD_ISSET (ls->sockfd, &readfds)) if (ls->type == SOCK_STREAM && ls->listening) kdc_accept (ls); else if (kdc_read (ls) < 0) |
- last->next = kdc_close (ls); |
+ ls = kdc_close (ls); |
else kdc_handle2 (ls); } |
[Prev in Thread] | Current Thread | [Next in Thread] |