mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 01:31:55 +00:00
Fix handling on full pipe to client in bird. Prevent packet overflows
for even only medium sized route table output. Fix a strange garbled output problem in the client. The latter seems to be caused by some library doing tcflush while there is still command output pending. So the best fix here is to do fflush and then tcdrain. Note that this problem occurs only under certain load situations and is not too easy to reproduce. (by Andreas)
This commit is contained in:
parent
a4ffe2739d
commit
5f2a6a9ff3
@ -281,6 +281,10 @@ server_got_reply(char *x)
|
||||
}
|
||||
else
|
||||
printf("??? <%s>\n", x);
|
||||
/* need this, otherwise some lib seems to eat pending output when
|
||||
the prompt is displayed */
|
||||
fflush(stdout);
|
||||
tcdrain(fileno(stdout));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -183,10 +183,12 @@ cli_write(cli *c)
|
||||
if (c->tx_pos)
|
||||
{
|
||||
struct cli_out *o = c->tx_pos;
|
||||
c->tx_pos = o->next;
|
||||
s->tbuf = o->outpos;
|
||||
if (sk_send(s, o->wpos - o->outpos) > 0)
|
||||
ev_schedule(c->event);
|
||||
{
|
||||
c->tx_pos = o->next;
|
||||
ev_schedule(c->event);
|
||||
}
|
||||
}
|
||||
return !c->tx_pos;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user