aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2014-11-23 21:42:46 +0200
committerNick Mathewson <nickm@torproject.org>2014-12-21 14:48:39 -0500
commitf6cc4d35b0e79a675b56bdb3d919a6e5c6e840b3 (patch)
treeab0419b1f7ef7b8f481e3f14b68ed0561df5e3a8 /src/or/connection_or.c
parentfc7d5e598bb2494bd121e73038cf29854a23d9d5 (diff)
downloadtor-f6cc4d35b0e79a675b56bdb3d919a6e5c6e840b3.tar.gz
tor-f6cc4d35b0e79a675b56bdb3d919a6e5c6e840b3.zip
Using channel state lookup macros in connection_or.c.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 29b88041b7..e26e0bcf2d 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -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);
}
}