diff -c -r -N irc2.8.21+CSr13/include/comstud.h irc2.8.21+CSr14/include/comstud.h *** irc2.8.21+CSr13/include/comstud.h Sat Sep 30 18:42:43 1995 --- irc2.8.21+CSr14/include/comstud.h Fri Oct 6 22:23:36 1995 *************** *** 1,6 **** --- 1,20 ---- #ifndef COMSTUD_H #define COMSTUD_H + /* MAXBUFFERS - make send/receive socket buffers the maximum + size they can be...#undef this if you notice + your ircd using way too much mem... + */ + + #define MAXBUFFERS + + #ifndef MAXBUFFERS + + /* This is the buffer size to use if MAXBUFFER isn't used: */ + + #define READBUFSIZE 32767 + #endif + /* DOG3 - define this if you want to use 'leet dog3 super stuff */ *************** *** 178,184 **** want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr13/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c --- 192,198 ---- want them logged */ ! #define FNAME_FAILED_OPER "/home/irc/irc2.8.21+CSr14/lib/logs/failed.log" /* CLIENT_NOTICES - define this if you wish to see client connecting and exiting notices via /umode +c *************** *** 262,268 **** and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr13/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client --- 276,282 ---- and you wish to log clones */ ! #define FNAME_CLONELOG "/home/irc/irc2.8.21+CSr14/logs/clones.log" /* DEFAULT_IDLELIMIT - if you have CHECK_IDLE defined above, this value is the default # a client diff -c -r -N irc2.8.21+CSr13/include/config.h irc2.8.21+CSr14/include/config.h *** irc2.8.21+CSr13/include/config.h Thu Sep 28 17:24:29 1995 --- irc2.8.21+CSr14/include/config.h Mon Oct 2 16:36:10 1995 *************** *** 107,114 **** * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr13/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr13/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ --- 107,114 ---- * these are only the recommened names and paths. Change as needed. * You must define these to something, even if you don't really want them. */ ! #define DPATH "/home/irc/irc2.8.21+CSr14/lib" /* dir where all ircd stuff is */ ! #define SPATH "/home/irc/irc2.8.21+CSr14/lib/ircd" #define CPATH "ircd.conf" /* server configuration file */ #define MPATH "ircd.motd" /* server MOTD file */ #define LPATH "ircd.log" /* Where the debug file lives, if DEBUGMODE */ *************** *** 122,129 **** * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr13/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr13/logs/opers.log" /* */ /* CHROOTDIR * --- 122,129 ---- * successful use of /oper. These are either full paths or files within DPATH. */ ! #define FNAME_USERLOG "/home/irc/irc2.8.21+CSr14/logs/users.log" /* */ ! #define FNAME_OPERLOG "/home/irc/irc2.8.21+CSr14/logs/opers.log" /* */ /* CHROOTDIR * *************** *** 404,410 **** * 1 server = 1 connection, 1 user = 1 connection. * This should be at *least* 3: 1 listen port, 1 dns port + 1 client */ ! #define MAXCONNECTIONS 35 /* * this defines the length of the nickname history. each time a user changes --- 404,410 ---- * 1 server = 1 connection, 1 user = 1 connection. * This should be at *least* 3: 1 listen port, 1 dns port + 1 client */ ! #define MAXCONNECTIONS 255 /* * this defines the length of the nickname history. each time a user changes diff -c -r -N irc2.8.21+CSr13/include/patchlevel.h irc2.8.21+CSr14/include/patchlevel.h *** irc2.8.21+CSr13/include/patchlevel.h Thu Sep 28 17:24:39 1995 --- irc2.8.21+CSr14/include/patchlevel.h Mon Oct 2 12:57:50 1995 *************** *** 17,21 **** */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr13" #endif --- 17,21 ---- */ #ifndef PATCHLEVEL ! #define PATCHLEVEL "2.8.21+CSr14" #endif diff -c -r -N irc2.8.21+CSr13/ircd/channel.c irc2.8.21+CSr14/ircd/channel.c *** irc2.8.21+CSr13/ircd/channel.c Thu Sep 28 17:24:59 1995 --- irc2.8.21+CSr14/ircd/channel.c Fri Oct 6 18:21:12 1995 *************** *** 367,375 **** sub1_from_channel(chptr); } ! static int change_chan_flag(lp, chptr) Link *lp; aChannel *chptr; { Reg1 Link *tmp; --- 367,376 ---- sub1_from_channel(chptr); } ! static int change_chan_flag(lp, chptr, mine) Link *lp; aChannel *chptr; + int mine; { Reg1 Link *tmp; *************** *** 377,383 **** if (lp->flags & MODE_ADD) { #ifdef NO_RED_MODES ! if (tmp->flags & (lp->flags & MODE_FLAGS)) return 0; #endif tmp->flags |= lp->flags & MODE_FLAGS; --- 378,384 ---- if (lp->flags & MODE_ADD) { #ifdef NO_RED_MODES ! if (mine && tmp->flags & (lp->flags & MODE_FLAGS)) return 0; #endif tmp->flags |= lp->flags & MODE_FLAGS; *************** *** 385,391 **** else { #ifdef NO_RED_MODES ! if (!(tmp->flags & (lp->flags & MODE_FLAGS))) return 0; #endif tmp->flags &= ~lp->flags & MODE_FLAGS; --- 386,392 ---- else { #ifdef NO_RED_MODES ! if (mine && !(tmp->flags & (lp->flags & MODE_FLAGS))) return 0; #endif tmp->flags &= ~lp->flags & MODE_FLAGS; *************** *** 1073,1079 **** case MODE_CHANOP : case MODE_VOICE : /* pass fakes along? nawww */ ! if (ischop && change_chan_flag(lp, chptr)) { *mbuf++ = c; (void)strcat(pbuf, cp); --- 1074,1081 ---- case MODE_CHANOP : case MODE_VOICE : /* pass fakes along? nawww */ ! if (ischop && change_chan_flag(lp, chptr, ! MyClient(sptr))) { *mbuf++ = c; (void)strcat(pbuf, cp); *************** *** 1974,1982 **** --- 1976,1990 ---- if (IsInvisible(c2ptr) && !IsMember(sptr,chptr)) continue; if (lp->flags & CHFL_CHANOP) + { + idx++; (void)strcat(buf, "@"); + } else if (lp->flags & CHFL_VOICE) + { (void)strcat(buf, "+"); + idx++; + } (void)strncat(buf, c2ptr->name, NICKLEN); idx += strlen(c2ptr->name) + 1; flag = 1; diff -c -r -N irc2.8.21+CSr13/ircd/ircd.c irc2.8.21+CSr14/ircd/ircd.c *** irc2.8.21+CSr13/ircd/ircd.c Sun Sep 24 01:48:20 1995 --- irc2.8.21+CSr14/ircd/ircd.c Fri Oct 6 22:12:51 1995 *************** *** 50,55 **** --- 50,56 ---- int dog3loadrecv = DEFAULT_LOADRECV; time_t check_fdlists(); + void send_high_sendq(); #endif /* DOG3 */ *************** *** 855,860 **** --- 856,866 ---- if (lifesux) (void)read_message(1,&serv_fdlist); /* read servs more often */ + #ifdef DOG3 + /* screw it...send what you can to high sendq'd + servers - CS */ + send_high_sendq(&serv_fdlist); + #endif { static time_t lasttime=0; if ((lasttime + (lifesux +1) * 2)< (now = time(NULL))) *************** *** 1013,1018 **** --- 1019,1042 ---- } #ifdef DOG3 + + void send_high_sendq(listp) + fdlist *listp; + { + int i, j; + aClient *cptr; + + for (i=listp->entry[j=1];j<=listp->last_entry; + i=listp->entry[++j]) + { + if (!(cptr = local[i]) || IsMe(cptr) || IsConnecting(cptr)) + continue; + if (DBufLength(&cptr->sendQ) > 10240) + send_queued(cptr); + } + } + + time_t check_fdlists(now) time_t now; { diff -c -r -N irc2.8.21+CSr13/ircd/s_bsd.c irc2.8.21+CSr14/ircd/s_bsd.c *** irc2.8.21+CSr13/ircd/s_bsd.c Thu Sep 28 18:06:51 1995 --- irc2.8.21+CSr14/ircd/s_bsd.c Fri Oct 6 21:00:17 1995 *************** *** 76,81 **** --- 76,85 ---- #define IN_LOOPBACKNET 0x7f #endif + #if defined(MAXBUFFERS) && !defined(SEQUENT) + int rcvbufmax = 0, sndbufmax = 0; + #endif + aClient *local[MAXCONNECTIONS]; int highest_fd = 0, readcalls = 0, udpfd = -1, resfd = -1; static struct sockaddr_in mysk; *************** *** 90,96 **** static void add_unixconnection PROTO((aClient *, int)); static char unixpath[256]; #endif ! static char readbuf[8192]; /* * Try and find the correct name to use with getrlimit() for setting the max. --- 94,113 ---- static void add_unixconnection PROTO((aClient *, int)); static char unixpath[256]; #endif ! ! #if defined(MAXBUFFERS) && !defined(SEQUENT) ! static char *readbuf; ! #else ! ! #ifdef SEQUENT ! # ifdef READBUFSIZE ! # undef READBUFSIZE ! # endif ! #define READBUFSIZE 8192 ! #endif ! ! static char readbuf[READBUFSIZE]; ! #endif /* * Try and find the correct name to use with getrlimit() for setting the max. *************** *** 1094,1100 **** report_error("setsockopt(SO_USELOOPBACK) %s:%s", cptr); #endif #ifdef SO_RCVBUF ! opt = 8192; if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) report_error("setsockopt(SO_RCVBUF) %s:%s", cptr); #endif --- 1111,1133 ---- report_error("setsockopt(SO_USELOOPBACK) %s:%s", cptr); #endif #ifdef SO_RCVBUF ! #ifdef MAXBUFFERS ! if (rcvbufmax==0) { ! int optlen; ! optlen = sizeof(rcvbufmax); ! getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rcvbufmax, ! &optlen); ! while((rcvbufmax < 65535) && (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, ! (char *) &rcvbufmax, optlen) >= 0)) ! rcvbufmax++; ! getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rcvbufmax, ! &optlen); ! readbuf = (char *)MyMalloc(rcvbufmax * sizeof(char)); ! } ! opt = rcvbufmax; ! #else ! opt = READBUFSIZE; ! #endif if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) < 0) report_error("setsockopt(SO_RCVBUF) %s:%s", cptr); #endif *************** *** 1105,1120 **** */ opt = 8192; # else ! opt = 8192; # endif if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)) < 0) report_error("setsockopt(SO_SNDBUF) %s:%s", cptr); #endif #if defined(IP_OPTIONS) && defined(IPPROTO_IP) { ! char *s = readbuf, *t = readbuf + sizeof(readbuf) / 2; opt = sizeof(readbuf) / 8; if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS, t, &opt) < 0) report_error("getsockopt(IP_OPTIONS) %s:%s", cptr); else if (opt > 0) --- 1138,1173 ---- */ opt = 8192; # else ! #ifdef MAXBUFFERS ! if (sndbufmax==0) { ! int optlen; ! optlen = sizeof(sndbufmax); ! getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &sndbufmax, ! &optlen); ! while((sndbufmax < 65535) && (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, ! (char *) &sndbufmax, optlen) >= 0)) sndbufmax++; ! getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &sndbufmax, ! &optlen); ! } ! opt = sndbufmax; ! #else ! opt = READBUFSIZE; ! #endif # endif if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)) < 0) report_error("setsockopt(SO_SNDBUF) %s:%s", cptr); #endif #if defined(IP_OPTIONS) && defined(IPPROTO_IP) { ! char *s = readbuf, *t; + #ifndef MAXBUFFERS + t = readbuf + sizeof(readbuf) / 2; opt = sizeof(readbuf) / 8; + #else + t = readbuf + (rcvbufmax*sizeof(char))/2; + opt = (rcvbufmax*sizeof(char))/8; + #endif if (getsockopt(fd, IPPROTO_IP, IP_OPTIONS, t, &opt) < 0) report_error("getsockopt(IP_OPTIONS) %s:%s", cptr); else if (opt > 0) *************** *** 1340,1346 **** --- 1393,1403 ---- !(IsPerson(cptr) && DBufLength(&cptr->recvQ) > 6090)) { errno = 0; + #ifndef MAXBUFFERS length = recv(cptr->fd, readbuf, sizeof(readbuf), 0); + #else + length = recv(cptr->fd, readbuf, rcvbufmax*sizeof(char), 0); + #endif #ifdef OPER_CAN_FLOOD1 if (!IsAnOper(cptr)) *************** *** 1413,1419 **** --- 1470,1480 ---- if (IsService(cptr) || IsServer(cptr)) { dolen = dbuf_get(&cptr->recvQ, readbuf, + #ifndef MAXBUFFERS sizeof(readbuf)); + #else + rcvbufmax*sizeof(char)); + #endif if (dolen <= 0) break; if ((done = dopacket(cptr, readbuf, dolen))) *************** *** 1421,1427 **** --- 1482,1492 ---- break; } dolen = dbuf_getmsg(&cptr->recvQ, readbuf, + #ifndef MAXBUFFERS sizeof(readbuf)); + #else + rcvbufmax*sizeof(char)); + #endif /* ** Devious looking...whats it do ? well..if a client ** sends a *long* message without any CR or LF, then *************** *** 2309,2315 **** --- 2374,2384 ---- */ if (!mlen) { + #ifndef MAXBUFFERS mlen = sizeof(readbuf) - strlen(me.name) - strlen(PATCHLEVEL); + #else + mlen = rcvbufmax*sizeof(char) - strlen(me.name) - strlen(PATCHLEVEL); + #endif mlen -= 6; if (mlen < 0) mlen = 0; diff -c -r -N irc2.8.21+CSr13/ircd/s_err.c irc2.8.21+CSr14/ircd/s_err.c *** irc2.8.21+CSr13/ircd/s_err.c Thu Sep 28 18:19:21 1995 --- irc2.8.21+CSr14/ircd/s_err.c Fri Oct 6 18:04:00 1995 *************** *** 40,46 **** /* 002 */ RPL_YOURHOST, ":Your host is %s, running version %s", /* 003 */ RPL_CREATED, ":This server was created %s", #ifdef FK_USERMODES ! /* 004 */ RPL_MYINFO, "%s %s oiwsfuckr biklmnopstv", #else /* 004 */ RPL_MYINFO, "%s %s oiwsucr biklmnopstv", #endif --- 40,46 ---- /* 002 */ RPL_YOURHOST, ":Your host is %s, running version %s", /* 003 */ RPL_CREATED, ":This server was created %s", #ifdef FK_USERMODES ! /* 004 */ RPL_MYINFO, "%s %s oiwsfrcuk biklmnopstv", #else /* 004 */ RPL_MYINFO, "%s %s oiwsucr biklmnopstv", #endif diff -c -r -N irc2.8.21+CSr13/ircd/s_user.c irc2.8.21+CSr14/ircd/s_user.c *** irc2.8.21+CSr13/ircd/s_user.c Sun Sep 24 01:48:20 1995 --- irc2.8.21+CSr14/ircd/s_user.c Fri Oct 6 21:32:30 1995 *************** *** 396,402 **** else strncpyzt(user->host, sptr->sockhost, HOSTLEN+1); aconf = sptr->confs->value.aconf; ! if (sptr->flags & FLAGS_DOID && !(sptr->flags & FLAGS_GOTID)) { char temp[USERLEN+1]; --- 396,402 ---- else strncpyzt(user->host, sptr->sockhost, HOSTLEN+1); aconf = sptr->confs->value.aconf; ! if ((sptr->flags & FLAGS_DOID) && !(sptr->flags & FLAGS_GOTID)) { char temp[USERLEN+1]; *************** *** 1360,1365 **** --- 1360,1366 ---- found = 0; (void)collapse(nick); + /* #ifdef DOG3 if (wilds = (index(nick, '?') || index(nick, '*'))) if (lifesux && !IsAnOper(sptr)) *************** *** 1368,1378 **** return 0; } #else wilds = (index(nick, '?') || index(nick, '*')); #endif /* No longer sending replies to remote clients when wildcards are given */ ! if (!MyConnect(sptr) && wilds) continue; for (acptr = client; (acptr = next_client(acptr, nick)); acptr = acptr->next) --- 1369,1383 ---- return 0; } #else + */ wilds = (index(nick, '?') || index(nick, '*')); + /* #endif + */ /* No longer sending replies to remote clients when wildcards are given */ ! /* Or local ones...something is broked! */ ! if (wilds) continue; for (acptr = client; (acptr = next_client(acptr, nick)); acptr = acptr->next)