summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2012-01-04 10:05:41 +0100
committerLinus Nordberg <linus@nordu.net>2012-01-04 10:05:41 +0100
commitbd18a7210b728cab6f9cebc35cf0b4a05c50a47f (patch)
tree8cb6a2a7cea7df4b1884291fc4e0e33ef6e89bb0 /lib
parent15ec61ae50914f16473ce5a2fe8df22636a69f7d (diff)
Avoid unused variable warning when building without DEBUG.
Spotted by Sam Hartman.
Diffstat (limited to 'lib')
-rw-r--r--lib/tcp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/tcp.c b/lib/tcp.c
index ce071cd..77365c0 100644
--- a/lib/tcp.c
+++ b/lib/tcp.c
@@ -158,17 +158,21 @@ tcp_event_cb (struct bufferevent *bev, short events, void *user_data)
{
struct rs_packet *pkt = (struct rs_packet *) user_data;
struct rs_connection *conn = NULL;
- struct rs_peer *p = NULL;
int sockerr = 0;
#if defined (RS_ENABLE_TLS)
unsigned long tlserr = 0;
#endif
+#if defined (DEBUG)
+ struct rs_peer *p = NULL;
+#endif
assert (pkt);
assert (pkt->conn);
- assert (pkt->conn->active_peer);
conn = pkt->conn;
+#if defined (DEBUG)
+ assert (pkt->conn->active_peer);
p = conn->active_peer;
+#endif
conn->is_connecting = 0;
if (events & BEV_EVENT_CONNECTED)