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

Comparing ircd-hybrid/branches/8.2.x/src/server.c (file contents):
Revision 3452 by michael, Thu May 1 19:20:08 2014 UTC vs.
Revision 4112 by michael, Tue Jul 1 16:02:36 2014 UTC

# Line 282 | Line 282 | try_connections(void *unused)
282      if (conf->until > CurrentTime)
283        continue;
284  
285 <    if (conf->class == NULL)
286 <      confrq = DEFAULT_CONNECTFREQUENCY;
287 <    else
288 <    {
289 <      confrq = conf->class->con_freq;
290 <      if (confrq < MIN_CONN_FREQ)
291 <        confrq = MIN_CONN_FREQ;
292 <    }
285 >    assert(conf->class);
286 >
287 >    confrq = conf->class->con_freq;
288 >    if (confrq < MIN_CONN_FREQ)
289 >      confrq = MIN_CONN_FREQ;
290  
291      conf->until = CurrentTime + confrq;
292  
# Line 439 | Line 436 | check_server(const char *name, struct Cl
436   void
437   add_capability(const char *capab_name, int cap_flag, int add_to_default)
438   {
439 <  struct Capability *cap = MyMalloc(sizeof(*cap));
439 >  struct Capability *cap = MyCalloc(sizeof(*cap));
440  
441    cap->name = xstrdup(capab_name);
442    cap->cap = cap_flag;
# Line 513 | Line 510 | find_capability(const char *capab)
510   void
511   send_capabilities(struct Client *client_p, int cap_can_send)
512   {
513 <  char msgbuf[IRCD_BUFSIZE] = "";
514 <  char *t = msgbuf;
518 <  int tl;
519 <  dlink_node *ptr = NULL;
513 >  char buf[IRCD_BUFSIZE] = "";
514 >  const dlink_node *ptr = NULL;
515  
516    DLINK_FOREACH(ptr, cap_list.head)
517    {
518 <    struct Capability *cap = ptr->data;
518 >    const struct Capability *cap = ptr->data;
519  
520      if (cap->cap & (cap_can_send|default_server_capabs))
521      {
522 <      tl = sprintf(t, "%s ", cap->name);
523 <      t += tl;
522 >      strlcat(buf, cap->name, sizeof(buf));
523 >      if (ptr->next)
524 >        strlcat(buf, " ", sizeof(buf));
525      }
526    }
527  
528 <  *(t - 1) = '\0';
533 <  sendto_one(client_p, "CAPAB :%s", msgbuf);
528 >  sendto_one(client_p, "CAPAB :%s", buf);
529   }
530  
531   /*
# Line 573 | Line 568 | struct Server *
568   make_server(struct Client *client_p)
569   {
570    if (client_p->serv == NULL)
571 <    client_p->serv = MyMalloc(sizeof(struct Server));
571 >    client_p->serv = MyCalloc(sizeof(struct Server));
572  
573    return client_p->serv;
574   }
# Line 879 | Line 874 | ssl_server_handshake(fde_t *fd, struct C
874  
875        if (X509_digest(cert, EVP_sha256(), md, &n))
876        {
877 <        for (unsigned int i = 0; i < n; ++i)
883 <          snprintf(buf + 2 * i, 3, "%02X", md[i]);
877 >        binary_to_hex(md, buf, n);
878          client_p->certfp = xstrdup(buf);
879        }
880      }

Diff Legend

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