Make IAuth protocol work again and add a bit of debugging to it.
authorMichael Poole <mdpoole@troilus.org>
Fri, 17 Sep 2004 03:42:59 +0000 (03:42 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 17 Sep 2004 03:42:59 +0000 (03:42 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1144 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
INSTALL
include/supported.h
ircd/ircd_auth.c
ircd/ircd_parser.y

index 18531a4f0d22d86c7703f77f6310c9a2ef5e5333..68186934a5d11541844ce38a42c28128b09c4166 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-09-16  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <steendijk@xs4all.nl>
 
        * include/channel.h, include/supported.h, ircd/channel.c,
diff --git a/INSTALL b/INSTALL
index 2b7668df63c15c5f4cddd85c69f95b7ca3b989d2..94a92a2107f5b9f6d48de3dd7aaf67a0ac319e44 100644 (file)
--- 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.
 
index 4b2c92c33fecf954c9c1004ab113666e4b59d333..74d16f18f91c828b679f5d95a005f0924a3429ed 100644 (file)
@@ -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 */
index dd9f9d7227c7a63674d062f6b2dce5d3b022ba3c..e189a323279195394247741d26ce0f3c87b92ce3 100644 (file)
@@ -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))) {
index 3aa0afcad9c8b6fc5218b5eac54e0a0a7d8eae74..608d518a4c635d79f06fdb41a4a9c5181bef50dd 100644 (file)
@@ -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;
   }