THREAD CLOSED: (was: question on qmgr_transport_select())

2015-05-10 Thread Viktor Dukhovni
On Mon, May 11, 2015 at 12:21:08PM +0800, King Cao wrote: > ..., but transport 2 will be selected while transport 1 never. I'm going to stop the discussion here. You'll need to figure out why the code is correct without additional input. Do not post on this topic again, ad nauseam repetition

Re: question on qmgr_transport_select()

2015-05-10 Thread King Cao
Hi Viktor, Each transport has queue list and each queue in that list stands for one destination (nexthop). Please consider below scenario, transport2 has more queued entries than transport1, but transport 2 will be selected while transport 1 never. The if statement doesn't satisfy the comments.

Re: question on qmgr_transport_select()

2015-05-10 Thread Viktor Dukhovni
On Mon, May 11, 2015 at 09:19:43AM +0800, King Cao wrote: > > > Suppose transport->pending is 1, so the value of need is 2 (pending+1), > > > > Which means that we're in the process of making an asynchronous > > connection to the transport to request a delivery. > > > > > queue->window is 5 by def

Re: question on qmgr_transport_select()

2015-05-10 Thread King Cao
Hi Victor, The weird thing is that if queue->todo_refcount = 2, the queue will be satisfied but if queue->todo_refcount = 1, the queue is not satisfied. So when we have one pending delivery agent connection, if one queue have two todo tasks, the related transport will be selected, but if one queue