chiark / gitweb /
+ * Documentation improved somewhat, including new GPL-vs-LGPL file.
[adns.git] / src / query.c
index a8423d7c36e3a7bdd6c13c104885d83a10a5bcf3..6cfebb5d00d0c25611fac4fbbcba4dfdb2ceeb2e 100644 (file)
@@ -6,11 +6,11 @@
  */
 /*
  *  This file is
- *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1997-2000 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>
+ *    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999-2000 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
@@ -66,7 +66,7 @@ static adns_query query_alloc(adns_state ads, const typeinfo *typei,
   adns__vbuf_init(&qu->search_vb);
   qu->search_origlen= qu->search_pos= qu->search_doneabs= 0;
 
-  qu->id= 0;
+  qu->id= -2; /* will be overwritten with real id before we leave adns */
   qu->flags= flags;
   qu->retries= 0;
   qu->udpnextserver= 0;
@@ -374,6 +374,7 @@ void adns__transfer_interim(adns_query from, adns_query to, void *block, size_t
   LIST_UNLINK(from->allocations,an);
   LIST_LINK_TAIL(to->allocations,an);
 
+  sz= MEM_ROUND(sz);
   from->interim_allocd -= sz;
   to->interim_allocd += sz;
 
@@ -422,6 +423,7 @@ static void free_query_allocs(adns_query qu) {
   adns__vbuf_free(&qu->vb);
   adns__vbuf_free(&qu->search_vb);
   free(qu->query_dgram);
+  qu->query_dgram= 0;
 }
 
 void adns_cancel(adns_query qu) {