diff options
author | brian <brian@FreeBSD.org> | 1998-05-23 22:24:50 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-05-23 22:24:50 +0000 |
commit | 7f9f3d4b006fb3ffffcebd44183520742fa0bf6f (patch) | |
tree | d9eda8d3412bab2407741e40c3e4b78839fe30ed /usr.sbin/ppp/prompt.c | |
parent | 3d5a66dff7468559eb0f226477cfed7891ba121f (diff) | |
download | FreeBSD-src-7f9f3d4b006fb3ffffcebd44183520742fa0bf6f.zip FreeBSD-src-7f9f3d4b006fb3ffffcebd44183520742fa0bf6f.tar.gz |
o Move our prompt descriptor list outside of the bundle.
It's now dealt with by the `server' object. This simplifies
things as we only have one list of prompt descriptors and
the log_ routines check prompt::logactive to determine
whether it should be used for output.
o Include the MP socket UpdateSet() result in bundle::UpdateSet().
o Don't select on the tun device unless we're in NETWORK
phase or AUTO mode.
o Stop the idle timer when we go to DEAD phase. We may
have transferred a link and not had a chance to kill
it.
o Don't fail when trying to unlink our transferred datalink
from our descriptor lists just before the transfer.
o Add our link descriptor to the write set if we got a short
write the last time (physical::out is set).
o Log the connection source address when a connection is closed.
o Remove descriptor::next field. Descriptor lists are not required
any more.
Diffstat (limited to 'usr.sbin/ppp/prompt.c')
-rw-r--r-- | usr.sbin/ppp/prompt.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.sbin/ppp/prompt.c b/usr.sbin/ppp/prompt.c index 81d927b..19c6cba 100644 --- a/usr.sbin/ppp/prompt.c +++ b/usr.sbin/ppp/prompt.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: prompt.c,v 1.1.2.30 1998/05/10 22:20:17 brian Exp $ + * $Id: prompt.c,v 1.2 1998/05/21 21:47:57 brian Exp $ */ #include <sys/param.h> @@ -185,7 +185,7 @@ prompt_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset) if (n) command_Decode(bundle, linebuff, n, p, p->src.from); } else if (n <= 0) { - log_Printf(LogPHASE, "Client connection closed.\n"); + log_Printf(LogPHASE, "%s: Client connection closed.\n", p->src.from); prompt_Destroy(p, 0); } return; @@ -279,7 +279,6 @@ prompt_Create(struct server *s, struct bundle *bundle, int fd) if (p != NULL) { p->desc.type = PROMPT_DESCRIPTOR; - p->desc.next = NULL; p->desc.UpdateSet = prompt_UpdateSet; p->desc.IsSet = prompt_IsSet; p->desc.Read = prompt_Read; @@ -306,12 +305,8 @@ prompt_Create(struct server *s, struct bundle *bundle, int fd) p->TermMode = NULL; p->nonewline = 1; p->needprompt = 1; - p->active = 1; p->bundle = bundle; - if (p->bundle) - bundle_RegisterDescriptor(p->bundle, &p->desc); log_RegisterPrompt(p); - log_DiscardAllLocal(&p->logmask); } return p; @@ -326,12 +321,11 @@ prompt_Destroy(struct prompt *p, int verbose) if (p->fd_out != p->fd_in) close(p->fd_out); if (verbose) - log_Printf(LogPHASE, "Client connection dropped.\n"); + log_Printf(LogPHASE, "%s: Client connection dropped.\n", p->src.from); } else prompt_TtyOldMode(p); log_UnRegisterPrompt(p); - bundle_UnRegisterDescriptor(p->bundle, &p->desc); free(p); } @@ -502,7 +496,7 @@ prompt_Continue(struct prompt *p) prompt_TtyCommandMode(p); p->nonewline = 1; prompt_Required(p); - p->active = 1; + log_ActivatePrompt(p); } else if (!p->owner) { bgtimer.func = prompt_TimedContinue; bgtimer.name = "prompt bg"; @@ -517,6 +511,6 @@ prompt_Suspend(struct prompt *p) { if (getpgrp() == prompt_pgrp(p)) { prompt_TtyOldMode(p); - p->active = 0; + log_DeactivatePrompt(p); } } |