From: Michael Poole Date: Fri, 17 Sep 2004 03:42:59 +0000 (+0000) Subject: Make IAuth protocol work again and add a bit of debugging to it. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=29f44aa47fc6e1a3b009c67628f8b3fcb23d7665 Make IAuth protocol work again and add a bit of debugging to it. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1144 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 18531a4..6818693 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2004-09-16 Michael Poole + + * INSTALL: Fix name of example.conf and mention its installed + location. + + * include/supported.h (FEATURESVALUES2): Fix a reference to + channel mode +u that escaped earlier rename attempts. + + * ircd/ircd_auth.c (iauth_connect): Assign port number after + zeroing out the destination address. + Add some additional debug statements to help follow operations. + + * ircd/ircd_parser.y (iauthblock): Do not require "name" to be set. + 2004-09-11 Bas Steendijk * include/channel.h, include/supported.h, ircd/channel.c, diff --git a/INSTALL b/INSTALL index 2b7668d..94a92a2 100644 --- a/INSTALL +++ b/INSTALL @@ -28,7 +28,8 @@ contact coder-com@undernet.org. Once ircu is compiled, install it by running "make install". Next, you will have to configure your IRC server by setting up your ircd.conf -file. Use the included doc/ircd.conf.sample as a starting point. +file. Use the included doc/example.conf as a starting point; it is installed +in $HOME/lib/example.conf by default. Setting up ircd.conf can be a bit tricky, so if this is your first time doing it, begin with a bare-bones configuration and extend it as you go. diff --git a/include/supported.h b/include/supported.h index 4b2c92c..74d16f1 100644 --- a/include/supported.h +++ b/include/supported.h @@ -62,7 +62,7 @@ NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, CHANNELLEN #define FEATURESVALUES2 (feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#"), "(ov)@+", "@+", \ - (feature_bool(FEAT_OPLEVELS) ? "b,Aku,l,imnpstrD" : "b,k,l,imnpstrD"), \ + (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrD" : "b,k,l,imnpstrD"), \ "rfc1459", feature_str(FEAT_NETWORK) #endif /* INCLUDED_supported_h */ diff --git a/ircd/ircd_auth.c b/ircd/ircd_auth.c index dd9f9d7..e189a32 100644 --- a/ircd/ircd_auth.c +++ b/ircd/ircd_auth.c @@ -35,6 +35,7 @@ #include "msgq.h" #include "res.h" #include "s_bsd.h" +#include "s_debug.h" #include "s_misc.h" #include "s_user.h" #include "send.h" @@ -180,8 +181,8 @@ struct IAuth *iauth_connect(char *host, unsigned short port, char *passwd, time_ i_list_head(iauth).iar_next = &i_list_head(iauth); msgq_init(&i_sendQ(iauth)); ircd_strncpy(i_host(iauth), host, HOSTLEN); - i_port(iauth) = port; memset(&i_addr(iauth), 0, sizeof(i_addr(iauth))); + i_port(iauth) = port; iauth_active = iauth; i_reconnect(iauth) = reconnect; iauth_reconnect(iauth); @@ -191,6 +192,7 @@ struct IAuth *iauth_connect(char *host, unsigned short port, char *passwd, time_ else i_passwd(iauth)[0] = '\0'; i_timeout(iauth) = timeout; + i_SetIClass(iauth); return iauth; } @@ -255,7 +257,7 @@ void iauth_close(struct IAuth *iauth) void iauth_close_unused(void) { struct IAuth *prev, *iauth, *next; - + for (prev = NULL, iauth = iauth_active; iauth; iauth = next) { next = i_next(iauth); if (i_GetClosing(iauth)) { @@ -355,6 +357,7 @@ static void iauth_reconnect(struct IAuth *iauth) IOResult result; int fd; + Debug((DEBUG_INFO, "IAuth attempt connection to %s port %p.", i_host(iauth), i_port(iauth))); if (!irc_in_addr_valid(&i_addr(iauth).addr) && !ircd_aton(&i_addr(iauth).addr, i_host(iauth))) { i_query(iauth).vptr = iauth; @@ -531,8 +534,10 @@ static void iauth_send_request(struct IAuth *iauth, struct IAuthRequest *iar) struct Client *client; /* If iauth is not connected, we must defer the request. */ - if (!i_GetConnected(iauth)) + if (!i_GetConnected(iauth)) { + Debug((DEBUG_SEND, "IAuth deferring request for %s because we are not connected.", cli_name(iar->iar_client))); return; + } /* If no timed request, set up expiration timer. */ if (!t_active(&i_request_timer(iauth))) { diff --git a/ircd/ircd_parser.y b/ircd/ircd_parser.y index 3aa0afc..608d518 100644 --- a/ircd/ircd_parser.y +++ b/ircd/ircd_parser.y @@ -999,7 +999,7 @@ iauthblock: IAUTH '{' tping = 60; } iauthitems '}' ';' { - if (!name || !host || !port) { + if (!host || !port) { log_write(LS_CONFIG, L_ERROR, 0, "IAuth block needs a server name and port."); return 0; }