Skip to content
Snippets Groups Projects
Commit 7b076faf authored by Marco De Marco's avatar Marco De Marco
Browse files

Basic file transfer works

parent e43331e5
No related branches found
No related tags found
No related merge requests found
......@@ -136,7 +136,8 @@ boost::posix_time::ptime DBManager::retrieveLastTimestamp()
std::tm tm_time;
*m_auxSession_sp << "select coalesce(last_timestamp,'1970-01-01 00:00:00')"
//FIXME: max return null, otherwise coalesce does not work
*m_auxSession_sp << "select coalesce(max(last_timestamp),'1970-01-01 00:00:00')"
<< " from "<< m_configuration_sp->getAuxDatabaseSchema()
<< "." << m_configuration_sp->getAuxDatabaseTimestampTable()
<< " where device_name like :deviceName",
......
......@@ -131,7 +131,7 @@ RequestSP ProtocolManager::createRequest() throw(std::runtime_error)
{
DEBUG_STREAM << "ProtocolManager::createNewFileRequest()" << endl;
if(hasNewFile())
if(!hasNewFile())
throw std::runtime_error("New file list is empty");
RequestSP request_sp(new Request);
......@@ -197,8 +197,10 @@ FileWrapper::SP ProtocolManager::processResponse(ResponseSP response_sp)
<< " transfer file " << fileName << " version "
<< fileVersion << " size " << fileSize << endl;
boost::filesystem::path path = composePath(m_configuration_sp->getStoragePath(),
filePath, fileVersion, fileName);
// boost::filesystem::path path = composePath(m_configuration_sp->getStoragePath(),
// filePath, fileVersion, fileName);
boost::filesystem::path path(fileName);
return FileWrapper::create(m_deviceImpl_p, path, fileSize);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment