summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-04-12 22:58:41 +0000
committerbrian <brian@FreeBSD.org>1997-04-12 22:58:41 +0000
commit24892f810362b61662c5846a03a44ac143eb4f44 (patch)
tree8231f4ecc93c5be8eb347ffe0c8f9bf441fd2090 /usr.sbin/ppp/main.c
parenta0864ebb141186c2b03be2ad392c5cd7a91dd45d (diff)
downloadFreeBSD-src-24892f810362b61662c5846a03a44ac143eb4f44.zip
FreeBSD-src-24892f810362b61662c5846a03a44ac143eb4f44.tar.gz
Only wait for the redial timeout when the last phone number in the
list has been dialed. Alternate number dialing has no "pause". Suggested by: joerg Document this behaviour. Document that the number of dial attempts applies to the number of phone calls rather than the number of times each number is dialed. Add a missing .El. Give a decent description of how to connect to an ISP.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index c56b3da..6f43044 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.40 1997/03/13 21:22:07 brian Exp $
+ * $Id: main.c,v 1.41 1997/04/09 17:35:54 ache Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -761,8 +761,12 @@ DoLoop()
if (modem < 0) {
StartRedialTimer();
} else {
- tries++;
- LogPrintf(LOG_CHAT_BIT, "Dial attempt %u\n", tries);
+ tries++; /* Tries are per number, not per list of numbers. */
+ if (VarDialTries)
+ LogPrintf(LOG_CHAT_BIT, "Dial attempt %u of %d\n", tries,
+ VarDialTries);
+ else
+ LogPrintf(LOG_CHAT_BIT, "Dial attempt %u\n", tries);
if (DialModem()) {
sleep(1); /* little pause to allow peer starts */
ModemTimeout();
@@ -771,13 +775,20 @@ DoLoop()
tries = 0;
} else {
CloseModem();
- /* Dial failed. Keep quite during redial wait period. */
- StartRedialTimer();
-
if (VarDialTries && tries >= VarDialTries) {
- dial_up = FALSE;
- tries = 0;
- }
+ /* I give up ! Can't get through :( */
+ StartRedialTimer();
+ dial_up = FALSE;
+ tries = 0;
+ } else if (VarNextPhone == NULL)
+ /* Dial failed. Keep quite during redial wait period. */
+ StartRedialTimer();
+ else
+ /*
+ * Give the modem a chance to recover, then dial the next
+ * number in our list
+ */
+ sleep(1);
}
}
}
OpenPOWER on IntegriCloud