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)
}
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
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;
}