Refactored async resolver code flow

Done.

On Wed, Dec 10, 2014 at 12:07 PM, Marko Mikulicic <notifications@github.com>
wrote:

> In test/unit_test.c
> <https://github.com/cesanta/fossa/pull/178#discussion-diff-21599213>:
>
> >
> >    /* handler is invoked when it fails asynchronously */
> > -  poll_mgr(&mgr, 500);
> > -  ASSERT(data & 1);
> > -  ASSERT(data & 2);
> > +  poll_mgr(&mgr, 20);
> > +  ASSERT(data == 6);
>
> Fails on my machine. Consider
>
>   while (data != 6) {
>     poll_mgr(&mgr, 1);
>   }
>   ASSERT(data == 6);
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cesanta/fossa/pull/178/files#r21599213>.
>