ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_capab.c
(Generate patch)

Comparing:
ircd-hybrid/modules/m_capab.c (file contents), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_capab.c (file contents), Revision 969 by michael, Sun Aug 2 22:48:53 2009 UTC

# Line 19 | Line 19
19   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
20   *  USA
21   *
22 < *  $Id: m_capab.c,v 1.39 2005/07/30 20:44:14 adx Exp $
22 > *  $Id$
23   */
24  
25   #include "stdinc.h"
# Line 32 | Line 32
32   #include "parse.h"
33   #include "modules.h"
34  
35 < static void mr_capab(struct Client *, struct Client *, int, char **);
35 > static void mr_capab(struct Client *, struct Client *, int, char *[]);
36  
37   struct Message capab_msgtab = {
38    "CAPAB", 0, 0, 0, 0, MFLG_SLOW | MFLG_UNREG, 0,
39 <  {mr_capab, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore}
39 >  { mr_capab, m_ignore, m_ignore, m_ignore, m_ignore, m_ignore }
40   };
41  
42   #ifndef STATIC_MODULES
# Line 52 | Line 52 | _moddeinit(void)
52    mod_del_cmd(&capab_msgtab);
53   }
54  
55 < const char *_version = "$Revision: 1.39 $";
55 > const char *_version = "$Revision$";
56   #endif
57  
58   /*
# Line 67 | Line 67 | mr_capab(struct Client *client_p, struct
67   {
68    int i;
69    int cap;
70 <  char *p;
71 <  char *s;
70 >  char *p = NULL;
71 >  char *s = NULL;
72   #ifdef HAVE_LIBCRYPTO
73 <  struct EncCapability *ecap;
73 >  const struct EncCapability *ecap;
74    unsigned int cipher = 0;
75   #endif
76  
77  /* ummm, this shouldn't happen. Could argue this should be logged etc. */
78  if (client_p->localClient == NULL)
79    return;
80
77    if (client_p->localClient->caps && !(IsCapable(client_p, CAP_TS6)))
78    {
79      exit_client(client_p, client_p, "CAPAB received twice");
80      return;
81    }
86  else
87    SetCapable(client_p, CAP_CAP);
82  
83 <  for (i = 1; i < parc; i++)
83 >  SetCapable(client_p, CAP_CAP);
84 >
85 >  for (i = 1; i < parc; ++i)
86    {
87 <    for (s = strtoken(&p, parv[i], " "); s; s = strtoken(&p, NULL, " "))
87 >    for (s = strtoken(&p, parv[i], " "); s;
88 >         s = strtoken(&p,    NULL, " "))
89      {
90   #ifdef HAVE_LIBCRYPTO
91 <      if ((strncmp(s, "ENC:", 4) == 0))
91 >      if (!strncmp(s, "ENC:", 4))
92        {
93          /* Skip the "ENC:" portion */
94          s += 4;
# Line 99 | Line 96 | mr_capab(struct Client *client_p, struct
96          /* Check the remaining portion against the list of ciphers we
97           * have available (CipherTable).
98           */
99 <        for (ecap = CipherTable; ecap->name; ecap++)
99 >        for (ecap = CipherTable; ecap->name; ++ecap)
100          {
101 <          if ((irccmp(ecap->name, s) == 0) && (ecap->cap & CAP_ENC_MASK))
101 >          if (!irccmp(ecap->name, s) && (ecap->cap & CAP_ENC_MASK))
102            {
103              cipher = ecap->cap;
104              break;
105            }
106          }
107 +
108          /* Since the name and capabilities matched, use it. */
109          if (cipher != 0)
110          {

Comparing:
ircd-hybrid/modules/m_capab.c (property svn:keywords), Revision 30 by adx, Sun Oct 2 20:03:27 2005 UTC vs.
ircd-hybrid-7.2/modules/m_capab.c (property svn:keywords), Revision 969 by michael, Sun Aug 2 22:48:53 2009 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)