1 write to _Validator
System (1)
net\System\Net\Cache\_RequestCacheProtocol.cs (1)
72
_Validator
= defaultValidator;
127 references to _Validator
System (127)
net\System\Net\Cache\_RequestCacheProtocol.cs (127)
59
internal RequestCacheValidator Validator {get {return
_Validator
;}}
60
internal bool IsCacheFresh {get {return
_Validator
!= null &&
_Validator
.CacheFreshnessStatus == CacheFreshnessStatus.Fresh;}}
104
if (_RequestCache == null ||
_Validator
== null)
110
_Validator
.FetchRequest(cacheUri, request);
127
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_validator_result, "ValidateRequest",
_Validator
.ValidationStatus.ToString()));
128
if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_unexpected_status, "ValidateRequest()",
_Validator
.ValidationStatus.ToString()));
173
if(Logging.On) Logging.Enter(Logging.RequestCache, this, "GetRevalidateStatus", (
_Validator
== null? null:
_Validator
.Request));
175
_Validator
.FetchResponse(response);
205
if (
_Validator
.Response == null)
206
_Validator
.FetchResponse(response);
210
EnsureCacheRemoval(
_Validator
.CacheKey);
258
if(Logging.On) Logging.PrintWarning(Logging.RequestCache, SR.GetString(SR.net_log_cache_closing_cache_stream, "CacheProtocol#" + this.GetHashCode().ToString(NumberFormatInfo.InvariantInfo), "Abort()", stream.GetType().FullName,
_Validator
.CacheKey));
292
if (
_Validator
.CacheStream != null &&
_Validator
.CacheStream != Stream.Null)
295
_Validator
.CacheStream.Close();
296
_Validator
.CacheStream = Stream.Null;
299
if (
_Validator
.StrictCacheErrors)
301
_Validator
.CacheStream = _RequestCache.Retrieve(
_Validator
.CacheKey, out cacheEntry);
306
_RequestCache.TryRetrieve(
_Validator
.CacheKey, out cacheEntry, out stream);
307
_Validator
.CacheStream = stream;
314
_Validator
.FetchCacheEntry(cacheEntry);
317
if (
_Validator
.CacheStream == null)
321
_Validator
.CacheStream = Stream.Null;
332
if (
_Validator
.CacheStream == null ||
_Validator
.CacheStream == Stream.Null)
336
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_no_stream,
_Validator
.CacheKey));
341
Stream stream =
_Validator
.CacheStream;
343
_RequestCache.UnlockEntry(
_Validator
.CacheStream);
345
if (
_Validator
.CacheStreamOffset != 0L ||
_Validator
.CacheStreamLength !=
_Validator
.CacheEntry.StreamSize)
347
stream = new RangeStream(stream,
_Validator
.CacheStreamOffset,
_Validator
.CacheStreamLength);
348
if(Logging.On) Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_returned_range_cache, "ValidateCache()",
_Validator
.CacheStreamOffset,
_Validator
.CacheStreamLength));
351
_ResponseStreamLength =
_Validator
.CacheStreamLength;
356
_ResponseStream =
_Validator
.CacheStream;
373
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_validator_result, "ValidateCache",
_Validator
.ValidationStatus.ToString()));
374
if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_unexpected_status, "ValidateCache()",
_Validator
.ValidationStatus.ToString()));
390
if (_ResponseStream == null &&
_Validator
.CacheStream != null &&
_Validator
.CacheStream != Stream.Null)
392
_Validator
.CacheStream.Close();
393
_Validator
.CacheStream = Stream.Null;
428
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_validator_result, "ValidateResponse",
_Validator
.ValidationStatus.ToString()));
429
if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_unexpected_status, "ValidateResponse()",
_Validator
.ValidationStatus.ToString()));
449
_Validator
.CacheStream = Stream.Null;
477
if (
_Validator
.CacheStream == null ||
_Validator
.CacheStream == Stream.Null)
480
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_no_stream,
_Validator
.CacheKey));
485
Stream stream =
_Validator
.CacheStream;
487
if (
_Validator
.CacheStreamOffset != 0L ||
_Validator
.CacheStreamLength !=
_Validator
.CacheEntry.StreamSize)
489
stream = new RangeStream(stream,
_Validator
.CacheStreamOffset,
_Validator
.CacheStreamLength);
490
if(Logging.On) Logging.PrintInfo(Logging.RequestCache, SR.GetString(SR.net_log_cache_returned_range_cache, "RevalidateCache()",
_Validator
.CacheStreamOffset,
_Validator
.CacheStreamLength));
493
_ResponseStreamLength =
_Validator
.CacheStreamLength;
498
if (
_Validator
.CacheStream == null ||
_Validator
.CacheStream == Stream.Null)
501
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_no_stream,
_Validator
.CacheKey));
510
stream = new CombinedReadStream(
_Validator
.CacheStream, responseStream);
515
stream =
_Validator
.CacheStream;
518
_ResponseStreamLength =
_Validator
.CacheStreamLength;
530
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_validator_result, "RevalidateCache",
_Validator
.ValidationStatus.ToString()));
531
if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_unexpected_status, "RevalidateCache()",
_Validator
.ValidationStatus.ToString()));
550
_Validator
.CacheStream = Stream.Null;
560
if (
_Validator
.CacheEntry == null)
565
_Validator
.FetchCacheEntry(cacheEntry);
573
string retrieveKey =
_Validator
.CacheKey;
591
_Validator
.CacheKey,
592
_Validator
.CacheEntry.ExpiresUtc,
593
_Validator
.CacheEntry.LastModifiedUtc,
594
_Validator
.CacheEntry.LastSynchronizedUtc,
595
_Validator
.CacheEntry.MaxStale,
596
_Validator
.CacheEntry.EntryMetadata,
597
_Validator
.CacheEntry.SystemMetadata,
598
_Validator
.StrictCacheErrors);
614
if (
_Validator
.StrictCacheErrors)
615
{stream = _RequestCache.Store(
_Validator
.CacheKey,
_Validator
.CacheEntry.StreamSize,
_Validator
.CacheEntry.ExpiresUtc,
_Validator
.CacheEntry.LastModifiedUtc,
_Validator
.CacheEntry.MaxStale,
_Validator
.CacheEntry.EntryMetadata,
_Validator
.CacheEntry.SystemMetadata);}
617
{_RequestCache.TryStore(
_Validator
.CacheKey,
_Validator
.CacheEntry.StreamSize,
_Validator
.CacheEntry.ExpiresUtc,
_Validator
.CacheEntry.LastModifiedUtc,
_Validator
.CacheEntry.MaxStale,
_Validator
.CacheEntry.EntryMetadata,
_Validator
.CacheEntry.SystemMetadata, out stream);}
624
_ResponseStream = new ForwardingReadStream(responseStream, stream,
_Validator
.CacheStreamOffset,
_Validator
.StrictCacheErrors);
638
_ProtocolException = new InvalidOperationException(SR.GetString(SR.net_cache_validator_result, "UpdateCache",
_Validator
.ValidationStatus.ToString()));
639
if(Logging.On) Logging.PrintError(Logging.RequestCache, SR.GetString(SR.net_log_cache_unexpected_status, "UpdateCache()",
_Validator
.ValidationStatus.ToString()));
647
_RequestCache.UnlockEntry(
_Validator
.CacheStream);
655
"Request#" +
_Validator
.Request.GetHashCode().ToString(NumberFormatInfo.InvariantInfo) +
656
", Policy = " +
_Validator
.Request.CachePolicy.ToString() +
657
", Cache Uri = " +
_Validator
.Uri);
659
CacheValidationStatus result =
_Validator
.ValidateRequest();
660
_Validator
.SetValidationStatus(result);
662
if(Logging.On) Logging.PrintInfo(Logging.RequestCache, "Selected cache Key = " +
_Validator
.CacheKey);
670
_Validator
.FetchCacheEntry(fetchEntry);
672
if (
_Validator
.CacheStream == null ||
_Validator
.CacheStream == Stream.Null) {
674
_Validator
.SetFreshnessStatus(CacheFreshnessStatus.Undefined);
697
CacheFreshnessStatus result =
_Validator
.ValidateFreshness();
698
_Validator
.SetFreshnessStatus(result);
708
CacheValidationStatus result =
_Validator
.ValidateCache();
709
_Validator
.SetValidationStatus(result);
717
CacheValidationStatus result =
_Validator
.RevalidateCache();
718
_Validator
.SetValidationStatus(result);
727
CacheValidationStatus result =
_Validator
.ValidateResponse();
728
_Validator
.SetValidationStatus(result);
736
CacheValidationStatus result =
_Validator
.UpdateCache();
737
_Validator
.SetValidationStatus(result);
745
_RequestCache.UnlockEntry(
_Validator
.CacheStream);
747
if (
_Validator
.StrictCacheErrors)
753
if (retrieveKey !=
_Validator
.CacheKey)
755
if (
_Validator
.StrictCacheErrors)
756
{_RequestCache.Remove(
_Validator
.CacheKey);}
758
{_RequestCache.TryRemove(
_Validator
.CacheKey);}