|
From: | shishi-commit |
Subject: | More of the same. |
Date: | Thu, 18 Dec 2003 07:04:00 +0100 |
Commit from jas | 2003-12-18 07:03 CET |
More of the same.
Module | File name | Revision | |||
---|---|---|---|---|---|
shishi | src/shishid.c | 1.72 | >>> | 1.73 |
shishi/src/shishid.c 1.72 >>> 1.73 |
---|
Line 955 |
} } |
- static void - kdc_read (struct listenspec *ls, struct listenspec *last) |
+ static int + kdc_read (struct listenspec *ls) |
{ ssize_t read_bytes; |
Line 964 |
sizeof(ls->buf) - ls->bufpos, 0, &ls->addr, &ls->addrlen); |
- if (read_bytes < 0 || (read_bytes == 0 && ls->type == SOCK_STREAM)) |
+ if (read_bytes < 0) |
{ |
- if (read_bytes == 0) - { - if (!arg.quiet_flag) - printf ("Peer %s disconnected\n", ls->str); - } - else - error (0, errno, "Error from recvfrom (%d)", read_bytes); - last->next = kdc_close (ls); - return; |
+ error (0, errno, "Error from recvfrom (%d)", read_bytes); + return -1; + } + + if (read_bytes == 0 && ls->type == SOCK_STREAM) + { + if (!arg.quiet_flag) + printf ("Peer %s disconnected\n", ls->str); + return -1; |
} ls->bufpos += read_bytes; |
Line 984 |
printf ("Has %d bytes from %s on socket %d\n", ls->bufpos, ls->str, ls->sockfd); |
- kdc_handle2 (ls); |
+ return 0; |
} static void |
Line 1046 |
if (FD_ISSET (ls->sockfd, &readfds)) if (ls->type == SOCK_STREAM && ls->listening) kdc_accept (ls, last); |
+ else if (kdc_read (ls) < 0) + last->next = kdc_close (ls); |
else |
- kdc_read (ls, last); |
+ kdc_handle2 (ls); |
} return 0; |
[Prev in Thread] | Current Thread | [Next in Thread] |