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

Comparing ircd-hybrid-7.3/src/send.c (file contents):
Revision 1077 by michael, Sun Nov 8 13:10:50 2009 UTC vs.
Revision 1078 by michael, Sun Mar 7 22:55:05 2010 UTC

# Line 44 | Line 44
44   #include "irc_getnameinfo.h"
45   #include "packet.h"
46  
47 #define LOG_BUFSIZE 2048
47  
48   struct Callback *iosend_cb = NULL;
49   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);
54
50   static unsigned int current_serial = 0;
51  
52 +
53   /* send_format()
54   *
55   * inputs       - buffer to format into
# Line 86 | Line 82 | send_format(char *lsendbuf, int bufsize,
82  
83    lsendbuf[len++] = '\r';
84    lsendbuf[len++] = '\n';
85 <  return (len);
85 >  return len;
86   }
87  
88   /*
# Line 461 | Line 457 | sendto_channel_butone(struct Client *one
457    char remote_buf[IRCD_BUFSIZE];
458    char uid_buf[IRCD_BUFSIZE];
459    int local_len, remote_len, uid_len;
460 <  dlink_node *ptr;
465 <  dlink_node *ptr_next;
466 <  struct Client *target_p;
460 >  dlink_node *ptr = NULL, *ptr_next = NULL;
461  
462    if (IsServer(from))
463      local_len = ircsprintf(local_buf, ":%s %s %s ",
# Line 494 | Line 488 | sendto_channel_butone(struct Client *one
488  
489    DLINK_FOREACH_SAFE(ptr, ptr_next, chptr->members.head)
490    {
491 <    target_p = ((struct Membership *)ptr->data)->client_p;
492 <    assert(target_p != NULL);
491 >    struct Client *target_p = ((struct Membership *)ptr->data)->client_p;
492 >
493 >    assert(IsClient(target_p));
494  
495      if (IsDefunct(target_p) || IsDeaf(target_p) || target_p->from == one)
496        continue;
497  
498 <    if (MyClient(target_p))
498 >    if (MyConnect(target_p))
499      {
500 <      if (target_p->serial != current_serial)
500 >      if (target_p->localClient->serial != current_serial)
501        {
502          send_message(target_p, local_buf, local_len);
503 <        target_p->serial = current_serial;
503 >        target_p->localClient->serial = current_serial;
504        }
505      }
506      else
# Line 513 | Line 508 | sendto_channel_butone(struct Client *one
508        /* Now check whether a message has been sent to this
509         * remote link already
510         */
511 <      if (target_p->from->serial != current_serial)
511 >      if (target_p->from->localClient->serial != current_serial)
512        {
513          if (IsCapable(target_p->from, CAP_TS6))
514            send_message_remote(target_p->from, from, uid_buf, uid_len);
515          else
516            send_message_remote(target_p->from, from, remote_buf, remote_len);
517 <        target_p->from->serial = current_serial;
517 >        target_p->from->localClient->serial = current_serial;
518        }
519      }
520    }
# Line 622 | Line 617 | sendto_common_channels_local(struct Clie
617        assert(target_p != NULL);
618  
619        if (!MyConnect(target_p) || target_p == user || IsDefunct(target_p) ||
620 <          target_p->serial == current_serial)
620 >          target_p->localClient->serial == current_serial)
621          continue;
622  
623 <      target_p->serial = current_serial;
623 >      target_p->localClient->serial = current_serial;
624        send_message(target_p, buffer, len);
625      }
626    }
627  
628    if (touser && MyConnect(user) && !IsDead(user) &&
629 <      user->serial != current_serial)
629 >      user->localClient->serial != current_serial)
630      send_message(user, buffer, len);
631   }
632  
# Line 764 | Line 759 | sendto_channel_remote(struct Client *one
759          ((target_p->from->localClient->caps & caps) != caps) ||
760          ((target_p->from->localClient->caps & nocaps) != 0))
761        continue;
762 <    if (target_p->from->serial != current_serial)
762 >    if (target_p->from->localClient->serial != current_serial)
763      {
764        send_message(target_p, buffer, len);
765 <      target_p->from->serial = current_serial;
765 >      target_p->from->localClient->serial = current_serial;
766      }
767    }
768   }
# Line 793 | Line 788 | static int
788   match_it(const struct Client *one, const char *mask, int what)
789   {
790    if (what == MATCH_HOST)
791 <    return(match(mask, one->host));
791 >    return match(mask, one->host);
792  
793 <  return(match(mask, one->servptr->name));
793 >  return match(mask, one->servptr->name);
794   }
795  
796   /* sendto_match_butone()
# Line 903 | Line 898 | sendto_match_servs(struct Client *source
898      if (IsMe(target_p) || target_p->from == source_p->from)
899        continue;
900  
901 <    if (target_p->from->serial == current_serial)
901 >    if (target_p->from->localClient->serial == current_serial)
902        continue;
903  
904      if (match(mask, target_p->name))
# Line 912 | Line 907 | sendto_match_servs(struct Client *source
907         * if we set the serial here, then we'll never do a
908         * match() again, if !IsCapable()
909         */
910 <      target_p->from->serial = current_serial;
910 >      target_p->from->localClient->serial = current_serial;
911        found++;
912  
913        if (!IsCapable(target_p->from, cap))
# Line 980 | Line 975 | sendto_anywhere(struct Client *to, struc
975   void
976   sendto_realops_flags(unsigned int flags, int level, const char *pattern, ...)
977   {
978 <  struct Client *client_p;
978 >  dlink_node *ptr = NULL;
979    char nbuf[IRCD_BUFSIZE];
985  dlink_node *ptr;
980    va_list args;
981  
982    va_start(args, pattern);
# Line 991 | Line 985 | sendto_realops_flags(unsigned int flags,
985  
986    DLINK_FOREACH(ptr, oper_list.head)
987    {
988 <    client_p = ptr->data;
988 >    struct Client *client_p = ptr->data;
989      assert(client_p->umodes & UMODE_OPER);
990  
991      /* If we're sending it to opers and theyre an admin, skip.
# Line 1019 | Line 1013 | void
1013   sendto_wallops_flags(unsigned int flags, struct Client *source_p,
1014                       const char *pattern, ...)
1015   {
1016 <  struct Client *client_p;
1023 <  dlink_node *ptr;
1016 >  dlink_node *ptr = NULL;
1017    va_list args;
1018    char buffer[IRCD_BUFSIZE];
1019    int len;
# Line 1037 | Line 1030 | sendto_wallops_flags(unsigned int flags,
1030  
1031    DLINK_FOREACH(ptr, oper_list.head)
1032    {
1033 <    client_p = ptr->data;
1033 >    struct Client *client_p = ptr->data;
1034      assert(client_p->umodes & UMODE_OPER);
1035  
1036      if ((client_p->umodes & flags) && !IsDefunct(client_p))
# Line 1056 | Line 1049 | void
1049   ts_warn(const char *pattern, ...)
1050   {
1051    va_list args;
1052 <  char buffer[LOG_BUFSIZE];
1052 >  char buffer[IRCD_BUFSIZE];
1053    static time_t last = 0;
1054    static int warnings = 0;
1055  

Diff Legend

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