Пример #1
0
        protected void FlushRemainingFragmentBuffer()
        {
            if (fragmentBuffer != null)
            {
                VariableSizedBufferPool.Resize(ref fragmentBuffer, fragmentBufferDataLength, false);

                AddStreamedFragment(fragmentBuffer);
                fragmentBuffer           = null;
                fragmentBufferDataLength = 0;
            }

#if !BESTHTTP_DISABLE_CACHING
            if (cacheStream != null)
            {
                cacheStream.Dispose();
                cacheStream = null;

                HTTPCacheService.SetBodyLength(baseRequest.CurrentUri, allFragmentSize);
            }
#endif
            var tmp = fragmentWaitEvent;
            fragmentWaitEvent = null;
            if (tmp != null)
            {
                (tmp as IDisposable).Dispose();
            }
        }
Пример #2
0
 protected void FlushRemainingFragmentBuffer()
 {
     if (fragmentBuffer != null)
     {
         Array.Resize(ref fragmentBuffer, fragmentBufferDataLength);
         AddStreamedFragment(fragmentBuffer);
         fragmentBuffer           = null;
         fragmentBufferDataLength = 0;
     }
     if (cacheStream != null)
     {
         cacheStream.Dispose();
         cacheStream = null;
         HTTPCacheService.SetBodyLength(baseRequest.CurrentUri, allFragmentSize);
     }
 }
Пример #3
0
 protected void FlushRemainingFragmentBuffer()
 {
     if (this.fragmentBuffer != null)
     {
         Array.Resize <byte>(ref this.fragmentBuffer, this.fragmentBufferDataLength);
         this.AddStreamedFragment(this.fragmentBuffer);
         this.fragmentBuffer           = null;
         this.fragmentBufferDataLength = 0;
     }
     if (this.cacheStream != null)
     {
         this.cacheStream.Dispose();
         this.cacheStream = null;
         HTTPCacheService.SetBodyLength(this.baseRequest.CurrentUri, this.allFragmentSize);
     }
 }
Пример #4
0
        protected void FlushRemainingFragmentBuffer()
        {
            if (fragmentBuffer != null)
            {
                AddStreamedFragment(fragmentBuffer, fragmentBufferDataLength);
                fragmentBuffer           = null;
                fragmentBufferDataLength = 0;
            }

#if !BESTHTTP_DISABLE_CACHING
            if (cacheStream != null)
            {
                cacheStream.Dispose();
                cacheStream = null;

                HTTPCacheService.SetBodyLength(baseRequest.CurrentUri, allFragmentSize);
            }
#endif
        }
Пример #5
0
        protected void FlushRemainingFragmentBuffer()
        {
            if (fragmentBuffer != null)
            {
                Array.Resize <byte>(ref fragmentBuffer, fragmentBufferDataLength);

                AddStreamedFragment(fragmentBuffer);
                fragmentBuffer           = null;
                fragmentBufferDataLength = 0;
            }

#if !BESTHTTP_DISABLE_CACHING && (!UNITY_WEBGL || UNITY_EDITOR)
            if (cacheStream != null)
            {
                cacheStream.Dispose();
                cacheStream = null;

                HTTPCacheService.SetBodyLength(baseRequest.CurrentUri, allFragmentSize);
            }
#endif
        }