/[svn]/ircd-hybrid-7.2/src/s_bsd.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/s_bsd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1012 by michael, Fri Sep 18 10:14:09 2009 UTC revision 1013 by michael, Sun Oct 18 14:26:49 2009 UTC
# Line 58  static const char *comm_err_str[] = { "C Line 58  static const char *comm_err_str[] = { "C
58    
59  struct Callback *setup_socket_cb = NULL;  struct Callback *setup_socket_cb = NULL;
60    
61  static void comm_connect_callback(fde_t *fd, int status);  static void comm_connect_callback(fde_t *, int);
62  static PF comm_connect_timeout;  static PF comm_connect_timeout;
63  static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *);  static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *);
64  static PF comm_connect_tryconnect;  static PF comm_connect_tryconnect;
# Line 213  close_connection(struct Client *client_p Line 213  close_connection(struct Client *client_p
213       * If the connection has been up for a long amount of time, schedule       * If the connection has been up for a long amount of time, schedule
214       * a 'quick' reconnect, else reset the next-connect cycle.       * a 'quick' reconnect, else reset the next-connect cycle.
215       */       */
216      if ((conf = find_conf_exact(SERVER_TYPE,      if ((conf = find_conf_exact(SERVER_TYPE, client_p->name,
217                                    client_p->name, client_p->username,                                  client_p->username, client_p->host)))
                                   client_p->host)))  
218      {      {
219        /*        /*
220         * Reschedule a faster reconnect, if this was a automatically         * Reschedule a faster reconnect, if this was a automatically
# Line 223  close_connection(struct Client *client_p Line 222  close_connection(struct Client *client_p
222         * a rehash in between, the status has been changed to         * a rehash in between, the status has been changed to
223         * CONF_ILLEGAL). But only do this if it was a "good" link.         * CONF_ILLEGAL). But only do this if it was a "good" link.
224         */         */
225        aconf = (struct AccessItem *)map_to_conf(conf);        aconf  = map_to_conf(conf);
226        aclass = (struct ClassItem *)map_to_conf(aconf->class_ptr);        aclass = map_to_conf(aconf->class_ptr);
227        aconf->hold = time(NULL);        aconf->hold = time(NULL);
228        aconf->hold += (aconf->hold - client_p->since > HANGONGOODLINK) ?        aconf->hold += (aconf->hold - client_p->since > HANGONGOODLINK) ?
229          HANGONRETRYDELAY : ConFreq(aclass);          HANGONRETRYDELAY : ConFreq(aclass);
       if (nextconnect > aconf->hold)  
         nextconnect = aconf->hold;  
230      }      }
231    }    }
232    else if (IsClient(client_p))    else if (IsClient(client_p))
# Line 327  add_connection(struct Listener *listener Line 324  add_connection(struct Listener *listener
324    memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr));    memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr));
325    
326    irc_getnameinfo((struct sockaddr*)&new_client->localClient->ip,    irc_getnameinfo((struct sockaddr*)&new_client->localClient->ip,
327          new_client->localClient->ip.ss_len,  new_client->sockhost,          new_client->localClient->ip.ss_len, new_client->sockhost,
328          HOSTIPLEN, NULL, 0, NI_NUMERICHOST);          sizeof(new_client->sockhost), NULL, 0, NI_NUMERICHOST);
329    new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family;    new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family;
330  #ifdef IPV6  #ifdef IPV6
331    if (new_client->sockhost[0] == ':')    if (new_client->sockhost[0] == ':')
# Line 737  comm_accept(struct Listener *lptr, struc Line 734  comm_accept(struct Listener *lptr, struc
734     * reserved fd limit, but we can deal with that when comm_open()     * reserved fd limit, but we can deal with that when comm_open()
735     * also does it. XXX -- adrian     * also does it. XXX -- adrian
736     */     */
737    newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, (socklen_t *)&addrlen);    newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, &addrlen);
738    if (newfd < 0)    if (newfd < 0)
739      return -1;      return -1;
740    

Legend:
Removed from v.1012  
changed lines
  Added in v.1013

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26