A typo and a couple of logic errors fixed. I think there may still be one

or two kinks lurking around, but it now appears to deal with the basic
test cases ok.
This commit is contained in:
Geoff Thorpe 2000-11-28 19:09:58 +00:00
parent adcc64cd9e
commit b984cd2b01
3 changed files with 7 additions and 4 deletions

2
demos/tunala/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
tunala

View File

@ -119,6 +119,7 @@ int state_machine_close_clean(state_machine_t *machine)
buffer_close(&machine->clean_in); buffer_close(&machine->clean_in);
buffer_close(&machine->clean_out); buffer_close(&machine->clean_out);
/* And start an SSL shutdown */ /* And start an SSL shutdown */
if(machine->ssl)
SSL_shutdown(machine->ssl); SSL_shutdown(machine->ssl);
/* This is an "event", so flush the SSL of any generated traffic */ /* This is an "event", so flush the SSL of any generated traffic */
state_machine_churn(machine); state_machine_churn(machine);

View File

@ -295,7 +295,7 @@ main_loop:
fprintf(stderr, "selector_select returned a badness error.\n"); fprintf(stderr, "selector_select returned a badness error.\n");
abort(); abort();
case 0: case 0:
fprintf(stderr, "Warn, selector_select return 0 - signal??\n"); fprintf(stderr, "Warn, selector_select returned 0 - signal??\n");
goto main_loop; goto main_loop;
default: default:
break; break;
@ -678,7 +678,7 @@ static int tunala_item_io(tunala_selector_t *selector, tunala_item_t *item)
item->clean_send = -1; item->clean_send = -1;
item->clean_read = -1; item->clean_read = -1;
} }
if(c_s) { if(c_s && (item->clean_send != -1)) {
close(item->clean_send); close(item->clean_send);
if(item->clean_send == item->clean_read) if(item->clean_send == item->clean_read)
item->clean_read = -1; item->clean_read = -1;
@ -690,7 +690,7 @@ static int tunala_item_io(tunala_selector_t *selector, tunala_item_t *item)
item->dirty_send = -1; item->dirty_send = -1;
item->dirty_read = -1; item->dirty_read = -1;
} }
if(d_s) { if(d_s && (item->dirty_send != -1)) {
close(item->dirty_send); close(item->dirty_send);
if(item->dirty_send == item->dirty_read) if(item->dirty_send == item->dirty_read)
item->dirty_read = -1; item->dirty_read = -1;