about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--btpd/net.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/btpd/net.c b/btpd/net.c
index 903b4df..a226aaf 100644
--- a/btpd/net.c
+++ b/btpd/net.c
@@ -30,6 +30,7 @@ net_bw_read_cb(int sd, short type, void *arg)
     struct bwlim *bw = arg;
 
     btpd.ibw_left += bw->count;
+    assert(btpd.ibw_left <= btpd.ibwlim);
 
     unsigned long count = 0;
 
@@ -79,6 +80,7 @@ net_bw_write_cb(int sd, short type, void *arg)
     struct bwlim *bw = arg;
 
     btpd.obw_left += bw->count;
+    assert(btpd.obw_left <= btpd.obwlim);
 
     unsigned long count = 0;