From: Michael Poole Date: Tue, 25 Jan 2005 16:42:03 +0000 (+0000) Subject: Configuration fixes. Repair automatic outbound connects. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=8e5976491f54c7db275880db1c6e29d4e7bf1dc6 Configuration fixes. Repair automatic outbound connects. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1305 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 7659815..7e6b073 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-01-25 Michael Poole + + * configure.in: Fix typos and thinkos in previous commut. + + * configure: Regenerate. + + * doc/example.conf: Change class name in Connect block to be + consistent with earlier Class block. + + * ircd/ircd.c (try_connections): Consider Connect blocks with hold + time of 0. Fix Links() vs MaxLinks() comparison to reflect ref + count starting at 1. + + * ircd/ircd_parser.y (cruleblock, iauthblock): Clear unused + variables after use. + 2005-01-24 Michael Poole * configure.in: Make sure that $LEX and $YACC are reasonable and diff --git a/configure b/configure index ba2cf8c..d6984de 100755 --- a/configure +++ b/configure @@ -8786,13 +8786,15 @@ _ACEOF fi fi -if "$LEX" eq ":" ; then +if test "$LEX" = ":" ; then { { echo "$as_me:$LINENO: error: Cannot find flex." >&5 echo "$as_me: error: Cannot find flex." >&2;} { (exit 1); exit 1; }; } elif echo "" | $LEX -V -v --version > /dev/null 2>&1 ; then - { { echo "$as_me:$LINENO: error: Cannot find flex." >&5 -echo "$as_me: error: Cannot find flex." >&2;} + : +else + { { echo "$as_me:$LINENO: error: Cannot use $LEX as flex." >&5 +echo "$as_me: error: Cannot use $LEX as flex." >&2;} { (exit 1); exit 1; }; } fi @@ -8851,13 +8853,15 @@ fi done test -n "$YACC" || YACC="yacc" -if "$YACC" eq ":" ; then +if test "$YACC" = ":" ; then { { echo "$as_me:$LINENO: error: Cannot find yacc." >&5 echo "$as_me: error: Cannot find yacc." >&2;} { (exit 1); exit 1; }; } elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then - { { echo "$as_me:$LINENO: error: Cannot find yacc." >&5 -echo "$as_me: error: Cannot find yacc." >&2;} + : +else + { { echo "$as_me:$LINENO: error: Cannot use $YACC as yacc." >&5 +echo "$as_me: error: Cannot use $YACC as yacc." >&2;} { (exit 1); exit 1; }; } fi diff --git a/configure.in b/configure.in index 2532dfb..531c045 100644 --- a/configure.in +++ b/configure.in @@ -143,10 +143,12 @@ AC_PATH_PROGS(SHPROG, sh, /bin/sh) dnl (F)LEX - needed for the new conf file parser AC_PROG_LEX dnl The autoconf docs say $LEX defaults to 'lex'. They lie. -if [ "$LEX" eq ":" ] ; then +if test "$LEX" = ":" ; then AC_MSG_ERROR([Cannot find flex.]) elif echo "" | $LEX -V -v --version > /dev/null 2>&1 ; then - AC_MSG_ERROR([Cannot find flex.]) + : +else + AC_MSG_ERROR([Cannot use $LEX as flex.]) fi if test -z "$LEXLIB" ; then @@ -161,10 +163,12 @@ dnl YACC - ditto AC_PROG_YACC dnl The autoconf docs say $YACC defaults to 'yacc'. This seems to be true, dnl but judging from AC_PROG_LEX, it may not stay true. -if [ "$YACC" eq ":" ] ; then +if test "$YACC" = ":" ; then AC_MSG_ERROR([Cannot find yacc.]) elif echo "" | $YACC -V -v --version > /dev/null 2>&1 ; then - AC_MSG_ERROR([Cannot find yacc.]) + : +else + AC_MSG_ERROR([Cannot use $YACC as yacc.]) fi diff --git a/doc/example.conf b/doc/example.conf index ee44712..8b269d0 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -547,7 +547,7 @@ Connect { host = "1.2.3.4"; password = "passwd"; port = 4400; - class = "Servers"; + class = "Server"; hub; }; diff --git a/ircd/ircd.c b/ircd/ircd.c index db6c604..d43f2b3 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -260,7 +260,6 @@ static void try_connections(struct Event* ev) { */ if (!(aconf->status & CONF_SERVER) || aconf->address.port == 0 - || aconf->hold == 0 || ((ajupe = jupe_find(aconf->name)) && JupeIsActive(ajupe))) continue; @@ -278,11 +277,10 @@ static void try_connections(struct Event* ev) { * or if connect rules forbid a link now. */ if (hold - || (Links(cltmp) >= MaxLinks(cltmp)) + || (Links(cltmp) > MaxLinks(cltmp)) || FindServer(aconf->name) - || conf_eval_crule(aconf->name, CRULE_MASK)) { + || conf_eval_crule(aconf->name, CRULE_MASK)) continue; - } /* Ensure it is at the end of the list for future checks. */ if (aconf->next) { diff --git a/ircd/ircd_parser.y b/ircd/ircd_parser.y index d47a941..2ae4a1b 100644 --- a/ircd/ircd_parser.y +++ b/ircd/ircd_parser.y @@ -786,6 +786,7 @@ cruleblock: CRULE parse_error("Bad CRule block"); } host = pass = NULL; + tconn = 0; }; cruleitems: cruleitem cruleitems | cruleitem; @@ -953,7 +954,7 @@ iauthblock: IAUTH '{' MyFree(pass); MyFree(host); pass = host = NULL; - port = 0; + port = tconn = tping = 0; }; iauthitems: iauthitem iauthitems | iauthitem;