Options "redialdelay <seconds>" und "dialmax <num>" are also used for
leased lines now.
This commit is contained in:
parent
695aecdf3e
commit
a6758decfb
|
@ -26,7 +26,7 @@
|
|||
#include <linux/if.h>
|
||||
#include <linux/in.h>
|
||||
|
||||
static char *revision = "$Revision: 1.28 $";
|
||||
static char *revision = "$Revision: 1.29 $";
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
|
@ -1536,26 +1536,49 @@ static capi_connection *setupconnection(char *num, int awaitingreject)
|
|||
static void makeleasedline(void)
|
||||
{
|
||||
capi_connection *cp;
|
||||
int retry = 0;
|
||||
time_t t;
|
||||
|
||||
do {
|
||||
if (retry) {
|
||||
t = time(0)+opt_redialdelay;
|
||||
do {
|
||||
handlemessages();
|
||||
if (status != EXIT_OK)
|
||||
die(status);
|
||||
} while (time(0) < t);
|
||||
}
|
||||
|
||||
cp = setupconnection("", 0);
|
||||
|
||||
t = time(0)+opt_dialtimeout;
|
||||
do {
|
||||
handlemessages();
|
||||
if (status != EXIT_OK && conn_find(cp)) {
|
||||
if (status != EXIT_OK) {
|
||||
if (conn_find(cp)) {
|
||||
info("capiplugin: pppd status %d, disconnecting ...", status);
|
||||
dodisconnect(cp);
|
||||
} else {
|
||||
die(status);
|
||||
}
|
||||
}
|
||||
} while (time(0) < t && conn_inprogress(cp));
|
||||
|
||||
if (conn_isconnected(cp))
|
||||
goto connected;
|
||||
|
||||
if (status != EXIT_OK)
|
||||
die(status);
|
||||
|
||||
} while (++retry < opt_dialmax);
|
||||
|
||||
connected:
|
||||
if (conn_isconnected(cp)) {
|
||||
t = time(0)+opt_connectdelay;
|
||||
do {
|
||||
handlemessages();
|
||||
if (status != EXIT_OK)
|
||||
die(status);
|
||||
} while (time(0) < t);
|
||||
}
|
||||
|
||||
|
@ -1567,7 +1590,7 @@ static void makeleasedline(void)
|
|||
}
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/* -------- connect a dislup connection ------------------------------- */
|
||||
/* -------- connect a dialup connection ------------------------------- */
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
static void makeconnection(STRINGLIST *numbers)
|
||||
|
@ -1616,6 +1639,8 @@ connected:
|
|||
t = time(0)+opt_connectdelay;
|
||||
do {
|
||||
handlemessages();
|
||||
if (status != EXIT_OK)
|
||||
die(status);
|
||||
} while (time(0) < t);
|
||||
}
|
||||
|
||||
|
@ -1740,6 +1765,8 @@ static void waitforcall(void)
|
|||
time_t t = time(0)+opt_connectdelay;
|
||||
do {
|
||||
handlemessages();
|
||||
if (status != EXIT_OK)
|
||||
die(status);
|
||||
} while (time(0) < t);
|
||||
}
|
||||
add_fd(capi20_fileno(applid));
|
||||
|
|
Loading…
Reference in New Issue