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

Comparing ircd-hybrid-7.2/modules/m_close.c (file contents):
Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 970 by michael, Sun Aug 2 23:04:14 2009 UTC

# Line 28 | Line 28
28   #include "client.h"
29   #include "ircd.h"
30   #include "numeric.h"
31 – #include "fdlist.h"
32 – #include "s_bsd.h"
31   #include "send.h"
32   #include "msg.h"
33   #include "parse.h"
34   #include "modules.h"
35  
36 < static void mo_close(struct Client *, struct Client *, int, char **);
36 > static void mo_close(struct Client *, struct Client *, int, char *[]);
37  
38   struct Message close_msgtab = {
39    "CLOSE", 0, 0, 0, 0, MFLG_SLOW, 0,
40 <  {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_close, m_ignore}
40 >  { m_unregistered, m_not_oper, m_ignore, m_ignore, mo_close, m_ignore }
41   };
42 +
43   #ifndef STATIC_MODULES
44   void
45   _modinit(void)
# Line 65 | Line 64 | static void
64   mo_close(struct Client *client_p, struct Client *source_p,
65           int parc, char *parv[])
66   {
67 <  struct Client *target_p;
68 <  dlink_node *ptr;
69 <  dlink_node *ptr_next;
71 <  unsigned int closed = 0;
67 >  dlink_node *ptr = NULL, *ptr_next = NULL;
68 >  unsigned int closed = dlink_list_length(&unknown_list);
69 >
70  
71    DLINK_FOREACH_SAFE(ptr, ptr_next, unknown_list.head)
72    {
73 <    target_p = ptr->data;
73 >    struct Client *target_p = ptr->data;
74  
75 <  /* Which list would connecting servers be found in? serv_list ? */
78 < #if 0
79 <      if (!IsUnknown(target_p) && !IsConnecting(target_p) &&
80 <          !IsHandshake(target_p) && !IsDoingKauth(target_p))
81 <        continue;
82 < #endif
83 <    sendto_one(source_p, form_str(RPL_CLOSING), me.name, parv[0],
75 >    sendto_one(source_p, form_str(RPL_CLOSING), me.name, source_p->name,
76                 get_client_name(target_p, SHOW_IP), target_p->status);
77 +
78      /* exit here is safe, because it is guaranteed not to be source_p
79       * because it is unregistered and source_p is an oper.
80       */
81      exit_client(target_p, target_p, "Oper Closing");
89 –    closed++;
82    }
83  
84    sendto_one(source_p, form_str(RPL_CLOSEEND),
85               me.name, source_p->name, closed);
86   }
95 –

Diff Legend

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