or two kinks lurking around, but it now appears to deal with the basic
test cases ok.
buffer_close(&machine->clean_in);
buffer_close(&machine->clean_out);
/* And start an SSL shutdown */
- SSL_shutdown(machine->ssl);
+ if(machine->ssl)
+ SSL_shutdown(machine->ssl);
/* This is an "event", so flush the SSL of any generated traffic */
state_machine_churn(machine);
if(buffer_empty(&machine->dirty_in) &&
fprintf(stderr, "selector_select returned a badness error.\n");
abort();
case 0:
- fprintf(stderr, "Warn, selector_select return 0 - signal??\n");
+ fprintf(stderr, "Warn, selector_select returned 0 - signal??\n");
goto main_loop;
default:
break;
item->clean_send = -1;
item->clean_read = -1;
}
- if(c_s) {
+ if(c_s && (item->clean_send != -1)) {
close(item->clean_send);
if(item->clean_send == item->clean_read)
item->clean_read = -1;
item->dirty_send = -1;
item->dirty_read = -1;
}
- if(d_s) {
+ if(d_s && (item->dirty_send != -1)) {
close(item->dirty_send);
if(item->dirty_send == item->dirty_read)
item->dirty_read = -1;