Removing the temporary use of thread static

This commit is contained in:
Louis DeJardin 2014-03-19 00:02:58 -07:00
parent 951e8df893
commit ff19628832
1 changed files with 3 additions and 12 deletions

View File

@ -43,20 +43,13 @@ namespace Microsoft.AspNet.RequestContainer
_rootHttpContextAccessor.SetContextSource(AccessRootHttpContext, ExchangeRootHttpContext);
}
#if NET45
#else
#warning This MUST NOT be ThreadStatic in reality
[ThreadStatic]
HttpContext THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
#endif
private HttpContext AccessRootHttpContext()
{
#if NET45
return CallContext.LogicalGetData(LogicalDataKey) as HttpContext;
#else
return THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
#endif
throw new Exception("TODO: CallContext not available");
#endif
}
private HttpContext ExchangeRootHttpContext(HttpContext httpContext)
@ -66,9 +59,7 @@ namespace Microsoft.AspNet.RequestContainer
CallContext.LogicalSetData(LogicalDataKey, httpContext);
return prior;
#else
var prior = THIS_IS_BROKEN_AND_MUST_BE_CHANGED;
THIS_IS_BROKEN_AND_MUST_BE_CHANGED = httpContext;
return prior;
return null;
#endif
}