• Emmanuel T Odeke's avatar
    net: preserve unexpired context values for LookupIPAddr · 5d392600
    Emmanuel T Odeke authored
    To avoid any cancelation of the parent context from affecting
    lookupGroup operations, Resolver.LookupIPAddr previously used
    an entirely new context created from context.Background().
    However, this meant that all the values in the parent context
    with which LookupIPAddr was invoked were dropped.
    
    This change provides a custom context implementation
    that only preserves values of the parent context by composing
    context.Background() and the parent context. It only falls back
    to the parent context to perform value lookups if the parent
    context has not yet expired.
    This context is never canceled, and has no deadlines.
    
    Fixes #28600
    
    Change-Id: If2f570caa26c65bad638b7102c35c79d5e429fea
    Reviewed-on: https://go-review.googlesource.com/c/148698
    Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    5d392600
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...