[cvslog] (2002-07-22 05:55:33 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Mon Jul 22 00:56:01 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2002-07-22 05:55:33 UTC
Commited by: Jeff Fisher <guppy at techmonkeys.org>

Modified files:
     doc/UPDATES1.6 src/net.c src/patch.h

Log message:

[sL]'s sockfix patch

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.378 eggdrop1.6/doc/UPDATES1.6:1.379
--- eggdrop1.6/doc/UPDATES1.6:1.378	Mon Jul 22 00:48:52 2002
+++ eggdrop1.6/doc/UPDATES1.6	Mon Jul 22 00:55:22 2002
@@ -1,10 +1,12 @@
-$Id: UPDATES1.6,v 1.378 2002/07/22 05:48:52 guppy Exp $
+$Id: UPDATES1.6,v 1.379 2002/07/22 05:55:22 guppy Exp $
 
 Changes in Eggdrop: (since v1.6.0)
 ----------------------------------
 
 1.6.11
 Found by  Fixed by  What...
+          [sL]      fixed a problem with 'connect' and 'control' where the script would abort
+                    prematurely
           Wcc       improved the logic in cmd_mnsban when specifying what happen to remove and
                     where to remove it from
           Eule      fixed cmd_kickban so it works
Index: eggdrop1.6/src/net.c
diff -u eggdrop1.6/src/net.c:1.39 eggdrop1.6/src/net.c:1.40
--- eggdrop1.6/src/net.c:1.39	Mon Jan 14 15:20:50 2002
+++ eggdrop1.6/src/net.c	Mon Jul 22 00:55:22 2002
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.39 2002/01/14 21:20:50 guppy Exp $
+ * $Id: net.c,v 1.40 2002/07/22 05:55:22 guppy Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -747,6 +747,7 @@
 {
   char xx[514], *p, *px;
   int ret, i, data = 0;
+  int chk = 0;
 
   for (i = 0; i < MAXSOCKS; i++) {
     /* Check for stored-up data waiting to be processed */
@@ -754,29 +755,48 @@
 	!(socklist[i].flags & SOCK_BUFFER) && (socklist[i].inbuf != NULL)) {
       if (!(socklist[i].flags & SOCK_BINARY)) {
 	/* look for \r too cos windows can't follow RFCs */
-	p = strchr(socklist[i].inbuf, '\n');
-	if (p == NULL)
-	  p = strchr(socklist[i].inbuf, '\r');
-	if (p != NULL) {
-	  *p = 0;
-	  if (strlen(socklist[i].inbuf) > 510)
-	    socklist[i].inbuf[510] = 0;
-	  strcpy(s, socklist[i].inbuf);
-	  px = (char *) nmalloc(strlen(p + 1) + 1);
-	  strcpy(px, p + 1);
-	  nfree(socklist[i].inbuf);
-	  if (px[0])
-	    socklist[i].inbuf = px;
-	  else {
-	    nfree(px);
-	    socklist[i].inbuf = NULL;
-	  }
-	  /* Strip CR if this was CR/LF combo */
-	  if (s[strlen(s) - 1] == '\r')
-	    s[strlen(s) - 1] = 0;
-	  *len = strlen(s);
-	  return socklist[i].sock;
-	}
+        while (chk == 0) {
+	  p = strchr(socklist[i].inbuf, '\n');
+	  if (p == NULL)
+	    p = strchr(socklist[i].inbuf, '\r');
+	  if (p != NULL) {
+	    *p = 0;
+	    if (strlen(socklist[i].inbuf) > 510)
+	      socklist[i].inbuf[510] = 0;
+	    strcpy(s, socklist[i].inbuf);
+	    px = (char *) nmalloc(strlen(p + 1) + 1);
+	    strcpy(px, p + 1);
+	    nfree(socklist[i].inbuf);
+	    if (px[0])
+	      socklist[i].inbuf = px;
+	    else {
+	      nfree(px);
+	      socklist[i].inbuf = NULL;
+	    }
+	    /* Strip CR if this was CR/LF combo */
+	    if (s[strlen(s) - 1] == '\r')
+	      s[strlen(s) - 1] = 0;
+            /* if s is null, we can't use it... */
+	    if ((s[0] == 0) || (s == NULL)) {
+              if (socklist[i].inbuf == NULL)
+                chk = 1;
+            } else
+              chk = 1;
+            if (chk) {
+              *len = strlen(s);
+       	      return socklist[i].sock;
+  	    }
+          } else {
+            if ((s[0] == 0) || (s == NULL)) {
+              if (socklist[i].inbuf != NULL) {
+                strcpy(s, socklist[i].inbuf);
+                *len = strlen(s);
+                return socklist[i].sock;
+              }
+            }
+            chk = 1;
+          }
+        }
       } else {
 	/* Handling buffered binary data (must have been SOCK_BUFFER before). */
 	if (socklist[i].inbuflen <= 510) {
@@ -893,9 +913,9 @@
   *len = strlen(s);
   /* Anything left that needs to be saved? */
   if (!xx[0]) {
-    if (data)
+    if (data) {
       return socklist[ret].sock;
-    else
+    } else
       return -3;
   }
   /* Prepend old data back */
@@ -907,11 +927,19 @@
     strcat(socklist[ret].inbuf, p);
     nfree(p);
   } else {
+    if ((xx[0] || xx[1]) && (data != 1))
+      data = 1;
     socklist[ret].inbuflen = strlen(xx);
     socklist[ret].inbuf = (char *) nmalloc(socklist[ret].inbuflen + 1);
     strcpy(socklist[ret].inbuf, xx);
   }
   if (data) {
+    if ((s[0] == 0) || (s == NULL)) {
+      if (socklist[ret].inbuf != NULL) {
+        strcpy(s, socklist[ret].inbuf);
+        *len = strlen(s);
+      }
+    }
     return socklist[ret].sock;
   } else {
     return -3;
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.784 eggdrop1.6/src/patch.h:1.785
--- eggdrop1.6/src/patch.h:1.784	Mon Jul 22 00:48:53 2002
+++ eggdrop1.6/src/patch.h	Mon Jul 22 00:55:23 2002
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.784 2002/07/22 05:48:53 guppy Exp $
+ * $Id: patch.h,v 1.785 2002/07/22 05:55:23 guppy Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1027316949");		/* current unixtime */
+patch("1027317495");		/* current unixtime */
 /*
  *
  *
  */
-patch("mns_ban_fix");
+patch("sockfix");
 /*
  *
  *
----------------------- End of diff -----------------------



More information about the Changes mailing list