Changeset 3596dc15e229f7b814203e71305d82868dac6c05

Show
Ignore:
Timestamp:
04/27/08 01:45:05 (7 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1209260705 +0000
git-parent:

[45cee6d38af0fe7cb5349d7fefc6d964368b6ad4]

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

timeout in initial connect needs to cleanup socket based on synch_fd_event, not the subject of the callback

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/ssh2.c

    r4b96846 r3596dc1  
    173173static int ssh2_connect_timeout(eventer_t e, int mask, void *closure, 
    174174                                struct timeval *now) { 
     175  eventer_t fde; 
    175176  ssh2_check_info_t *ci = closure; 
    176177  noit_check_t *check = ci->check; 
     
    178179  ci->timeout_event = NULL; /* This is us, return 0 will free this */ 
    179180  ci->error = strdup("ssh connect timeout"); 
     181  if(ci->synch_fd_event) { 
     182    fde = ci->synch_fd_event; 
     183    eventer_remove_fd(fde->fd); 
     184    fde->opset->close(fde->fd, &mask, fde); 
     185    eventer_free(fde); 
     186     ci->synch_fd_event = NULL; 
     187  } 
    180188  ssh2_log_results(ci->self, ci->check); 
    181189  ssh2_cleanup(ci->self, ci->check); 
    182   eventer_remove_fd(e->fd); 
    183   e->opset->close(e->fd, &mask, e); 
    184190  check->flags &= ~NP_RUNNING; 
    185191  return 0;