tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

OutStreamWithCRC.cpp (427B)


      1 // OutStreamWithCRC.cpp
      2 
      3 #include "StdAfx.h"
      4 
      5 #include "OutStreamWithCRC.h"
      6 
      7 STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
      8 {
      9  HRESULT result = S_OK;
     10  if (_stream)
     11    result = _stream->Write(data, size, &size);
     12  if (_calculate)
     13    _crc = CrcUpdate(_crc, data, size);
     14  _size += size;
     15  if (processedSize != NULL)
     16    *processedSize = size;
     17  return result;
     18 }