Changeset dbaf64bc41991ad1a538a17c4d9cfc5bab31e0a8

Show
Ignore:
Timestamp:
02/06/09 22:22:32 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1233958952 +0000
git-parent:

[0d31467a1c681159c9f9682ea66c08e7b2392641]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1233958952 +0000
Message:

refs #78, cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/noit_defines.h

    r84d6f13 rdbaf64b  
    7474#define HAVE_IPv6 
    7575 
     76#include <stdio.h> 
     77 
    7678static inline int noit_build_version(char *buff, int len) { 
    7779  const char *v = NOIT_HEADURL; 
     
    8587        return snprintf(buff, len, "trunk.%s", NOIT_SVNVERSION); 
    8688      if(!strncmp(start, "branches/", 9)) 
    87         return snprintf(buff, len, "b_%.*s.%s", end - ns, ns, NOIT_SVNVERSION); 
     89        return snprintf(buff, len, "b_%.*s.%s", (int)(end - ns), ns, NOIT_SVNVERSION); 
    8890      if(!strncmp(start, "tags/", 5)) 
    89         return snprintf(buff, len, "%.*s.%s", end - ns, ns, NOIT_SVNVERSION); 
     91        return snprintf(buff, len, "%.*s.%s", (int)(end - ns), ns, NOIT_SVNVERSION); 
    9092    } 
    9193  } 
  • src/stratcon_datastore.c

    r21b0c6c rdbaf64b  
    108108__get_conn_q_for_remote(struct sockaddr *remote) { 
    109109  conn_q *cq; 
     110  char queue_name[128] = "datastore_"; 
    110111  static const char __zeros[4] = { 0 }; 
    111112  int len = 0; 
    112113  if(remote) { 
    113114    switch(remote->sa_family) { 
    114       case AF_INET: len = sizeof(struct sockaddr_in); break; 
    115       case AF_INET6: len = sizeof(struct sockaddr_in6); break; 
    116       case AF_UNIX: len = SUN_LEN(((struct sockaddr_un *)remote)); break; 
     115      case AF_INET: 
     116        len = sizeof(struct sockaddr_in); 
     117        inet_ntop(remote->sa_family, &((struct sockaddr_in *)remote)->sin_addr, 
     118                  queue_name + strlen("datastore_"), len); 
     119        break; 
     120      case AF_INET6: 
     121       len = sizeof(struct sockaddr_in6); 
     122        inet_ntop(remote->sa_family, &((struct sockaddr_in6 *)remote)->sin6_addr, 
     123                  queue_name + strlen("datastore_"), len); 
     124       break; 
     125      case AF_UNIX: 
     126        len = SUN_LEN(((struct sockaddr_un *)remote)); 
     127        snprintf(queue_name, sizeof(queue_name), "datastore_%s", ((struct sockaddr_un *)remote)->sun_path); 
     128        break; 
    117129      default: return NULL; 
    118130    } 
     
    121133    /* This is a dummy connection */ 
    122134    remote = (struct sockaddr *)__zeros; 
     135    snprintf(queue_name, sizeof(queue_name), "datastore_default"); 
    123136    len = 4; 
    124137  } 
     
    129142  memcpy(cq->remote, remote, len); 
    130143  cq->jobq = calloc(1, sizeof(*cq->jobq)); 
    131   eventer_jobq_init(cq->jobq); 
     144  eventer_jobq_init(cq->jobq, queue_name); 
    132145  cq->jobq->backq = eventer_default_backq(); 
    133146  /* Add one thread */ 
     
    604617    if(!buff) goto bad_row; 
    605618 
    606     snprintf(time_as_str, sizeof(time_as_str), "%lu", time(NULL)); 
     619    snprintf(time_as_str, sizeof(time_as_str), "%lu", (long unsigned int)time(NULL)); 
    607620    DECLARE_PARAM_STR("0.0.0.0", 7); 
    608621    DECLARE_PARAM_STR("stratcond", 9);