Commit 7b076faf authored by Marco De Marco's avatar Marco De Marco
Browse files

Basic file transfer works

parent e43331e5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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",
+5 −3
Original line number Diff line number Diff line
@@ -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);
}