This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".

The branch, master has been updated
       via  932881b89d21c91652bb3b326b5383f84d32c911 (commit)
       via  c58832935437dc2bebe5d9e76bc9f6349d447696 (commit)
       via  344cb9a255b0a0083454d052fa7172695c65cdfd (commit)
       via  407dc92c5d5e4fc2d52ca6214f8680adcaaa6390 (commit)
       via  bedb72a99fc308e508ed4fd019f91de5e121093c (commit)
       via  a43bd90057510e151a0f1bb4c42ea432dc521cab (commit)
       via  a480e001508c6d0aedc2cb61308d1e6b9a6befdf (commit)
       via  d2942b64403783b833166b1d5c80b0fccab2ec23 (commit)
       via  f4e0d720a62f9b9fb6f00f4ac46ffb1a4bf60974 (commit)
       via  2dbbe9916ce1a6aa389661ac7fd3346e64e129a4 (commit)
       via  a5f0bbaf5fda744efbdfcca3e185f9f8c58a641c (commit)
       via  b632d7552473bd071d535195ac1614fce490df46 (commit)
       via  5da1f3056298c89c6124a554f6912de4049d5404 (commit)
       via  8734346c94c8aba65c059f9b045871c5c655de22 (commit)
       via  b5819a0550f544236330015b47627b5a652344f0 (commit)
       via  7572ce31e4730c8b3b64d9b589a743166aa4f402 (commit)
       via  5cfa0027e5c632d087dad6a3ece271ba7bd7622f (commit)
       via  ae85ca6a216ffe9b636f0edc7946e3bc2477e4b6 (commit)
       via  a9ea6536ced4428fa8614a19b7e870561bed61a6 (commit)
      from  5959f7b04b78640a4961f86620a9f6c9f62944ef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 932881b89d21c91652bb3b326b5383f84d32c911
Merge: 407dc92 c588329
Author: Michael Poole <[email protected]>
Date:   Sun Jul 30 21:00:26 2017 -0400

    Merge tag 'u2.10.12.17'
    
    ircu2.10.12.17

diff --cc ircd/m_opmode.c
index f47068f,7f3d8ca..a70822b
--- a/ircd/m_opmode.c
+++ b/ircd/m_opmode.c
@@@ -116,16 -167,23 +116,20 @@@ int ms_opmode(struct Client* cptr, stru
  
    if (('#' != *parv[1]) && IsServer(sptr))
    {
 -    struct ConfItem *conf;
      struct Client *dptr;
  
-     if (!(cli_serv(sptr)->flags & SFLAG_REMOTE_OPER))
-       return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]);
- 
      dptr = findNUser(parv[1]);
      if (!dptr)
        return send_reply(sptr, ERR_NOSUCHNICK, parv[1]);
  
-     sendcmdto_serv(sptr, CMD_OPMODE, cptr, "%s %s", parv[1], parv[2]);
+     if (!MyConnect(dptr))
+     {
 -      sendcmdto_serv_butone(sptr, CMD_OPMODE, cptr, "%s %s",
 -        parv[1], parv[2]);
++      sendcmdto_serv(sptr, CMD_OPMODE, cptr, "%s %s", parv[1], parv[2]);
+       return 0;
+     }
+ 
 -    conf = find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD);
 -    if (!conf || !(conf->flags & CONF_UWORLD_OPER))
