Changeset 9488f4575dc24414b3ed1696be5eea1db918f928

Show
Ignore:
Timestamp:
05/20/09 14:16:23 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1242828983 +0000
git-parent:

[9332cdae593119fe293288b4be9f00c7ad864e5f]

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

better debugging, refs #42

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/eventer/eventer_SSL_fd_opset.c

    r88a7178 r9488f45  
    344344  eventer_ssl_ctx_t *ctx = e->opset_ctx; 
    345345  int (*sslop)(SSL *) = NULL; 
     346  const char *opstr = "none"; 
    346347 
    347348  switch(op) { 
    348349    case SSL_OP_READ: 
     350      opstr = "read"; 
    349351      if((rv = SSL_read(ctx->ssl, buffer, len)) > 0) return rv; 
    350352      break; 
    351353    case SSL_OP_WRITE: 
     354      opstr = "write"; 
    352355      if((rv = SSL_write(ctx->ssl, buffer, len)) > 0) return rv; 
    353356      break; 
    354357 
    355358    case SSL_OP_CONNECT: 
     359      opstr = "connect"; 
    356360      if(!sslop) sslop = SSL_connect; 
    357361      /* fall through */ 
    358362    case SSL_OP_ACCEPT: 
     363      opstr = "accept"; 
    359364      /* only set if we didn't fall through */ 
    360365      if(!sslop) sslop = SSL_accept; 
     
    383388      break; 
    384389    default: 
    385       noitL(eventer_err, "SSL rw error: %d\n", sslerror); 
     390      noitL(eventer_err, "SSL[%s of %d] rw error: %d\n", opstr, 
     391            (int)len, sslerror); 
    386392      eventer_ssl_error(); 
    387393      errno = EIO; 
  • src/stratcon_jlog_streamer.c

    rd346b50 r9488f45  
    129129noit_connection_ctx_free(noit_connection_ctx_t *ctx) { 
    130130  if(ctx->remote_cn) free(ctx->remote_cn); 
     131  if(ctx->remote_str) free(ctx->remote_str); 
    131132  if(ctx->timeout_event) { 
    132133    eventer_remove(ctx->timeout_event); 
     
    178179  if(len < 0) { \ 
    179180    if(errno == EAGAIN) return mask | EVENTER_EXCEPTION; \ 
    180     noitL(noit_error, "SSL read error: %s\n", strerror(errno)); \ 
     181    noitL(noit_error, "[%s] SSL read error: %s\n", nctx->remote_str, strerror(errno)); \ 
    181182    goto socket_error; \ 
    182183  } \ 
     
    184185  ctx->bytes_expected = 0; \ 
    185186  if(len != size) { \ 
    186     noitL(noit_error, "SSL short read [%d] (%d/%lu).  Reseting connection.\n", \ 
    187           ctx->state, len, (long unsigned int)size); \ 
     187    noitL(noit_error, "[%s] SSL short read [%d] (%d/%lu).  Reseting connection.\n", \ 
     188          nctx->remote_str, ctx->state, len, (long unsigned int)size); \ 
    188189    goto socket_error; \ 
    189190  } \ 
     
    258259      case JLOG_STREAMER_WANT_BODY: 
    259260        FULLREAD(e, ctx, (unsigned long)ctx->header.message_len); 
    260         ctx->push(DS_OP_INSERT, &nctx->r.remote, ctx->buffer); 
     261        if(ctx->header.message_len > 0) 
     262          ctx->push(DS_OP_INSERT, &nctx->r.remote, ctx->buffer); 
    261263        /* Don't free the buffer, it's used by the datastore process. */ 
    262264        ctx->buffer = NULL; 
     
    434436 
    435437  ctx = noit_connection_ctx_alloc(); 
     438  ctx->remote_str = calloc(1, strlen(host) + 7); 
     439  snprintf(ctx->remote_str, strlen(host) + 7, 
     440           "%s:%d", host, port); 
    436441   
    437442  memset(&ctx->r, 0, sizeof(ctx->r)); 
     
    515520    config = noit_conf_get_hash(noit_configs[i], "config"); 
    516521 
     522noitL(noit_error, "initiating to %s\n", address); 
    517523    initiate_noit_connection(address, port, sslconfig, config, 
    518524                             handler, 
  • src/stratcon_jlog_streamer.h

    r88a7178 r9488f45  
    4949  } r; 
    5050  socklen_t remote_len; 
     51  char *remote_str; 
    5152  char *remote_cn; 
    5253  u_int32_t current_backoff;