[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2007-04-26 21:17:26
|
Committer : zolty CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2007-04-26 21:17:22 UTC Modified files: ChangeLog ChangeLog.es config.h.in include/ircd_features.h include/ircd_signal.h include/motd.h include/patchlevel.h include/s_bsd.h include/struct.h ircd/convert-conf.c ircd/ircd.c ircd/ircd_events.c ircd/ircd_features.c ircd/ircd_log.c ircd/ircd_signal.c ircd/ircd_string.c ircd/m_list.c ircd/m_names.c ircd/m_pass.c ircd/m_ping.c ircd/m_pong.c ircd/m_stats.c ircd/m_whois.c ircd/m_whowas.c ircd/match.c ircd/motd.c ircd/s_bsd.c ircd/s_err.c ircd/s_stats.c Log message: Author: zo...@ir... Log message: 2007-04-26 Toni Garc�a <zo...@ir...> 1.0.beta6 * Aliases para /STATS * PING-PONG con alta prioridad * Soporte para senial SIGCHLD ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.54 ircd-ircdev/ChangeLog:1.55 --- ircd-ircdev/ChangeLog:1.54 Thu Apr 26 12:17:30 2007 +++ ircd-ircdev/ChangeLog Thu Apr 26 14:17:11 2007 @@ -1,10 +1,15 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.54 2007/04/26 19:17:30 zolty Exp $ +# $Id: ChangeLog,v 1.55 2007/04/26 21:17:11 zolty Exp $ # # Insert new changes at beginning of the change list. # +2007-04-26 Toni Garc�a <zo...@ir...> 1.0.beta6 + * Aliases for /STATS + * PING-PONG with high priority + * Signal SIGCHLD support + 2007-04-26 Toni Garcïa <zo...@ir...> 1.0.beta5 * New AUTH * Fix IPv6 support for SunOS and FreeBSD Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.54 ircd-ircdev/ChangeLog.es:1.55 --- ircd-ircdev/ChangeLog.es:1.54 Thu Apr 26 12:17:30 2007 +++ ircd-ircdev/ChangeLog.es Thu Apr 26 14:17:11 2007 @@ -1,10 +1,15 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.54 2007/04/26 19:17:30 zolty Exp $ +# $Id: ChangeLog.es,v 1.55 2007/04/26 21:17:11 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2007-04-26 Toni Garc�a <zo...@ir...> 1.0.beta6 + * Aliases para /STATS + * PING-PONG con alta prioridad + * Soporte para senial SIGCHLD + 2007-04-26 Toni Garc�a <zo...@ir...> 1.0.beta5 * Nuevo AUTH * Fix soporte IPv6 para SunOS y FreeBSD Index: ircd-ircdev/config.h.in diff -u ircd-ircdev/config.h.in:1.10 ircd-ircdev/config.h.in:1.11 --- ircd-ircdev/config.h.in:1.10 Sun Apr 22 06:56:17 2007 +++ ircd-ircdev/config.h.in Thu Apr 26 14:17:11 2007 @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: config.h.in,v 1.10 2007/04/22 13:56:17 zolty Exp $ + * $Id: config.h.in,v 1.11 2007/04/26 21:17:11 zolty Exp $ * */ #ifndef INCLUDED_config_h Index: ircd-ircdev/include/ircd_features.h diff -u ircd-ircdev/include/ircd_features.h:1.18 ircd-ircdev/include/ircd_features.h:1.19 --- ircd-ircdev/include/ircd_features.h:1.18 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/include/ircd_features.h Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Public interfaces and declarations for dealing with configurable features. - * @version $Id: ircd_features.h,v 1.18 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: ircd_features.h,v 1.19 2007/04/26 21:17:11 zolty Exp $ */ #ifndef INCLUDED_features_h #define INCLUDED_features_h @@ -116,41 +116,70 @@ FEAT_HIS_LINKS, FEAT_HIS_TRACE, FEAT_HIS_STATS_a, + FEAT_HIS_STATS_NAMESERVERS, #if defined(DDB) FEAT_HIS_STATS_b, + FEAT_HIS_STATS_DDB, #endif FEAT_HIS_STATS_c, + FEAT_HIS_STATS_CONNECT, FEAT_HIS_STATS_d, + FEAT_HIS_STATS_CRULES, FEAT_HIS_STATS_e, + FEAT_HIS_STATS_ENGINE, FEAT_HIS_STATS_f, + FEAT_HIS_STATS_FEATURES, FEAT_HIS_STATS_g, + FEAT_HIS_STATS_GLINES, FEAT_HIS_STATS_i, + FEAT_HIS_STATS_ACCESS, FEAT_HIS_STATS_j, + FEAT_HIS_STATS_HISTOGRAM, FEAT_HIS_STATS_J, + FEAT_HIS_STATS_JUPES, FEAT_HIS_STATS_k, + FEAT_HIS_STATS_KLINES, FEAT_HIS_STATS_l, + FEAT_HIS_STATS_LINKS, FEAT_HIS_STATS_L, + FEAT_HIS_STATS_MODULES, FEAT_HIS_STATS_m, - FEAT_HIS_STATS_M, + FEAT_HIS_STATS_COMMANDS, FEAT_HIS_STATS_o, + FEAT_HIS_STATS_OPERATORS, FEAT_HIS_STATS_p, + FEAT_HIS_STATS_PORTS, FEAT_HIS_STATS_q, - FEAT_HIS_STATS_r, + FEAT_HIS_STATS_QUARANTINES, FEAT_HIS_STATS_R, + FEAT_HIS_STATS_MAPPINGS, + FEAT_HIS_STATS_r, + FEAT_HIS_STATS_USAGE, FEAT_HIS_STATS_t, + FEAT_HIS_STATS_LOCALS, FEAT_HIS_STATS_T, + FEAT_HIS_STATS_MOTDS, FEAT_HIS_STATS_u, + FEAT_HIS_STATS_UPTIME, FEAT_HIS_STATS_U, + FEAT_HIS_STATS_UWORLD, FEAT_HIS_STATS_v, + FEAT_HIS_STATS_VSERVERS, FEAT_HIS_STATS_w, + FEAT_HIS_STATS_USERLOAD, FEAT_HIS_STATS_x, + FEAT_HIS_STATS_MEMUSAGE, FEAT_HIS_STATS_y, + FEAT_HIS_STATS_CLASSES, FEAT_HIS_STATS_z, + FEAT_HIS_STATS_MEMORY, + FEAT_HIS_STATS_IAUTH, FEAT_HIS_WHOIS_SERVERNAME, FEAT_HIS_WHOIS_IDLETIME, FEAT_HIS_WHOIS_LOCALCHAN, FEAT_HIS_WHO_SERVERNAME, FEAT_HIS_WHO_HOPCOUNT, + FEAT_HIS_MODEWHO, FEAT_HIS_BANWHO, FEAT_HIS_KILLWHO, FEAT_HIS_REWRITE, Index: ircd-ircdev/include/ircd_signal.h diff -u ircd-ircdev/include/ircd_signal.h:1.5 ircd-ircdev/include/ircd_signal.h:1.6 --- ircd-ircdev/include/ircd_signal.h:1.5 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/ircd_signal.h Thu Apr 26 14:17:11 2007 @@ -21,12 +21,17 @@ */ /** @file ircd_signal.h * @brief Interface to signal handler subsystem. - * @version $Id: ircd_signal.h,v 1.5 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: ircd_signal.h,v 1.6 2007/04/26 21:17:11 zolty Exp $ */ #ifndef INCLUDED_ircd_signal_h #define INCLUDED_ircd_signal_h +typedef void (*SigChldCallBack)(pid_t child_pid, void *datum, int status); + extern void setup_signals(void); +extern void register_child(pid_t child, SigChldCallBack call, void *datum); +extern void unregister_child(pid_t child); +extern void reap_children(void); #endif /* INCLUDED_ircd_signal_h */ Index: ircd-ircdev/include/motd.h diff -u ircd-ircdev/include/motd.h:1.6 ircd-ircdev/include/motd.h:1.7 --- ircd-ircdev/include/motd.h:1.6 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/motd.h Thu Apr 26 14:17:11 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Message-of-the-day manipulation interface and declarations. - * @version $Id: motd.h,v 1.6 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: motd.h,v 1.7 2007/04/26 21:17:11 zolty Exp $ */ #ifndef INCLUDED_motd_h #define INCLUDED_motd_h @@ -93,10 +93,11 @@ /* motd_recache causes all the MOTD caches to be cleared */ void motd_recache(void); -/* motd_init initializes the MOTD routines, including reading the +/* motd_init_* initialize the MOTDs, including reading the * ircd.motd and remote.motd files into cache */ -void motd_init(void); +void motd_init_local(void); +void motd_init_remote(void); /* This routine adds a MOTD */ void motd_add(const char *hostmask, const char *path); Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.53 ircd-ircdev/include/patchlevel.h:1.54 --- ircd-ircdev/include/patchlevel.h:1.53 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/include/patchlevel.h Thu Apr 26 14:17:11 2007 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.53 2007/04/26 19:17:31 zolty Exp $ + * $Id: patchlevel.h,v 1.54 2007/04/26 21:17:11 zolty Exp $ * */ -#define PATCHLEVEL "5" +#define PATCHLEVEL "6" #define RELEASE "1.0.beta" Index: ircd-ircdev/include/s_bsd.h diff -u ircd-ircdev/include/s_bsd.h:1.10 ircd-ircdev/include/s_bsd.h:1.11 --- ircd-ircdev/include/s_bsd.h:1.10 Sun Apr 22 06:56:20 2007 +++ ircd-ircdev/include/s_bsd.h Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file s_bsd.h * @brief Wrapper functions to avoid direct use of BSD APIs. - * @version $Id: s_bsd.h,v 1.10 2007/04/22 13:56:20 zolty Exp $ + * @version $Id: s_bsd.h,v 1.11 2007/04/26 21:17:11 zolty Exp $ */ #ifndef INCLUDED_s_bsd_h #define INCLUDED_s_bsd_h @@ -62,14 +62,8 @@ extern const char* const REUSEADDR_ERROR_MSG; extern const char* const SOCKET_ERROR_MSG; extern const char* const CONNLIMIT_ERROR_MSG; -extern const char* const ACCEPT_ERROR_MSG; -extern const char* const PEERNAME_ERROR_MSG; -extern const char* const POLL_ERROR_MSG; -extern const char* const SELECT_ERROR_MSG; -extern const char* const CONNECT_ERROR_MSG; extern const char* const SETBUFS_ERROR_MSG; extern const char* const TOS_ERROR_MSG; -extern const char* const REGISTER_ERROR_MSG; extern int HighestFd; extern struct Client** LocalClientArray; Index: ircd-ircdev/include/struct.h diff -u ircd-ircdev/include/struct.h:1.12 ircd-ircdev/include/struct.h:1.13 --- ircd-ircdev/include/struct.h:1.12 Sun Apr 22 06:56:20 2007 +++ ircd-ircdev/include/struct.h Thu Apr 26 14:17:11 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Structure definitions for users and servers. - * @version $Id: struct.h,v 1.12 2007/04/22 13:56:20 zolty Exp $ + * @version $Id: struct.h,v 1.13 2007/04/26 21:17:11 zolty Exp $ */ #ifndef INCLUDED_struct_h #define INCLUDED_struct_h @@ -62,6 +62,7 @@ int asll_rtt; /**< AsLL round-trip time */ int asll_to; /**< AsLL upstream lag */ int asll_from; /**< AsLL downstream lag */ + time_t asll_last; /**< Last time we sent or received an AsLL ping */ #if defined(DDB) unsigned long ddb_open; /**< DDB database open */ Index: ircd-ircdev/ircd/convert-conf.c diff -u ircd-ircdev/ircd/convert-conf.c:1.2 ircd-ircdev/ircd/convert-conf.c:1.3 --- ircd-ircdev/ircd/convert-conf.c:1.2 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/ircd/convert-conf.c Thu Apr 26 14:17:11 2007 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: convert-conf.c,v 1.2 2007/04/19 22:53:47 zolty Exp $ + * $Id: convert-conf.c,v 1.3 2007/04/26 21:17:11 zolty Exp $ * convert-conf.c - Convert ircu2.10.11 ircd.conf to ircu2.10.12 format. * */ @@ -30,13 +30,12 @@ #define MAX_FIELDS 5 -const char *admin_names[] = { "location", "contact", "contact", 0 }, - *connect_names[] = { "host", "password", "name", "#port", "class", 0 }, +static const char *admin_names[] = { "location", "contact", "contact", 0 }, *crule_names[] = { "server", "", "rule", 0 }, *general_names[] = { "name", "vhost", "description", "", "#numeric", 0 }, *motd_names[] = { "host", "file", 0 }, *class_names[] = { "name", "#pingfreq", "#connectfreq", "#maxlinks", "#sendq", 0 }, - *removed_features[] = { "VIRTUAL_HOST", "OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", 0 }; + *removed_features[] = { "VIRTUAL_HOST", "TIMESEC", "OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", "HIS_STATS_h", "HIS_DESYNCS", "AUTOHIDE", 0 }; static char orig_line[512], line[512], dbuf[512]; static char *fields[MAX_FIELDS + 1]; static unsigned int nfields; @@ -106,7 +105,7 @@ fputs("};\n", stdout); } -#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE); (TARGET) = malloc(len+1); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0) +#define dupstring(TARGET, SOURCE) do { free(TARGET); if (SOURCE) { size_t len = strlen(SOURCE) + 1; (TARGET) = malloc(len); memcpy((TARGET), (SOURCE), len); } else (TARGET) = 0; } while(0) /*** MANAGING LISTS OF STRINGS ***/ @@ -165,7 +164,7 @@ nlen = strlen(name); for (conn = connects; conn; conn = conn->next) { - for (ii = 0; tolower(name[ii]) == conn->name[ii] && ii < nlen; ++ii) ; + for (ii = 0; tolower(name[ii]) == tolower(conn->name[ii]) && ii < nlen; ++ii) ; if (conn->name[ii] == '\0' && name[ii] == '\0') break; } @@ -175,7 +174,7 @@ { conn = calloc(1, sizeof(*conn) + nlen); for (ii = 0; ii < nlen; ++ii) - conn->name[ii] = tolower(name[ii]); + conn->name[ii] = name[ii]; conn->next = connects; connects = conn; } @@ -219,6 +218,13 @@ { for (sl = conn->origins; sl; sl = sl->next) fprintf(stdout, "# %s\n", sl->value); + if (conn->host == NULL + || conn->password == NULL + || conn->class == NULL) { + fprintf(stderr,"H:line missing C:line for %s\n", conn->name); + continue; + } + fprintf(stdout, "Connect {\n\tname =\"%s\";\n\thost = \"%s\";\n" "\tpassword = \"%s\";\n\tclass = \"%s\";\n", @@ -308,7 +314,7 @@ ii = strlen(fields[0]); feat = calloc(1, sizeof(*feat) + ii); while (ii-- > 0) - feat->name[ii] = toupper(fields[0][ii]); + feat->name[ii] = fields[0][ii]; feat->next = features; features = feat; string_get(&feat->origins, orig_line); @@ -323,9 +329,15 @@ struct feature *feat; size_t ii; - fputs("Features {\n\t\"OPLEVELS\" = \"FALSE\";\n", stdout); + fputs("Features {\n", stdout); + fputs("\t\"OPLEVELS\" = \"FALSE\";\n", stdout); + fputs("\t\"ZANNELS\" = \"FALSE\";\n", stdout); for (feat = features; feat; feat = feat->next) { + /* Display the original feature line we are talking about. */ + for (sl = feat->origins; sl; sl = sl->next) + fprintf(stdout, "# %s\n", sl->value); + /* See if the feature was remapped to an oper privilege. */ for (rmf = remapped_features; rmf->name; rmf++) if (0 == strcmp(feat->name, rmf->name)) @@ -345,6 +357,14 @@ continue; } + /* If it had no value before, drop it now since the lexer does + * not accept empty strings and the grammar does not accept + * empty stringlists.*/ + if (!feat->values) { + fprintf(stdout, "# Above feature had no value.\n"); + continue; + } + /* Wasn't remapped, wasn't removed: print it out. */ fprintf(stdout, "\t\"%s\" =", feat->name); for (sl = feat->values; sl; sl = sl->next) @@ -421,7 +441,7 @@ } for (ii = 0; (remap = &remapped_features[ii++])->name; ) { if (!remap->feature || !remap->privilege - || !remap->feature->values || !remap->flags & mask) + || !remap->feature->values || !(remap->flags & mask)) continue; fprintf(stdout, "\t%s = %s;\n", remap->privilege, strcmp(remap->feature->values->value, "TRUE") ? "no" : "yes"); @@ -601,9 +621,10 @@ fputs(line, stdout); continue; } - /* Strip EOL character(s) and pass blank lines through. */ - while (len > 0 && (line[len-1] == '\n' || line[len-1] == '\r')) + /* Strip trailing whitespace. */ + while (len > 0 && isspace(line[len-1])) line[--len] = '\0'; + /* Pass blank lines through. */ if (len == 0) { fputc('\n', stdout); continue; Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.27 ircd-ircdev/ircd/ircd.c:1.28 --- ircd-ircdev/ircd/ircd.c:1.27 Sat Apr 21 14:17:22 2007 +++ ircd-ircdev/ircd/ircd.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Entry point and other initialization functions for the daemon. - * @version $Id: ircd.c,v 1.27 2007/04/21 21:17:22 zolty Exp $ + * @version $Id: ircd.c,v 1.28 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -44,7 +44,6 @@ #include "jupe.h" #include "list.h" #include "match.h" -#include "motd.h" #include "msg.h" #include "numeric.h" #include "numnicks.h" @@ -107,8 +106,6 @@ struct Client *GlobalClientList = &me; /**< Pointer to beginning of Client list */ time_t TSoffset = 0; /**< Offset of timestamps to system clock */ -int GlobalRehashFlag = 0; /**< do a rehash if set */ -int GlobalRestartFlag = 0; /**< do a restart if set */ time_t CurrentTime; /**< Updated every time we leave select() */ char *configfile = CPATH; /**< Server configuration file */ @@ -193,6 +190,8 @@ close_connections(!(thisServer.bootopt & (BOOT_TTY | BOOT_DEBUG | BOOT_CHKCONF))); + reap_children(); + execv(SPATH, thisServer.argv); /* Have to reopen since it has been closed above */ @@ -264,14 +263,17 @@ struct ConfItem* aconf; struct ConfItem** pconf; time_t next = 0; - struct ConnectionClass* cltmp; struct Jupe* ajupe; - int hold; + int hold; + int done; assert(ET_EXPIRE == ev_type(ev)); assert(0 != ev_timer(ev)); Debug((DEBUG_NOTICE, "Connection check at : %s", myctime(CurrentTime))); + next = CurrentTime + feature_int(FEAT_CONNECTFREQUENCY); + done = 0; + for (aconf = GlobalConfList; aconf; aconf = aconf->next) { /* Only consider server items with non-zero port and non-zero * connect times that are not actively juped. @@ -286,17 +288,16 @@ hold = aconf->hold > CurrentTime; /* Update next possible connection check time. */ - if (hold && (next > aconf->hold || next == 0)) + if (hold && next > aconf->hold) next = aconf->hold; - cltmp = aconf->conn_class; - /* Do not try to connect if its use is still on hold until future, + * we have already initiated a connection this try_connections(), * too many links in its connection class, it is already linked, * or if connect rules forbid a link now. */ - if (hold - || (Links(cltmp) > MaxLinks(cltmp)) + if (hold || done + || (ConfLinks(aconf) > ConfMaxLinks(aconf)) || FindServer(aconf->name) || conf_eval_crule(aconf->name, CRULE_MASK)) continue; @@ -318,14 +319,10 @@ aconf->name); /* And stop looking for further candidates. */ - break; + done = 1; } - if (next == 0) - next = CurrentTime + feature_int(FEAT_CONNECTFREQUENCY); - Debug((DEBUG_NOTICE, "Next connection check : %s", myctime(next))); - timer_add(&connect_timer, try_connections, 0, TT_ABSOLUTE, next); } @@ -369,6 +366,24 @@ IsPingSent(cptr) ? "[Ping Sent]" : "[]", max_ping, (int)(CurrentTime - cli_lasttime(cptr)))); + /* If it's a server and we have not sent an AsLL lately, do so. */ + if (IsServer(cptr)) { + if (CurrentTime - cli_serv(cptr)->asll_last >= max_ping) { + char *asll_ts; + + SetPingSent(cptr); + cli_serv(cptr)->asll_last = CurrentTime; + expire = cli_serv(cptr)->asll_last + max_ping; + asll_ts = militime_float(NULL); + sendcmdto_prio_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, + cli_name(cptr), asll_ts); + } + + expire = cli_serv(cptr)->asll_last + max_ping; + if (expire < next_check) + next_check = expire; + } + /* Ok, the thing that will happen most frequently, is that someone will * have sent something recently. Cover this first for speed. * -- @@ -392,28 +407,18 @@ */ if (!IsRegistered(cptr)) { assert(!IsServer(cptr)); - if ((CurrentTime-cli_firsttime(cptr) >= max_ping)) { - /* Display message if they have sent a NICK and a USER but no - * nospoof PONG. - */ - if (*(cli_name(cptr)) && cli_user(cptr) && *(cli_user(cptr))->username) { - send_reply(cptr, SND_EXPLICIT | ERR_BADPING, - ":Your client may not be compatible with this server."); - send_reply(cptr, SND_EXPLICIT | ERR_BADPING, - ":Compatible clients are available at %s", - feature_str(FEAT_URL_CLIENTS)); - } - exit_client_msg(cptr,cptr,&me, "Registration Timeout"); - continue; - } else { - /* OK, they still have enough time left, so we'll just skip to the - * next client. Set the next check to be when their time is up, if - * that's before the currently scheduled next check -- hikari */ - expire = cli_firsttime(cptr) + max_ping; - if (expire < next_check) - next_check = expire; + /* If client authorization time has expired, ask auth whether they + * should be checked again later. */ + if ((CurrentTime-cli_firsttime(cptr) >= max_ping) + && auth_ping_timeout(cptr)) continue; - } + /* OK, they still have enough time left, so we'll just skip to the + * next client. Set the next check to be when their time is up, if + * that's before the currently scheduled next check -- hikari */ + expire = cli_firsttime(cptr) + max_ping; + if (expire < next_check) + next_check = expire; + continue; } /* Quit the client after max_ping*2 - they should have answered by now */ @@ -441,11 +446,7 @@ if (IsUser(cptr)) sendrawto_one(cptr, MSG_PING " :%s", cli_name(&me)); else - { - char *asll_ts = militime_float(NULL); - sendcmdto_one(&me, CMD_PING, cptr, "!%s %s %s", asll_ts, - cli_name(cptr), asll_ts); - } + sendcmdto_prio_one(&me, CMD_PING, cptr, ":%s", cli_name(&me)); } expire = cli_lasttime(cptr) + max_ping * 2; @@ -730,8 +731,6 @@ should be removed -- hikari */ ircd_crypt_init(); - motd_init(); - if (!init_conf()) { log_write(LS_SYSTEM, L_CRIT, 0, "Failed to read configuration file %s", configfile); Index: ircd-ircdev/ircd/ircd_events.c diff -u ircd-ircdev/ircd/ircd_events.c:1.9 ircd-ircdev/ircd/ircd_events.c:1.10 --- ircd-ircdev/ircd/ircd_events.c:1.9 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_events.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of event loop mid-layer. - * @version $Id: ircd_events.c,v 1.9 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_events.c,v 1.10 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -88,13 +88,13 @@ * This is used if an engine does not implement signal handling itself * (when Engine::eng_signal is NULL). */ -static struct { +static struct sigInfo_s { int fd; /**< signal routine's fd */ struct Socket sock; /**< and its struct Socket */ } sigInfo = { -1 }; /** All the thread info */ -static struct { +static struct evInfo_s { struct Generators gens; /**< List of all generators */ struct Event* events_free; /**< struct Event free list */ unsigned int events_alloc; /**< count of allocated struct Events */ @@ -146,6 +146,48 @@ } } +#ifndef IRCD_THREADED + +/** Generate and execute an event. + * @param[in] type Type of event to generate. + * @param[in] arg Pointer to an event generator (GenHeader). + * @param[in] data Extra data for event. + */ +void +event_generate(enum EventType type, void* arg, int data) +{ + struct Event ev; + struct GenHeader *gen = (struct GenHeader*) arg; + + assert(0 != gen); + assert(gen->gh_flags & GEN_ACTIVE); + + if (type == ET_DESTROY) + { + if (gen->gh_flags & GEN_DESTROY) + return; + gen->gh_flags &= ~GEN_ACTIVE; + } + else if (type == ET_ERROR) + gen->gh_flags |= GEN_ERROR; + + Debug((DEBUG_LIST, "Generating event type %s for generator %p (%s)", + event_to_name(type), gen, gen_flags(gen->gh_flags))); + + ev.ev_next = NULL; + ev.ev_prev_p = NULL; + ev.ev_type = type; + ev.ev_data = data; + ev.ev_gen.gen_header = gen; + gen->gh_ref++; + + gen->gh_call(&ev); + if (type != ET_DESTROY) + gen_ref_dec(gen); +} + +#else + /** Execute an event. * Optimizations should inline this. * @param[in] event Event to execute. @@ -180,17 +222,6 @@ evInfo.events_free = event; } -#ifndef IRCD_THREADED -/** we synchronously execute the event when not threaded */ -#define event_add(event) \ -do { \ - struct Event* _ev = (event); \ - _ev->ev_next = 0; \ - _ev->ev_prev_p = 0; \ - event_execute(_ev); \ -} while (0) - -#else /** Add an event to the work queue. * @param[in] event Event to enqueue. */ @@ -241,6 +272,43 @@ /* We'd also have to signal the work crew here */ } } + +/** Generate an event and add it to the queue (or execute it). + * @param[in] type Type of event to generate. + * @param[in] arg Pointer to an event generator (GenHeader). + * @param[in] data Extra data for event. + */ +void +event_generate(enum EventType type, void* arg, int data) +{ + struct Event* ptr; + struct GenHeader* gen = (struct GenHeader*) arg; + + assert(0 != gen); + + /* don't create events (other than ET_DESTROY) for destroyed generators */ + if (type != ET_DESTROY && (gen->gh_flags & GEN_DESTROY)) + return; + + Debug((DEBUG_LIST, "Generating event type %s for generator %p (%s)", + event_to_name(type), gen, gen_flags(gen->gh_flags))); + + if ((ptr = evInfo.events_free)) + evInfo.events_free = ptr->ev_next; /* pop one off the freelist */ + else { /* allocate another structure */ + ptr = (struct Event*) MyMalloc(sizeof(struct Event)); + evInfo.events_alloc++; /* count of allocated events */ + } + + ptr->ev_type = type; /* Record event type */ + ptr->ev_data = data; + + ptr->ev_gen.gen_header = (struct GenHeader*) gen; + ptr->ev_gen.gen_header->gh_ref++; + + event_add(ptr); /* add event to queue */ +} + #endif /* IRCD_THREADED */ /** Place a timer in the correct spot on the queue. @@ -381,42 +449,6 @@ (*evInfo.engine->eng_loop)(&evInfo.gens); } -/** Generate an event and add it to the queue (or execute it). - * @param[in] type Type of event to generate. - * @param[in] arg Pointer to an event generator (GenHeader). - * @param[in] data Extra data for event. - */ -void -event_generate(enum EventType type, void* arg, int data) -{ - struct Event* ptr; - struct GenHeader* gen = (struct GenHeader*) arg; - - assert(0 != gen); - - /* don't create events (other than ET_DESTROY) for destroyed generators */ - if (type != ET_DESTROY && (gen->gh_flags & GEN_DESTROY)) - return; - - Debug((DEBUG_LIST, "Generating event type %s for generator %p (%s)", - event_to_name(type), gen, gen_flags(gen->gh_flags))); - - if ((ptr = evInfo.events_free)) - evInfo.events_free = ptr->ev_next; /* pop one off the freelist */ - else { /* allocate another structure */ - ptr = (struct Event*) MyMalloc(sizeof(struct Event)); - evInfo.events_alloc++; /* count of allocated events */ - } - - ptr->ev_type = type; /* Record event type */ - ptr->ev_data = data; - - ptr->ev_gen.gen_header = (struct GenHeader*) gen; - ptr->ev_gen.gen_header->gh_ref++; - - event_add(ptr); /* add event to queue */ -} - #if 0 /* Try to verify the timer list */ void Index: ircd-ircdev/ircd/ircd_features.c diff -u ircd-ircdev/ircd/ircd_features.c:1.18 ircd-ircdev/ircd/ircd_features.c:1.19 --- ircd-ircdev/ircd/ircd_features.c:1.18 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_features.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of configurable feature support. - * @version $Id: ircd_features.c,v 1.18 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_features.c,v 1.19 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -300,8 +300,13 @@ #define FEAT_INT 0x0001 /**< set if entry contains an integer value */ #define FEAT_BOOL 0x0002 /**< set if entry contains a boolean value */ #define FEAT_STR 0x0003 /**< set if entry contains a string value */ +#define FEAT_ALIAS 0x0004 /**< set if entry is alias for another entry */ +#define FEAT_DEP 0x0005 /**< set if entry is deprecated feature */ #define FEAT_MASK 0x000f /**< possible value types */ +/** Extract just the feature type from a feature descriptor. */ +#define feat_type(feat) ((feat)->flags & FEAT_MASK) + #define FEAT_MARK 0x0010 /**< set if entry has been changed */ #define FEAT_NULL 0x0020 /**< NULL string is permitted */ #define FEAT_CASE 0x0040 /**< string is case-sensitive */ @@ -328,6 +333,13 @@ #define F_S(type, flags, v_str, notify) \ { FEAT_ ## type, #type, FEAT_STR | (flags), 0, 0, 0, (v_str), \ 0, 0, 0, (notify), 0, 0, 0 } +/** Declare a feature as an alias for another feature. */ +#define F_A(type, alias) \ + { FEAT_ ## type, #type, FEAT_ALIAS, 0, FEAT_ ## alias, 0, 0, \ + 0, 0, 0, 0, 0, 0, 0 } +/** Declare a feature as deprecated. */ +#define F_D(type) \ + { FEAT_ ## type, #type, FEAT_DEP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /** Table of feature descriptions. */ static struct FeatureDesc { @@ -363,6 +375,7 @@ F_B(HUB, 0, 0, 0), F_B(WALLOPS_OPER_ONLY, 0, 0, 0), F_B(NODNS, 0, 0, 0), + F_B(NOIDENT, 0, 0, 0), F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0), F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default), F_I(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc), @@ -399,8 +412,8 @@ F_I(CHANNELLEN, 0, 200, set_isupport_channellen), /* Some misc. default paths */ - F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init), - F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init), + F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init_local), + F_S(RPATH, FEAT_CASE | FEAT_MYOPER, "remote.motd", motd_init_remote), F_S(PPATH, FEAT_CASE | FEAT_MYOPER | FEAT_READ, "ircd.pid", 0), #if defined(DDB) F_S(DDBPATH, FEAT_CASE | FEAT_MYOPER, "database", 0), @@ -426,42 +439,71 @@ F_B(HIS_MAP, 0, 1, 0), F_B(HIS_LINKS, 0, 1, 0), F_B(HIS_TRACE, 0, 1, 0), - F_B(HIS_STATS_a, 0, 1, 0), + F_A(HIS_STATS_a, HIS_STATS_NAMESERVERS), + F_B(HIS_STATS_NAMESERVERS, 0, 1, 0), #if defined(DDB) - F_B(HIS_STATS_b, 0, 1, 0), + F_A(HIS_STATS_b, HIS_STATS_DDB), + F_B(HIS_STATS_DDB, 0, 1, 0), #endif - F_B(HIS_STATS_c, 0, 1, 0), - F_B(HIS_STATS_d, 0, 1, 0), - F_B(HIS_STATS_e, 0, 1, 0), - F_B(HIS_STATS_f, 0, 1, 0), - F_B(HIS_STATS_g, 0, 1, 0), - F_B(HIS_STATS_i, 0, 1, 0), - F_B(HIS_STATS_j, 0, 1, 0), - F_B(HIS_STATS_J, 0, 1, 0), - F_B(HIS_STATS_k, 0, 1, 0), - F_B(HIS_STATS_l, 0, 1, 0), - F_B(HIS_STATS_L, 0, 1, 0), - F_B(HIS_STATS_m, 0, 1, 0), - F_B(HIS_STATS_M, 0, 1, 0), - F_B(HIS_STATS_o, 0, 1, 0), - F_B(HIS_STATS_p, 0, 1, 0), - F_B(HIS_STATS_q, 0, 1, 0), - F_B(HIS_STATS_r, 0, 1, 0), - F_B(HIS_STATS_R, 0, 1, 0), - F_B(HIS_STATS_t, 0, 1, 0), - F_B(HIS_STATS_T, 0, 1, 0), - F_B(HIS_STATS_u, 0, 0, 0), - F_B(HIS_STATS_U, 0, 1, 0), - F_B(HIS_STATS_v, 0, 1, 0), - F_B(HIS_STATS_w, 0, 0, 0), - F_B(HIS_STATS_x, 0, 1, 0), - F_B(HIS_STATS_y, 0, 1, 0), - F_B(HIS_STATS_z, 0, 1, 0), + F_A(HIS_STATS_c, HIS_STATS_CONNECT), + F_B(HIS_STATS_CONNECT, 0, 1, 0), + F_A(HIS_STATS_d, HIS_STATS_CRULES), + F_B(HIS_STATS_CRULES, 0, 1, 0), + F_A(HIS_STATS_e, HIS_STATS_ENGINE), + F_B(HIS_STATS_ENGINE, 0, 1, 0), + F_A(HIS_STATS_f, HIS_STATS_FEATURES), + F_B(HIS_STATS_FEATURES, 0, 1, 0), + F_A(HIS_STATS_g, HIS_STATS_GLINES), + F_B(HIS_STATS_GLINES, 0, 1, 0), + F_A(HIS_STATS_i, HIS_STATS_ACCESS), + F_B(HIS_STATS_ACCESS, 0, 1, 0), + F_A(HIS_STATS_j, HIS_STATS_HISTOGRAM), + F_B(HIS_STATS_HISTOGRAM, 0, 1, 0), + F_A(HIS_STATS_J, HIS_STATS_JUPES), + F_B(HIS_STATS_JUPES, 0, 1, 0), + F_A(HIS_STATS_k, HIS_STATS_KLINES), + F_B(HIS_STATS_KLINES, 0, 1, 0), + F_A(HIS_STATS_l, HIS_STATS_LINKS), + F_B(HIS_STATS_LINKS, 0, 1, 0), + F_A(HIS_STATS_L, HIS_STATS_MODULES), + F_B(HIS_STATS_MODULES, 0, 1, 0), + F_A(HIS_STATS_m, HIS_STATS_COMMANDS), + F_B(HIS_STATS_COMMANDS, 0, 1, 0), + F_A(HIS_STATS_o, HIS_STATS_OPERATORS), + F_B(HIS_STATS_OPERATORS, 0, 1, 0), + F_A(HIS_STATS_p, HIS_STATS_PORTS), + F_B(HIS_STATS_PORTS, 0, 1, 0), + F_A(HIS_STATS_q, HIS_STATS_QUARANTINES), + F_B(HIS_STATS_QUARANTINES, 0, 1, 0), + F_A(HIS_STATS_R, HIS_STATS_MAPPINGS), + F_B(HIS_STATS_MAPPINGS, 0, 1, 0), + F_A(HIS_STATS_r, HIS_STATS_USAGE), + F_B(HIS_STATS_USAGE, 0, 1, 0), + F_A(HIS_STATS_t, HIS_STATS_LOCALS), + F_B(HIS_STATS_LOCALS, 0, 1, 0), + F_A(HIS_STATS_T, HIS_STATS_MOTDS), + F_B(HIS_STATS_MOTDS, 0, 1, 0), + F_A(HIS_STATS_u, HIS_STATS_UPTIME), + F_B(HIS_STATS_UPTIME, 0, 0, 0), + F_A(HIS_STATS_U, HIS_STATS_UWORLD), + F_B(HIS_STATS_UWORLD, 0, 1, 0), + F_A(HIS_STATS_v, HIS_STATS_VSERVERS), + F_B(HIS_STATS_VSERVERS, 0, 1, 0), + F_A(HIS_STATS_w, HIS_STATS_USERLOAD), + F_B(HIS_STATS_USERLOAD, 0, 0, 0), + F_A(HIS_STATS_x, HIS_STATS_MEMUSAGE), + F_B(HIS_STATS_MEMUSAGE, 0, 1, 0), + F_A(HIS_STATS_y, HIS_STATS_CLASSES), + F_B(HIS_STATS_CLASSES, 0, 1, 0), + F_A(HIS_STATS_z, HIS_STATS_MEMORY), + F_B(HIS_STATS_MEMORY, 0, 1, 0), + F_B(HIS_STATS_IAUTH, 0, 1, 0), F_B(HIS_WHOIS_SERVERNAME, 0, 1, 0), F_B(HIS_WHOIS_IDLETIME, 0, 1, 0), F_B(HIS_WHOIS_LOCALCHAN, 0, 1, 0), F_B(HIS_WHO_SERVERNAME, 0, 1, 0), F_B(HIS_WHO_HOPCOUNT, 0, 1, 0), + F_B(HIS_MODEWHO, 0, 1, 0), F_B(HIS_BANWHO, 0, 1, 0), F_B(HIS_KILLWHO, 0, 1, 0), F_B(HIS_REWRITE, 0, 1, 0), @@ -474,6 +516,7 @@ /* Misc. random stuff */ F_S(NETWORK, 0, "IRC-Dev", set_isupport_network), F_S(URL_CLIENTS, 0, "ftp://ftp.irc.org/pub/irc/clients", 0), + F_S(URLREG, 0, "http://cservice.undernet.org/live/", 0), #undef F_S #undef F_B @@ -495,8 +538,30 @@ assert(0 != feature); for (i = 0; features[i].type; i++) /* find appropriate descriptor */ - if (!strcmp(feature, features[i].type)) + if (!strcmp(feature, features[i].type)) { + if (feat_type(&features[i]) == FEAT_ALIAS) { + Debug((DEBUG_NOTICE, "Deprecated feature \"%s\" referenced; replace " + "with %s", feature, features[features[i].def_int].type)); + if (from) /* report a warning */ + send_reply(from, SND_EXPLICIT | ERR_NOFEATURE, + "%s :Feature deprecated, use %s", feature, + features[features[i].def_int].type); + else + log_write(LS_CONFIG, L_WARNING, 0, "Feature \"%s\" deprecated, " + "use \"%s\"", feature, features[features[i].def_int].type); + + return &features[features[i].def_int]; + } else if (feat_type(&features[i]) == FEAT_DEP) { + Debug((DEBUG_NOTICE, "Deprecated feature \"%s\" referenced", feature)); + if (from) /* report a warning */ + send_reply(from, SND_EXPLICIT | ERR_NOFEATURE, + "%s :Feature deprecated", feature); + else + log_write(LS_CONFIG, L_WARNING, 0, "Feature \"%s\" deprecated", + feature); + } return &features[i]; + } Debug((DEBUG_ERROR, "Unknown feature \"%s\"", feature)); if (from) /* report an error */ @@ -532,7 +597,7 @@ if (from && feat->flags & FEAT_READ) return send_reply(from, ERR_NOFEATURE, fields[0]); - switch (feat->flags & FEAT_MASK) { + switch (feat_type(feat)) { case FEAT_NONE: if (feat->set && (i = (*feat->set)(from, fields + 1, count - 1))) { change++; /* feature handler wants a change recorded */ @@ -683,7 +748,7 @@ if (from && feat->flags & FEAT_READ) return send_reply(from, ERR_NOFEATURE, fields[0]); - switch (feat->flags & FEAT_MASK) { + switch (feat_type(feat)) { case FEAT_NONE: /* None... */ if (feat->reset && (i = (*feat->reset)(from, fields + 1, count - 1))) { change++; /* feature handler wants a change recorded */ @@ -744,7 +809,7 @@ (feat->flags & FEAT_OPER && !IsAnOper(from))) /* check privs */ return send_reply(from, ERR_NOPRIVILEGES); - switch (feat->flags & FEAT_MASK) { + switch (feat_type(feat)) { case FEAT_NONE: /* none, call the callback... */ if (feat->get) /* if there's a callback, use it */ (*feat->get)(from, fields + 1, count - 1); @@ -797,7 +862,7 @@ for (i = 0; features[i].type; i++) { change = 0; - switch (features[i].flags & FEAT_MASK) { + switch (feat_type(&features[i])) { case FEAT_NONE: if (features[i].mark && (*features[i].mark)(features[i].flags & FEAT_MARK ? 1 : 0)) @@ -837,26 +902,29 @@ int i; for (i = 0; features[i].type; i++) { - switch (features[i].flags & FEAT_MASK) { + struct FeatureDesc *feat = &features[i]; + + switch (feat_type(feat)) { case FEAT_NONE: /* you're on your own */ break; case FEAT_INT: /* Integers or Booleans... */ case FEAT_BOOL: - features[i].v_int = features[i].def_int; + feat->v_int = feat->def_int; break; case FEAT_STR: /* Strings */ - features[i].v_str = features[i].def_str; - assert(features[i].def_str || (features[i].flags & FEAT_NULL)); + feat->v_str = feat->def_str; + assert(feat->def_str || (feat->flags & FEAT_NULL)); break; } + + if (feat->notify) + (*feat->notify)(); } cli_magic(&his) = CLIENT_MAGIC; cli_status(&his) = STAT_SERVER; - feature_notify_servername(); - feature_notify_serverinfo(); } /** Report all F-lines to a user. @@ -875,7 +943,7 @@ (features[i].flags & FEAT_OPER && !IsAnOper(to))) continue; /* skip this one */ - switch (features[i].flags & FEAT_MASK) { + switch (feat_type(&features[i])) { case FEAT_NONE: if (features[i].report) /* let the callback handle this */ (*features[i].report)(to, features[i].flags & FEAT_MARK ? 1 : 0); @@ -916,7 +984,7 @@ feature_int(enum Feature feat) { assert(features[feat].feat == feat); - assert((features[feat].flags & FEAT_MASK) == FEAT_INT); + assert(feat_type(&features[feat]) == FEAT_INT); return features[feat].v_int; } @@ -932,7 +1000,7 @@ if (FEAT_LAST_F < feat) return 0; assert(features[feat].feat == feat); - assert((features[feat].flags & FEAT_MASK) == FEAT_BOOL); + assert(feat_type(&features[feat]) == FEAT_BOOL); return features[feat].v_int; } @@ -945,7 +1013,7 @@ feature_str(enum Feature feat) { assert(features[feat].feat == feat); - assert((features[feat].flags & FEAT_MASK) == FEAT_STR); + assert(feat_type(&features[feat]) == FEAT_STR); return features[feat].v_str; } Index: ircd-ircdev/ircd/ircd_log.c diff -u ircd-ircdev/ircd/ircd_log.c:1.15 ircd-ircdev/ircd/ircd_log.c:1.16 --- ircd-ircdev/ircd/ircd_log.c:1.15 Sat Apr 21 14:17:22 2007 +++ ircd-ircdev/ircd/ircd_log.c Thu Apr 26 14:17:11 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief IRC logging implementation. - * @version $Id: ircd_log.c,v 1.15 2007/04/21 21:17:22 zolty Exp $ + * @version $Id: ircd_log.c,v 1.16 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -98,7 +98,7 @@ #define LOG_NOTFOUND -2 /**< didn't find a facility corresponding to name */ /** Map names to syslog facilities. */ -static struct { +static struct facilities_s { char *name; /**< Textual name of facility. */ int facility; /**< Facility value for syslog(). */ } facilities[] = { @@ -118,7 +118,7 @@ #define SNO_NOTFOUND 0xffffffff /**< didn't find a SNO_MASK value for name */ /** Map names to snomask values. */ -static struct { +static struct masks_s { char *name; /**< Name of server notice bit. */ unsigned int snomask; /**< Bitmask corresponding to name. */ } masks[] = { @@ -126,7 +126,7 @@ M(NONE), M(OLDSNO), M(SERVKILL), M(OPERKILL), M(HACK2), M(HACK3), M(UNAUTH), M(TCPCOMMON), M(TOOMANY), M(HACK4), M(GLINE), M(NETWORK), M(IPMISMATCH), M(THROTTLE), M(OLDREALOP), - M(CONNEXIT), M(DEBUG), + M(CONNEXIT), M(DEBUG), M(AUTH), #undef M { 0, 0 } }; @@ -168,7 +168,7 @@ S(IAUTH, -1, SNO_NETWORK), S(DEBUG, -1, SNO_DEBUG), #undef S - { LS_LAST_SYSTEM, 0, 0, -1, 0, -1, 0 } + { LS_LAST_SYSTEM, 0, 0, -1, 0, -1, 0, 0, 0 } }; /** Describes a log file. */ @@ -181,7 +181,7 @@ }; /** Modifiable static information. */ -static struct { +static struct logInfo_s{ struct LogFile *filelist; /**< list of log files */ struct LogFile *freelist; /**< list of free'd log files */ int facility; /**< default facility */ Index: ircd-ircdev/ircd/ircd_signal.c diff -u ircd-ircdev/ircd/ircd_signal.c:1.6 ircd-ircdev/ircd/ircd_signal.c:1.7 --- ircd-ircdev/ircd/ircd_signal.c:1.6 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_signal.c Thu Apr 26 14:17:11 2007 @@ -21,11 +21,12 @@ */ /** @file * @brief Signal handlers for ircu. - * @version $Id: ircd_signal.c,v 1.6 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_signal.c,v 1.7 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" #include "ircd.h" +#include "ircd_alloc.h" #include "ircd_events.h" #include "ircd_log.h" #include "ircd_signal.h" @@ -33,11 +34,23 @@ /* #include <assert.h> -- Now using assert in ircd_log.h */ #include <signal.h> +#include <string.h> +#include <sys/wait.h> +#include <unistd.h> + +/** Records a function to be called when a child process terminates. */ +struct ChildRecord { + struct ChildRecord *next; + SigChldCallBack call; + void *datum; + pid_t cpid; +}; /** Counts various types of signals that we receive. */ static struct tag_SignalCounter { unsigned int alrm; /**< Received SIGALRM count. */ unsigned int hup; /**< Received SIGHUP count. */ + unsigned int chld; /**< Received SIGCHLD count. */ } SignalCounter; /** Event generator for SIGHUP. */ @@ -46,6 +59,17 @@ static struct Signal sig_int; /** Event generator for SIGTERM. */ static struct Signal sig_term; +/** Event generator for SIGCHLD. */ +static struct Signal sig_chld; +/** List of active child process callback requests. */ +static struct ChildRecord *children; +/** List of inactive (free) child records. */ +static struct ChildRecord *crec_freelist; + +/* Make sure we have a definition for SIGCHLD. */ +#if !defined(SIGCHLD) +# define SIGCHLD SIGCLD +#endif /** Signal handler for SIGALRM. * @param[in] sig Signal number (ignored). @@ -95,6 +119,112 @@ server_restart("caught signal: SIGINT"); } +/** Allocate a child callback record. + * @return Newly allocated callback record. + */ +static struct ChildRecord *alloc_crec(void) +{ + struct ChildRecord *crec; + + if (crec_freelist) + { + crec = crec_freelist; + crec_freelist = crec->next; + } + else + { + crec = MyCalloc(1, sizeof(*crec)); + } + + memset(crec, 0, sizeof(*crec)); + crec->next = NULL; + return crec; +} + +/** Release \a crec, which is after \a prev. + * @param[in] crec Child process callback record to release. + */ +static void release_crec(struct ChildRecord *crec) +{ + memset(crec, 0, sizeof(*crec)); + crec->next = crec_freelist; + crec_freelist = crec; +} + +/** Register a function to be called when a child process terminates. + * @param[in] child Child process ID. + * @param[in] call Function to call when process \a child terminates. + * @param[in] datum Additional data parameter to pass to \a call. + */ +void register_child(pid_t child, SigChldCallBack call, void *datum) +{ + struct ChildRecord *crec; + + crec = alloc_crec(); + /* Link into #children list. */ + crec->next = children; + children = crec; + /* Fill in user fields. */ + crec->call = call; + crec->datum = datum; + crec->cpid = child; +} + +/** Unregister all callbacks for a child process, optionally calling + * them first. + * @param[in] child Child process ID to unregister. + * @param[in] do_call If non-zero, make the callbacks. + * @param[in] status If \a do_call is non-zero, the child's exit status. + */ +static void do_unregister_child(pid_t child, int do_call, int status) +{ + struct ChildRecord *crec = children; + struct ChildRecord *prev = NULL; + + while (crec != NULL) + { + if (crec->cpid == child) + { + if (do_call) + crec->call(child, crec->datum, status); + + if (prev) + prev->next = crec->next; + else + children = crec->next; + + release_crec(crec); + } + else + prev = crec; + crec = prev ? prev->next : children; + } +} + +/** Unregister all callbacks for a child process. + * @param[in] child Child process ID to unregister. + */ +void unregister_child(pid_t child) +{ + do_unregister_child(child, 0, 0); +} + +/** Signal handler for SIGCHLD. + * @param[in] ev Signal event descriptor. + */ +static void sigchld_callback(struct Event *ev) +{ + pid_t cpid; + int status; + + ++SignalCounter.chld; + do { + cpid = waitpid(-1, &status, WNOHANG); + if (cpid > 0) + do_unregister_child(cpid, 1, status); + } while (cpid > 0); +} + /** Register all necessary signal handlers. */ void setup_signals(void) { @@ -117,6 +247,7 @@ signal_add(&sig_hup, sighup_callback, 0, SIGHUP); signal_add(&sig_int, sigint_callback, 0, SIGINT); signal_add(&sig_term, sigterm_callback, 0, SIGTERM); + signal_add(&sig_chld, sigchld_callback, 0, SIGCHLD); #ifdef HAVE_RESTARTABLE_SYSCALLS /* @@ -127,3 +258,14 @@ siginterrupt(SIGALRM, 1); #endif } + +/** Kill and clean up all child processes. */ +void reap_children(void) +{ + /* Send SIGTERM to all children in process group. Sleep for a + * second to let them exit before we try to clean them up. + */ + kill(0, SIGTERM); + sleep(1); + sigchld_callback(NULL); +} Index: ircd-ircdev/ircd/ircd_string.c diff -u ircd-ircdev/ircd/ircd_string.c:1.14 ircd-ircdev/ircd/ircd_string.c:1.15 --- ircd-ircdev/ircd/ircd_string.c:1.14 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/ircd_string.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Implementation of string operations. - * @version $Id: ircd_string.c,v 1.14 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: ircd_string.c,v 1.15 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -159,6 +159,8 @@ while (s < endp && (*s++ = *s2++)) ; + if (s == endp) + *s = '\0'; return s1; } Index: ircd-ircdev/ircd/m_list.c diff -u ircd-ircdev/ircd/m_list.c:1.10 ircd-ircdev/ircd/m_list.c:1.11 --- ircd-ircdev/ircd/m_list.c:1.10 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_list.c Thu Apr 26 14:17:11 2007 @@ -20,7 +20,7 @@ */ /** @file * @brief Handlers for LIST command. - * @version $Id: m_list.c,v 1.10 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_list.c,v 1.11 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -205,6 +205,12 @@ case 'S': case 's': + /* Admins have no business making the default LIST include + * secret channels, even if it is just for opers with the + * LIST_CHAN privilege. */ + if (!sptr) + break; + if (!IsAnOper(sptr) || !HasPriv(sptr, PRIV_LIST_CHAN)) return show_usage(sptr); Index: ircd-ircdev/ircd/m_names.c diff -u ircd-ircdev/ircd/m_names.c:1.12 ircd-ircdev/ircd/m_names.c:1.13 --- ircd-ircdev/ircd/m_names.c:1.12 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_names.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for NAMES command. - * @version $Id: m_names.c,v 1.12 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_names.c,v 1.13 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -203,7 +203,8 @@ s = strchr(para, ','); /* Recursively call m_names for each comma-separated channel. Eww. */ if (s) { - parv[1+showingdelayed] = ++s; + *s++ = '\0'; + parv[1+showingdelayed] = s; m_names(cptr, sptr, parc, parv); } @@ -357,7 +358,8 @@ s = strchr(para, ','); /* Recursively call m_names for each comma-separated channel. */ if (s) { - parv[1+!!showingdelayed] = ++s; + *s++ = '\0'; + parv[1+!!showingdelayed] = s; m_names(cptr, sptr, parc, parv); } Index: ircd-ircdev/ircd/m_pass.c diff -u ircd-ircdev/ircd/m_pass.c:1.5 ircd-ircdev/ircd/m_pass.c:1.6 --- ircd-ircdev/ircd/m_pass.c:1.5 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_pass.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for PASS command. - * @version $Id: m_pass.c,v 1.5 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_pass.c,v 1.6 2007/04/26 21:17:11 zolty Exp $ */ #include "config.h" @@ -29,6 +29,7 @@ #include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" +#include "s_auth.h" #include "send.h" /* #include <assert.h> -- Now using assert in ircd_log.h */ @@ -47,15 +48,30 @@ */ int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - const char* password = parc > 1 ? parv[1] : 0; + char password[BUFSIZE]; + int arg, len; assert(0 != cptr); assert(cptr == sptr); assert(!IsRegistered(sptr)); + /* Some clients (brokenly) send "PASS x y" rather than "PASS :x y" + * when the user enters "x y" as the password. Unsplit arguments to + * work around this. + */ + for (arg = 1, len = 0; arg < parc; ++arg) + { + ircd_strncpy(password + len, parv[arg], sizeof(password) - len); + len += strlen(parv[arg]); + password[len++] = ' '; + } + if (len > 0) + --len; + password[len] = '\0'; + if (EmptyString(password)) return need_more_params(cptr, "PASS"); - ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN); + return cli_auth(cptr) ? auth_set_password(cli_auth(cptr), password) : 0; return 0; } Index: ircd-ircdev/ircd/m_ping.c diff -u ircd-ircdev/ircd/m_ping.c:1.9 ircd-ircdev/ircd/m_ping.c:1.10 --- ircd-ircdev/ircd/m_ping.c:1.9 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_ping.c Thu Apr 26 14:17:11 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for PING command. - * @version $Id: m_ping.c,v 1.9 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_ping.c,v 1.10 2007/04/26 21:17:11 zolty Exp $ */ /* * Stupid ircd Tricks @@ -143,7 +143,7 @@ if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) { if ((acptr = FindServer(destination))) - sendcmdto_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination); + sendcmdto_prio_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination); else send_reply(sptr, ERR_NOSUCHSERVER, destination); } @@ -214,8 +214,8 @@ { /* AsLL ping, send reply back */ int diff = atoi(militime_float(parv[3])); - sendcmdto_one(&me, CMD_PONG, sptr, "%C %s %s %i %s", &me, origin, - parv[3], diff, militime_float(NULL)); + sendcmdto_prio_one(&me, CMD_PONG, sptr, "%C %s %s %i %s", &me, origin, + parv[3], diff, militime_float(NULL)); return 0; } if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) { @@ -223,7 +223,7 @@ /* * Servers can just forward the origin */ - sendcmdto_one(sptr, CMD_PING, acptr, "%s :%s", origin, destination); + sendcmdto_prio_one(sptr, CMD_PING, acptr, "%s :%s", origin, destination); } else { /* @@ -238,7 +238,7 @@ * NOTE: sptr is never local so if pong handles numerics everywhere we * could send a numeric here. */ - sendcmdto_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin); + sendcmdto_prio_one(&me, CMD_PONG, sptr, "%C :%s", &me, origin); } return 0; } Index: ircd-ircdev/ircd/m_pong.c diff -u ircd-ircdev/ircd/m_pong.c:1.8 ircd-ircdev/ircd/m_pong.c:1.9 --- ircd-ircdev/ircd/m_pong.c:1.8 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/m_pong.c Thu Apr 26 14:17:12 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for PONG command. - * @version $Id: m_pong.c,v 1.8 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: m_pong.c,v 1.9 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -74,8 +74,8 @@ } origin = parv[1]; destination = parv[2]; - ClrFlag(cptr, FLAG_PINGSENT); - ClrFlag(sptr, FLAG_PINGSENT); + ClearPingSent(cptr); + ClearPingSent(sptr); cli_lasttime(cptr) = CurrentTime; if (parc > 5) @@ -84,6 +84,7 @@ cli_serv(cptr)->asll_rtt = atoi(militime_float(parv[3])); cli_serv(cptr)->asll_to = atoi(parv[4]); cli_serv(cptr)->asll_from = atoi(militime_float(parv[5])); + cli_serv(cptr)->asll_last = CurrentTime; return 0; } @@ -99,7 +100,7 @@ { struct Client* acptr; if ((acptr = FindClient(destination))) - sendcmdto_one(sptr, CMD_PONG, acptr, "%s %s", origin, destination); + sendcmdto_prio_one(sptr, CMD_PONG, acptr, "%s %s", origin, destination); } return 0; } @@ -121,7 +122,7 @@ assert(cptr == sptr); assert(!IsRegistered(sptr)); - ClrFlag(cptr, FLAG_PINGSENT); + ClearPingSent(cptr); return (parc > 1) ? auth_set_pong(cli_auth(sptr), strtoul(parv[parc - 1], NULL, 10)) : 0; } @@ -139,7 +140,8 @@ { assert(0 != cptr); assert(cptr == sptr); - ClrFlag(cptr, FLAG_PINGSENT); + + ClearPingSent(cptr); cli_lasttime(cptr) = CurrentTime; return 0; } Index: ircd-ircdev/ircd/m_stats.c diff -u ircd-ircdev/ircd/m_stats.c:1.8 ircd-ircdev/ircd/m_stats.c:1.9 --- ircd-ircdev/ircd/m_stats.c:1.8 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_stats.c Thu Apr 26 14:17:12 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for the STATS command. - * @version $Id: m_stats.c,v 1.8 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_stats.c,v 1.9 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -84,7 +84,11 @@ if (!IsPrivileged(cptr) && ((sd->sd_flags & STAT_FLAG_OPERONLY) || ((sd->sd_flags & STAT_FLAG_OPERFEAT) && feature_bool(sd->sd_control)))) - return send_reply(cptr, ERR_NOPRIVILEGES); + return send_reply(sptr, ERR_NOPRIVILEGES); + + /* Check if they are a local user */ + if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(sptr)) + return send_reply(sptr, ERR_NOPRIVILEGES); /* Check if they are a local user */ if ((sd->sd_flags & STAT_FLAG_LOCONLY) && !MyUser(cptr)) Index: ircd-ircdev/ircd/m_whois.c diff -u ircd-ircdev/ircd/m_whois.c:1.17 ircd-ircdev/ircd/m_whois.c:1.18 --- ircd-ircdev/ircd/m_whois.c:1.17 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_whois.c Thu Apr 26 14:17:12 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for WHOIS command. - * @version $Id: m_whois.c,v 1.17 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_whois.c,v 1.18 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -124,7 +124,7 @@ } if (IsDeaf(acptr)) *(buf + len++) = '-'; - if (IsOper(sptr) && !ShowChannel(sptr, chptr)) + if (!ShowChannel(sptr, chptr)) *(buf + len++) = '*'; if (IsDelayedJoin(chan) && (sptr != acptr)) *(buf + len++) = '<'; Index: ircd-ircdev/ircd/m_whowas.c diff -u ircd-ircdev/ircd/m_whowas.c:1.10 ircd-ircdev/ircd/m_whowas.c:1.11 --- ircd-ircdev/ircd/m_whowas.c:1.10 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_whowas.c Thu Apr 26 14:17:12 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for WHOWAS command. - * @version $Id: m_whowas.c,v 1.10 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_whowas.c,v 1.11 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -92,7 +92,7 @@ send_reply(sptr, RPL_WHOWASUSER, temp->name, temp->username, temp->hostname, temp->realname); if (IsAnOper(sptr) && temp->realhost) - send_reply(sptr, RPL_WHOISACTUALLY, temp->name, temp->username, temp->realhost); + send_reply(sptr, RPL_WHOISACTUALLY, temp->name, temp->username, temp->realhost, "<untracked>"); send_reply(sptr, RPL_WHOISSERVER, temp->name, (feature_bool(FEAT_HIS_WHOIS_SERVERNAME) && !IsOper(sptr)) ? feature_str(FEAT_HIS_SERVERNAME) : Index: ircd-ircdev/ircd/match.c diff -u ircd-ircdev/ircd/match.c:1.13 ircd-ircdev/ircd/match.c:1.14 --- ircd-ircdev/ircd/match.c:1.13 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/match.c Thu Apr 26 14:17:12 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Functions to match strings against IRC mask strings. - * @version $Id: match.c,v 1.13 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: match.c,v 1.14 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -210,7 +210,7 @@ m++; /* allow escaping to force capitalization */ if (*m++ != *n++) - return 1; + goto backtrack; break; case '*': case '?': for (star_p = 0; ; m++) { Index: ircd-ircdev/ircd/motd.c diff -u ircd-ircdev/ircd/motd.c:1.10 ircd-ircdev/ircd/motd.c:1.11 --- ircd-ircdev/ircd/motd.c:1.10 Sat Apr 21 14:17:23 2007 +++ ircd-ircdev/ircd/motd.c Thu Apr 26 14:17:12 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Message-of-the-day manipulation implementation. - * @version $Id: motd.c,v 1.10 2007/04/21 21:17:23 zolty Exp $ + * @version $Id: motd.c,v 1.11 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -361,23 +361,36 @@ motd_cache(MotdList.remote); } -/** Re-cache the local and remote MOTDs. - * If they already exist, they are deallocated first. +/** Re-cache the local MOTD. + * If it already exists it is deallocated first. */ void -motd_init(void) +motd_init_local(void) { if (MotdList.local) /* destroy old local... */ motd_destroy(MotdList.local); - MotdList.local = motd_create(0, feature_str(FEAT_MPATH), MOTD_MAXLINES); - motd_cache(MotdList.local); /* init local and cache it */ + if (!EmptyString(feature_str(FEAT_MPATH))) + { + MotdList.local = motd_create(0, feature_str(FEAT_MPATH), MOTD_MAXLINES); + motd_cache(MotdList.local); /* init local and cache it */ + } +} +/** Re-cache the remote MOTD. + * If it already exists it is deallocated first. + */ +void +motd_init_remote(void) +{ if (MotdList.remote) /* destroy old remote... */ motd_destroy(MotdList.remote); - MotdList.remote = motd_create(0, feature_str(FEAT_RPATH), MOTD_MAXREMOTE); - motd_cache(MotdList.remote); /* init remote and cache it */ + if (!EmptyString(feature_str(FEAT_RPATH))) + { + MotdList.remote = motd_create(0, feature_str(FEAT_RPATH), MOTD_MAXREMOTE); + motd_cache(MotdList.remote); /* init remote and cache it */ + } } /** Add a new MOTD. Index: ircd-ircdev/ircd/s_bsd.c diff -u ircd-ircdev/ircd/s_bsd.c:1.21 ircd-ircdev/ircd/s_bsd.c:1.22 --- ircd-ircdev/ircd/s_bsd.c:1.21 Thu Apr 26 12:17:31 2007 +++ ircd-ircdev/ircd/s_bsd.c Thu Apr 26 14:17:12 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Functions that now (or in the past) relied on BSD APIs. - * @version $Id: s_bsd.c,v 1.21 2007/04/26 19:17:31 zolty Exp $ + * @version $Id: s_bsd.c,v 1.22 2007/04/26 21:17:12 zolty Exp $ */ #include "config.h" @@ -87,20 +87,34 @@ /* * report_error text constants */ -const char* const ACCEPT_ERROR_MSG = "error accepting connection for %s: %s"; -const char* const BIND_ERROR_MSG = "bind error for %s: %s"; -const char* const CONNECT_ERROR_MSG = "connect to host %s failed: %s"; -const char* const CONNLIMIT_ERROR_MSG = "connect limit exceeded for %s: %s"; -const char* const LISTEN_ERROR_MSG = "listen error for %s: %s"; -const char* const NONB_ERROR_MSG = "error setting non-blocking for %s: %s"; -const char* const PEERNAME_ERROR_MSG = "getpeername failed for %s: %s"; -const char* const POLL_ERROR_MSG = "poll error for %s: %s"; -const char* const REGISTER_ERROR_MSG = "registering %s: %s"; -const char* const REUSEADDR_ERROR_MSG = "error setting SO_REUSEADDR for %s: %s"; -const char* const SELECT_ERROR_MSG = "select error for %s: %s"; -const char* const SETBUFS_ERROR_MSG = "error setting buffer size for %s: %s"; -const char* const SOCKET_ERROR_MSG = "error creating socket for %s: %s"; -const char* const TOS_ERROR_MSG = "error setting TOS for %s: %s"; +static const char* const ACCEPT_ERROR_MSG + = "error accepting connection for %s: %s"; + const char* const BIND_ERROR_MSG + = "bind error for %s: %s"; +static const char* const CONNECT_ERROR_MSG + = "connect to host %s failed: %s"; + const char* const CONNLIMIT_ERROR_MSG + = "connect limit exceeded for %s: %s"; + const char* const LISTEN_ERROR_MSG + = "listen error for %s: %s"; + const char* const NONB_ERROR_MSG + = "error setting non-blocking for %s: %s"; +static const char* const PEERNAME_ERROR_MSG + = "getpeername failed for %s: %s"; +static const char* const POLL_ERROR_MSG + = "poll error for %s: %s"; +static const char* const REGISTER_ERROR_MSG + = "registering %s: %s"; + const char* const REUSEADDR_ERROR_MSG + = "error setting SO_REUSEADDR for %s: %s"; +static const char* const SELECT_ERROR_MSG + = "select error for %s: %s"; + const char* const SETBUFS_ERROR_MSG + = "error setting buffer size for %s: %s"; + const char* const SOCKET_ERROR_MSG + = "error creating socket for %s: %s"; + const char* const TOS_ERROR_MSG + = "error setting TOS for %s: %s"; static void client_sock_callback(struct Event* ev); @@ -363,7 +377,7 @@ * Make us timeout after twice the timeout for DNS look ups */ cli_la... [truncated message content] |