TMXR: Make tmxr_rqln() only return count times tmxr_getc_ln() can be called
This commit is contained in:
parent
440bbfd307
commit
215a71d608
1 changed files with 5 additions and 9 deletions
14
sim_tmxr.c
14
sim_tmxr.c
|
@ -2109,24 +2109,20 @@ for (i = 0; i < mp->lines; i++) { /* loop thru lines */
|
||||||
int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed)
|
int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed)
|
||||||
{
|
{
|
||||||
if (speed) {
|
if (speed) {
|
||||||
int32 send_data = 0;
|
|
||||||
|
|
||||||
if (lp->send.extoff < lp->send.insoff) {/* buffered SEND data? */
|
if (lp->send.extoff < lp->send.insoff) {/* buffered SEND data? */
|
||||||
if (sim_gtime () < lp->send.next_time)
|
if (sim_gtime () < lp->send.next_time)
|
||||||
send_data = 0;
|
return 0;
|
||||||
else
|
else
|
||||||
send_data = lp->send.delay ? 1 : (lp->send.insoff - lp->send.extoff);
|
return lp->send.delay ? 1 : (lp->send.insoff - lp->send.extoff);
|
||||||
}
|
}
|
||||||
if (lp->rxbps) { /* consider speed and rate limiting? */
|
if (lp->rxbps) { /* consider speed and rate limiting? */
|
||||||
if (sim_gtime () < lp->rxnexttime) /* too soon? */
|
if (sim_gtime () < lp->rxnexttime) /* too soon? */
|
||||||
return send_data;
|
return 0;
|
||||||
else
|
else
|
||||||
return send_data +
|
return 1;
|
||||||
((lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)) ? 1 : 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0) +
|
return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0));
|
||||||
(lp->send.insoff - lp->send.extoff));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 tmxr_rqln (const TMLN *lp)
|
int32 tmxr_rqln (const TMLN *lp)
|
||||||
|
|
Loading…
Add table
Reference in a new issue