chiark / gitweb /
Test case for infinite timeouts.
[adns.git] / src / check.c
index 84fe168cd6cac54259793bde2b0892d8ab099d63..4d5e031f702acbdfafee00fcfaea8cd30caf1f28 100644 (file)
@@ -3,7 +3,12 @@
  * - consistency checks
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -78,11 +83,13 @@ static void checkc_global(adns_state ads) {
   case server_connecting:
     assert(ads->tcpsocket >= 0);
   case server_disconnected: /* fall through */
-    assert(!ads->tcprecv.used);
     assert(!ads->tcpsend.used);
+    assert(!ads->tcprecv.used);
+    assert(!ads->tcprecv_skip);
     break;
   case server_ok:
     assert(ads->tcpsocket >= 0);
+    assert(ads->tcprecv_skip <= ads->tcprecv.used);
     break;
   default:
     assert(!"ads->tcpstate value");
@@ -136,6 +143,7 @@ static void checkc_queue_output(adns_state ads) {
     assert(qu->state == query_done);
     assert(!qu->children.head && !qu->children.tail);
     assert(!qu->parent);
+    assert(!qu->allocations.head && !qu->allocations.tail);
     checkc_query(ads,qu);
   });
 }