mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
dtlsconnection: Replace if-else chain with switch
A more idiomatic construct for testing a bunch of integers.
This commit is contained in:
parent
49cc7b8091
commit
7bb6ce352b
1 changed files with 15 additions and 14 deletions
|
@ -721,7 +721,8 @@ openssl_poll (GstDtlsConnection * self)
|
||||||
|
|
||||||
log_state (self, "poll: after handshake");
|
log_state (self, "poll: after handshake");
|
||||||
|
|
||||||
if (ret == 1) {
|
switch (ret) {
|
||||||
|
case 1:
|
||||||
if (!self->priv->keys_exported) {
|
if (!self->priv->keys_exported) {
|
||||||
GST_INFO_OBJECT (self,
|
GST_INFO_OBJECT (self,
|
||||||
"handshake just completed successfully, exporting keys");
|
"handshake just completed successfully, exporting keys");
|
||||||
|
@ -730,15 +731,15 @@ openssl_poll (GstDtlsConnection * self)
|
||||||
GST_INFO_OBJECT (self, "handshake is completed");
|
GST_INFO_OBJECT (self, "handshake is completed");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
case 0:
|
||||||
if (ret == 0) {
|
|
||||||
GST_DEBUG_OBJECT (self, "do_handshake encountered EOF");
|
GST_DEBUG_OBJECT (self, "do_handshake encountered EOF");
|
||||||
} else if (ret == -1) {
|
break;
|
||||||
|
case -1:
|
||||||
GST_DEBUG_OBJECT (self, "do_handshake encountered BIO error");
|
GST_DEBUG_OBJECT (self, "do_handshake encountered BIO error");
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
GST_DEBUG_OBJECT (self, "do_handshake returned %d", ret);
|
GST_DEBUG_OBJECT (self, "do_handshake returned %d", ret);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
error = SSL_get_error (self->priv->ssl, ret);
|
error = SSL_get_error (self->priv->ssl, ret);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue