mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Using channel state lookup macros in connection_or.c.
This commit is contained in:
parent
fc7d5e598b
commit
f6cc4d35b0
@ -1144,9 +1144,7 @@ connection_or_notify_error(or_connection_t *conn,
|
||||
if (conn->chan) {
|
||||
chan = TLS_CHAN_TO_BASE(conn->chan);
|
||||
/* Don't transition if we're already in closing, closed or error */
|
||||
if (!(chan->state == CHANNEL_STATE_CLOSING ||
|
||||
chan->state == CHANNEL_STATE_CLOSED ||
|
||||
chan->state == CHANNEL_STATE_ERROR)) {
|
||||
if (!CHANNEL_CONDEMNED(chan)) {
|
||||
channel_close_for_error(chan);
|
||||
}
|
||||
}
|
||||
@ -1305,9 +1303,7 @@ connection_or_close_normally(or_connection_t *orconn, int flush)
|
||||
if (orconn->chan) {
|
||||
chan = TLS_CHAN_TO_BASE(orconn->chan);
|
||||
/* Don't transition if we're already in closing, closed or error */
|
||||
if (!(chan->state == CHANNEL_STATE_CLOSING ||
|
||||
chan->state == CHANNEL_STATE_CLOSED ||
|
||||
chan->state == CHANNEL_STATE_ERROR)) {
|
||||
if (!CHANNEL_CONDEMNED(chan)) {
|
||||
channel_close_from_lower_layer(chan);
|
||||
}
|
||||
}
|
||||
@ -1328,9 +1324,7 @@ connection_or_close_for_error(or_connection_t *orconn, int flush)
|
||||
if (orconn->chan) {
|
||||
chan = TLS_CHAN_TO_BASE(orconn->chan);
|
||||
/* Don't transition if we're already in closing, closed or error */
|
||||
if (!(chan->state == CHANNEL_STATE_CLOSING ||
|
||||
chan->state == CHANNEL_STATE_CLOSED ||
|
||||
chan->state == CHANNEL_STATE_ERROR)) {
|
||||
if (!CHANNEL_CONDEMNED(chan)) {
|
||||
channel_close_for_error(chan);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user