"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/m_userhost.c" between
ircd-hybrid-8.2.27.tgz and ircd-hybrid-8.2.28.tgz

About: IRCD-Hybrid is a Internet Relay Chat server.

m_userhost.c  (ircd-hybrid-8.2.27.tgz):m_userhost.c  (ircd-hybrid-8.2.28.tgz)
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA * USA
*/ */
/*! \file m_userhost.c /*! \file m_userhost.c
* \brief Includes required functions for processing the USERHOST command. * \brief Includes required functions for processing the USERHOST command.
* \version $Id: m_userhost.c 9102 2020-01-01 09:58:57Z michael $ * \version $Id: m_userhost.c 9199 2020-01-23 17:49:06Z michael $
*/ */
#include "stdinc.h" #include "stdinc.h"
#include "client.h" #include "client.h"
#include "ircd.h" #include "ircd.h"
#include "numeric.h" #include "numeric.h"
#include "send.h" #include "send.h"
#include "irc_string.h" #include "irc_string.h"
#include "parse.h" #include "parse.h"
#include "modules.h" #include "modules.h"
skipping to change at line 52 skipping to change at line 52
* pointers. * pointers.
* \note Valid arguments for this command are: * \note Valid arguments for this command are:
* - parv[0] = command * - parv[0] = command
* - parv[1] = space-separated list of up to 5 nicknames * - parv[1] = space-separated list of up to 5 nicknames
*/ */
static void static void
m_userhost(struct Client *source_p, int parc, char *parv[]) m_userhost(struct Client *source_p, int parc, char *parv[])
{ {
char buf[IRCD_BUFSIZE]; char buf[IRCD_BUFSIZE];
char response[NICKLEN + USERLEN + HOSTLEN + 6]; /* +6 for "*=+@ \0" */ char response[NICKLEN + USERLEN + HOSTLEN + 6]; /* +6 for "*=+@ \0" */
char *t = NULL, *p = NULL; char *p = NULL;
int i = 0; int i = 0;
int cur_len;
int rl; int rl;
cur_len = snprintf(buf, sizeof(buf), numeric_form(RPL_USERHOST), me.name, sour int cur_len = snprintf(buf, sizeof(buf), numeric_form(RPL_USERHOST), me.name,
ce_p->name, ""); source_p->name, "");
t = buf + cur_len; char *t = buf + cur_len;
for (const char *name = strtok_r(parv[1], " ", &p); name && i++ < 5; for (const char *name = strtok_r(parv[1], " ", &p); name && i++ < 5;
name = strtok_r(NULL, " ", &p)) name = strtok_r(NULL, " ", &p))
{ {
const struct Client *target_p; const struct Client *target_p = find_person(source_p, name);
if ((target_p = find_person(source_p, name))) if (target_p)
{ {
/* /*
* Show real IP address for USERHOST on yourself. * Show real IP address for USERHOST on yourself.
* This is needed for things like mIRC, which do a server-based * This is needed for things like mIRC, which do a server-based
* lookup (USERHOST) to figure out what the clients' local IP * lookup (USERHOST) to figure out what the clients' local IP
* is. Useful for things like NAT, and dynamic dial-up users. * is. Useful for things like NAT, and dynamic dial-up users.
*/ */
if (target_p == source_p) if (target_p == source_p)
{ {
rl = snprintf(response, sizeof(response), "%s%s=%c%s@%s ", rl = snprintf(response, sizeof(response), "%s%s=%c%s@%s ",
skipping to change at line 132 skipping to change at line 131
} }
static void static void
module_exit(void) module_exit(void)
{ {
mod_del_cmd(&userhost_msgtab); mod_del_cmd(&userhost_msgtab);
} }
struct module module_entry = struct module module_entry =
{ {
.version = "$Revision: 9102 $", .version = "$Revision: 9199 $",
.modinit = module_init, .modinit = module_init,
.modexit = module_exit, .modexit = module_exit,
}; };
 End of changes. 6 change blocks. 
9 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)