Show
Ignore:
Timestamp:
03/03/08 04:38:18 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1204519098 +0000
git-parent:

[b5f532b42a354e0463bc43a0aac27f591b9090fb]

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

make remote_len a first-class struct member

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_jlog_streamer.c

    ra7304b5 rae5b0cb  
    3131    struct sockaddr_in6 remote_in6; 
    3232  } r; 
     33  socklen_t remote_len; 
    3334  char *remote_cn; 
    3435  u_int32_t current_backoff; 
     
    210211          completion_e = eventer_alloc(); 
    211212          memcpy(completion_e, e, sizeof(*e)); 
     213          completion_e->mask = EVENTER_WRITE | EVENTER_EXCEPTION; 
    212214          ctx->state = WANT_CHKPT; 
    213215          stratcon_datastore_push(DS_OP_CHKPT, &ctx->r.remote, completion_e); 
     216          noitL(noit_debug, "Pushing batch asynch...\n"); 
    214217          return 0; 
    215218        } else 
     
    322325 
    323326  /* Initiate a connection */ 
    324   rv = connect(fd, &ctx->r.remote, ctx->r.remote.sa_len); 
     327  ctx->r.remote.sa_len = ctx->remote_len; 
     328  rv = connect(fd, &ctx->r.remote, ctx->remote_len); 
    325329  if(rv == -1 && errno != EINPROGRESS) goto reschedule; 
    326330 
     
    376380    s->sun_family = AF_UNIX; 
    377381    strncpy(s->sun_path, host, sizeof(s->sun_path)-1); 
    378     s->sun_len = sizeof(*s); 
     382    ctx->remote_len = sizeof(*s); 
    379383  } 
    380384  else { 
     
    383387    s->sin6_port = htons(port); 
    384388    memcpy(&s->sin6_addr, &a, sizeof(a)); 
    385     s->sin6_len = (family == AF_INET) ? 
    386                     sizeof(struct sockaddr_in) : sizeof(*s); 
     389    ctx->remote_len = (family == AF_INET) ? 
     390                        sizeof(struct sockaddr_in) : sizeof(*s); 
    387391  } 
    388392