Changeset e7ae97b8a3932bf5cb12dbfe71a21caa328d49af

Show
Ignore:
Timestamp:
05/04/09 14:45:12 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1241448312 +0000
git-parent:

[2cd3984a27517d54dcdd66d178d42b11714f4236]

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

refs #119, scaffolding is there. I don't like how it is a slave to the postgres stuff. Perhaps separate streams would be good.

Files:

Legend:

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

    r6453a67 re7ae97b  
    7676                       struct timeval *now) { 
    7777  struct iep_batch *batch = closure; 
     78  /* We only play when it is an asynch event */ 
    7879  if(!(mask & EVENTER_ASYNCH_WORK)) return 0; 
     80 
     81  if(mask & EVENTER_ASYNCH_CLEANUP) { 
     82    /* free all the memory associated with the batch */ 
     83    while(batch->head) { 
     84      struct noit_line_list *l; 
     85      l = batch->head; 
     86      batch->head = l->next; 
     87      free(l->line); 
     88      free(l); 
     89    } 
     90    free(batch); 
     91    return 0; 
     92  } 
    7993 
    8094  /* pull from batch and submit */ 
     
    8296        batch->batch_size); 
    8397 
    84   /* free all the memory associated with the batch */ 
    85   while(batch->head) { 
    86     struct noit_line_list *l; 
    87     l = batch->head; 
    88     batch->head = l->next; 
    89     free(l->line); 
    90     free(l); 
    91   } 
    92   free(batch); 
    9398  return 0; 
    9499} 
  • src/stratcon_jlog_streamer.c

    r6210da7 re7ae97b  
    7676  struct timeval __now, interval; 
    7777  const char *v; 
    78   u_int32_t min_interval = 1000, max_interval = 60000; 
     78  u_int32_t min_interval = 1000, max_interval = 8000; 
    7979  if(noit_hash_retr_str(ctx->config, 
    8080                        "reconnect_initial_interval", 
     
    189189 
    190190  if(mask & EVENTER_EXCEPTION || nctx->wants_shutdown) { 
     191    if(write(e->fd, e, 0) == -1) 
     192      noitL(noit_error, "socket error: %s\n", strerror(errno)); 
    191193 socket_error: 
    192194    ctx->state = WANT_INITIATE; 
     
    315317  if(errno == EAGAIN) return mask | EVENTER_EXCEPTION; 
    316318 
     319  noitL(noit_error, "jlog streamer SSL upgrade failed.\n"); 
    317320  eventer_remove_fd(e->fd); 
    318321  e->opset->close(e->fd, &mask, e); 
     
    328331 
    329332  if(mask & EVENTER_EXCEPTION) { 
     333    if(write(e->fd, e, 0) == -1) 
     334      noitL(noit_error, "socket error: %s\n", strerror(errno)); 
    330335 connect_error: 
    331336    eventer_remove_fd(e->fd);