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-7.2/src/send.c (file contents), Revision 1015 by michael, Sun Oct 25 00:08:06 2009 UTC vs.
ircd-hybrid/trunk/src/send.c (file contents), Revision 2635 by michael, Tue Dec 10 17:46:37 2013 UTC

# Line 27 | Line 27
27   #include "send.h"
28   #include "channel.h"
29   #include "client.h"
30 #include "common.h"
30   #include "dbuf.h"
31   #include "irc_string.h"
32   #include "ircd.h"
34 #include "handlers.h"
33   #include "numeric.h"
34   #include "fdlist.h"
35   #include "s_bsd.h"
36   #include "s_serv.h"
37 < #include "sprintf_irc.h"
38 < #include "s_conf.h"
41 < #include "s_log.h"
37 > #include "conf.h"
38 > #include "log.h"
39   #include "memory.h"
43 #include "hook.h"
44 #include "irc_getnameinfo.h"
40   #include "packet.h"
41  
47 #define LOG_BUFSIZE 2048
48
49 struct Callback *iosend_cb = NULL;
50 struct Callback *iosendctrl_cb = NULL;
51
52 static void send_message(struct Client *, char *, int);
53 static void send_message_remote(struct Client *, struct Client *, char *, int);
42  
43   static unsigned int current_serial = 0;
44  
45 +
46   /* send_format()
47   *
48   * inputs       - buffer to format into
# Line 86 | Line 75 | send_format(char *lsendbuf, int bufsize,
75  
76    lsendbuf[len++] = '\r';
77    lsendbuf[len++] = '\n';
78 <  return (len);
90 < }
91 <
92 < /*
93 < * iosend_default - append a packet to the client's sendq.
94 < */
95 < void *
96 < iosend_default(va_list args)
97 < {
98 <  struct Client *to = va_arg(args, struct Client *);
99 <  int length = va_arg(args, int);
100 <  char *buf = va_arg(args, char *);
101 <
102 <  dbuf_put(&to->localClient->buf_sendq, buf, length);
103 <  return NULL;
78 >  return len;
79   }
80  
81   /*
# Line 114 | Line 89 | send_message(struct Client *to, char *bu
89    assert(!IsMe(to));
90    assert(to != &me);
91  
92 <  if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(to))
92 >  if (dbuf_length(&to->localClient->buf_sendq) + len > get_sendq(&to->localClient->confs))
93    {
94      if (IsServer(to))
95 <      sendto_realops_flags(UMODE_ALL, L_ALL,
96 <                           "Max SendQ limit exceeded for %s: %lu > %lu",
95 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
96 >                           "Max SendQ limit exceeded for %s: %lu > %u",
97                             get_client_name(to, HIDE_IP),
98                             (unsigned long)(dbuf_length(&to->localClient->buf_sendq) + len),
99 <                           get_sendq(to));
99 >                           get_sendq(&to->localClient->confs));
100      if (IsClient(to))
101        SetSendQExceeded(to);
102      dead_link_on_write(to, 0);
103      return;
104    }
105 <
106 <  execute_callback(iosend_cb, to, len, buf);
105 >
106 >  dbuf_put(&to->localClient->buf_sendq, buf, len);
107  
108    /*
109     ** Update statistics. The following is slightly incorrect
# Line 160 | Line 135 | send_message_remote(struct Client *to, s
135   {
136    if (!MyConnect(to))
137    {
138 <    sendto_realops_flags(UMODE_ALL, L_ALL,
138 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
139                           "server send message to %s [%s] dropped from %s(Not local server)",
140                           to->name, to->from->name, from->name);
141      return;
# Line 173 | Line 148 | send_message_remote(struct Client *to, s
148    {
149      if (IsServer(from))
150      {
151 <      sendto_realops_flags(UMODE_ALL, L_ALL,
151 >      sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
152                             "Send message to %s [%s] dropped from %s(Fake Dir)",
153                             to->name, to->from->name, from->name);
154        return;
155      }
156  
157 <    sendto_realops_flags(UMODE_ALL, L_ALL,
157 >    sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
158                           "Ghosted: %s[%s@%s] from %s[%s@%s] (%s)",
159                           to->name, to->username, to->host,
160                           from->name, from->username, from->host,
161                           to->from->name);
162  
163 <    sendto_server(NULL, NULL, CAP_TS6, NOCAPS,
163 >    sendto_server(NULL, CAP_TS6, NOCAPS,
164                    ":%s KILL %s :%s (%s[%s@%s] Ghosted %s)",
165                    me.id, to->name, me.name, to->name,
166                    to->username, to->host, to->from->name);
167 <    sendto_server(NULL, NULL, NOCAPS, CAP_TS6,
167 >    sendto_server(NULL, NOCAPS, CAP_TS6,
168                    ":%s KILL %s :%s (%s[%s@%s] Ghosted %s)",
169                    me.name, to->name, me.name, to->name,
170                    to->username, to->host, to->from->name);
171  
172 <    SetKilled(to);
172 >    AddFlag(to, FLAGS_KILLED);
173  
174      if (IsClient(from))
175        sendto_one(from, form_str(ERR_GHOSTEDCLIENT),
# Line 229 | Line 204 | sendq_unblocked(fde_t *fd, struct Client
204   }
205  
206   /*
232 ** slinkq_unblocked
233 **      Called when a server control socket is ready for writing.
234 */
235 static void
236 slinkq_unblocked(fde_t *fd, struct Client *client_p)
237 {
238  ClearSlinkqBlocked(client_p);
239  send_queued_slink_write(client_p);
240 }
241
242 /*
207   ** send_queued_write
208   **      This is called when there is a chance that some output would
209   **      be possible. This attempts to empty the send queue as far as
# Line 317 | Line 281 | send_queued_write(struct Client *to)
281    }
282   }
283  
320 /*
321 ** send_queued_slink_write
322 **      This is called when there is a chance the some output would
323 **      be possible. This attempts to empty the send queue as far as
324 **      possible, and then if any data is left, a write is rescheduled.
325 */
326 void
327 send_queued_slink_write(struct Client *to)
328 {
329  int retlen;
330
331  /*
332   ** Once socket is marked dead, we cannot start writing to it,
333   ** even if the error is removed...
334   */
335  if (IsDead(to) || IsSlinkqBlocked(to))
336    return;  /* no use calling send() now */
337
338  /* Next, lets try to write some data */
339  if (to->localClient->slinkq != NULL)
340  {
341    retlen = send(to->localClient->ctrlfd.fd,
342                   to->localClient->slinkq + to->localClient->slinkq_ofs,
343                   to->localClient->slinkq_len, 0);
344    if (retlen < 0)
345    {
346      /* If we have a fatal error */
347      if (!ignoreErrno(errno))
348      {
349        dead_link_on_write(to, errno);
350        return;
351      }
352    }
353    else if (retlen == 0)
354    {
355      /* 0 bytes is an EOF .. */
356      dead_link_on_write(to, 0);
357      return;
358    }
359    else
360    {
361      execute_callback(iosendctrl_cb, to, retlen,
362        to->localClient->slinkq + to->localClient->slinkq_ofs);
363      to->localClient->slinkq_len -= retlen;
364
365      assert(to->localClient->slinkq_len >= 0);
366      if (to->localClient->slinkq_len)
367        to->localClient->slinkq_ofs += retlen;
368      else
369      {
370        to->localClient->slinkq_ofs = 0;
371        MyFree(to->localClient->slinkq);
372        to->localClient->slinkq = NULL;
373      }
374    }
375
376    /* Finally, if we have any more data, reschedule a write */
377    if (to->localClient->slinkq_len)
378    {
379      SetSlinkqBlocked(to);
380      comm_setselect(&to->localClient->ctrlfd, COMM_SELECT_WRITE,
381                     (PF *)slinkq_unblocked, (void *)to, 0);
382    }
383  }
384 }
385
284   /* send_queued_all()
285   *
286   * input        - NONE
# Line 453 | Line 351 | sendto_one(struct Client *to, const char
351   */
352   void
353   sendto_channel_butone(struct Client *one, struct Client *from,
354 <                      struct Channel *chptr, const char *command,
354 >                      struct Channel *chptr, unsigned int type,
355                        const char *pattern, ...)
356   {
357    va_list alocal, aremote, auid;
# Line 461 | Line 359 | sendto_channel_butone(struct Client *one
359    char remote_buf[IRCD_BUFSIZE];
360    char uid_buf[IRCD_BUFSIZE];
361    int local_len, remote_len, uid_len;
362 <  dlink_node *ptr;
465 <  dlink_node *ptr_next;
466 <  struct Client *target_p;
362 >  dlink_node *ptr = NULL, *ptr_next = NULL;
363  
364    if (IsServer(from))
365 <    local_len = ircsprintf(local_buf, ":%s %s %s ",
366 <                           from->name, command, chptr->chname);
365 >    local_len = snprintf(local_buf, sizeof(local_buf), ":%s ",
366 >                        from->name);
367    else
368 <    local_len = ircsprintf(local_buf, ":%s!%s@%s %s %s ",
369 <                           from->name, from->username, from->host,
370 <                           command, chptr->chname);
371 <  remote_len = ircsprintf(remote_buf, ":%s %s %s ",
372 <                          from->name, command, chptr->chname);
477 <  uid_len = ircsprintf(uid_buf, ":%s %s %s ",
478 <                       ID(from), command, chptr->chname);
368 >    local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ",
369 >                         from->name, from->username, from->host);
370 >  remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ",
371 >                        from->name);
372 >  uid_len = snprintf(uid_buf, sizeof(uid_buf), ":%s ", ID(from));
373  
374    va_start(alocal, pattern);
375    va_start(aremote, pattern);
# Line 494 | Line 388 | sendto_channel_butone(struct Client *one
388  
389    DLINK_FOREACH_SAFE(ptr, ptr_next, chptr->members.head)
390    {
391 <    target_p = ((struct Membership *)ptr->data)->client_p;
392 <    assert(target_p != NULL);
391 >    struct Membership *ms = ptr->data;
392 >    struct Client *target_p = ms->client_p;
393 >
394 >    assert(IsClient(target_p));
395  
396 <    if (IsDefunct(target_p) || IsDeaf(target_p) || target_p->from == one)
396 >    if (IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF) || target_p->from == one)
397        continue;
398  
399 <    if (MyClient(target_p))
399 >    if (type != 0 && (ms->flags & type) == 0)
400 >      continue;
401 >
402 >    if (MyConnect(target_p))
403      {
404 <      if (target_p->serial != current_serial)
404 >      if (target_p->localClient->serial != current_serial)
405        {
406          send_message(target_p, local_buf, local_len);
407 <        target_p->serial = current_serial;
407 >        target_p->localClient->serial = current_serial;
408        }
409      }
410      else
# Line 513 | Line 412 | sendto_channel_butone(struct Client *one
412        /* Now check whether a message has been sent to this
413         * remote link already
414         */
415 <      if (target_p->from->serial != current_serial)
415 >      if (target_p->from->localClient->serial != current_serial)
416        {
417          if (IsCapable(target_p->from, CAP_TS6))
418            send_message_remote(target_p->from, from, uid_buf, uid_len);
419          else
420            send_message_remote(target_p->from, from, remote_buf, remote_len);
421 <        target_p->from->serial = current_serial;
421 >        target_p->from->localClient->serial = current_serial;
422        }
423      }
424    }
# Line 544 | Line 443 | sendto_channel_butone(struct Client *one
443   * -davidt
444   */
445   void
446 < sendto_server(struct Client *one, const struct Channel *chptr,
446 > sendto_server(struct Client *one,
447                const unsigned int caps,
448                const unsigned int nocaps,
449                const char *format, ...)
# Line 554 | Line 453 | sendto_server(struct Client *one, const
453    char buffer[IRCD_BUFSIZE];
454    int len = 0;
455  
557  if (chptr && chptr->chname[0] != '#')
558    return;
559
456    va_start(args, format);
457    len = send_format(buffer, IRCD_BUFSIZE, format, args);
458    va_end(args);
# Line 592 | Line 488 | sendto_server(struct Client *one, const
488   *                used by m_nick.c and exit_one_client.
489   */
490   void
491 < sendto_common_channels_local(struct Client *user, int touser,
491 > sendto_common_channels_local(struct Client *user, int touser, unsigned int cap,
492                               const char *pattern, ...)
493   {
494    va_list args;
# Line 622 | Line 518 | sendto_common_channels_local(struct Clie
518        assert(target_p != NULL);
519  
520        if (!MyConnect(target_p) || target_p == user || IsDefunct(target_p) ||
521 <          target_p->serial == current_serial)
521 >          target_p->localClient->serial == current_serial)
522          continue;
523  
524 <      target_p->serial = current_serial;
524 >      if (HasCap(target_p, cap) != cap)
525 >        continue;
526 >
527 >      target_p->localClient->serial = current_serial;
528        send_message(target_p, buffer, len);
529      }
530    }
531  
532    if (touser && MyConnect(user) && !IsDead(user) &&
533 <      user->serial != current_serial)
534 <    send_message(user, buffer, len);
533 >      user->localClient->serial != current_serial)
534 >    if (HasCap(user, cap) == cap)
535 >      send_message(user, buffer, len);
536   }
537  
538   /* sendto_channel_local()
# Line 646 | Line 546 | sendto_common_channels_local(struct Clie
546   *                locally connected to this server.
547   */
548   void
549 < sendto_channel_local(int type, int nodeaf, struct Channel *chptr,
549 > sendto_channel_local(unsigned int type, int nodeaf, struct Channel *chptr,
550                       const char *pattern, ...)
551   {
552    va_list args;
# Line 669 | Line 569 | sendto_channel_local(int type, int nodea
569        continue;
570  
571      if (!MyConnect(target_p) || IsDefunct(target_p) ||
572 <        (nodeaf && IsDeaf(target_p)))
572 >        (nodeaf && HasUMode(target_p, UMODE_DEAF)))
573        continue;
574  
575      send_message(target_p, buffer, len);
# Line 689 | Line 589 | sendto_channel_local(int type, int nodea
589   * WARNING - +D clients are omitted
590   */
591   void      
592 < sendto_channel_local_butone(struct Client *one, int type,
592 > sendto_channel_local_butone(struct Client *one, unsigned int type, unsigned int cap,
593                              struct Channel *chptr, const char *pattern, ...)
594   {
595    va_list args;
# Line 712 | Line 612 | sendto_channel_local_butone(struct Clien
612        continue;
613  
614      if (!MyConnect(target_p) || target_p == one ||
615 <        IsDefunct(target_p) || IsDeaf(target_p))
615 >        IsDefunct(target_p) || HasUMode(target_p, UMODE_DEAF))
616        continue;
617 +
618 +    if (HasCap(target_p, cap) != cap)
619 +        continue;
620      send_message(target_p, buffer, len);
621    }
622   }
# Line 731 | Line 634 | sendto_channel_local_butone(struct Clien
634   *                remote to this server.
635   */
636   void
637 < sendto_channel_remote(struct Client *one, struct Client *from, int type,
637 > sendto_channel_remote(struct Client *one, struct Client *from, unsigned int type,
638                        const unsigned int caps, const unsigned int nocaps,
639                        struct Channel *chptr, const char *pattern, ...)
640   {
# Line 764 | Line 667 | sendto_channel_remote(struct Client *one
667          ((target_p->from->localClient->caps & caps) != caps) ||
668          ((target_p->from->localClient->caps & nocaps) != 0))
669        continue;
670 <    if (target_p->from->serial != current_serial)
670 >    if (target_p->from->localClient->serial != current_serial)
671      {
672        send_message(target_p, buffer, len);
673 <      target_p->from->serial = current_serial;
673 >      target_p->from->localClient->serial = current_serial;
674      }
675    }
676   }
# Line 793 | Line 696 | static int
696   match_it(const struct Client *one, const char *mask, int what)
697   {
698    if (what == MATCH_HOST)
699 <    return(match(mask, one->host));
699 >    return !match(mask, one->host);
700  
701 <  return(match(mask, one->servptr->name));
701 >  return !match(mask, one->servptr->name);
702   }
703  
704   /* sendto_match_butone()
# Line 813 | Line 716 | sendto_match_butone(struct Client *one,
716    struct Client *client_p;
717    dlink_node *ptr, *ptr_next;
718    char local_buf[IRCD_BUFSIZE], remote_buf[IRCD_BUFSIZE];
719 <  int local_len = ircsprintf(local_buf, ":%s!%s@%s ", from->name,
720 <                             from->username, from->host);
721 <  int remote_len = ircsprintf(remote_buf, ":%s ", from->name);
719 >  int local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ",
720 >                           from->name, from->username, from->host);
721 >  int remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ",
722 >                            from->name);
723  
724    va_start(alocal, pattern);
725    va_start(aremote, pattern);
# Line 880 | Line 784 | sendto_match_butone(struct Client *one,
784   * side effects - data sent to servers matching with capab
785   */
786   void
787 < sendto_match_servs(struct Client *source_p, const char *mask, int cap,
787 > sendto_match_servs(struct Client *source_p, const char *mask, unsigned int cap,
788                     const char *pattern, ...)
789   {
790    va_list args;
791    struct Client *target_p;
792    dlink_node *ptr;
793    char buffer[IRCD_BUFSIZE];
890  int found = 0;
794  
795    va_start(args, pattern);
796    vsnprintf(buffer, sizeof(buffer), pattern, args);
# Line 903 | Line 806 | sendto_match_servs(struct Client *source
806      if (IsMe(target_p) || target_p->from == source_p->from)
807        continue;
808  
809 <    if (target_p->from->serial == current_serial)
809 >    if (target_p->from->localClient->serial == current_serial)
810        continue;
811  
812 <    if (match(mask, target_p->name))
812 >    if (!match(mask, target_p->name))
813      {
814        /*
815         * if we set the serial here, then we'll never do a
816         * match() again, if !IsCapable()
817         */
818 <      target_p->from->serial = current_serial;
916 <      found++;
818 >      target_p->from->localClient->serial = current_serial;
819  
820        if (!IsCapable(target_p->from, cap))
821          continue;
# Line 947 | Line 849 | sendto_anywhere(struct Client *to, struc
849    if (MyClient(to))
850    {
851      if (IsServer(from))
852 <    {
951 <      if (IsCapable(to, CAP_TS6) && HasID(from))
952 <        len = ircsprintf(buffer, ":%s ", from->id);
953 <      else
954 <        len = ircsprintf(buffer, ":%s ", from->name);
955 <    }
852 >      len = snprintf(buffer, sizeof(buffer), ":%s ", from->name);
853      else
854 <      len = ircsprintf(buffer, ":%s!%s@%s ",
855 <                       from->name, from->username, from->host);
854 >      len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s ",
855 >                     from->name, from->username, from->host);
856    }
857 <  else len = ircsprintf(buffer, ":%s ", ID_or_name(from, send_to));
857 >  else
858 >    len = snprintf(buffer, sizeof(buffer), ":%s ", ID_or_name(from, send_to));
859  
860    va_start(args, pattern);
861    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
862    va_end(args);
863  
864 <  if(MyClient(to))
864 >  if (MyClient(to))
865      send_message(send_to, buffer, len);
866    else
867      send_message_remote(send_to, from, buffer, len);
# Line 978 | Line 876 | sendto_anywhere(struct Client *to, struc
876   * side effects - Send to *local* ops only but NOT +s nonopers.
877   */
878   void
879 < sendto_realops_flags(unsigned int flags, int level, const char *pattern, ...)
879 > sendto_realops_flags(unsigned int flags, int level, int type, const char *pattern, ...)
880   {
881 <  struct Client *client_p;
881 >  const char *ntype = NULL;
882 >  dlink_node *ptr = NULL;
883    char nbuf[IRCD_BUFSIZE];
985  dlink_node *ptr;
884    va_list args;
885  
886    va_start(args, pattern);
887 <  vsnprintf(nbuf, IRCD_BUFSIZE, pattern, args);
887 >  vsnprintf(nbuf, sizeof(nbuf), pattern, args);
888    va_end(args);
889  
890 +  switch (type)
891 +  {
892 +    case SEND_NOTICE:
893 +      ntype = "Notice";
894 +      break;
895 +    case SEND_GLOBAL:
896 +      ntype = "Global";
897 +      break;
898 +    case SEND_LOCOPS:
899 +      ntype = "LocOps";
900 +      break;
901 +    default:
902 +      assert(0);
903 +  }
904 +
905    DLINK_FOREACH(ptr, oper_list.head)
906    {
907 <    client_p = ptr->data;
908 <    assert(client_p->umodes & UMODE_OPER);
907 >    struct Client *client_p = ptr->data;
908 >    assert(HasUMode(client_p, UMODE_OPER));
909  
910 <    /* If we're sending it to opers and theyre an admin, skip.
911 <     * If we're sending it to admins, and theyre not, skip.
910 >    /*
911 >     * If we're sending it to opers and they're an admin, skip.
912 >     * If we're sending it to admins, and they're not, skip.
913       */
914 <    if (((level == L_ADMIN) && !IsAdmin(client_p)) ||
915 <        ((level == L_OPER) && IsAdmin(client_p)))
914 >    if (((level == L_ADMIN) && !HasUMode(client_p, UMODE_ADMIN)) ||
915 >        ((level == L_OPER) && HasUMode(client_p, UMODE_ADMIN)))
916        continue;
917  
918 <    if (client_p->umodes & flags)
919 <      sendto_one(client_p, ":%s NOTICE %s :*** Notice -- %s",
920 <                 me.name, client_p->name, nbuf);
918 >    if (HasUMode(client_p, flags))
919 >      sendto_one(client_p, ":%s NOTICE %s :*** %s -- %s",
920 >                 me.name, client_p->name, ntype, nbuf);
921    }
922   }
923  
# Line 1019 | Line 933 | void
933   sendto_wallops_flags(unsigned int flags, struct Client *source_p,
934                       const char *pattern, ...)
935   {
936 <  struct Client *client_p;
1023 <  dlink_node *ptr;
936 >  dlink_node *ptr = NULL;
937    va_list args;
938    char buffer[IRCD_BUFSIZE];
939    int len;
940  
941    if (IsClient(source_p))
942 <    len = ircsprintf(buffer, ":%s!%s@%s WALLOPS :",
943 <                     source_p->name, source_p->username, source_p->host);
942 >    len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s WALLOPS :",
943 >                   source_p->name, source_p->username,
944 >                   source_p->host);
945    else
946 <    len = ircsprintf(buffer, ":%s WALLOPS :", source_p->name);
946 >    len = snprintf(buffer, sizeof(buffer), ":%s WALLOPS :",
947 >                   source_p->name);
948  
949    va_start(args, pattern);
950    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
# Line 1037 | Line 952 | sendto_wallops_flags(unsigned int flags,
952  
953    DLINK_FOREACH(ptr, oper_list.head)
954    {
955 <    client_p = ptr->data;
955 >    struct Client *client_p = ptr->data;
956      assert(client_p->umodes & UMODE_OPER);
957  
958 <    if ((client_p->umodes & flags) && !IsDefunct(client_p))
958 >    if (HasUMode(client_p, flags) && !IsDefunct(client_p))
959        send_message(client_p, buffer, len);
960    }
961   }
# Line 1056 | Line 971 | void
971   ts_warn(const char *pattern, ...)
972   {
973    va_list args;
974 <  char buffer[LOG_BUFSIZE];
974 >  char buffer[IRCD_BUFSIZE];
975    static time_t last = 0;
976    static int warnings = 0;
977  
# Line 1079 | Line 994 | ts_warn(const char *pattern, ...)
994    }
995  
996    va_start(args, pattern);
997 <  vsprintf_irc(buffer, pattern, args);
997 >  vsnprintf(buffer, sizeof(buffer), pattern, args);
998    va_end(args);
999  
1000 <  sendto_realops_flags(UMODE_ALL, L_ALL, "%s", buffer);
1001 <  ilog(L_CRIT, "%s", buffer);
1000 >  sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, "%s", buffer);
1001 >  ilog(LOG_TYPE_IRCD, "%s", buffer);
1002   }
1003  
1004   /* kill_client()
# Line 1107 | Line 1022 | kill_client(struct Client *client_p, str
1022    if (IsDead(client_p))
1023      return;
1024  
1025 <  len = ircsprintf(buffer, ":%s KILL %s :", ID_or_name(&me, client_p->from),
1026 <                   ID_or_name(diedie, client_p));
1025 >  len = snprintf(buffer, sizeof(buffer), ":%s KILL %s :",
1026 >                 ID_or_name(&me, client_p->from),
1027 >                 ID_or_name(diedie, client_p));
1028  
1029    va_start(args, pattern);
1030    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
# Line 1128 | Line 1044 | kill_client(struct Client *client_p, str
1044   *                client being unknown to leaf, as in lazylink...
1045   */
1046   void
1047 < kill_client_ll_serv_butone(struct Client *one, struct Client *source_p,
1048 <                           const char *pattern, ...)
1047 > kill_client_serv_butone(struct Client *one, struct Client *source_p,
1048 >                        const char *pattern, ...)
1049   {
1050    va_list args;
1051    int have_uid = 0;
# Line 1137 | Line 1053 | kill_client_ll_serv_butone(struct Client
1053    char buf_uid[IRCD_BUFSIZE], buf_nick[IRCD_BUFSIZE];
1054    int len_uid = 0, len_nick = 0;
1055  
1056 <  if (HasID(source_p) && (me.id[0] != '\0'))
1056 >  if (HasID(source_p))
1057    {
1058      have_uid = 1;
1059      va_start(args, pattern);
1060 <    len_uid = ircsprintf(buf_uid, ":%s KILL %s :", me.id, ID(source_p));
1060 >    len_uid = snprintf(buf_uid, sizeof(buf_uid), ":%s KILL %s :",
1061 >                       me.id, ID(source_p));
1062      len_uid += send_format(&buf_uid[len_uid], IRCD_BUFSIZE - len_uid, pattern,
1063                             args);
1064      va_end(args);
1065    }
1066  
1067    va_start(args, pattern);
1068 <  len_nick = ircsprintf(buf_nick, ":%s KILL %s :", me.name, source_p->name);
1068 >  len_nick = snprintf(buf_nick, sizeof(buf_nick), ":%s KILL %s :",
1069 >                      me.name, source_p->name);
1070    len_nick += send_format(&buf_nick[len_nick], IRCD_BUFSIZE - len_nick, pattern,
1071                            args);
1072    va_end(args);

Diff Legend

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