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

Comparing ircd-hybrid-7.2/contrib/m_ltrace.c (file contents):
Revision 888 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 889 by michael, Thu Nov 1 12:59:05 2007 UTC

# Line 81 | Line 81 | _moddeinit(void)
81   }
82   #endif
83  
84 < static int report_this_status(struct Client *source_p, struct Client *target_p,int dow,
85 <                              int link_u_p, int link_u_s);
84 > static void report_this_status(struct Client *, struct Client *, int);
85 >
86 > static void
87 > trace_get_dependent(int *const server,
88 >                    int *const client, const struct Client *target_p)
89 > {
90 >  const dlink_node *ptr = NULL;
91 >
92 >  (*server)++;
93 >  (*client) += dlink_list_length(&target_p->serv->client_list);
94 >
95 >  DLINK_FOREACH(ptr, target_p->serv->server_list.head)
96 >    trace_get_dependent(server, client, ptr->data);
97 > }
98  
99   /*
100   * m_ltrace()
# Line 206 | Line 218 | do_ltrace(struct Client *source_p, int p
218      if (!dow && irccmp(tname, target_p->name))
219        continue;
220  
221 <    report_this_status(source_p, target_p, dow, 0, 0);
221 >    report_this_status(source_p, target_p, dow);
222    }
223  
224    /* report all servers */
# Line 219 | Line 231 | do_ltrace(struct Client *source_p, int p
231      if (!dow && irccmp(tname, target_p->name))
232        continue;
233  
234 <    report_this_status(source_p, target_p, dow, target_p->serv->dep_users,
223 <                       target_p->serv->dep_servers);
234 >    report_this_status(source_p, target_p, dow);
235    }
236  
237    sendto_one(source_p, form_str(RPL_ENDOFTRACE), me.name, parv[0], tname);
# Line 261 | Line 272 | mo_ltrace(struct Client *client_p, struc
272   * output       - counter of number of hits
273   * side effects - NONE
274   */
275 < static int
275 > static void
276   report_this_status(struct Client *source_p, struct Client *target_p,
277 <                   int dow, int link_u_p, int link_s_p)
277 >                   int dow)
278   {
279    const char *name = NULL;
280    const char *class_name = NULL;
# Line 326 | Line 337 | report_this_status(struct Client *source
337        break;
338  
339      case STAT_SERVER:
340 <      if(!IsAdmin(source_p))
340 >    {
341 >      int clients = 0;
342 >      int servers = 0;
343 >
344 >      trace_get_dependent(&servers, &clients, target_p);
345 >
346 >      if (!IsAdmin(source_p))
347          name = get_client_name(target_p, MASK_IP);
348  
349        sendto_one(source_p, form_str(RPL_TRACESERVER),
350 <                 me.name, source_p->name, class_name, link_s_p,
351 <                 link_u_p, name, *(target_p->serv->by) ?
350 >                 me.name, source_p->name, class_name, servers,
351 >                 clients, name, *(target_p->serv->by) ?
352                   target_p->serv->by : "*", "*",
353                   me.name, CurrentTime - target_p->lasttime);
354        break;
355 +    }
356  
357      case STAT_ME:
358      case STAT_UNKNOWN:
# Line 345 | Line 363 | report_this_status(struct Client *source
363                   source_p->name, name);
364        break;
365    }
348
349  return 0;
366   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines