Пример #1
0
        protected Stream OpenFileOnlineInternal(IndexEntry idxInfo, MD5Hash key)
        {
            Stream s;

            if (idxInfo != null)
            {
                s = CDNIndex.OpenDataFile(idxInfo);
            }
            else
            {
                s = CDNIndex.OpenDataFileDirect(key);
            }

            BLTEStream blte;

            try
            {
                blte = new BLTEStream(s, key);
            }
            catch (BLTEDecoderException exc) when(exc.ErrorCode == 0)
            {
                return(OpenFileOnlineInternal(idxInfo, key));
            }

            return(blte);
        }
Пример #2
0
        protected Stream OpenFileOnlineInternal(IndexEntry idxInfo, MD5Hash key)
        {
            Stream s;

            if (idxInfo != null)
            {
                s = CDNIndex.OpenDataFile(idxInfo);
            }
            else
            {
                s = CDNIndex.OpenDataFileDirect(key);
            }

            BLTEStream blte;

            try
            {
                blte = new BLTEStream(s, key);
            }
            catch (BLTEDecoderException exc) when(exc.ErrorCode == 0)
            {
                CDNCache.Instance.InvalidateFile(idxInfo != null ? Config.Archives[idxInfo.Index] : key.ToHexString());
                return(OpenFileOnlineInternal(idxInfo, key));
            }

            return(blte);
        }
Пример #3
0
 protected Stream OpenFileOnlineInternal(IndexEntry idxInfo, MD5Hash key)
 {
     if (idxInfo != null)
     {
         Stream s = CDNIndex.OpenDataFile(idxInfo);
         return(new BLTEStream(s, key));
     }
     else
     {
         Stream s = CDNIndex.OpenDataFileDirect(key);
         return(new BLTEStream(s, key));
     }
 }