The branch master has been updated
       via  4f8a5f4da94bb70e06cf709beb1ddfa57a218c3d (commit)
      from  c5ad3076a6c076ac9f8449c393dd14c16b737560 (commit)


- Log -----------------------------------------------------------------
commit 4f8a5f4da94bb70e06cf709beb1ddfa57a218c3d
Author: Alessandro Ghedini <alessan...@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 <ap...@openssl.org>
    Reviewed-by: Rich Salz <rs...@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1571)

-----------------------------------------------------------------------

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;
 
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to