[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] 1.4 evdns: can have duplicate transaction ids
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] 1.4 evdns: can have duplicate transaction ids
- From: Marko Kreen <markokr@xxxxxxxxx>
- Date: Tue, 12 Oct 2010 10:54:36 +0300
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 12 Oct 2010 03:54:44 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=SXE3v4gQSXP/SjBjdH5XDUBSSDpvn0nxmPwqnrbAFR0=; b=EsialmyzCaGXRQhmGlSPRVOEheRZ0R/CFNJxsIJO+efkn5J8VbIMJn6FU/5M092h9H YjdaWXp9uYsHT5slhgC7ncWpIyJZ9Dtn4W2hxCRM2KS0aesPWhFA+TcsJMfqR8Lc+eo7 gTfTeArqQ+jSHyieiZcmQhJp5kXEYRRCnp8i4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=t58BRYlmdzt568gA4x4IRPzeO7EgIx/XrT7+XwwJM5RGamPIk6maPh6zuQsMWI8GfK 00B+VQ83+b7TM7ubDRXV+uNZK3Qpj5SbmzYwELf6vK9XPX2QUHcMPg1obLfl8nqTne2P n6Iu3fKQgiA5mNy3C4b/4gG3CiE22lxGbFj24=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
It seems libevent 1.4 evdns can issue duplicate transaction ids,
if the double id is first one in the list.
See attached patch for quick fix.
--
marko
diff --git a/evdns.c b/evdns.c
index c85f6ea..e4213ff 100644
--- a/evdns.c
+++ b/evdns.c
@@ -1119,9 +1119,10 @@ transaction_id_pick(void) {
if (req->trans_id == trans_id) break;
req = req->next;
} while (req != started_at);
+ if (req->trans_id == trans_id) continue;
}
/* we didn't find it, so this is a good id */
- if (req == started_at) return trans_id;
+ return trans_id;
}
}