++    if (!(cli_serv(sptr)->flags & SFLAG_REMOTE_OPER))
+       return send_reply(sptr, ERR_NOPRIVILEGES, parv[1]);
  
      /* At the moment, we only support +o and -o.  set_user_mode() does
       * not support remote mode setting or setting +o.
diff --cc ircd/m_server.c
index 5dc26fc,70b9c43..0c4ecc3
--- a/ircd/m_server.c
+++ b/ircd/m_server.c
@@@ -635,11 -640,11 +635,11 @@@ int mr_server(struct Client* cptr, stru
    ret = server_estab(cptr, aconf);
  
    if (feature_bool(FEAT_RELIABLE_CLOCK) &&
-       abs(cli_serv(cptr)->timestamp - recv_time) > 30) {
+       labs(cli_serv(cptr)->timestamp - recv_time) > 30) {
 -    sendto_opmask_butone(0, SNO_OLDSNO, "Connected to a net with a "
 -                       "timestamp-clock difference of %Td seconds! "
 -                       "Used SETTIME to correct this.",
 -                       timestamp - recv_time);
 +    sendto_opmask(0, SNO_OLDSNO, "Connected to a net with a "
 +                  "timestamp-clock difference of %Td seconds! "
 +                  "Used SETTIME to correct this.",
 +                  timestamp - recv_time);
      sendcmdto_prio_one(&me, CMD_SETTIME, cptr, "%Tu :%s", TStime(),
                       cli_name(&me));
    }
diff --cc ircd/s_auth.c
index 110cd0c,6f4a0b9..f738048
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@@ -971,11 -976,19 +975,18 @@@ static void auth_dns_callback(void* vpt
    } else if (!irc_in_addr_valid(addr)
               || (irc_in_addr_cmp(&cli_ip(auth->client), addr)
                   && irc_in_addr_cmp(&auth->original, addr))) {
-     /* IP for hostname did not match client's IP. */
-     sendto_opmask(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]",
-                   cli_sock_ip(auth->client), h_name, ircd_ntoa(addr));
-     if (IsUserPort(auth->client))
+     if (IsUserPort(auth->client)) {
+       /* IP for hostname did not match client's IP. */
 -      sendto_opmask_butone(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]",
 -                           cli_sock_ip(auth->client), h_name,
 -                           ircd_ntoa(addr));
++      sendto_opmask(0, SNO_IPMISMATCH, "IP# Mismatch: %s != %s[%s]",
++                   cli_sock_ip(auth->client), h_name, ircd_ntoa(addr));
        sendheader(auth->client, REPORT_IP_MISMATCH);
+     } else {
+       /* Mismatch for a server, do not send to opers. */
+       log_write(LS_NETWORK, L_NOTICE, LOG_NOSNOTICE,
+                 "IP# Mismatch: %s != %s[%s]",
+                 cli_sock_ip(auth->client), h_name,
+                 ircd_ntoa(addr));
+     }
      if (feature_bool(FEAT_KILL_IPMISMATCH)) {
        exit_client(auth->client, auth->client, &me, "IP mismatch");
        return;
commit 407dc92c5d5e4fc2d52ca6214f8680adcaaa6390
Author: Michael Poole <[email protected]>
Date:   Mon May 29 15:41:23 2017 -0400

    parse_server: Use FindNClient().

diff --git a/ircd/parse.c b/ircd/parse.c
index 1ad8209..288e5ce 100644
--- a/ircd/parse.c
+++ b/ircd/parse.c
@@ -1035,36 +1035,23 @@ int parse_server(struct Client *cptr, char *buffer, 
char *bufend)
   else
   {
     char numeric_prefix[6];
-    int  i;
-    for (i = 0; i < 5; ++i)
-    {
-      if ('\0' == ch[i] || ' ' == (numeric_prefix[i] = ch[i]))
-      {
-        break;
-      }
-    }
+    for (i = 0; (i < 5) && (*ch != ' ') && (*ch != '\0'); ++i)
+      numeric_prefix[i] = *ch++;
     numeric_prefix[i] = '\0';
 
-    /*
-     * We got a numeric nick as prefix
-     * 1 or 2 character prefixes are from servers
-     * 3 or 5 chars are from clients
-     */
     if (0 == i)
     {
       protocol_violation(cptr,"Missing Prefix");
       from = cptr;
     }
-    else if (' ' == ch[1] || ' ' == ch[2])
-      from = FindNServer(numeric_prefix);
     else
-      from = findNUser(numeric_prefix);
-
-    do
     {
-      ++ch;
+      from = FindNClient(numeric_prefix);
     }
-    while (*ch != ' ' && *ch);
+    while (*ch != ' ' && *ch != '\0')
+      ch++;
+    while (*ch == ' ')
+      ch++;
 
     /*
      * If the client corresponding to the
@@ -1081,24 +1068,25 @@ int parse_server(struct Client *cptr, char *buffer, 
char *bufend)
     if (from == NULL)
     {
       ServerStats->is_unpf++;
-      while (*ch == ' ')
-        ch++;
-      if (*ch == 'N' && (ch[1] == ' ' || ch[1] == 'I'))
-        /* Only sent a KILL for a nick change */
+      if (ch[0] == 'N' && (ch[1] == ' ' || !strncmp(ch+1, "ICK ", 4)))
+        /* Only send a KILL for a nick change */
       {
         struct Client *server;
         /* Kill the unknown numeric prefix upstream if
-         * it's server still exists: */
+         * its server still exists: */
         if ((server = FindNServer(numeric_prefix)) && cli_from(server) == cptr)
          sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (Unknown numeric nick)",
                        numeric_prefix, cli_name(&me));
       }
       /*
-       * Things that must be allowed to travel
+       * SQ(UIT) and D/KILL must be allowed to travel
        * upstream against an squit:
        */
-      if (ch[1] == 'Q' || (*ch == 'D' && ch[1] == ' ') ||
-          (*ch == 'K' && ch[2] == 'L'))
+      if ((ch[0] == 'S' && ch[1] == 'Q'
+            && (ch[2] == ' ' || !strncmp(ch+2, "UIT ", 4)))
+          || (ch[0] == 'D' && ch[1] == ' ')
+          || (ch[0] == 'K'
+            && (ch[1] == ' ' || !strncmp(ch+1, "ILL ", 4))))
         from = cptr;
       else
         return 0;
@@ -1116,8 +1104,6 @@ int parse_server(struct Client *cptr, char *buffer, char 
*bufend)
     }
   }
 
