~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
@@@ wip type definitions in manpage synopses
[mLib]
/
sel
/
bres.c
diff --git
a/sel/bres.c
b/sel/bres.c
index
2885d0e
..
22da560
100644
(file)
--- a/
sel/bres.c
+++ b/
sel/bres.c
@@
-473,38
+473,33
@@
static void child(int rfd, int cfd)
if (doread(cfd, &addr, sizeof(addr)))
goto lose;
if ((h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == 0)
if (doread(cfd, &addr, sizeof(addr)))
goto lose;
if ((h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == 0)
- goto
fail
;
+ goto
skip
;
/* --- Do a forward lookup to confirm --- */
{
size_t sz = strlen(h->h_name) + 1;
if ((p = malloc(sz)) == 0)
/* --- Do a forward lookup to confirm --- */
{
size_t sz = strlen(h->h_name) + 1;
if ((p = malloc(sz)) == 0)
- goto
fail
;
+ goto
skip
;
memcpy(p, h->h_name, sz);
}
h = gethostbyname(p);
free(p);
if (!h)
memcpy(p, h->h_name, sz);
}
h = gethostbyname(p);
free(p);
if (!h)
- goto fail;
- p = 0;
+ goto skip;
if (h) {
char **pp;
for (pp = h->h_addr_list; *pp; pp++) {
struct in_addr a;
memcpy(&a, *pp, sizeof(a));
if (h) {
char **pp;
for (pp = h->h_addr_list; *pp; pp++) {
struct in_addr a;
memcpy(&a, *pp, sizeof(a));
- if (a.s_addr == addr.s_addr) {
- p = h->h_name;
- break;
- }
+ if (a.s_addr == addr.s_addr)
+ goto skip;
}
}
}
}
- if (!p) {
- h = 0;
- h_errno = NO_RECOVERY;
- }
- fail:;
+ h = 0;
+ h_errno = NO_RECOVERY;
+ skip:;
} break;
/* --- Unknown request -- may have lost sync --- */
} break;
/* --- Unknown request -- may have lost sync --- */
@@
-591,7
+586,7
@@
static void zap(bres_server *rs)
/* --- Move the server to the back of the list --- */
/* --- Move the server to the back of the list --- */
- UNLINK(freelist, freetail, rs);
+
if (!rs->rc)
UNLINK(freelist, freetail, rs);
LINKTAIL(freelist, freetail, rs);
}
LINKTAIL(freelist, freetail, rs);
}