Skip to content

Commit

Permalink
add FALLTHRU comments
Browse files Browse the repository at this point in the history
In file included from src/websocket.c:56:0:
src/websocket.c: In function ‘shutdown_ssl’:
src/error.h:78:24: error: this statement may fall through [-Werror=implicit-fallthrough=]
 #define LOG(x) do { if (DEBUG_TEST) dbg_printf x; } while (0)
                        ^
src/websocket.c:766:5: note: in expansion of macro ‘LOG’
     LOG (("SSL: SSL_shutdown, probably unrecoverable, forcing close.\n"));
     ^~~
src/websocket.c:767:3: note: here
   case SSL_ERROR_ZERO_RETURN:
   ^~~~
src/websocket.c: In function ‘send_ssl_buffer’:
src/websocket.c:902:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if ((bytes < 0 &&
        ^
src/websocket.c:906:3: note: here
   case SSL_ERROR_ZERO_RETURN:
   ^~~~
src/websocket.c: In function ‘accept_ssl’:
src/websocket.c:803:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
     if (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) {
        ^
src/websocket.c:809:3: note: here
   case SSL_ERROR_ZERO_RETURN:
   ^~~~
src/websocket.c: In function ‘read_ssl_socket’:
src/websocket.c:945:10: error: this statement may fall through [-Werror=implicit-fallthrough=]
       if ((bytes < 0 &&
          ^
src/websocket.c:948:5: note: here
     case SSL_ERROR_ZERO_RETURN:
     ^~~~
  • Loading branch information
cgzones committed Nov 15, 2019
1 parent 1ad0373 commit 98483de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ shutdown_ssl (WSClient * client)
break;
}
LOG (("SSL: SSL_shutdown, probably unrecoverable, forcing close.\n"));
/* FALLTHRU */
case SSL_ERROR_ZERO_RETURN:
case SSL_ERROR_WANT_X509_LOOKUP:
default:
Expand Down Expand Up @@ -806,6 +807,7 @@ accept_ssl (WSClient * client)
}
/* The peer notified that it is shutting down through a SSL "close_notify" so
* we shutdown too */
/* FALLTHRU */
case SSL_ERROR_ZERO_RETURN:
case SSL_ERROR_WANT_X509_LOOKUP:
default:
Expand Down Expand Up @@ -903,6 +905,7 @@ send_ssl_buffer (WSClient * client, const char *buffer, int len)
(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)))
break;
/* The connection was shut down cleanly */
/* FALLTHRU */
case SSL_ERROR_ZERO_RETURN:
case SSL_ERROR_WANT_X509_LOOKUP:
default:
Expand Down Expand Up @@ -945,6 +948,7 @@ read_ssl_socket (WSClient * client, char *buffer, int size)
if ((bytes < 0 &&
(errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)))
break;
/* FALLTHRU */
case SSL_ERROR_ZERO_RETURN:
case SSL_ERROR_WANT_X509_LOOKUP:
default:
Expand Down

0 comments on commit 98483de

Please sign in to comment.