summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-10-16 22:14:52 +0000
committerRoger Dingledine <arma@torproject.org>2004-10-16 22:14:52 +0000
commitde65052312ff9ddd86e492985008bd5ca61d7aa9 (patch)
tree96a2b81c47b4e35e465aa01d8328517a1525d752 /src/or/main.c
parent25a046df7422560b16dfdb302df9621309d5fa77 (diff)
downloadtor-de65052312ff9ddd86e492985008bd5ca61d7aa9.tar.gz
tor-de65052312ff9ddd86e492985008bd5ca61d7aa9.zip
don't assert multiple things in the same tor_assert()
svn:r2544
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 13c53d60b6..8c3e3e36ae 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -170,20 +170,25 @@ void get_connection_array(connection_t ***array, int *n) {
*/
void connection_watch_events(connection_t *conn, short events) {
- tor_assert(conn && conn->poll_index >= 0 && conn->poll_index < nfds);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
+ tor_assert(conn->poll_index < nfds);
poll_array[conn->poll_index].events = events;
}
/** Return true iff <b>conn</b> is listening for read events. */
int connection_is_reading(connection_t *conn) {
- tor_assert(conn && conn->poll_index >= 0);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
return poll_array[conn->poll_index].events & POLLIN;
}
/** Tell the main loop to stop notifying <b>conn</b> of any read events. */
void connection_stop_reading(connection_t *conn) {
- tor_assert(conn && conn->poll_index >= 0 && conn->poll_index < nfds);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
+ tor_assert(conn->poll_index < nfds);
log(LOG_DEBUG,"connection_stop_reading() called.");
if(poll_array[conn->poll_index].events & POLLIN)
@@ -192,7 +197,9 @@ void connection_stop_reading(connection_t *conn) {
/** Tell the main loop to start notifying <b>conn</b> of any read events. */
void connection_start_reading(connection_t *conn) {
- tor_assert(conn && conn->poll_index >= 0 && conn->poll_index < nfds);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
+ tor_assert(conn->poll_index < nfds);
poll_array[conn->poll_index].events |= POLLIN;
}
@@ -203,14 +210,18 @@ int connection_is_writing(connection_t *conn) {
/** Tell the main loop to stop notifying <b>conn</b> of any write events. */
void connection_stop_writing(connection_t *conn) {
- tor_assert(conn && conn->poll_index >= 0 && conn->poll_index < nfds);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
+ tor_assert(conn->poll_index < nfds);
if(poll_array[conn->poll_index].events & POLLOUT)
poll_array[conn->poll_index].events -= POLLOUT;
}
/** Tell the main loop to start notifying <b>conn</b> of any write events. */
void connection_start_writing(connection_t *conn) {
- tor_assert(conn && conn->poll_index >= 0 && conn->poll_index < nfds);
+ tor_assert(conn);
+ tor_assert(conn->poll_index >= 0);
+ tor_assert(conn->poll_index < nfds);
poll_array[conn->poll_index].events |= POLLOUT;
}