From: Michael Poole Date: Thu, 31 Mar 2005 04:05:56 +0000 (+0000) Subject: Fix Doxygen comment typo; clarify username handling. X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=c7f8cccba5012c0557998c353a84da18999ecf3d;p=ircu2.10.12-pk.git Fix Doxygen comment typo; clarify username handling. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1346 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 26eb3a6..2a80a77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2005-03-30 Michael Poole + + * include/client.h (struct Client): Explain where cli_username + comes from. + + * include/struct.h (struct User): Explain where this username + comes from, too + + * ircd/ircd_res.c (timeout_resolver): Update parameter name in + Doxygen comment, too. + + * ircd/s_misc.c (get_client_name): Reorganize to have less + indentation and behave like 2.10.11 when client is not idented. + 2005-03-29 Michael Poole * doc/example.conf: Remove no-longer-used HIS_STATS_h. diff --git a/include/client.h b/include/client.h index 7b4179f..f6c2244 100644 --- a/include/client.h +++ b/include/client.h @@ -262,7 +262,7 @@ struct Client { struct irc_in_addr cli_ip; /**< Real IP of client */ short cli_status; /**< Client type */ char cli_name[HOSTLEN + 1]; /**< Unique name of the client, nick or host */ - char cli_username[USERLEN + 1]; /**< username here now for auth stuff */ + char cli_username[USERLEN + 1]; /**< Username determined by ident lookup */ char cli_info[REALLEN + 1]; /**< Free form additional client information */ }; diff --git a/include/struct.h b/include/struct.h index fcbf74b..b704166 100644 --- a/include/struct.h +++ b/include/struct.h @@ -73,7 +73,12 @@ struct User { unsigned int refcnt; /**< Number of times this block is referenced */ unsigned int joined; /**< number of channels joined */ unsigned int invites; /**< Number of channels we've been invited to */ - char username[USERLEN + 1]; /**< remote account name */ + /** Remote account name. Before registration is complete, this is + * either empty or contains the username from the USER command. + * After registration, that may be prefixed with ~ or it may be + * overwritten with the ident response. + */ + char username[USERLEN + 1]; char host[HOSTLEN + 1]; /**< displayed hostname */ char realhost[HOSTLEN + 1]; /**< actual hostname */ char account[ACCOUNTLEN + 1]; /**< IRC account name */ diff --git a/ircd/ircd_res.c b/ircd/ircd_res.c index eab072b..f91fdc5 100644 --- a/ircd/ircd_res.c +++ b/ircd/ircd_res.c @@ -289,7 +289,7 @@ check_resolver_timeout(time_t when) } /** Drop pending DNS lookups which have timed out. - * @param[in] notused Timer event data (ignored). + * @param[in] ev Timer event data (ignored). */ static void timeout_resolver(struct Event *ev) diff --git a/ircd/s_misc.c b/ircd/s_misc.c index 4021bcc..a55c974 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -164,16 +164,12 @@ const char* get_client_name(const struct Client* sptr, int showip) { static char nbuf[HOSTLEN * 2 + USERLEN + 5]; - if (MyConnect(sptr)) { - if (showip) - ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr), - IsIdented(sptr) ? cli_username(sptr) : "unknown", - cli_sock_ip(sptr)); - else - return cli_name(sptr); - return nbuf; - } - return cli_name(sptr); + if (!MyConnect(sptr) || !showip) + return cli_name(sptr); + ircd_snprintf(0, nbuf, sizeof(nbuf), "%s[%s@%s]", cli_name(sptr), + IsIdented(sptr) ? cli_username(sptr) : "", + cli_sock_ip(sptr)); + return nbuf; } /** Set cli_sockhost(cptr) from \a host.