[openssl-commits] [openssl] OpenSSL_1_1_0-stable update
Rich Salz
rsalz at openssl.org
Wed Sep 21 14:39:41 UTC 2016
The branch OpenSSL_1_1_0-stable has been updated
via 64d1cc09f912fdc92b12588cc9ad189978051a3e (commit)
from 6bdd2637daa862706598d04ae2750a920ebee0ae (commit)
- Log -----------------------------------------------------------------
commit 64d1cc09f912fdc92b12588cc9ad189978051a3e
Author: Alessandro Ghedini <alessandro at ghedini.me>
Date: Wed Sep 14 00:51:02 2016 +0100
Use switch instead of multiple ifs
Makes the logic a little bit clearer.
Reviewed-by: Andy Polyakov <appro at openssl.org>
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1571)
(cherry picked from commit 4f8a5f4da94bb70e06cf709beb1ddfa57a218c3d)
-----------------------------------------------------------------------
Summary of changes:
ssl/statem/statem.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 3df4ce6..df30085 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -566,22 +566,24 @@ static SUB_STATE_RETURN read_state_machine(SSL *s)
/* Discard the packet data */
s->init_num = 0;
- if (ret == MSG_PROCESS_ERROR) {
+ switch (ret) {
+ case MSG_PROCESS_ERROR:
return SUB_STATE_ERROR;
- }
- if (ret == MSG_PROCESS_FINISHED_READING) {
+ case MSG_PROCESS_FINISHED_READING:
if (SSL_IS_DTLS(s)) {
dtls1_stop_timer(s);
}
return SUB_STATE_FINISHED;
- }
- if (ret == MSG_PROCESS_CONTINUE_PROCESSING) {
+ case MSG_PROCESS_CONTINUE_PROCESSING:
st->read_state = READ_STATE_POST_PROCESS;
st->read_state_work = WORK_MORE_A;
- } else {
+ break;
+
+ default:
st->read_state = READ_STATE_HEADER;
+ break;
}
break;
More information about the openssl-commits
mailing list