X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fstream-ssl.c;h=5a67da8f69a03f804198dd593272356008f5ce6c;hb=246f5b5edee9a35d8126a1d15c4f43328cf38570;hp=84c1a115739918b66a3f6e3e6f1ce0dc2f706f42;hpb=0fbc9f11c027cce9c89de12525de852e6b2ae332;p=sliver-openvswitch.git diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c index 84c1a1157..5a67da8f6 100644 --- a/lib/stream-ssl.c +++ b/lib/stream-ssl.c @@ -188,6 +188,7 @@ static int do_ssl_init(void); static bool ssl_wants_io(int ssl_error); static void ssl_close(struct stream *); static void ssl_clear_txbuf(struct ssl_stream *); +static void interpret_queued_ssl_error(const char *function); static int interpret_ssl_error(const char *function, int ret, int error, int *want); static DH *tmp_dh_callback(SSL *ssl, int is_export OVS_UNUSED, int keylength); @@ -600,6 +601,18 @@ ssl_close(struct stream *stream) free(sslv); } +static void +interpret_queued_ssl_error(const char *function) +{ + int queued_error = ERR_get_error(); + if (queued_error != 0) { + VLOG_WARN_RL(&rl, "%s: %s", + function, ERR_error_string(queued_error, NULL)); + } else { + VLOG_ERR_RL(&rl, "%s: SSL_ERROR_SSL without queued error", function); + } +} + static int interpret_ssl_error(const char *function, int ret, int error, int *want) @@ -656,17 +669,9 @@ interpret_ssl_error(const char *function, int ret, int error, } } - case SSL_ERROR_SSL: { - int queued_error = ERR_get_error(); - if (queued_error != 0) { - VLOG_WARN_RL(&rl, "%s: %s", - function, ERR_error_string(queued_error, NULL)); - } else { - VLOG_ERR_RL(&rl, "%s: SSL_ERROR_SSL without queued error", - function); - } + case SSL_ERROR_SSL: + interpret_queued_ssl_error(function); break; - } default: VLOG_ERR_RL(&rl, "%s: bad SSL error code %d", function, error);