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

Comparing ircd-hybrid/trunk/src/send.c (file contents):
Revision 3186 by michael, Thu Mar 20 18:09:34 2014 UTC vs.
Revision 3189 by michael, Fri Mar 21 18:18:00 2014 UTC

# Line 306 | Line 306 | void
306   sendto_one(struct Client *to, const char *pattern, ...)
307   {
308    va_list args;
309 <  struct dbuf_block *buffer;
310 <
311 <  to = to->from;
309 >  struct dbuf_block *buffer = NULL;
310  
311 <  if (IsDead(to))
311 >  if (IsDead(to->from))
312      return;  /* This socket has already been marked as dead */
313  
314    buffer = dbuf_alloc();
# Line 319 | Line 317 | sendto_one(struct Client *to, const char
317    send_format(buffer, pattern, args);
318    va_end(args);
319  
320 <  send_message(to, buffer);
320 >  send_message(to->from, buffer);
321  
322    dbuf_ref_free(buffer);
323   }
# Line 327 | Line 325 | sendto_one(struct Client *to, const char
325   void
326   sendto_one_numeric(struct Client *to, struct Client *from, enum irc_numerics numeric, ...)
327   {
328 <  struct dbuf_block *buffer;
328 >  struct dbuf_block *buffer = NULL;
329 >  const char *dest = NULL;
330    va_list args;
332 –  const char *dest;
333 –
334 –  to = to->from;
331  
332 <  if (IsDead(to))
332 >  if (IsDead(to->from))
333      return;
334  
335    dest = ID_or_name(to, to);
# Line 348 | Line 344 | sendto_one_numeric(struct Client *to, st
344    send_format(buffer, numeric_form(numeric), args);
345    va_end(args);
346  
347 <  send_message(to, buffer);
347 >  send_message(to->from, buffer);
348  
349    dbuf_ref_free(buffer);
350   }
# Line 356 | Line 352 | sendto_one_numeric(struct Client *to, st
352   void
353   sendto_one_notice(struct Client *to, struct Client *from, const char *pattern, ...)
354   {
355 <  struct dbuf_block *buffer;
355 >  struct dbuf_block *buffer = NULL;
356 >  const char *dest = NULL;
357    va_list args;
361 –  const char *dest;
362 –
363 –  to = to->from;
358  
359 <  if (IsDead(to))
359 >  if (IsDead(to->from))
360      return;
361  
362    dest = ID_or_name(to, to);
# Line 377 | Line 371 | sendto_one_notice(struct Client *to, str
371    send_format(buffer, pattern, args);
372    va_end(args);
373  
374 <  send_message(to, buffer);
374 >  send_message(to->from, buffer);
375  
376    dbuf_ref_free(buffer);
377   }
# Line 824 | Line 818 | sendto_anywhere(struct Client *to, struc
818                  const char *pattern, ...)
819   {
820    va_list args;
821 <  struct dbuf_block *buffer;
821 >  struct dbuf_block *buffer = NULL;
822  
823    if (IsDead(to->from))
824      return;
825  
826    buffer = dbuf_alloc();
827  
828 <  if (MyClient(to))
829 <  {
830 <    if (IsServer(from))
837 <      dbuf_put_fmt(buffer, ":%s %s %s ", from->name, command, to->name);
838 <    else
839 <      dbuf_put_fmt(buffer, ":%s!%s@%s %s %s ", from->name, from->username, from->host, command, to->name);
840 <  }
828 >  if (MyClient(to) && IsClient(from))
829 >    dbuf_put_fmt(buffer, ":%s!%s@%s %s %s ", from->name, from->username,
830 >                 from->host, command, to->name);
831    else
832 <    dbuf_put_fmt(buffer, ":%s %s %s ", ID_or_name(from, to), command, ID_or_name(to, to));
832 >    dbuf_put_fmt(buffer, ":%s %s %s ", ID_or_name(from, to),
833 >                 command, ID_or_name(to, to));
834  
835    va_start(args, pattern);
836    send_format(buffer, pattern, args);

Diff Legend

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