> BUFSIZE is not to be increased on any IRC network unless all clients and
> servers agree on the new value.  512 is the value specified in RFC 1459.
> IRC servers that use a smaller value will drop parameters; IRC clients
> with a smaller value than their server could be crashed, depending on the
> degree of care that has gone into writing the client.  (A well-written
> client should not crash, but what it will get and what it will display to
> the user are left unspecified--and not all coders pay attention to the
> "Be liberal in what you accept" rule.)

    Thanks for the information.  The software will be used in a
    tightly controlled environment where we can define all
    settings beforehand, so that compatibility to other software
    is of less concern.

    After crashing the server a couple of times, I have found
    that increasing the send-/user-/servbuf-sizes in send.[ch]
    from 2048 to 8192 seems to make it work.  I'm not sure
    whether dbuf.c's DBUF_SIZE needs to be increased as well.
    Your guidance on this issue is appreciated.

    I'm appending a patch for centralizing the sendbuffer-related
    settings.

    - Sascha                                     Experience IRCG
      http://schumann.cx/                http://schumann.cx/ircg
diff -ur ircu2.10/include/ircd_defs.h ircu2.10-ok/include/ircd_defs.h
--- ircu2.10/include/ircd_defs.h        Tue Oct  2 14:57:23 2001
+++ ircu2.10-ok/include/ircd_defs.h     Fri Nov  9 20:17:04 2001
@@ -105,6 +105,12 @@
  */
 #define BUFSIZE         512     /* WARNING: *DONT* CHANGE THIS!!!! */
 
+/*
+ * SENDBUFSIZE must be large enough to contain all messages which are
+ * sent to clients and servers.
+ */
+#define SENDBUFSIZE    2048
+
 #define MAXTARGETS      20
 #define STARTTARGETS    10
 #define RESERVEDTARGETS 12
diff -ur ircu2.10/include/send.h ircu2.10-ok/include/send.h
--- ircu2.10/include/send.h     Wed Aug 29 22:01:08 2001
+++ ircu2.10-ok/include/send.h  Fri Nov  9 20:18:12 2001
@@ -62,6 +62,8 @@
 extern void sendbufto_op_mask(unsigned int mask);
 extern void sendbufto_serv_butone(struct Client *one);
 
-extern char sendbuf[2048];
+#include "ircd_defs.h"
+
+extern char sendbuf[SENDBUFSIZE];
 
 #endif /* INCLUDED_send_h */
diff -ur ircu2.10/ircd/s_bsd.c ircu2.10-ok/ircd/s_bsd.c
--- ircu2.10/ircd/s_bsd.c       Sun Jun 10 00:45:37 2001
+++ ircu2.10-ok/ircd/s_bsd.c    Fri Nov  9 19:10:30 2001
@@ -717,7 +717,7 @@
        * -avalon
        */
       if (0 == dolen) {
-        if (DBufLength(&cptr->recvQ) < 510)
+        if (DBufLength(&cptr->recvQ) < BUFSIZE - 2)
           cptr->flags |= FLAGS_NONL;
         else
           DBufClear(&cptr->recvQ);
diff -ur ircu2.10/ircd/send.c ircu2.10-ok/ircd/send.c
--- ircu2.10/ircd/send.c        Wed Aug 29 22:01:20 2001
+++ ircu2.10-ok/ircd/send.c     Fri Nov  9 20:15:59 2001
@@ -42,13 +42,13 @@
 #include <string.h>
 
 
-char sendbuf[2048];
+char sendbuf[SENDBUFSIZE];
 static int sentalong[MAXCONNECTIONS];
 static int sentalong_marker;
 struct SLink *opsarray[32];     /* don't use highest bit unless you change
                                    atoi to strtoul in sendto_op_mask() */
 #ifdef GODMODE
-char sendbuf2[2048];
+char sendbuf2[SENDBUFSIZE];
 int sdbflag;
 #endif /* GODMODE */
 
@@ -239,8 +239,8 @@
 
   len = strlen(buf);
   if (buf[len - 1] != '\n') {
-    if (len > 510)
-      len = 510;
+    if (len > BUFSIZE - 2)
+      len = BUFSIZE - 2;
     buf[len++] = '\r';
     buf[len++] = '\n';
     buf[len] = '\0';
@@ -367,8 +367,8 @@
   */
   struct Membership* member;
   struct Client *acptr;
-  char userbuf[2048];
-  char servbuf[2048];
+  char userbuf[SENDBUFSIZE];
+  char servbuf[SENDBUFSIZE];
   int i;
   int flag=-1;
 

Reply via email to