mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 08:38:42 +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
|
else
|
||||||
printf("??? <%s>\n", x);
|
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
|
static void
|
||||||
|
@ -183,11 +183,13 @@ cli_write(cli *c)
|
|||||||
if (c->tx_pos)
|
if (c->tx_pos)
|
||||||
{
|
{
|
||||||
struct cli_out *o = c->tx_pos;
|
struct cli_out *o = c->tx_pos;
|
||||||
c->tx_pos = o->next;
|
|
||||||
s->tbuf = o->outpos;
|
s->tbuf = o->outpos;
|
||||||
if (sk_send(s, o->wpos - o->outpos) > 0)
|
if (sk_send(s, o->wpos - o->outpos) > 0)
|
||||||
|
{
|
||||||
|
c->tx_pos = o->next;
|
||||||
ev_schedule(c->event);
|
ev_schedule(c->event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return !c->tx_pos;
|
return !c->tx_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user