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

Comparing ircd-hybrid-8/src/s_serv.c (file contents):
Revision 1383 by michael, Tue May 1 11:18:22 2012 UTC vs.
Revision 1413 by michael, Sat May 26 08:25:12 2012 UTC

# Line 208 | Line 208 | hunt_server(struct Client *client_p, str
208        target_p = NULL;
209  
210    collapse(parv[server]);
211 <  wilds = (strchr(parv[server], '?') || strchr(parv[server], '*'));
211 >  wilds = has_wildcards(parv[server]);
212  
213    /* Again, if there are no wild cards involved in the server
214     * name, use the hash lookup
# Line 475 | Line 475 | check_server(const char *name, struct Cl
475      {
476   #ifdef IPV6
477        case AF_INET6:
478 <        v6 = (struct sockaddr_in6 *)&aconf->ipnum;
478 >        v6 = (struct sockaddr_in6 *)&aconf->addr;
479  
480          if (IN6_IS_ADDR_UNSPECIFIED(&v6->sin6_addr))
481 <          memcpy(&aconf->ipnum, &client_p->localClient->ip, sizeof(struct irc_ssaddr));
481 >          memcpy(&aconf->addr, &client_p->localClient->ip, sizeof(struct irc_ssaddr));
482          break;
483   #endif
484        case AF_INET:
485 <        v4 = (struct sockaddr_in *)&aconf->ipnum;
485 >        v4 = (struct sockaddr_in *)&aconf->addr;
486  
487          if (v4->sin_addr.s_addr == INADDR_NONE)
488 <          memcpy(&aconf->ipnum, &client_p->localClient->ip, sizeof(struct irc_ssaddr));
488 >          memcpy(&aconf->addr, &client_p->localClient->ip, sizeof(struct irc_ssaddr));
489          break;
490      }
491    }
# Line 668 | Line 668 | sendnick_TS(struct Client *client_p, str
668                   target_p->servptr->name, target_p->info);
669    }
670  
671 <  if (IsConfAwayBurst((struct AccessItem *)map_to_conf(client_p->serv->sconf)))
671 >  if (IsConfAwayBurst((struct AccessItem *)map_to_conf(client_p->localClient->confs.head->data)))
672      if (!EmptyString(target_p->away))
673        sendto_one(client_p, ":%s AWAY :%s", target_p->name,
674                   target_p->away);
# Line 894 | Line 894 | server_estab(struct Client *client_p)
894           inpath_ip, show_capabilities(client_p));
895    }
896  
897  client_p->serv->sconf = conf;
898
897    fd_note(&client_p->localClient->fd, "Server: %s", client_p->name);
898  
899    /* Old sendto_serv_but_one() call removed because we now
# Line 1076 | Line 1074 | send_tb(struct Client *client_p, struct
1074                   chptr->topic_info,
1075                   chptr->topic);
1076      else if (IsCapable(client_p, CAP_TB))
1077 <    {
1078 <      if (ConfigChannel.burst_topicwho)
1079 <      {
1080 <        sendto_one(client_p, ":%s TB %s %lu %s :%s",
1083 <                   me.name, chptr->chname,
1084 <                   (unsigned long)chptr->topic_time,
1085 <                   chptr->topic_info, chptr->topic);
1086 <      }
1087 <      else
1088 <      {
1089 <        sendto_one(client_p, ":%s TB %s %lu :%s",
1090 <                   me.name, chptr->chname,
1091 <                   (unsigned long)chptr->topic_time,
1092 <                   chptr->topic);
1093 <      }
1094 <    }
1077 >      sendto_one(client_p, ":%s TB %s %lu %s :%s",
1078 >                 me.name, chptr->chname,
1079 >                 (unsigned long)chptr->topic_time,
1080 >                 chptr->topic_info, chptr->topic);
1081    }
1082   }
1083  
# Line 1150 | Line 1136 | serv_connect(struct AccessItem *aconf, s
1136   {
1137    struct ConfItem *conf;
1138    struct Client *client_p;
1139 <  char buf[HOSTIPLEN];
1139 >  char buf[HOSTIPLEN + 1];
1140  
1141    /* conversion structs */
1142    struct sockaddr_in *v4;
1143    /* Make sure aconf is useful */
1144    assert(aconf != NULL);
1145  
1160  if(aconf == NULL)
1161    return (0);
1162
1146    /* XXX should be passing struct ConfItem in the first place */
1147    conf = unmap_conf_item(aconf);
1148  
1149    /* log */
1150 <  getnameinfo((struct sockaddr *)&aconf->ipnum, aconf->ipnum.ss_len,
1150 >  getnameinfo((struct sockaddr *)&aconf->addr, aconf->addr.ss_len,
1151                buf, sizeof(buf), NULL, 0, NI_NUMERICHOST);
1152 <  ilog(LOG_TYPE_IRCD, "Connect to %s[%s] @%s", aconf->user, aconf->host,
1152 >  ilog(LOG_TYPE_IRCD, "Connect to %s[%s] @%s", conf->name, aconf->host,
1153         buf);
1154  
1155    /* Still processing a DNS lookup? -> exit */
# Line 1215 | Line 1198 | serv_connect(struct AccessItem *aconf, s
1198    strlcpy(client_p->sockhost, buf, sizeof(client_p->sockhost));
1199  
1200    /* create a socket for the server connection */
1201 <  if (comm_open(&client_p->localClient->fd, aconf->ipnum.ss.ss_family,
1201 >  if (comm_open(&client_p->localClient->fd, aconf->addr.ss.ss_family,
1202                  SOCK_STREAM, 0, NULL) < 0)
1203    {
1204      /* Eek, failure to create the socket */
# Line 1270 | Line 1253 | serv_connect(struct AccessItem *aconf, s
1253    switch (aconf->aftype)
1254    {
1255      case AF_INET:
1256 <      v4 = (struct sockaddr_in*)&aconf->my_ipnum;
1256 >      v4 = (struct sockaddr_in*)&aconf->bind;
1257        if (v4->sin_addr.s_addr != 0)
1258        {
1259          struct irc_ssaddr ipn;
1260          memset(&ipn, 0, sizeof(struct irc_ssaddr));
1261          ipn.ss.ss_family = AF_INET;
1262          ipn.ss_port = 0;
1263 <        memcpy(&ipn, &aconf->my_ipnum, sizeof(struct irc_ssaddr));
1263 >        memcpy(&ipn, &aconf->bind, sizeof(struct irc_ssaddr));
1264          comm_connect_tcp(&client_p->localClient->fd, aconf->host, aconf->port,
1265                           (struct sockaddr *)&ipn, ipn.ss_len,
1266                           serv_connect_callback, client_p, aconf->aftype,
# Line 1308 | Line 1291 | serv_connect(struct AccessItem *aconf, s
1291          struct sockaddr_in6 *v6conf;
1292  
1293          memset(&ipn, 0, sizeof(struct irc_ssaddr));
1294 <        v6conf = (struct sockaddr_in6 *)&aconf->my_ipnum;
1294 >        v6conf = (struct sockaddr_in6 *)&aconf->bind;
1295          v6 = (struct sockaddr_in6 *)&ipn;
1296  
1297          if (memcmp(&v6conf->sin6_addr, &v6->sin6_addr,
1298                     sizeof(struct in6_addr)) != 0)
1299          {
1300 <          memcpy(&ipn, &aconf->my_ipnum, sizeof(struct irc_ssaddr));
1300 >          memcpy(&ipn, &aconf->bind, sizeof(struct irc_ssaddr));
1301            ipn.ss.ss_family = AF_INET6;
1302            ipn.ss_port = 0;
1303            comm_connect_tcp(&client_p->localClient->fd,

Diff Legend

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