tinc 1.1: missing PONG

Todd C. Miller Todd.Miller at sudo.ws
Tue Feb 27 17:26:15 CET 2018


On Tue, 27 Feb 2018 08:12:53 +0100, Guus Sliepen wrote:

> I was thinking by setting a flag whenever we call io_del(), and checking
> that flag in the for-loop in event_loop().

So basically you would store a generation number in the tree that
gets incremented by a call to io_del()?  Or should the flag/number
be changed each time the order of the tree changes?

> > Changing the order of the events changes the index of which event
> > is returned by WSAWaitForMultipleEvents().  Moving the most recently
> > accessed event to the end gives the others a chance to proceed.
>
> But it doesn't order them by most recently accessed. It's a
> deterministic order that doesn't change except when io_add() or io_del()
> is called. Or put in another way: splay_each(io_t, io, &io_tree) goes
> through the nodes of the io_tree in the order determined by
> io_compare().

Unlike the POSIX event code, the Windows version calls splay_search()
to map the event to an io_t.  The call to splay_search() will splay
the tree which changes the order the next time we go through the
loop.  At least that's my take on it.  It makes more sense to make
the POSIX and Windows versions be as close as possible so I've
abandoned this approach.

 - todd


More information about the tinc-devel mailing list