Loading proto/Response.proto +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,5 +19,5 @@ message Response optional string file_path = 3; optional string file_path = 3; optional int32 file_version = 4; optional int32 file_version = 4; optional string file_name = 5; optional string file_name = 5; optional uint64 size = 6; optional uint64 file_size = 6; } } src/FileWrapper.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -61,17 +61,17 @@ bool FileWrapper::isBad() //============================================================================== //============================================================================== bool FileWrapper::isCompleted() bool FileWrapper::isCompleted() { { return m_inputFileStream.tellg() >= m_inputFileSize; return (boost::uint64_t)m_inputFileStream.tellg() >= m_inputFileSize; } } //============================================================================== //============================================================================== // FileWrapper::read() // FileWrapper::read() //============================================================================== //============================================================================== void FileWrapper::read(std::vector<char>& writeBuff) throw(std::runtime_error) void FileWrapper::read(std::vector<char>& writeBuff) { { int leftToRead = m_inputFileSize - m_inputFileStream.tellg(); boost::uint64_t leftToRead = m_inputFileSize - m_inputFileStream.tellg(); int bufferSize = 0; boost::uint64_t bufferSize = 0; if(leftToRead < BUFFER_SIZE) if(leftToRead < BUFFER_SIZE) bufferSize = leftToRead; bufferSize = leftToRead; Loading src/FileWrapper.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -49,20 +49,20 @@ public: virtual bool isCompleted(); virtual bool isCompleted(); virtual void read(std::vector<char>&) throw(std::runtime_error); virtual void read(std::vector<char>&); protected: protected: //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // [Protected] Class variables // [Protected] Class variables //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Input file size //Input file size int m_inputFileSize; boost::uint64_t m_inputFileSize; //Input file stream //Input file stream std::ifstream m_inputFileStream; std::ifstream m_inputFileStream; //Read buffer size //Read buffer size const int BUFFER_SIZE = 1024; const boost::uint64_t BUFFER_SIZE = 40960; }; }; } //End of namespace } //End of namespace Loading src/ProtocolManager.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -108,7 +108,7 @@ ResponseSP ProtocolManager::prepareResponse(RequestSP request_sp) response_sp->set_file_path(filePath); response_sp->set_file_path(filePath); response_sp->set_file_version(fileVersion); response_sp->set_file_version(fileVersion); response_sp->set_file_name(fileName); response_sp->set_file_name(fileName); response_sp->set_size(fileSize); response_sp->set_file_size(fileSize); } } else else { { Loading src/ProtocolManager.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -71,7 +71,7 @@ public: protected: protected: //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // [Protected] // [Protected] File path method //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ virtual boost::filesystem::path composePath(std::string, std::string, virtual boost::filesystem::path composePath(std::string, std::string, int, std::string); int, std::string); Loading Loading
proto/Response.proto +1 −1 Original line number Original line Diff line number Diff line Loading @@ -19,5 +19,5 @@ message Response optional string file_path = 3; optional string file_path = 3; optional int32 file_version = 4; optional int32 file_version = 4; optional string file_name = 5; optional string file_name = 5; optional uint64 size = 6; optional uint64 file_size = 6; } }
src/FileWrapper.cpp +4 −4 Original line number Original line Diff line number Diff line Loading @@ -61,17 +61,17 @@ bool FileWrapper::isBad() //============================================================================== //============================================================================== bool FileWrapper::isCompleted() bool FileWrapper::isCompleted() { { return m_inputFileStream.tellg() >= m_inputFileSize; return (boost::uint64_t)m_inputFileStream.tellg() >= m_inputFileSize; } } //============================================================================== //============================================================================== // FileWrapper::read() // FileWrapper::read() //============================================================================== //============================================================================== void FileWrapper::read(std::vector<char>& writeBuff) throw(std::runtime_error) void FileWrapper::read(std::vector<char>& writeBuff) { { int leftToRead = m_inputFileSize - m_inputFileStream.tellg(); boost::uint64_t leftToRead = m_inputFileSize - m_inputFileStream.tellg(); int bufferSize = 0; boost::uint64_t bufferSize = 0; if(leftToRead < BUFFER_SIZE) if(leftToRead < BUFFER_SIZE) bufferSize = leftToRead; bufferSize = leftToRead; Loading
src/FileWrapper.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -49,20 +49,20 @@ public: virtual bool isCompleted(); virtual bool isCompleted(); virtual void read(std::vector<char>&) throw(std::runtime_error); virtual void read(std::vector<char>&); protected: protected: //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // [Protected] Class variables // [Protected] Class variables //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Input file size //Input file size int m_inputFileSize; boost::uint64_t m_inputFileSize; //Input file stream //Input file stream std::ifstream m_inputFileStream; std::ifstream m_inputFileStream; //Read buffer size //Read buffer size const int BUFFER_SIZE = 1024; const boost::uint64_t BUFFER_SIZE = 40960; }; }; } //End of namespace } //End of namespace Loading
src/ProtocolManager.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -108,7 +108,7 @@ ResponseSP ProtocolManager::prepareResponse(RequestSP request_sp) response_sp->set_file_path(filePath); response_sp->set_file_path(filePath); response_sp->set_file_version(fileVersion); response_sp->set_file_version(fileVersion); response_sp->set_file_name(fileName); response_sp->set_file_name(fileName); response_sp->set_size(fileSize); response_sp->set_file_size(fileSize); } } else else { { Loading
src/ProtocolManager.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -71,7 +71,7 @@ public: protected: protected: //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // [Protected] // [Protected] File path method //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ virtual boost::filesystem::path composePath(std::string, std::string, virtual boost::filesystem::path composePath(std::string, std::string, int, std::string); int, std::string); Loading