Skip to content

Instantly share code, notes, and snippets.

@SteveGilham
Created April 14, 2015 19:59
Show Gist options
  • Save SteveGilham/1dfa7425b34a090fce53 to your computer and use it in GitHub Desktop.
Save SteveGilham/1dfa7425b34a090fce53 to your computer and use it in GitHub Desktop.
/* discover context if required */
if(need_token && (!have_token))
{
int ok = discover_context(...);
result = ok ? S_OK : E_FAIL;
goto exit;
}
/* If we don't need to discover the context, but need to do more work, hand to calling code */
if((have_token || !need_token) && ! all_done)
{
result = S_FALSE;
/* forward if need be */
if(need_token && peer)
{
/* Forward to the indicated peer */
int ok = redirect(peer,... );
result = ok ? S_OK : E_FAIL;
}
goto exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment