[eggheads-patches] PATCH1.4: nonallocsock_1.4.patch

Fabian Knittel fknittel at gmx.de
Sun Oct 10 18:29:52 CST 1999


[ nonallocsock_1.4.patch ]

Fixes a tiny bug in the server module which caused delete attempts
of socket 0 if the server connection failed.

Fabian
-------------- next part --------------
diff -urN eggdrop1.4~/doc/UPDATES1.4 eggdrop1.4/doc/UPDATES1.4
--- eggdrop1.4~/doc/UPDATES1.4	Mon Oct 11 00:15:04 1999
+++ eggdrop1.4/doc/UPDATES1.4	Mon Oct 11 01:13:22 1999
@@ -5,6 +5,7 @@
 
 1.4.0
 Foundby   Fixedby   What....
+G`Quann	  Fabian    was deleting socket 0 if server connect failed
 arthur2	  Fabian    the dcc[].addr is now consistently host byte order and
 		    all async dns lookup functions accept host byte order IPs
 	  Fabian    added an asynchronous DNS request module which prevents
diff -urN eggdrop1.4~/src/mod/server.mod/servmsg.c eggdrop1.4/src/mod/server.mod/servmsg.c
--- eggdrop1.4~/src/mod/server.mod/servmsg.c	Mon Oct 11 00:15:04 1999
+++ eggdrop1.4/src/mod/server.mod/servmsg.c	Mon Oct 11 01:00:13 1999
@@ -942,7 +942,8 @@
   module_entry *me;
 
   server_online = 0;
-  killsock(dcc[idx].sock);
+  if (dcc[idx].sock >= 0)
+    killsock(dcc[idx].sock);
   serv = -1;
   if ((me = module_find("channels", 0, 0)) && me->funcs) {
     struct chanset_t *chan;
@@ -1080,6 +1081,7 @@
     strncpy(dcc[servidx].host, botserver, UHOSTLEN);
     dcc[servidx].host[UHOSTLEN] = 0;
     dcc[servidx].timeval = now;
+    dcc[servidx].sock = (-1);
     dcc[servidx].u.dns->host = get_data_ptr(strlen(dcc[servidx].host) + 1);
     strcpy(dcc[servidx].u.dns->host, dcc[servidx].host);
     dcc[servidx].u.dns->cbuf = get_data_ptr(strlen(pass) + 1);


More information about the Patches mailing list