mirror of
https://github.com/paulusmack/ppp.git
synced 2024-11-24 02:43:27 +08:00
mods to force output on timeout
This commit is contained in:
parent
a97726dbc8
commit
41269f7e0b
@ -1,4 +1,4 @@
|
||||
/* $Id: ppp_tty.c,v 1.3 1996/07/01 01:04:11 paulus Exp $ */
|
||||
/* $Id: ppp_tty.c,v 1.4 1997/04/30 05:47:38 paulus Exp $ */
|
||||
|
||||
/*
|
||||
* ppp_tty.c - Point-to-Point Protocol (PPP) driver for asynchronous
|
||||
@ -104,6 +104,9 @@
|
||||
#include <net/slcompress.h>
|
||||
#endif
|
||||
|
||||
#ifdef PPP_FILTER
|
||||
#include <net/bpf.h>
|
||||
#endif
|
||||
#include <net/ppp_defs.h>
|
||||
#include <net/if_ppp.h>
|
||||
#include <net/if_pppvar.h>
|
||||
@ -115,7 +118,7 @@ int pppwrite __P((struct tty *tp, struct uio *uio, int flag));
|
||||
int ppptioctl __P((struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
struct proc *));
|
||||
int pppinput __P((int c, struct tty *tp));
|
||||
int pppstart __P((struct tty *tp));
|
||||
int pppstart __P((struct tty *tp, int));
|
||||
|
||||
static u_int16_t pppfcs __P((u_int16_t fcs, u_char *cp, int len));
|
||||
static void pppasyncstart __P((struct ppp_softc *));
|
||||
@ -568,8 +571,10 @@ pppasyncstart(sc)
|
||||
*/
|
||||
if (len) {
|
||||
s = spltty();
|
||||
if (putc(PPP_ESCAPE, &tp->t_outq))
|
||||
if (putc(PPP_ESCAPE, &tp->t_outq)) {
|
||||
splx(s);
|
||||
break;
|
||||
}
|
||||
if (putc(*start ^ PPP_TRANS, &tp->t_outq)) {
|
||||
(void) unputc(&tp->t_outq);
|
||||
splx(s);
|
||||
@ -658,7 +663,7 @@ pppasyncstart(sc)
|
||||
|
||||
/* Call pppstart to start output again if necessary. */
|
||||
s = spltty();
|
||||
pppstart(tp);
|
||||
pppstart(tp, 0);
|
||||
|
||||
/*
|
||||
* This timeout is needed for operation on a pseudo-tty,
|
||||
@ -699,8 +704,9 @@ pppasyncctlp(sc)
|
||||
* Called at spltty or higher.
|
||||
*/
|
||||
int
|
||||
pppstart(tp)
|
||||
pppstart(tp, force)
|
||||
register struct tty *tp;
|
||||
int force;
|
||||
{
|
||||
register struct ppp_softc *sc = (struct ppp_softc *) tp->t_sc;
|
||||
|
||||
@ -716,8 +722,9 @@ pppstart(tp)
|
||||
* or been disconnected from the ppp unit, then tell if_ppp.c that
|
||||
* we need more output.
|
||||
*/
|
||||
if (CCOUNT(&tp->t_outq) < PPP_LOWAT
|
||||
&& !((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0)
|
||||
if (CCOUNT(&tp->t_outq) >= PPP_LOWAT && !force)
|
||||
return 0;
|
||||
if (!((tp->t_state & TS_CARR_ON) == 0 && (tp->t_cflag & CLOCAL) == 0)
|
||||
&& sc != NULL && tp == (struct tty *) sc->sc_devp) {
|
||||
ppp_restart(sc);
|
||||
}
|
||||
@ -738,7 +745,7 @@ ppp_timeout(x)
|
||||
|
||||
s = spltty();
|
||||
sc->sc_flags &= ~SC_TIMEOUT;
|
||||
pppstart(tp);
|
||||
pppstart(tp, 1);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user