-  while (*ch == ' ')
-    ch++;
   if (*ch == '\0')
   {
     ServerStats->is_empt++;
commit bedb72a99fc308e508ed4fd019f91de5e121093c
Author: Michael Poole <[email protected]>
Date:   Mon May 29 21:47:47 2017 -0400

    ancillary.*: Remove these until we have a specific need for them.

diff --git a/include/ancillary.h b/include/ancillary.h
deleted file mode 100644
index 5c9ba54..0000000
--- a/include/ancillary.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * IRC - Internet Relay Chat, include/ancillary.h
- * Copyright (C) 2008 Kevin L. Mitchell
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/** @file
- * @brief Structures and functions for handling generic ancillary data.
- */
-#ifndef INCLUDED_ancillary_h
-#define INCLUDED_ancillary_h
-#ifndef INCLUDED_register_h
-#include "register.h"
-#endif
-#ifndef INCLUDED_limits_h
-#include <limits.h>
-#define INCLUDED_limits_h
-#endif
-#ifndef INCLUDED_sys_types_h
-#include <sys/types.h>
-#define INCLUDED_sys_types_h
-#endif
-
-/** Registration table for ancillary data. */
-#define ANC_TABLE      "ancillary"
-
-/** Invalid anckey_t value for returning errors from ad_key_create(). */
-#define ANC_INVKEY     UINT_MAX
-
-/** Description of an object accepting ancillary data. */
-typedef struct AncModule ancmodule_t;
-/** Ancillary data to attach to an object. */
-typedef struct AncData ancdata_t;
-
-/** Key for accessing specific ancillary data. */
-typedef unsigned int anckey_t;
-
-/** Iteration callback for visiting all objects of specified type.
- * @param[in] mod The ancillary data module.
- * @param[in] obj The object being iterated over.
- * @param[in,out] extra Extra data for the iteration.
- * @return 0 to continue iteration, non-zero to stop iteration.
- */
-typedef int (*anciter_t)(ancmodule_t* mod, void* obj, void* extra);
-
-/** Function to call to perform iteration.
- * @param[in] mod The ancillary data module.
- * @param[in] func Iteration function to execute.
- * @param[in,out] extra Extra data to pass to iteration funciton.
- * @return 0 or whatever non-zero value \a func returns.  (Iteration
- * terminates if \a func returns non-zero.)
- */
-typedef int (*ancwalk_t)(ancmodule_t* mod, anciter_t func, void* extra);
-
-/** Destructor function for ancillary data.
- * @param[in] datum The datum to destroy.
- */
-typedef void (*ancdestroy_t)(void* datum);
-
-/** Describes ancillary data. */
-struct AncModule {
-  regent_t     am_regent;      /**< Registration entry. */
-  ancwalk_t    am_walk;        /**< Iteration callback function. */
-  size_t       am_offset;      /**< Offset of data element. */
-  unsigned int am_alloc;       /**< Number of destroy entries allocated. */
-  ancdestroy_t*        am_destroy;     /**< Destroy callback functions. */
-};
-
-/** Magic number for ancmodule_t. */
-#define ANCMODULE_MAGIC 0xdadf751
-
-/** Initialize an ancmodule_t.
- * @param[in] name Name of the object accepting ancillary data.
- * @param[in] walk Iteration function to visit all objects.  May not
- * be NULL.
- * @param[in] offset Offset of ancdata_t element in objects.  Use
- * offsetof() macro to compute this.
- */
-#define ANCMODULE_INIT(name, walk, offset)                             \
-  { REGENT_INIT(ANCMODULE_MAGIC, (name)), (walk), (offset), 0, 0 }
-
-/** Check an ancillary data module. */
-#define ANCMODULE_CHECK(am)    REGENT_CHECK((am), ANCMODULE_MAGIC)
-/** Get the name of the data module. */
-#define am_name(am)            rl_id(am)
-/** Retrieve the walk function. */
-#define am_walk(am)            ((am)->am_walk)
-/** Retrieve the ancillary data element object offset. */
-#define am_offset(am)          ((am)->am_offset)
-
-/** Retrieve the ancillary data element from an object. */
-#define am_data(am, obj)       ((ancdata_t*) (((char*) (obj)) +        \
-                                              (am)->am_offset))
-
-/** Contains ancillary data. */
-struct AncData {
-  ancmodule_t* ad_module;      /**< Module for ancillary data. */
-  unsigned int ad_alloc;       /**< Number of entries allocated. */
-  void**       ad_data;        /**< Array of ancillary data. */
-};
-
-/** Initialize an ancdata_t. */
-#define ANCDATA_INIT(module)                   \
-  { (module), 0, 0 }
-
-/** Dynamically initialize an ancdata_t.
- * @param[in,out] ad The ancdata_t to be initialized.
- * @param[in] module The module the object is in.
- */
-#define ancdata_init(ad, module)               \
-  do {                                         \
-    ancdata_t _ad = (ad);                      \
-    _ad->ad_module = (module);                 \
-    _ad->ad_alloc = 0;                         \
-    _ad->ad_data = 0;                          \
-  } while (0)
-
-/** Retrieve ancillary data with a specified key.
- * @param[in] ad Pointer to the relevant ancdata_t.
- * @param[in] key Key for the datum.
- * @return Pointer to the ancillary data.
- */
-#define ad_get(ad, key)                                                        
\
-  (((anckey_t) (key)) < (ad)->ad_alloc ? (ad)->ad_data[(key)] : (void*) 0)
-
-/* Set ancillary data for a specified key. */
-extern int ad_set(ancdata_t* ad, anckey_t key, void* value);
-
-/* Create an ancillary data key. */
-extern anckey_t ad_key_create(const char* module, ancdestroy_t destroy);
-
-/* Destroy an ancillary data key. */
-extern void ad_key_destroy(const char* module, anckey_t key);
-
-/* Iterate over all objects in a module. */
-extern int ad_iter(const char* module, anciter_t func, void* extra);
-
-/* Flush all data in a particular object. */
-extern void ad_flush(ancmodule_t* am, ancdata_t* ad);
-
-/* Initialize ancillary data subsystem. */
-extern void ad_init(void);
-
-#endif /* INCLUDED_ancillary_h */
diff --git a/ircd/ancillary.c b/ircd/ancillary.c
deleted file mode 100644
index 6349fa3..0000000
--- a/ircd/ancillary.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * IRC - Internet Relay Chat, ircd/ancillary.c
- * Copyright (C) 2008 Kevin L. Mitchell
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/** @file
- * @brief Implementation of generic ancillary data.
- */
-#include "config.h"
-
-#include "ancillary.h"
-#include "ircd_alloc.h"
-#include "ircd_log.h"
-#include "register.h"
-
-/** @page ancillary Generic ancillary data subsystem.
- *
- * @section introanc Introduction
- *
- * The database is full of all sorts of objects--connections, servers,
- * users, etc.  Many modules have ancillary data stored in the
- * database structures for these objects.  This violates the
- * abstraction boundary--those modules have to have intimate
- * information about the details of those structures, and the database
- * also has to know about what ancillary data is to be stored in them.
- * This also prevents dynamically loaded modules from being able to
- * add their own ancillary data to these structures.
- *
- * The ancillary data subsystem is an attempt to solve these basic
- * issues.  Its API is modeled on the POSIX threads routines
- * pthread_getspecific() and pthread_setspecific(), which in turn
- * interact with pthread_key_create() and pthread_key_delete().  The
- * basic concept is that each object which permits ancillary data to
- * be associated with it must register an ancmodule_t through the
- * registration system (see \subpage register), and must include an
- * ancdata_t somewhere within the object's data structure.  Then, any
- * other module may associate ancillary data with those objects by
- * obtaining a key and passing that key, along with the object, to a
- * get or set function.
- *
- * @section keyanc Managing Keys
- *
- * Keys may be obtained by calling the ad_key_create() routine,
- * passing it the name of an ancillary data module and the address of
- * a function to destroy objects stored under that key.  (Note that
- * this destructor may not be NULL.)  When done with the key, such as
- * when the module storing the ancillary data is being unloaded, the
- * ad_key_destroy() routine should be called.  It will call the
- * destructor on all ancillary data stored under that key.
- *
- * @section getsetanc Getting and Setting Ancillary Data
- *
- * Ancillary data is retrieved and set using ad_get() and ad_set(),
- * respectively.  These routines require both a pointer to the
- * object's ancdata_t ancillary data storage location and the key
- * under which the ancillary data is to be stored.  If a key is
- * undefined, ad_set() will return a non-zero value, whereas ad_get()
- * will simply return NULL.
- *
- * @section otheropsanc Other Ancillary Data Operations
- *
- * The ancillary data subsystem provides the ad_iter() function, which
- * causes a function to be executed on every object in an ancillary
- * data module.  Additionally, when an ancillary data module is
- * releasing one of its objects, it can clean up all ancillary data in
- * that object by calling ad_flush().
- *
- * @section enableanc Enabling Ancillary Data
- *
- * "This sound great!" you say.  "But how do I create objects that are
- * ancillary data-enabled?"  This turns out to be simple.  In your
- * structure for the object, you must have one element that is an
- * ancdata_t; this element will be used for storing the actual
- * ancillary data.  You must initialize this element with the
- * ANCDATA_INIT() macro or with the ancdata_init() macro if you need
- * dynamic initialization; both these macros require a pointer to your
- * ancmodule_t for the module.
- *
- * This ancmodule_t stores the data about allocated keys, such as the
- * pointers to the destructors.  It also contains the offset of the
- * ancdata_t element of your structure and a pointer to a "walk"
- * function, both of which are mandatory arguments.  The "walk"
- * function must be compatible with ancwalk_t, and the offset may be
- * computed by the offsetof() macro.  You should statically allocate
- * this ancmodule_t and initialize it with the ANCMODULE_INIT() macro.
- * It must also be passed to the reg() function, passing ANC_TABLE as
- * the value of the \a table parameter.
- *
- * @section infoanc Important Subsystem Information
- *
- * This subsystem provides two structures--struct AncModule and struct
- * AncData--and 6 types: ancmodule_t and ancdata_t, corresponding to
- * the two structures; anckey_t, for keys; anciter_t, for the
- * iteration callback needed by ancwalk_t, which must iterate over all
- * objects in the module; and ancdestroy_t, which represents a
- * function used to destroy abandoned ancillary data.  In particular,
- * ancmodule_t, ancdata_t, and anckey_t should be treated as opaque by
- * all callers, and struct AncModule and struct AncData should not be
- * referenced directly.  Any data needed from these structures may be
- * obtained using the provided macros.
- *
- * This subsystem makes use of ircu's registration subsystem and its
- * allocation routines.  In addition, it references the assert() macro
- * in ircd_log.h.  This module requires explicit initialization, which
- * may be performed by calling ad_init().  This must be done before
- * any module which is ancillary data-enabled.
- *
- * Memory allocated by the subsystem is managed solely by the
- * subsystem; the caller will never see any allocated memory, and need
- * not worry about calling MyFree() on any result of calling any
- * function in this subsystem.  Only the destructor callbacks should
- * need to call MyFree(), in order to release memory allocated for the
- * ancillary data itself.
- */
-
-/** Define a chunk size for allocation of keyspace. */
-#define AD_CHUNK       4
-
-/* pre-declare am_reg() and am_unreg() */
-static int am_reg(regtab_t* table, ancmodule_t* am);
-static int am_unreg(regtab_t* table, ancmodule_t* am);
-
-/** Table of ancillary data modules. */
-static regtab_t ad_table = REGTAB_INIT(ANC_TABLE, ANCMODULE_MAGIC,
-                                      (reg_t) am_reg, (unreg_t) am_unreg);
-
-/** Check that ancillary data module is valid.
- * @param[in] table Pointer to ad_table.
- * @param[in] am Ancillary data module to verify.
- * @return 0 for valid ancillary data modules, non-zero otherwise.
- */
-static int am_reg(regtab_t* table, ancmodule_t* am)
-{
-  if (!am->am_walk) /* must have a walk function */
-    return 1;
-
-  return 0; /* it passes the tests */
-}
-
-/** Iteration callback for flushing all ancillary data from an object.
- * @param[in] mod The ancillary data module.
- * @param[in] obj The object being iterated over.
- * @param[in] extra Unused.
- * @return 0 to continue iteration.
- */
-static int am_unreg_flush(ancmodule_t* mod, void* obj, void* extra)
-{
-  /* simply flush the data away */
-  ad_flush(mod, am_data(mod, obj));
-
-  return 0;
-}
-
-/** Flush away all allocated memory.  Nominally, all objects will be
- * destroyed before unreg() is called, but this is for that
- * just-in-case eventuality.
- * @param[in] table Pointer to ad_table.
- * @param[in] am Ancillary data module to flush.
- * @return 0 to accept unregistration.
- */
-static int am_unreg(regtab_t* table, ancmodule_t* am)
-{
-  /* iterate over all the objects in the module and flush them */
-  (am->am_walk)(am, am_unreg_flush, 0);
-
-  return 0;
-}
-
-/** Set ancillary data for a specified key.
- * @param[in,out] ad Pointer to the relevant ancdata_t.
- * @param[in] key Key for the datum.
- * @param[in] value Value of the datum to set; can be NULL.
- * @return 0 if the value is set properly; -1 if key is undefined.
- */
-int ad_set(ancdata_t* ad, anckey_t key, void* value)
-{
-  ancmodule_t *am;
-  anckey_t i;
-
-  assert(0 != ad);
-
-  /* obtain a pointer to the responsible module */
-  am = ad->ad_module;
-
-  assert(ANCMODULE_CHECK(am));
-
-  /* check to see if it's a defined key */
-  if (key >= am->am_alloc || !am->am_destroy[key])
-    return -1;
-
-  /* If this key hasn't been created in the object yet, resize... */
-  if (ad->ad_alloc <= key) {
-    if (!value) /* not storing anything anyway, so bail out */
-      return 0;
-
-    /* resize the ancillary data storage array... */
-    ad->ad_data = MyRealloc(ad->ad_data, sizeof(void*) * (key + 1));
-
-    /* initialize the new pointers */
-    for (i = ad->ad_alloc; i <= key; i++)
-      ad->ad_data[i] = 0;
-
-    ad->ad_alloc = key + 1; /* store new allocation count */
-  }
-
-  /* if there is an existing setting, call the destructor on it. */
-  if (ad->ad_data[key])
-    (am->am_destroy[key])(ad->ad_data[key]);
-
-  /* set the new value and return */
-  ad->ad_data[key] = value;
-
-  return 0;
-}
-
-/** Create an ancillary data key.
- * @param[in] module Name of an object module accepting ancillary
- * data.
- * @param[in] destroy Pointer to a destructor function.  May not be
- * NULL.
- * @return A new ancillary data key, or ANC_INVKEY if module not found
- * or no keys available.
- */
-anckey_t ad_key_create(const char* module, ancdestroy_t destroy)
-{
-  anckey_t i, j;
-  ancmodule_t *mod;
-
-  assert(0 != destroy);
-
-  /* look up the named module */
-  if (!(mod = reg_find(ANC_TABLE, module)))
-    return ANC_INVKEY;
-
-  /* see if we can find an available key... */
-  for (i = 0; i < mod->am_alloc; i++)
-    if (!mod->am_destroy[i]) /* found an empty slot! */
-      break;
-    else if (i == ANC_INVKEY) /* can't allocate another */
-      return ANC_INVKEY; /* yeah, how likely is *this*?  :) */
-
-  if (i >= mod->am_alloc) { /* have to allocate more slots */
-    if (i == ANC_INVKEY) /* make sure we can actually allocate some more */
-      return ANC_INVKEY;
-
-    /* do the resize... */
-    mod->am_destroy = MyRealloc(mod->am_destroy, sizeof(ancdestroy_t) *
-                               (mod->am_alloc + AD_CHUNK));
-
-    /* initialize the new slots */
-    for (j = i; j < mod->am_alloc + AD_CHUNK; j++)
-      mod->am_destroy[j] = 0;
-
-    /* save the new allocation size */
-    mod->am_alloc += AD_CHUNK;
-  }
-
-  assert(i < mod->am_alloc);
-
-  /* set the new slot with the destructor and return the key */
-  mod->am_destroy[i] = destroy;
-  return i;
-}
-
-/** Destroy datum in object during iteration.
- * @param[in] mod The ancillary data module.
- * @param[in] obj The object being iterated over.
- * @param[in] key Key being released.
- * @return 0 to continue iteration.
- */
-static int ad_key_release(ancmodule_t* mod, void* obj, anckey_t* key)
-{
-  ancdata_t *data = am_data(mod, obj);
-
-  if (data->ad_alloc > *key && data->ad_data[*key]) {
-    (mod->am_destroy[*key])(data->ad_data[*key]);
-    data->ad_data[*key] = 0; /* zero the object data */
-  }
-
-  return 0;
-}
-
-/** Destroy an ancillary data key.
- * @param[in] module Name of an object module accepting ancillary
- * data.
- * @param[in] key Key to destroy.
- */
-void ad_key_destroy(const char* module, anckey_t key)
-{
-  ancmodule_t *mod;
-
-  assert(ANC_INVKEY != key);
-
-  /* look up the named module */
-  if (!(mod = reg_find(ANC_TABLE, module)) || key >= mod->am_alloc ||
-      !mod->am_destroy[key])
-    return;
-
-  /* now iterate over all the objects, releasing the datum */
-  (mod->am_walk)(mod, (anciter_t) ad_key_release, (void*) &key);
-
-  /* finally, mark the slot empty */
-  mod->am_destroy[key] = 0;
-}
-
-/** Iterate over all objects in a module.
- * @param[in] module Name of an object module accepting ancillary
- * data.
- * @param[in] func Iteration function to execute.
- * @param[in,out] extra Extra data to pass to iteration function.
- * @return -1 if table doesn't exist; otherwise 0 or whatever non-zero
- * value \a func returns.  (Iteration terminates if \a func returns
- * non-zero.)
- */
-int ad_iter(const char* module, anciter_t func, void* extra)
-{
-  ancmodule_t *mod;
-
-  assert(0 != func);
-
-  /* look up the named module */
-  if (!(mod = reg_find(ANC_TABLE, module)))
-    return -1;
-
-  /* now call the module's walk callback */
-  return (mod->am_walk)(mod, func, extra);
-}
-
-/** Flush all data in a particular object.
- * @param[in] am The module the object is in.
- * @param[in] ad A pointer to the object's ancillary data.
- */
-void ad_flush(ancmodule_t* am, ancdata_t* ad)
-{
-  anckey_t i;
-
-  /* walk all the data */
-  for (i = 0; i < ad->ad_alloc; i++)
-    if (ad->ad_data[i]) { /* have to destroy a datum */
-      assert(0 != am->am_destroy[i]);
-      (am->am_destroy[i])(ad->ad_data[i]); /* so destroy it */
-    }
-
-  /* we've released all the data, so let's clean up after ourselves */
-  MyFree(ad->ad_data);
-
-  ad->ad_alloc = 0;
-  ad->ad_data = 0; /* should be done by MyFree(), but I don't rely on that */
-}
-
-/** Initialize ancillary data subsystem. */
-void ad_init(void)
-{
-  reg(REG_TABLE, &ad_table);
-}
commit a43bd90057510e151a0f1bb4c42ea432dc521cab
Author: Michael Poole <[email protected]>
Date:   Fri Jun 2 22:17:33 2017 -0400

    Bug fixes for numnick changes.

