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/trunk/src/s_serv.c (file contents), Revision 3335 by michael, Thu Apr 17 18:55:31 2014 UTC vs.
ircd-hybrid/branches/8.2.x/src/server.c (file contents), Revision 3505 by michael, Sat May 10 19:51:42 2014 UTC

# Line 40 | Line 40
40   #include "numeric.h"
41   #include "packet.h"
42   #include "conf.h"
43 < #include "s_serv.h"
43 > #include "server.h"
44   #include "log.h"
45 < #include "s_user.h"
45 > #include "user.h"
46   #include "send.h"
47   #include "memory.h"
48   #include "channel.h"
# Line 159 | Line 159 | hunt_server(struct Client *source_p, con
159    struct Client *target_p = NULL;
160    struct Client *target_tmp = NULL;
161    dlink_node *ptr;
162  int wilds;
162  
163    /* Assume it's me, if no server */
164    if (parc <= server || EmptyString(parv[server]))
# Line 185 | Line 184 | hunt_server(struct Client *source_p, con
184      if (target_p->from == source_p->from && !MyConnect(target_p))
185        target_p = NULL;
186  
188  wilds = has_wildcards(parv[server]);
189
187    /* Again, if there are no wild cards involved in the server
188     * name, use the hash lookup
189     */
190    if (target_p == NULL)
191    {
192 <    if (!wilds)
192 >    if (!has_wildcards(parv[server]))
193      {
194        if (!(target_p = hash_find_server(parv[server])))
195        {
# Line 343 | Line 340 | try_connections(void *unused)
340   int
341   valid_servname(const char *name)
342   {
343 <  unsigned int length = 0;
347 <  unsigned int dots   = 0;
343 >  unsigned int dots = 0;
344    const char *p = name;
345  
346    for (; *p; ++p)
# Line 352 | Line 348 | valid_servname(const char *name)
348      if (!IsServChar(*p))
349        return 0;
350  
355    ++length;
356
351      if (*p == '.')
352        ++dots;
353    }
354  
355 <  return dots && length <= HOSTLEN;
355 >  return dots && (p - name) <= HOSTLEN;
356   }
357  
358   int
# Line 445 | Line 439 | check_server(const char *name, struct Cl
439   void
440   add_capability(const char *capab_name, int cap_flag, int add_to_default)
441   {
442 <  struct Capability *cap = MyMalloc(sizeof(*cap));
442 >  struct Capability *cap = MyCalloc(sizeof(*cap));
443  
444    cap->name = xstrdup(capab_name);
445    cap->cap = cap_flag;
# Line 579 | Line 573 | struct Server *
573   make_server(struct Client *client_p)
574   {
575    if (client_p->serv == NULL)
576 <    client_p->serv = MyMalloc(sizeof(struct Server));
576 >    client_p->serv = MyCalloc(sizeof(struct Server));
577  
578    return client_p->serv;
579   }
# Line 874 | Line 868 | ssl_server_handshake(fde_t *fd, struct C
868    if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl)))
869    {
870      int res = SSL_get_verify_result(client_p->localClient->fd.ssl);
871 <    char buf[EVP_MAX_MD_SIZE * 2 + 1] = { '\0' };
872 <    unsigned char md[EVP_MAX_MD_SIZE] = { '\0' };
871 >    char buf[EVP_MAX_MD_SIZE * 2 + 1] = "";
872 >    unsigned char md[EVP_MAX_MD_SIZE] = "";
873  
874      if (res == X509_V_OK || res == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN ||
875          res == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE ||
876          res == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT)
877      {
878 <      unsigned int i = 0, n = 0;
878 >      unsigned int n = 0;
879  
880        if (X509_digest(cert, EVP_sha256(), md, &n))
881        {
882 <        for (; i < n; ++i)
882 >        for (unsigned int i = 0; i < n; ++i)
883            snprintf(buf + 2 * i, 3, "%02X", md[i]);
884          client_p->certfp = xstrdup(buf);
885        }

Diff Legend

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