mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Flock: fixed some random bugs but there are obviously some more
This commit is contained in:
parent
8cc7596e44
commit
20c3706efc
@ -459,6 +459,12 @@ container_mainloop(int fd)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (sz == 0)
|
||||
{
|
||||
log(L_INFO "control socket closing, shutdown");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ASSERT_DIE(sz >= 3);
|
||||
ASSERT_DIE(buf[0] == 0xa1);
|
||||
switch (buf[1]) {
|
||||
|
@ -40,15 +40,15 @@ hcs_rx(sock *s, uint size)
|
||||
log(L_INFO "Parsed command.");
|
||||
|
||||
/* TODO do something more */
|
||||
if (sz < size)
|
||||
memmove(s->rbuf, s->rbuf + sz, size - sz);
|
||||
if (!s->rx_hook)
|
||||
return (sz == size);
|
||||
|
||||
hcs_parser_cleanup(s->data);
|
||||
s->data = hcs_parser_init(s);
|
||||
|
||||
if (sz == size)
|
||||
return 1;
|
||||
|
||||
memmove(s->rbuf, s->rbuf + sz, size - sz);
|
||||
return hcs_rx(s, size - sz);
|
||||
return (sz < size) ? hcs_rx(s, size - sz) : 1;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -517,6 +517,10 @@ static void hexp_received_telnet(void *_data)
|
||||
|
||||
sk_send(s, cw->pt);
|
||||
sk_resume_rx(hcs_loop, s);
|
||||
|
||||
hcs_parser_cleanup(s->data);
|
||||
s->data = hcs_parser_init(s);
|
||||
|
||||
rfree(lp);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user