diff --git a/ircd/numnicks.c b/ircd/numnicks.c
index bc85e0b..cf46517 100644
--- a/ircd/numnicks.c
+++ b/ircd/numnicks.c
@@ -182,6 +182,7 @@ struct Client *FindNClient(const char* numnick)
   case 4: /* SCCC */
   case 5: /* SSCCC */
     srv = server_list[nn >> (3 * NUMNICKLOG)];
+    break;
   default:
     return NULL;
   }
@@ -200,7 +201,7 @@ struct Client *FindNClient(const char* numnick)
 struct Client* FindNServer(const char* numeric)
 {
   struct Client* cli = FindNClient(numeric);
-  return (cli && cli_serv(cli)) ? cli : NULL;
+  return !cli ? NULL : cli_serv(cli) ? cli : cli_user(cli)->server;
 }
 
 /** Look up a user by numnick string.
-----------------------------------------------------------------------

Summary of changes:
 include/ancillary.h  | 156 ----------------------
 include/client.h     |   2 +-
 include/ircd.h       |   2 -
 include/ircd_osdep.h |   2 +-
 ircd/ancillary.c     | 368 ---------------------------------------------------
 ircd/gline.c         |   3 +-
 ircd/listener.c      |  11 +-
 ircd/m_opmode.c      |  12 +-
 ircd/m_part.c        |  16 ++-
 ircd/m_server.c      |   2 +-
 ircd/m_webirc.c      |  13 +-
 ircd/numnicks.c      |   5 +-
 ircd/os_generic.c    |  16 ++-
 ircd/parse.c         |  46 +++----
 ircd/s_auth.c        |  55 ++++----
 ircd/s_bsd.c         |   8 +-
 ircd/s_user.c        |   2 +-
 17 files changed, 101 insertions(+), 618 deletions(-)
 delete mode 100644 include/ancillary.h
 delete mode 100644 ircd/ancillary.c


hooks/post-receive
-- 
Undernet IRC Server Source Code.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to