Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-04-08 Thread Alexander Klauer
On 03/23/2013 03:12 PM, Daniel Stenberg wrote: On Thu, 21 Mar 2013, Alexander Klauer wrote: Implementation-wise, I think I would just swap the list head in the ares channel with an empty list head on the stack, and then start walking through the list with the list head on the stack. Any new req

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-23 Thread Daniel Stenberg
On Thu, 21 Mar 2013, Alexander Klauer wrote: Implementation-wise, I think I would just swap the list head in the ares channel with an empty list head on the stack, and then start walking through the list with the list head on the stack. Any new requests would then be added to the now initially

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Alexander Klauer
On 03/21/2013 02:56 PM, Tommie Gannert wrote: 2013/3/21 Alexander Klauer : What happens if someone calls ares_cancel() while ares_cancel() is in progress? With (1), that would mean that the topmost (most recent) instance ares_cancel() has to cancel all those requests that appeared since the next

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Tommie Gannert
2013/3/21 Alexander Klauer : > What happens if someone calls ares_cancel() while ares_cancel() is in > progress? With (1), that would mean that the topmost (most recent) instance > ares_cancel() has to cancel all those requests that appeared since the > next-to-topmost instance was invoked, right?

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Alexander Klauer
On 03/21/2013 01:44 PM, Tommie Gannert wrote: 2013/3/21 Alexander Klauer : How about this: * Make ares_destroy() more user friendly and allow callbacks to register new requests on the channel being destroyed. Those requests would then immediately be finished with ARES_EDESTRUCTION. * Let ares_c

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Tommie Gannert
2013/3/21 Alexander Klauer : > How about this: > > * Make ares_destroy() more user friendly and allow callbacks to register new > requests on the channel being destroyed. Those requests would then > immediately be finished with ARES_EDESTRUCTION. > * Let ares_cancel() walk through the list, but don

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Alexander Klauer
On 03/21/2013 11:45 AM, Tommie Gannert wrote: 2013/3/21 Alexander Klauer : 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

Re: [PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Tommie Gannert
2013/3/21 Alexander Klauer : > 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 f

[PATCH 1/4] ares_cancel(): ensure cancellation of all requests

2013-03-21 Thread Alexander Klauer
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 th