aboutsummaryrefslogtreecommitdiffstats
path: root/demos/tunala
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2000-11-28 19:09:58 +0000
committerGeoff Thorpe <geoff@openssl.org>2000-11-28 19:09:58 +0000
commitb984cd2b016bd37eabf41ef34a573208c5661685 (patch)
treed9932ab6902e78f97f0f982ec15ac1c354fe7627 /demos/tunala
parentadcc64cd9e9eb81b5d9ef70b532806147d718f97 (diff)
downloadopenssl-b984cd2b016bd37eabf41ef34a573208c5661685.tar.gz
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.
Diffstat (limited to 'demos/tunala')
-rw-r--r--demos/tunala/.cvsignore2
-rw-r--r--demos/tunala/sm.c3
-rw-r--r--demos/tunala/tunala.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/demos/tunala/.cvsignore b/demos/tunala/.cvsignore
new file mode 100644
index 0000000000..1254a1ee29
--- /dev/null
+++ b/demos/tunala/.cvsignore
@@ -0,0 +1,2 @@
+tunala
+
diff --git a/demos/tunala/sm.c b/demos/tunala/sm.c
index 05bd7b9459..ee661c5197 100644
--- a/demos/tunala/sm.c
+++ b/demos/tunala/sm.c
@@ -119,7 +119,8 @@ int state_machine_close_clean(state_machine_t *machine)
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) &&
diff --git a/demos/tunala/tunala.c b/demos/tunala/tunala.c
index b54bb422db..cc32adc050 100644
--- a/demos/tunala/tunala.c
+++ b/demos/tunala/tunala.c
@@ -295,7 +295,7 @@ main_loop:
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;
@@ -678,7 +678,7 @@ static int tunala_item_io(tunala_selector_t *selector, tunala_item_t *item)
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;
@@ -690,7 +690,7 @@ static int tunala_item_io(tunala_selector_t *selector, tunala_item_t *item)
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;