Index: sources/update/IDataProvider.h =================================================================== diff -u -r20b370a54d2737831b307a0de82aec9e06e2b772 -r8ed1ad9f8c2de2ea19dd455cf59b648061c0a998 --- sources/update/IDataProvider.h (.../IDataProvider.h) (revision 20b370a54d2737831b307a0de82aec9e06e2b772) +++ sources/update/IDataProvider.h (.../IDataProvider.h) (revision 8ed1ad9f8c2de2ea19dd455cf59b648061c0a998) @@ -74,7 +74,12 @@ * * \return The amount of bytes fetched / ran out of data to fill the buffer. */ - virtual std::size_t read(std::size_t offset, unsigned char* pBuffer, std::size_t size_bytes) = 0; + virtual std::size_t read(std::size_t offset, unsigned char* pBuffer, std::size_t size_bytes) { + (void)offset; + (void)pBuffer; + (void)size_bytes; + return 0; // NOP. + } /*! * \brief Copy a file to a given destination. @@ -94,7 +99,7 @@ // Use our fileDestination set at constructor if we don't override. FILE* pDest = fopen( - destination.size() != 0 ? destination.c_str() : fileDestination.c_str(), + destination.size() != 0 ? destination.c_str() : fileDestination.c_str(), "wb"); std::size_t copied = 0; @@ -103,11 +108,11 @@ rv = true; while (rv) { try { - std::size_t sz_r = read(copied, pBuffer, MEMORY_PAGE_SIZE); + std::size_t sz_r = this->read(copied, pBuffer, MEMORY_PAGE_SIZE); if (sz_r == 0) { break; } else { - decrypt(pBuffer, sz_r); + //IDataProvider::decrypt(pBuffer, sz_r); std::size_t sz_w = fwrite(pBuffer, 1, sz_r, pDest); if (sz_w != sz_r) { rv = false; @@ -117,7 +122,7 @@ } catch (...) { rv = false; } - } + } // Close it. rv &= (fclose(pDest) == 0); @@ -143,7 +148,7 @@ * \param pBuffer Buffer to use. * \param size_bytes Max bytes to return. */ - void decrypt(unsigned char* pBuffer, std::size_t size_bytes) { + static void decrypt(unsigned char* pBuffer, std::size_t size_bytes) { const unsigned char obs = 71; // Randomly picked value. for (uint32 ii = 0; ii < size_bytes; ii++) { pBuffer[ii] -= obs;