]> granicus.if.org Git - libevent/commitdiff
Add a comment to explain why evdns_request is now separte from request
authorNick Mathewson <nickm@torproject.org>
Fri, 23 Apr 2010 18:04:03 +0000 (14:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 23 Apr 2010 18:04:03 +0000 (14:04 -0400)
evdns.c

diff --git a/evdns.c b/evdns.c
index 3dbe7bea0165b5addb89d977f7dec71715c8a0f4..30269078c457f24e48c726b950574aedc2080ea8 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -148,7 +148,10 @@ typedef unsigned int uint;
 
 #define CLASS_INET     EVDNS_CLASS_INET
 
-/* persistent handle */
+/* Persistent handle.  We keep this separate from 'struct request' since we
+ * need some object to last for as long as an evdns_request is outstanding so
+ * that it can be cancelled, whereas a search request can lead to multiple
+ * 'struct request' instances being created over its lifetime. */
 struct evdns_request {
        struct request *current_req;
 
@@ -182,7 +185,7 @@ struct request {
        char **put_cname_in_ptr; /* store the cname here if we get one. */
 
        struct evdns_base *base;
-       
+
        struct evdns_request *handle;
 };