diff options
author | Geoff Thorpe <geoff@openssl.org> | 2002-01-10 06:03:12 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2002-01-10 06:03:12 +0000 |
commit | fd69886aeda473c97af2b9ae9c52123c45783ded (patch) | |
tree | 6cf2578eacf8909af66250eacb4aeff2edaf3a8d /demos/tunala/sm.c | |
parent | fd795679bbcc56980663610c8d9a62ca300b424f (diff) |
- Network errors could pollute the buffers because -1 isn't noticed in an
"unsigned int".
- Remove redundant processing with machine->ssl is NULL.
- Remove compiler warnings about uninitialised 'ctx' (it's not used
uninitialised, but gcc can't see that).
Diffstat (limited to 'demos/tunala/sm.c')
-rw-r--r-- | demos/tunala/sm.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/demos/tunala/sm.c b/demos/tunala/sm.c index c213d110d5..25359e67ef 100644 --- a/demos/tunala/sm.c +++ b/demos/tunala/sm.c @@ -82,14 +82,6 @@ int state_machine_set_SSL(state_machine_t *machine, SSL *ssl, int is_server) int state_machine_churn(state_machine_t *machine) { unsigned int loop; - /* Do this loop twice to cover any dependencies about which precise - * order of reads and writes is required. */ - for(loop = 0; loop < 2; loop++) { - buffer_to_SSL(&machine->clean_in, machine->ssl); - buffer_to_BIO(&machine->dirty_in, machine->bio_intossl); - buffer_from_SSL(&machine->clean_out, machine->ssl); - buffer_from_BIO(&machine->dirty_out, machine->bio_fromssl); - } if(machine->ssl == NULL) { if(buffer_empty(&machine->clean_out)) /* Time to close this state-machine altogether */ @@ -98,6 +90,14 @@ int state_machine_churn(state_machine_t *machine) /* Still buffered data on the clean side to go out */ return 1; } + /* Do this loop twice to cover any dependencies about which precise + * order of reads and writes is required. */ + for(loop = 0; loop < 2; loop++) { + buffer_to_SSL(&machine->clean_in, machine->ssl); + buffer_to_BIO(&machine->dirty_in, machine->bio_intossl); + buffer_from_SSL(&machine->clean_out, machine->ssl); + buffer_from_BIO(&machine->dirty_out, machine->bio_fromssl); + } /* We close on the SSL side if the info callback noticed some problems * or an SSL shutdown was underway and shutdown traffic had all been * sent. */ |