ares_cancel(): cancel requests safely
authorAlexander Klauer <Alexander.Klauer@itwm.fraunhofer.de>
Mon, 8 Apr 2013 09:48:43 +0000 (11:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 8 Apr 2013 20:16:48 +0000 (22:16 +0200)
commit54faf09da68691a88dbf1936f5969b53af364261
tree15b181c46c5fe6ea060b737d070e22b8e388e419
parent127d4cb35798697b8d9a87648dd9af66d4ed9dec
ares_cancel(): cancel requests safely

An invocation of ares_cancel() walks through the request list, calling
the callbacks of all pending requests on a channel. Previously, if such
a callback added a new request to the channel, the request list might
not end up empty, causing an abort by assertion failure. The present
commit ensures that precisely all requests present upon entry of
ares_cancel() are cancelled, and that adding new requests through
callbacks is safe.
ares_cancel.c