From 81c2cef172941b72f9306dd19cb07f354c8bbbab Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 22 Feb 2014 15:22:42 +0100 Subject: [PATCH] Updated copyright notice --- AcceptThread.cpp | 2 +- Client.cpp | 46 +-- Condition_boost.cpp | 54 +-- DBSettingsReader.cpp | 36 +- Database.cpp | 2 +- FileSettingsReader.cpp | 36 +- LoadbalancerClient.cpp | 2 +- LookupService.cpp | 42 +-- MemoryPipe.cpp | 42 +-- MemorySettingsReader.cpp | 36 +- Mutex_boost.cpp | 36 +- OutputStream.cpp | 36 +- Query.cpp | 2 +- SQLiteFactory.cpp | 26 +- SelectThread.cpp | 36 +- Server.cpp | 116 +++---- ServerWin32.cpp | 2 +- ServiceAcceptor.cpp | 2 +- SessionMgr.cpp | 40 +-- SettingsReader.cpp | 42 +-- StreamPipe.cpp | 70 ++-- Table.cpp | 36 +- Template.cpp | 60 ++-- ThreadPool.cpp | 38 +-- WorkerThread.cpp | 2 +- common/data.cpp | 2 +- cryptoplugin/AESDecryption.cpp | 2 +- cryptoplugin/AESEncryption.cpp | 36 +- cryptoplugin/CryptoFactory.cpp | 2 +- cryptoplugin/dllmain.cpp | 44 +-- cryptoplugin/pluginmgr.cpp | 34 +- downloadplugin/DownloadFactory.cpp | 24 +- downloadplugin/DownloadThread.cpp | 36 +- downloadplugin/dllmain.cpp | 42 +-- downloadplugin/download2.cpp | 109 ++++--- downloadplugin/pluginmgr.cpp | 34 +- file_common.cpp | 38 +-- file_fstream.cpp | 2 +- file_linux.cpp | 2 +- file_memory.cpp | 2 +- file_win.cpp | 2 +- fileservplugin/CClientThread.cpp | 100 +++--- fileservplugin/CTCPFileServ.cpp | 22 +- fileservplugin/CUDPThread.cpp | 22 +- fileservplugin/CampusThread.cpp | 36 +- fileservplugin/CriticalSection.cpp | 2 +- fileservplugin/FileServ.cpp | 48 +-- fileservplugin/FileServFactory.cpp | 36 +- fileservplugin/bufmgr.cpp | 2 +- fileservplugin/dllmain.cpp | 2 +- fileservplugin/download.cpp | 38 +-- fileservplugin/log.cpp | 2 +- fileservplugin/main.cpp | 2 +- fileservplugin/map_buffer.cpp | 2 +- fileservplugin/pluginmgr.cpp | 34 +- fsimageplugin/FSImageFactory.cpp | 46 +-- fsimageplugin/dllmain.cpp | 60 ++-- fsimageplugin/filesystem.cpp | 48 +-- fsimageplugin/fs/ntfs.cpp | 50 +-- fsimageplugin/fs/unknown.cpp | 46 +-- fsimageplugin/pluginmgr.cpp | 34 +- fsimageplugin/vhdfile.cpp | 144 ++++---- httpserver/HTTPAction.cpp | 2 +- httpserver/HTTPClient.cpp | 2 +- httpserver/HTTPFile.cpp | 2 +- httpserver/HTTPProxy.cpp | 2 +- httpserver/HTTPService.cpp | 2 +- httpserver/IndexFiles.cpp | 36 +- httpserver/MIMEType.cpp | 36 +- httpserver/dllmain.cpp | 2 +- main.cpp | 254 +++++++-------- maintest.cpp | 36 +- stringtools.cpp | 126 +++---- urbackupclient/ChangeJournalWatcher.cpp | 36 +- urbackupclient/ClientSend.cpp | 36 +- urbackupclient/ClientService.cpp | 2 +- urbackupclient/DirectoryWatcherThread.cpp | 67 ++-- urbackupclient/ServerIdentityMgr.cpp | 162 ++++----- urbackupclient/client.cpp | 2 +- urbackupclient/clientdao.cpp | 2 +- urbackupclient/dllmain.cpp | 2 +- urbackupclient/watchdir/CriticalSection.cpp | 36 +- urbackupcommon/bufmgr.cpp | 2 +- urbackupcommon/escape.cpp | 36 +- urbackupcommon/fileclient/tcpstack.cpp | 62 ++-- urbackupcommon/json.cpp | 2 +- urbackupcommon/os_functions_win.cpp | 2 +- urbackupserver/fileclient/FileClient.cpp | 308 +++++++++--------- urbackupserver/server.cpp | 2 +- urbackupserver/server_channel.cpp | 38 +-- urbackupserver/server_cleanup.cpp | 298 ++++++++--------- urbackupserver/server_get.cpp | 2 +- urbackupserver/server_hash.cpp | 2 +- urbackupserver/server_image.cpp | 130 ++++---- urbackupserver/server_log.cpp | 36 +- urbackupserver/server_ping.cpp | 2 +- urbackupserver/server_prepare_hash.cpp | 56 ++-- urbackupserver/server_running.cpp | 2 +- urbackupserver/server_settings.cpp | 34 +- urbackupserver/server_status.cpp | 2 +- urbackupserver/server_update.cpp | 48 +-- urbackupserver/server_writer.cpp | 36 +- urbackupserver/serverinterface/backups.cpp | 34 +- urbackupserver/serverinterface/getimage.cpp | 2 +- urbackupserver/serverinterface/helper.cpp | 11 +- urbackupserver/serverinterface/lastacts.cpp | 36 +- urbackupserver/serverinterface/login.cpp | 36 +- urbackupserver/serverinterface/logs.cpp | 2 +- urbackupserver/serverinterface/piegraph.cpp | 36 +- urbackupserver/serverinterface/progress.cpp | 36 +- urbackupserver/serverinterface/salt.cpp | 36 +- urbackupserver/serverinterface/settings.cpp | 18 +- urbackupserver/serverinterface/shutdown.cpp | 2 +- urbackupserver/serverinterface/usage.cpp | 36 +- urbackupserver/serverinterface/usagegraph.cpp | 70 ++-- urbackupserver/serverinterface/users.cpp | 36 +- urbackupserver/treediff/TreeDiff.cpp | 32 +- urbackupserver/treediff/TreeNode.cpp | 32 +- urbackupserver/treediff/TreeReader.cpp | 34 +- urlplugin/dllmain.cpp | 36 +- urlplugin/pluginmgr.cpp | 32 +- 121 files changed, 2263 insertions(+), 2268 deletions(-) diff --git a/AcceptThread.cpp b/AcceptThread.cpp index 45ecc5cf..6ae7d158 100644 --- a/AcceptThread.cpp +++ b/AcceptThread.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Client.cpp b/Client.cpp index e4d1a24c..f05a841f 100644 --- a/Client.cpp +++ b/Client.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #include "Client.h" @@ -49,10 +49,10 @@ FCGIProtocolDriver * CClient::getFCGIProtocolDriver() { return driver; } - -#ifndef TCP_CORK -#define TCP_CORK TCP_NOPUSH -#endif + +#ifndef TCP_CORK +#define TCP_CORK TCP_NOPUSH +#endif void CClient::set(SOCKET ps, OutputCallback *poutput, FCGIProtocolDriver * pdriver ) { @@ -65,7 +65,7 @@ void CClient::set(SOCKET ps, OutputCallback *poutput, FCGIProtocolDriver * pdriv #ifdef _WIN32 flag=1; setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)); -#else +#else flag=0; setsockopt(s, IPPROTO_TCP, TCP_CORK, (char *) &flag, sizeof(int)); #endif diff --git a/Condition_boost.cpp b/Condition_boost.cpp index 960e7b29..22448645 100644 --- a/Condition_boost.cpp +++ b/Condition_boost.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,22 +16,22 @@ * along with this program. If not, see . **************************************************************************/ -#include "Condition_boost.h" -#include "Mutex_boost.h" -#include "Server.h" - -void CCondition::wait(IScopedLock *lock, int timems) -{ - boost::recursive_mutex::scoped_lock *tl=((CLock*)lock->getLock())->getLock(); - - if(timems<0) - cond.wait(*tl); - else - { - cond.timed_wait(*tl, getWaitTime(timems)); - } -} - +#include "Condition_boost.h" +#include "Mutex_boost.h" +#include "Server.h" + +void CCondition::wait(IScopedLock *lock, int timems) +{ + boost::recursive_mutex::scoped_lock *tl=((CLock*)lock->getLock())->getLock(); + + if(timems<0) + cond.wait(*tl); + else + { + cond.timed_wait(*tl, getWaitTime(timems)); + } +} + boost::xtime CCondition::getWaitTime(int timeoutms) { boost::xtime xt; @@ -43,14 +43,14 @@ boost::xtime CCondition::getWaitTime(int timeoutms) } xt.nsec+=timeoutms*1000000; return xt; -} - -void CCondition::notify_one(void) -{ - cond.notify_one(); -} - -void CCondition::notify_all(void) -{ - cond.notify_all(); +} + +void CCondition::notify_one(void) +{ + cond.notify_one(); +} + +void CCondition::notify_all(void) +{ + cond.notify_all(); } \ No newline at end of file diff --git a/DBSettingsReader.cpp b/DBSettingsReader.cpp index 0ba4ab97..db0ac0aa 100644 --- a/DBSettingsReader.cpp +++ b/DBSettingsReader.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "Interface/Types.h" #include "Interface/Database.h" diff --git a/Database.cpp b/Database.cpp index dbb9b317..d6852109 100644 --- a/Database.cpp +++ b/Database.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/FileSettingsReader.cpp b/FileSettingsReader.cpp index 21db5772..6e64f1a7 100644 --- a/FileSettingsReader.cpp +++ b/FileSettingsReader.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "FileSettingsReader.h" #include "stringtools.h" #include "Server.h" diff --git a/LoadbalancerClient.cpp b/LoadbalancerClient.cpp index 33a18b8b..07847c9f 100644 --- a/LoadbalancerClient.cpp +++ b/LoadbalancerClient.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/LookupService.cpp b/LookupService.cpp index af172fc8..d30717e6 100644 --- a/LookupService.cpp +++ b/LookupService.cpp @@ -1,26 +1,26 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "socket_header.h" #include -#ifndef _WIN32 -#include -#endif +#ifndef _WIN32 +#include +#endif bool LookupBlocking(std::string pServer, in_addr *dest) { diff --git a/MemoryPipe.cpp b/MemoryPipe.cpp index d0544819..74fa582f 100644 --- a/MemoryPipe.cpp +++ b/MemoryPipe.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,26 +197,26 @@ void CMemoryPipe::shutdown(void) { } -void CMemoryPipe::addThrottler(IPipeThrottler *throttler) -{ - -} - -void CMemoryPipe::addOutgoingThrottler(IPipeThrottler *throttler) -{ - -} - -void CMemoryPipe::addIncomingThrottler(IPipeThrottler *throttler) -{ - +void CMemoryPipe::addThrottler(IPipeThrottler *throttler) +{ + } -_i64 CMemoryPipe::getTransferedBytes(void) -{ - return 0; -} - -void CMemoryPipe::resetTransferedBytes(void) -{ +void CMemoryPipe::addOutgoingThrottler(IPipeThrottler *throttler) +{ + +} + +void CMemoryPipe::addIncomingThrottler(IPipeThrottler *throttler) +{ + +} + +_i64 CMemoryPipe::getTransferedBytes(void) +{ + return 0; +} + +void CMemoryPipe::resetTransferedBytes(void) +{ } \ No newline at end of file diff --git a/MemorySettingsReader.cpp b/MemorySettingsReader.cpp index 71b406a3..1b1fc0f8 100644 --- a/MemorySettingsReader.cpp +++ b/MemorySettingsReader.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "MemorySettingsReader.h" #include "Server.h" #include "stringtools.h" diff --git a/Mutex_boost.cpp b/Mutex_boost.cpp index 5744d24e..d4fa0f9f 100644 --- a/Mutex_boost.cpp +++ b/Mutex_boost.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "Mutex_boost.h" CMutex::CMutex(void) diff --git a/OutputStream.cpp b/OutputStream.cpp index 11b3e725..a8579be5 100644 --- a/OutputStream.cpp +++ b/OutputStream.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "OutputStream.h" #ifndef _WIN32 diff --git a/Query.cpp b/Query.cpp index 6b2aca71..0e9dcfd5 100644 --- a/Query.cpp +++ b/Query.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SQLiteFactory.cpp b/SQLiteFactory.cpp index fb8c150d..560dcbee 100644 --- a/SQLiteFactory.cpp +++ b/SQLiteFactory.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,16 +14,16 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . -**************************************************************************/ -#ifndef NO_SQLITE - -#include "SQLiteFactory.h" - -#include "Database.h" - -IDatabaseInt *SQLiteFactory::createDatabase(void) -{ - return new CDatabase; -} - +**************************************************************************/ +#ifndef NO_SQLITE + +#include "SQLiteFactory.h" + +#include "Database.h" + +IDatabaseInt *SQLiteFactory::createDatabase(void) +{ + return new CDatabase; +} + #endif \ No newline at end of file diff --git a/SelectThread.cpp b/SelectThread.cpp index 91f04b47..924b4afd 100644 --- a/SelectThread.cpp +++ b/SelectThread.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #include diff --git a/Server.cpp b/Server.cpp index b3f87e81..db3fed73 100644 --- a/Server.cpp +++ b/Server.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #ifdef _WIN32 #define _CRT_RAND_S @@ -23,7 +23,7 @@ #include #include -#include +#include #include #ifndef _WIN32 #include @@ -81,13 +81,13 @@ # include # include # include -# include -# include +# include +# include #endif -const size_t SEND_BLOCKSIZE=8192; -const size_t MAX_THREAD_ID=std::string::npos; - +const size_t SEND_BLOCKSIZE=8192; +const size_t MAX_THREAD_ID=std::string::npos; + extern bool run; CServer::CServer() @@ -136,7 +136,7 @@ void CServer::setup(void) void CServer::destroyAllDatabases(void) { - Log("Destroying all databases...", LL_DEBUG); + Log("Destroying all databases...", LL_DEBUG); IScopedLock lock(db_mutex); for(std::map::iterator i=databases.begin(); @@ -414,7 +414,7 @@ void CServer::Log( const std::wstring &pStr, int LogLevel) void CServer::setLogFile(const std::string &plf, std::string chown_user) { - IScopedLock lock(log_mutex); + IScopedLock lock(log_mutex); if(logfile_a) { logfile.close(); @@ -426,17 +426,17 @@ void CServer::setLogFile(const std::string &plf, std::string chown_user) #ifndef _WIN32 if(!chown_user.empty()) { - char buf[1000]; - passwd pwbuf; - passwd *pw; - int rc=getpwnam_r(chown_user.c_str(), &pwbuf, buf, 1000, &pw); - if(pw!=NULL) - { - chown(plf.c_str(), pw->pw_uid, pw->pw_gid); - } - else - { - Server->Log("Unable to change logfile ownership", LL_ERROR); + char buf[1000]; + passwd pwbuf; + passwd *pw; + int rc=getpwnam_r(chown_user.c_str(), &pwbuf, buf, 1000, &pw); + if(pw!=NULL) + { + chown(plf.c_str(), pw->pw_uid, pw->pw_gid); + } + else + { + Server->Log("Unable to change logfile ownership", LL_ERROR); } } #endif @@ -812,8 +812,8 @@ IDatabase* CServer::getDatabase(THREAD_ID tid, DATABASE_ID pIdentifier) Log("Database \""+database_iter->second.file+"\" couldn't be opened", LL_ERROR); return NULL; } - - Log("Created new database connection for "+database_iter->second.file, LL_DEBUG); + + Log("Created new database connection for "+database_iter->second.file, LL_DEBUG); database_iter->second.tmap.insert( std::pair< THREAD_ID, IDatabaseInt* >( tid, db ) ); @@ -967,10 +967,10 @@ IPipe* CServer::ConnectStream(std::string pServer, unsigned short pPort, unsigne server.sin_family=AF_INET; SOCKET s=socket(AF_INET, SOCK_STREAM, 0); - if(s==SOCKET_ERROR) - { - return NULL; - } + if(s==SOCKET_ERROR) + { + return NULL; + } #ifdef _WIN32 u_long nonBlocking=1; @@ -1247,7 +1247,7 @@ void CServer::createThread(IThread *thread) #endif pthread_t t; - pthread_create(&t, &attr, &thread_helper_f, (void*)thread); + pthread_create(&t, &attr, &thread_helper_f, (void*)thread); pthread_detach(t); pthread_attr_destroy(&attr); @@ -1607,19 +1607,19 @@ void CServer::startupComplete(void) IPipeThrottler* CServer::createPipeThrottler(size_t bps) { return new PipeThrottler(bps); -} - - -void CServer::shutdown(void) -{ - run=false; -} - -void CServer::initRandom(unsigned int seed) -{ - init_genrand(seed); -} - +} + + +void CServer::shutdown(void) +{ + run=false; +} + +void CServer::initRandom(unsigned int seed) +{ + init_genrand(seed); +} + unsigned int CServer::getRandomNumber(void) { IScopedLock lock(rnd_mutex); @@ -1767,7 +1767,7 @@ void CServer::setLogCircularBufferSize(size_t size) has_circular_log_buffer=size>0?true:false; } -std::vector CServer::getCicularLogBuffer( size_t minid ) +std::vector CServer::getCicularLogBuffer( size_t minid ) { IScopedLock lock(log_mutex); diff --git a/ServerWin32.cpp b/ServerWin32.cpp index 4650fafd..a4ab3464 100644 --- a/ServerWin32.cpp +++ b/ServerWin32.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/ServiceAcceptor.cpp b/ServiceAcceptor.cpp index f8bd9a00..aee1beba 100644 --- a/ServiceAcceptor.cpp +++ b/ServiceAcceptor.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/SessionMgr.cpp b/SessionMgr.cpp index a691e095..490aa20c 100644 --- a/SessionMgr.cpp +++ b/SessionMgr.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #include #include "SessionMgr.h" @@ -180,7 +180,7 @@ bool CSessionMgr::RemoveSession(const std::wstring &pSID) { iter->second->Remove(); } - + delete i->second; mSessions.erase(i); return true; @@ -225,4 +225,4 @@ void CSessionMgr::operator()(void) } IScopedLock slock(stop_mutex); stop_cond->notify_one(); -} +} diff --git a/SettingsReader.cpp b/SettingsReader.cpp index 925d6b5b..a621d515 100644 --- a/SettingsReader.cpp +++ b/SettingsReader.cpp @@ -1,26 +1,26 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "SettingsReader.h" #include "stringtools.h" -#ifndef _WIN32 -#include -#endif +#ifndef _WIN32 +#include +#endif std::string CSettingsReader::getValue(std::string key,std::string def) { diff --git a/StreamPipe.cpp b/StreamPipe.cpp index 95cb1557..847fe708 100644 --- a/StreamPipe.cpp +++ b/StreamPipe.cpp @@ -1,30 +1,30 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifdef _WIN32 #include #endif #include "StreamPipe.h" -#ifndef _WIN32 -#include -#endif -#include "Server.h" -#include "Interface/PipeThrottler.h" +#ifndef _WIN32 +#include +#endif +#include "Server.h" +#include "Interface/PipeThrottler.h" CStreamPipe::CStreamPipe( SOCKET pSocket) : transfered_bytes(0) @@ -104,20 +104,20 @@ size_t CStreamPipe::Read(char *buffer, size_t bsize, int timeoutms) if( rc>0 ) { rc=recv(s, buffer, (int)bsize, MSG_NOSIGNAL); - if(rc<=0) - { - has_error=true; - return 0; - } + if(rc<=0) + { + has_error=true; + return 0; + } } if( rc>0 ) return rc; else { - if(rc<0) - { + if(rc<0) + { has_error=true; - } + } return 0; } } @@ -172,10 +172,10 @@ size_t CStreamPipe::Read(std::string *ret, int timeoutms) ret->resize(l); memcpy((char*)ret->c_str(), buffer, l); } - else - { - return 0; - } + else + { + return 0; + } return l; } diff --git a/Table.cpp b/Table.cpp index 5b6257d4..1d2f6d9e 100644 --- a/Table.cpp +++ b/Table.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "Table.h" CRATable::~CRATable() diff --git a/Template.cpp b/Template.cpp index 1b19398c..f1deeb80 100644 --- a/Template.cpp +++ b/Template.cpp @@ -1,27 +1,27 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #include "Template.h" #include "stringtools.h" #include "Table.h" #include "utf8/utf8.h" -#include "Server.h" +#include "Server.h" #include "Interface/Database.h" @@ -199,18 +199,18 @@ std::string CTemplate::getData(void) std::wstring output=data; transform(output); std::string ret; - try - { - if( sizeof(wchar_t)==2 ) + try + { + if( sizeof(wchar_t)==2 ) utf8::utf16to8(output.begin(), output.end(), back_inserter(ret) ); - else - utf8::utf32to8(output.begin(), output.end(), back_inserter(ret) ); - } - catch(...) - { - Server->Log("Invalid UTF8!", LL_ERROR); - } - + else + utf8::utf32to8(output.begin(), output.end(), back_inserter(ret) ); + } + catch(...) + { + Server->Log("Invalid UTF8!", LL_ERROR); + } + return ret; } diff --git a/ThreadPool.cpp b/ThreadPool.cpp index a29c97c9..73a432be 100644 --- a/ThreadPool.cpp +++ b/ThreadPool.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "Interface/Thread.h" #include "ThreadPool.h" @@ -115,7 +115,7 @@ CThreadPool::~CThreadPool() } void CThreadPool::Shutdown(void) -{ +{ bool do_leak_check=(Server->getServerParameter("leak_check")=="true"); IScopedLock lock(mutex); for(size_t i=0;i. -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "AESEncryption.h" #include "../Interface/Server.h" diff --git a/cryptoplugin/CryptoFactory.cpp b/cryptoplugin/CryptoFactory.cpp index 97d2ecf2..d5e5949c 100644 --- a/cryptoplugin/CryptoFactory.cpp +++ b/cryptoplugin/CryptoFactory.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/cryptoplugin/dllmain.cpp b/cryptoplugin/dllmain.cpp index 22bc6395..fd3b979e 100644 --- a/cryptoplugin/dllmain.cpp +++ b/cryptoplugin/dllmain.cpp @@ -1,28 +1,28 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../vld.h" #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec (dllexport) #else #define DLLEXPORT extern "C" -#define _exit exit -#include +#define _exit exit +#include #endif @@ -108,5 +108,5 @@ DLLEXPORT void LoadActions(IServer* pServer) DLLEXPORT void UnloadActions(void) { -} - +} + diff --git a/cryptoplugin/pluginmgr.cpp b/cryptoplugin/pluginmgr.cpp index f19779c1..594ce8e5 100644 --- a/cryptoplugin/pluginmgr.cpp +++ b/cryptoplugin/pluginmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,19 +16,19 @@ * along with this program. If not, see . **************************************************************************/ -#include "../vld.h" -#include "pluginmgr.h" -#include "CryptoFactory.h" -#include "../stringtools.h" - -IPlugin *CCryptoPluginMgr::createPluginInstance(str_map ¶ms) -{ - return new CryptoFactory(); -} - -void CCryptoPluginMgr::destroyPluginInstance(IPlugin *plugin) -{ - CryptoFactory *s=(CryptoFactory*)plugin; - delete s; -} - +#include "../vld.h" +#include "pluginmgr.h" +#include "CryptoFactory.h" +#include "../stringtools.h" + +IPlugin *CCryptoPluginMgr::createPluginInstance(str_map ¶ms) +{ + return new CryptoFactory(); +} + +void CCryptoPluginMgr::destroyPluginInstance(IPlugin *plugin) +{ + CryptoFactory *s=(CryptoFactory*)plugin; + delete s; +} + diff --git a/downloadplugin/DownloadFactory.cpp b/downloadplugin/DownloadFactory.cpp index 276e9cfc..7247241c 100644 --- a/downloadplugin/DownloadFactory.cpp +++ b/downloadplugin/DownloadFactory.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,15 +16,15 @@ * along with this program. If not, see . **************************************************************************/ -#include "DownloadFactory.h" -#include "download2.h" - -IFileDownload* DownloadFactory::createFileDownload(void) -{ - return new CFileDownload(); -} - -void DownloadFactory::destroyFileDownload(IFileDownload* dl) -{ - delete ((CFileDownload*)dl); +#include "DownloadFactory.h" +#include "download2.h" + +IFileDownload* DownloadFactory::createFileDownload(void) +{ + return new CFileDownload(); +} + +void DownloadFactory::destroyFileDownload(IFileDownload* dl) +{ + delete ((CFileDownload*)dl); } \ No newline at end of file diff --git a/downloadplugin/DownloadThread.cpp b/downloadplugin/DownloadThread.cpp index 09092ca3..af06bb84 100644 --- a/downloadplugin/DownloadThread.cpp +++ b/downloadplugin/DownloadThread.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + //--------------------------------------------------------------------------- #include "DownloadThread.h" diff --git a/downloadplugin/dllmain.cpp b/downloadplugin/dllmain.cpp index f27fa9e2..8a7503c4 100644 --- a/downloadplugin/dllmain.cpp +++ b/downloadplugin/dllmain.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../vld.h" #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec (dllexport) @@ -30,11 +30,11 @@ IServer *Server; #include "../Interface/Action.h" #include "../Interface/File.h" #include "../stringtools.h" - -#include + +#include #include "pluginmgr.h" - + CDownloadPluginMgr *downloadpluginmgr; DLLEXPORT void LoadActions(IServer* pServer) diff --git a/downloadplugin/download2.cpp b/downloadplugin/download2.cpp index 52f50d4e..15d47707 100644 --- a/downloadplugin/download2.cpp +++ b/downloadplugin/download2.cpp @@ -1,38 +1,38 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "socket_header.h" #include "DownloadThread.h" #include "../Interface/Server.h" #include -#include +#include #include "../stringtools.h" -#include +#include using namespace std; in_addr getIP(std::string ip); #define BUFFERSIZE 32768 -#ifndef _WIN32 -#define _unlink unlink -#endif - +#ifndef _WIN32 +#define _unlink unlink +#endif + in_addr getIP(string ip) { const char* host=ip.c_str(); @@ -92,7 +92,7 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std if(pos>2) site+=url[i]; } -#ifdef _WIN32 +#ifdef _WIN32 WSADATA wsa; int rc = WSAStartup(MAKEWORD(2, 0), &wsa); if(rc == SOCKET_ERROR) @@ -103,9 +103,9 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std pipe->Write(wd.getDataPtr(), wd.getDataSize()); return false; } -#else - int rc; -#endif +#else + int rc; +#endif Cs=(int)socket(AF_INET,SOCK_STREAM,0); @@ -131,13 +131,13 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std addr.sin_addr=getIP(proxy); } -#ifdef _WIN32 +#ifdef _WIN32 u_long nonBlocking=1; ioctlsocket(Cs,FIONBIO,&nonBlocking); -#else - int flags=fcntl(Cs,F_GETFL,0); - fcntl(Cs, F_SETFL, flags|O_NONBLOCK); -#endif +#else + int flags=fcntl(Cs,F_GETFL,0); + fcntl(Cs, F_SETFL, flags|O_NONBLOCK); +#endif int error; connect(Cs,(sockaddr*)&addr,sizeof(sockaddr)); @@ -220,10 +220,10 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std bool chunked=false; int chunksize=-1; bool exit=false; - -#ifndef _WIN32 - conn[0].events=POLLIN; -#endif + +#ifndef _WIN32 + conn[0].events=POLLIN; +#endif while(bytes>0 && exit==false) { @@ -307,9 +307,9 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std { out.write(&tmpbuf[4+csize2.size()], tmpbuf.size()-4-csize2.size()); out.flush(); - chunksize-=tmpbuf.size()-4-csize2.size(); + chunksize-=tmpbuf.size()-4-csize2.size(); totalbytes+=(int)(tmpbuf.size()-4-csize2.size()); - tmpbuf.clear(); + tmpbuf.clear(); } } } @@ -386,7 +386,7 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std if( csize1!="" ) { chunksize=hexToULong((char*)csize1.c_str() ); - chunksize=(std::max)(-1, (std::min)(1048576,chunksize) ); + chunksize=(std::max)(-1, (std::min)(1048576,chunksize) ); } offadd+=csize1.size()+2; } @@ -409,7 +409,7 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std if( ncsize!="" ) { chunksize=hexToULong((char*)ncsize.c_str() ); - chunksize=(std::max)(-1, (std::min)(1048576,chunksize) ); + chunksize=(std::max)(-1, (std::min)(1048576,chunksize) ); off=4+ncsize.size(); offadd=0; } @@ -423,9 +423,10 @@ bool DownloadfileThreaded(std::string url,std::string filename, IPipe *pipe, std { out.write(&tmpbuf[off+offadd], tmpbuf.size()-off-offadd ); out.flush(); - chunksize-=tmpbuf.size()-off-offadd; + chunksize-=tmpbuf.size()-off-offadd; totalbytes+=(int)(tmpbuf.size()-off-offadd); - tmpbuf.clear(); + tmpbuf.clear(); + } else if( chunksize==0 ) { @@ -543,14 +544,14 @@ uchar CFileDownload::download(int wait) { CRData rd(data.c_str(), data.size()); rd.getUChar(&id); - err1=id; + err1=id; switch(id) { case DL2_ERROR: { uchar eid; rd.getUChar(&eid); - err2=eid; + err2=eid; if( eid==DL2_ERR_TIMEOUT ) { @@ -569,7 +570,7 @@ uchar CFileDownload::download(int wait) { uchar iid; rd.getUChar(&iid); - err2=iid; + err2=iid; if( iid==DL2_INFO_DOWNLOADING ) { @@ -581,7 +582,7 @@ uchar CFileDownload::download(int wait) { uchar b; rd.getUChar(&b); - err2=b; + err2=b; if( b==0 ) return FD_ERR_ERROR; @@ -637,13 +638,13 @@ std::string CFileDownload::getErrorString(uchar err) ERR2STR(ERROR); ERR2STR(CONTENT_LENGTH); ERR2STR(QUEUE_ITEMS); - - if(err1==DL2_ERROR && err2==DL2_ERR_COULDNOTOPENFILE ) - { - errmsg+=" Could not open destination file. Check rights please. Filename="+filename; - } - - errmsg+=" ("+nconvert(err1)+", "+nconvert(err2)+") url="+url; + + if(err1==DL2_ERROR && err2==DL2_ERR_COULDNOTOPENFILE ) + { + errmsg+=" Could not open destination file. Check rights please. Filename="+filename; + } + + errmsg+=" ("+nconvert(err1)+", "+nconvert(err2)+") url="+url; return errmsg; } \ No newline at end of file diff --git a/downloadplugin/pluginmgr.cpp b/downloadplugin/pluginmgr.cpp index d7b83d80..4996de51 100644 --- a/downloadplugin/pluginmgr.cpp +++ b/downloadplugin/pluginmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,19 +16,19 @@ * along with this program. If not, see . **************************************************************************/ -#include "../vld.h" -#include "pluginmgr.h" -#include "DownloadFactory.h" -#include "../stringtools.h" - -IPlugin *CDownloadPluginMgr::createPluginInstance(str_map ¶ms) -{ - return new DownloadFactory(); -} - -void CDownloadPluginMgr::destroyPluginInstance(IPlugin *plugin) -{ - DownloadFactory *s=(DownloadFactory*)plugin; - delete s; -} - +#include "../vld.h" +#include "pluginmgr.h" +#include "DownloadFactory.h" +#include "../stringtools.h" + +IPlugin *CDownloadPluginMgr::createPluginInstance(str_map ¶ms) +{ + return new DownloadFactory(); +} + +void CDownloadPluginMgr::destroyPluginInstance(IPlugin *plugin) +{ + DownloadFactory *s=(DownloadFactory*)plugin; + delete s; +} + diff --git a/file_common.cpp b/file_common.cpp index d1695b73..155ccb5c 100644 --- a/file_common.cpp +++ b/file_common.cpp @@ -1,22 +1,22 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - -#include "Server.h" +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + +#include "Server.h" #include "file.h" #include "stringtools.h" diff --git a/file_fstream.cpp b/file_fstream.cpp index ce698d21..3ea7659c 100644 --- a/file_fstream.cpp +++ b/file_fstream.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/file_linux.cpp b/file_linux.cpp index d37588d3..06191e32 100644 --- a/file_linux.cpp +++ b/file_linux.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/file_memory.cpp b/file_memory.cpp index b461b4a4..99c20c8a 100644 --- a/file_memory.cpp +++ b/file_memory.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/file_win.cpp b/file_win.cpp index dbbe002d..2562ed79 100644 --- a/file_win.cpp +++ b/file_win.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/CClientThread.cpp b/fileservplugin/CClientThread.cpp index 7b1692b3..3ae198b4 100644 --- a/fileservplugin/CClientThread.cpp +++ b/fileservplugin/CClientThread.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,40 +44,40 @@ CriticalSection cs; int curr_tid=0; #ifdef _WIN32 -bool isDirectory(const std::wstring &path) -{ - DWORD attrib = GetFileAttributesW(path.c_str()); - - if ( attrib == 0xFFFFFFFF || !(attrib & FILE_ATTRIBUTE_DIRECTORY) ) - { - return false; - } - else - { - return true; - } +bool isDirectory(const std::wstring &path) +{ + DWORD attrib = GetFileAttributesW(path.c_str()); + + if ( attrib == 0xFFFFFFFF || !(attrib & FILE_ATTRIBUTE_DIRECTORY) ) + { + return false; + } + else + { + return true; + } } #else -#include -#include +#include +#include #include -bool isDirectory(const std::wstring &path) -{ - struct stat64 f_info; - int rc=stat64(Server->ConvertToUTF8(path).c_str(), &f_info); - if(rc!=0) - { - return false; - } - - if ( S_ISDIR(f_info.st_mode) ) - { - return true; - } - else - { - return false; - } +bool isDirectory(const std::wstring &path) +{ + struct stat64 f_info; + int rc=stat64(Server->ConvertToUTF8(path).c_str(), &f_info); + if(rc!=0) + { + return false; + } + + if ( S_ISDIR(f_info.st_mode) ) + { + return true; + } + else + { + return false; + } } #endif @@ -421,15 +421,15 @@ bool CClientThread::ProcessPacket(CRData *data) } #ifdef _WIN32 - if(filename.size()>=2 && filename[0]=='\\' && filename[1]=='\\' ) - { - if(filename.size()<3 || filename[2]!='?') - { - filename=L"\\\\?\\UNC"+filename.substr(1); - } - } - else - { + if(filename.size()>=2 && filename[0]=='\\' && filename[1]=='\\' ) + { + if(filename.size()<3 || filename[2]!='?') + { + filename=L"\\\\?\\UNC"+filename.substr(1); + } + } + else + { filename = L"\\\\?\\"+filename; } @@ -1098,15 +1098,15 @@ bool CClientThread::GetFileBlockdiff(CRData *data) hash_func.init(); #ifdef _WIN32 - if(filename.size()>=2 && filename[0]=='\\' && filename[1]=='\\' ) - { - if(filename.size()<3 || filename[2]!='?') - { - filename=L"\\\\?\\UNC"+filename.substr(1); - } - } - else - { + if(filename.size()>=2 && filename[0]=='\\' && filename[1]=='\\' ) + { + if(filename.size()<3 || filename[2]!='?') + { + filename=L"\\\\?\\UNC"+filename.substr(1); + } + } + else + { filename = L"\\\\?\\"+filename; } #endif diff --git a/fileservplugin/CTCPFileServ.cpp b/fileservplugin/CTCPFileServ.cpp index 0f725641..c67aed97 100644 --- a/fileservplugin/CTCPFileServ.cpp +++ b/fileservplugin/CTCPFileServ.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -136,12 +136,12 @@ bool CTCPFileServ::Start(_u16 tcpport,_u16 udpport, std::string pServername) getsockopt(mSocket, SOL_SOCKET, SO_SNDBUF,(char *) &window_size, &window_size_len ); Log("Info: Window size="+nconvert(window_size)); #endif - int optval=1; - rc=setsockopt(mSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(int)); - if(rc==SOCKET_ERROR) - { - Log("Failed setting SO_REUSEADDR in CTCPFileServ::Start", LL_ERROR); - return false; + int optval=1; + rc=setsockopt(mSocket, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(int)); + if(rc==SOCKET_ERROR) + { + Log("Failed setting SO_REUSEADDR in CTCPFileServ::Start", LL_ERROR); + return false; } sockaddr_in addr; @@ -218,10 +218,10 @@ bool CTCPFileServ::TcpStep(void) lon.tv_usec=0; _i32 rc = select((int)mSocket+1, &fdset, 0, 0, &lon); #else - pollfd conn[1]; - conn[0].fd=mSocket; - conn[0].events=POLLIN; - conn[0].revents=0; + pollfd conn[1]; + conn[0].fd=mSocket; + conn[0].events=POLLIN; + conn[0].revents=0; int rc = poll(conn, 1, REFRESH_SECONDS*1000); #endif diff --git a/fileservplugin/CUDPThread.cpp b/fileservplugin/CUDPThread.cpp index 95be48a7..cc7a2682 100644 --- a/fileservplugin/CUDPThread.cpp +++ b/fileservplugin/CUDPThread.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -66,12 +66,12 @@ CUDPThread::CUDPThread(_u16 udpport,std::string servername) { udpsock=socket(AF_INET,SOCK_DGRAM,0); - int optval=1; - int rc=setsockopt(udpsock, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(int)); - if(rc==SOCKET_ERROR) - { - Log("Failed setting SO_REUSEADDR in CUDPThread::CUDPThread", LL_ERROR); - return; + int optval=1; + int rc=setsockopt(udpsock, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(int)); + if(rc==SOCKET_ERROR) + { + Log("Failed setting SO_REUSEADDR in CUDPThread::CUDPThread", LL_ERROR); + return; } sockaddr_in addr_udp; @@ -172,10 +172,10 @@ bool CUDPThread::UdpStep(void) lon.tv_sec=60; rc=select((int)udpsock+1, &fdset, 0, 0, &lon); #else - pollfd conn[1]; - conn[0].fd=udpsock; - conn[0].events=POLLIN; - conn[0].revents=0; + pollfd conn[1]; + conn[0].fd=udpsock; + conn[0].events=POLLIN; + conn[0].revents=0; rc = poll(conn, 1, 60*1000); #endif } diff --git a/fileservplugin/CampusThread.cpp b/fileservplugin/CampusThread.cpp index 9f2baa2e..08251634 100644 --- a/fileservplugin/CampusThread.cpp +++ b/fileservplugin/CampusThread.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "settings.h" #ifdef CAMPUS diff --git a/fileservplugin/CriticalSection.cpp b/fileservplugin/CriticalSection.cpp index 3c56101b..9e802671 100644 --- a/fileservplugin/CriticalSection.cpp +++ b/fileservplugin/CriticalSection.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/FileServ.cpp b/fileservplugin/FileServ.cpp index 921b3123..213c618e 100644 --- a/fileservplugin/FileServ.cpp +++ b/fileservplugin/FileServ.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "FileServ.h" #include "map_buffer.h" #include "../stringtools.h" @@ -74,11 +74,11 @@ void FileServ::addIdentity(const std::string &pIdentity) void FileServ::init_mutex(void) { mutex=Server->createMutex(); -} - -void FileServ::destroy_mutex(void) -{ - Server->destroy(mutex); +} + +void FileServ::destroy_mutex(void) +{ + Server->destroy(mutex); } bool FileServ::checkIdentity(const std::string &pIdentity) @@ -118,4 +118,4 @@ void FileServ::runClient(IPipe *cp) { CClientThread cc(cp, NULL); cc(); -} +} diff --git a/fileservplugin/FileServFactory.cpp b/fileservplugin/FileServFactory.cpp index 35e90e56..dd859927 100644 --- a/fileservplugin/FileServFactory.cpp +++ b/fileservplugin/FileServFactory.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "FileServFactory.h" #include "../Interface/Thread.h" #include "../Interface/Server.h" diff --git a/fileservplugin/bufmgr.cpp b/fileservplugin/bufmgr.cpp index a804b0fe..8ad174b1 100644 --- a/fileservplugin/bufmgr.cpp +++ b/fileservplugin/bufmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/dllmain.cpp b/fileservplugin/dllmain.cpp index 9b21afb7..bb481c50 100644 --- a/fileservplugin/dllmain.cpp +++ b/fileservplugin/dllmain.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/download.cpp b/fileservplugin/download.cpp index 5f1fae54..ec418910 100644 --- a/fileservplugin/download.cpp +++ b/fileservplugin/download.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "settings.h" #ifdef CAMPUS @@ -31,7 +31,7 @@ #include #include #include - #include + #include #define SOCKET_ERROR -1 #define closesocket close #endif diff --git a/fileservplugin/log.cpp b/fileservplugin/log.cpp index 218ca089..d03a62d2 100644 --- a/fileservplugin/log.cpp +++ b/fileservplugin/log.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/main.cpp b/fileservplugin/main.cpp index 7bfaf393..b4287153 100644 --- a/fileservplugin/main.cpp +++ b/fileservplugin/main.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/map_buffer.cpp b/fileservplugin/map_buffer.cpp index de3b15e2..570a690d 100644 --- a/fileservplugin/map_buffer.cpp +++ b/fileservplugin/map_buffer.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fileservplugin/pluginmgr.cpp b/fileservplugin/pluginmgr.cpp index 341b50f1..de16a313 100644 --- a/fileservplugin/pluginmgr.cpp +++ b/fileservplugin/pluginmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,19 +16,19 @@ * along with this program. If not, see . **************************************************************************/ -#include "../vld.h" -#include "FileServFactory.h" -#include "pluginmgr.h" -#include "../stringtools.h" - -IPlugin *CFileServPluginMgr::createPluginInstance(str_map ¶ms) -{ - return new FileServFactory(); -} - -void CFileServPluginMgr::destroyPluginInstance(IPlugin *plugin) -{ - FileServFactory *s=(FileServFactory*)plugin; - delete s; -} - +#include "../vld.h" +#include "FileServFactory.h" +#include "pluginmgr.h" +#include "../stringtools.h" + +IPlugin *CFileServPluginMgr::createPluginInstance(str_map ¶ms) +{ + return new FileServFactory(); +} + +void CFileServPluginMgr::destroyPluginInstance(IPlugin *plugin) +{ + FileServFactory *s=(FileServFactory*)plugin; + delete s; +} + diff --git a/fsimageplugin/FSImageFactory.cpp b/fsimageplugin/FSImageFactory.cpp index 90793984..e68d95f5 100644 --- a/fsimageplugin/FSImageFactory.cpp +++ b/fsimageplugin/FSImageFactory.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "FSImageFactory.h" #include "../Interface/Server.h" #include "../Interface/File.h" @@ -28,11 +28,11 @@ #include "fs/unknown.h" #include "vhdfile.h" #include "../stringtools.h" -#ifdef _WIN32 -#include -#else -#include -#endif +#ifdef _WIN32 +#include +#else +#include +#endif void PrintInfo(IFilesystem *fs) diff --git a/fsimageplugin/dllmain.cpp b/fsimageplugin/dllmain.cpp index 7a53fe7e..22b32288 100644 --- a/fsimageplugin/dllmain.cpp +++ b/fsimageplugin/dllmain.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../vld.h" #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec (dllexport) @@ -24,7 +24,7 @@ #endif #include -#include +#include #define DEF_SERVER #include "../Interface/Server.h" @@ -33,7 +33,7 @@ IServer *Server; #include "../Interface/Action.h" #include "../Interface/File.h" #include "../stringtools.h" -#include "../urbackupcommon/sha2/sha2.h" +#include "../urbackupcommon/sha2/sha2.h" #include @@ -220,7 +220,7 @@ DLLEXPORT void LoadActions(IServer* pServer) std::string vhdinfo=Server->getServerParameter("vhdinfo"); if(!vhdinfo.empty()) { - std::cout << "--VHDINFO--" << std::endl; + std::cout << "--VHDINFO--" << std::endl; VHDFile in(Server->ConvertToUnicode(vhdinfo), true,0); if(in.isOpen()==false) { @@ -248,7 +248,7 @@ DLLEXPORT void LoadActions(IServer* pServer) } std::cout << "Blocks: " << new_blocks << "/" << total_blocks << std::endl; - exit(3); + exit(3); } std::string vhd_verify=Server->getServerParameter("vhd_verify"); @@ -304,7 +304,7 @@ DLLEXPORT void LoadActions(IServer* pServer) bool has_dig_z=false; for(;currposRead((char*)dig_f, 32); - if( dr!=32 ) - { - Server->Log("Could not read hash from file", LL_ERROR); - } + if( dr!=32 ) + { + Server->Log("Could not read hash from file", LL_ERROR); + } sha256_final(&ctx, dig_r); sha256_init(&ctx); } @@ -437,9 +437,9 @@ DLLEXPORT void LoadActions(IServer* pServer) unsigned char dig_f[32]; _u32 dr=hashfile->Read((char*)dig_f, 32); - if( dr!=32 ) - { - Server->Log("Could not read hash from file", LL_ERROR); + if( dr!=32 ) + { + Server->Log("Could not read hash from file", LL_ERROR); } sha256_final(&ctx, dig_r); diff --git a/fsimageplugin/filesystem.cpp b/fsimageplugin/filesystem.cpp index b62b4ef5..53839bd5 100644 --- a/fsimageplugin/filesystem.cpp +++ b/fsimageplugin/filesystem.cpp @@ -1,31 +1,31 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "filesystem.h" #include "../Interface/Server.h" #include "../Interface/File.h" #include "../stringtools.h" -#include -#ifdef _WIN32 -#include -#else -#include -#endif +#include +#ifdef _WIN32 +#include +#else +#include +#endif Filesystem::Filesystem(const std::wstring &pDev) { diff --git a/fsimageplugin/fs/ntfs.cpp b/fsimageplugin/fs/ntfs.cpp index 554f2cf6..b8c0afa5 100644 --- a/fsimageplugin/fs/ntfs.cpp +++ b/fsimageplugin/fs/ntfs.cpp @@ -1,32 +1,32 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../../Interface/Server.h" #include "../../stringtools.h" #include "ntfs.h" #include -#include - -#ifndef _WIN32 -#define UD_UINT64 0xFFFFFFFFFFFFFFFFULL -#else -#define UD_UINT64 0xFFFFFFFFFFFFFFFF -#endif +#include + +#ifndef _WIN32 +#define UD_UINT64 0xFFFFFFFFFFFFFFFFULL +#else +#define UD_UINT64 0xFFFFFFFFFFFFFFFF +#endif class MemFree { diff --git a/fsimageplugin/fs/unknown.cpp b/fsimageplugin/fs/unknown.cpp index 26188cd8..2a8b3c6d 100644 --- a/fsimageplugin/fs/unknown.cpp +++ b/fsimageplugin/fs/unknown.cpp @@ -1,28 +1,28 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "unknown.h" #include "../../Interface/Server.h" -#include - -#ifdef _WIN32 -#include -#endif +#include + +#ifdef _WIN32 +#include +#endif #define DEF_BLOCKSIZE 4096 diff --git a/fsimageplugin/pluginmgr.cpp b/fsimageplugin/pluginmgr.cpp index 540216a4..5ea07987 100644 --- a/fsimageplugin/pluginmgr.cpp +++ b/fsimageplugin/pluginmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,19 +16,19 @@ * along with this program. If not, see . **************************************************************************/ -#include "../vld.h" -#include "pluginmgr.h" -#include "FSImageFactory.h" -#include "../stringtools.h" - -IPlugin *CImagePluginMgr::createPluginInstance(str_map ¶ms) -{ - return new FSImageFactory(); -} - -void CImagePluginMgr::destroyPluginInstance(IPlugin *plugin) -{ - FSImageFactory *s=(FSImageFactory*)plugin; - delete s; -} - +#include "../vld.h" +#include "pluginmgr.h" +#include "FSImageFactory.h" +#include "../stringtools.h" + +IPlugin *CImagePluginMgr::createPluginInstance(str_map ¶ms) +{ + return new FSImageFactory(); +} + +void CImagePluginMgr::destroyPluginInstance(IPlugin *plugin) +{ + FSImageFactory *s=(FSImageFactory*)plugin; + delete s; +} + diff --git a/fsimageplugin/vhdfile.cpp b/fsimageplugin/vhdfile.cpp index 2833c8cd..f738b7f6 100644 --- a/fsimageplugin/vhdfile.cpp +++ b/fsimageplugin/vhdfile.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vhdfile.h" #include "../Interface/Server.h" #include "../Interface/Types.h" @@ -26,8 +26,8 @@ #ifdef _WIN32 #include #else -#include -#endif +#include +#endif const uint64 def_header_offset=0; const uint64 def_dynamic_header_offset=512; @@ -1142,56 +1142,56 @@ std::wstring VHDFile::getFilenameW(void) return file->getFilenameW(); } -std::string VHDFile::Read(_u32 tr) -{ - std::string ret; - ret.resize(4096); - size_t read; - bool b=Read((char*)ret.c_str(), 4096, read); - if(!b) - { - ret.clear(); - return ret; - } - - ret.resize(read); - return ret; -} - -_u32 VHDFile::Read(char* buffer, _u32 bsize) -{ - size_t read; - bool b=Read(buffer, bsize, read); - if(!b) - { - return 0; - } - else - { - return (_u32)read; - } -} - -_u32 VHDFile::Write(const std::string &tw) -{ - return Write(tw.c_str(), (_u32)tw.size()); -} - -_i64 VHDFile::Size(void) -{ - return (_i64)getSize(); -} - -void VHDFile::addVolumeOffset(_i64 offset) -{ - volume_offset=offset; -} - -void VHDFile::print_last_error() -{ -#ifdef _WIN32 - Server->Log("Last error: "+nconvert((int)GetLastError()), LL_ERROR); -#else - Server->Log("Last error: "+nconvert(errno), LL_ERROR); -#endif +std::string VHDFile::Read(_u32 tr) +{ + std::string ret; + ret.resize(4096); + size_t read; + bool b=Read((char*)ret.c_str(), 4096, read); + if(!b) + { + ret.clear(); + return ret; + } + + ret.resize(read); + return ret; +} + +_u32 VHDFile::Read(char* buffer, _u32 bsize) +{ + size_t read; + bool b=Read(buffer, bsize, read); + if(!b) + { + return 0; + } + else + { + return (_u32)read; + } +} + +_u32 VHDFile::Write(const std::string &tw) +{ + return Write(tw.c_str(), (_u32)tw.size()); +} + +_i64 VHDFile::Size(void) +{ + return (_i64)getSize(); +} + +void VHDFile::addVolumeOffset(_i64 offset) +{ + volume_offset=offset; +} + +void VHDFile::print_last_error() +{ +#ifdef _WIN32 + Server->Log("Last error: "+nconvert((int)GetLastError()), LL_ERROR); +#else + Server->Log("Last error: "+nconvert(errno), LL_ERROR); +#endif } \ No newline at end of file diff --git a/httpserver/HTTPAction.cpp b/httpserver/HTTPAction.cpp index 7035b86c..304034b9 100644 --- a/httpserver/HTTPAction.cpp +++ b/httpserver/HTTPAction.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/httpserver/HTTPClient.cpp b/httpserver/HTTPClient.cpp index e5f33a50..c5ab0132 100644 --- a/httpserver/HTTPClient.cpp +++ b/httpserver/HTTPClient.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/httpserver/HTTPFile.cpp b/httpserver/HTTPFile.cpp index 8b533681..3780cc67 100644 --- a/httpserver/HTTPFile.cpp +++ b/httpserver/HTTPFile.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/httpserver/HTTPProxy.cpp b/httpserver/HTTPProxy.cpp index fc09fb28..dddf15ad 100644 --- a/httpserver/HTTPProxy.cpp +++ b/httpserver/HTTPProxy.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/httpserver/HTTPService.cpp b/httpserver/HTTPService.cpp index a81fae5b..cfbefaaf 100644 --- a/httpserver/HTTPService.cpp +++ b/httpserver/HTTPService.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/httpserver/IndexFiles.cpp b/httpserver/IndexFiles.cpp index 43a81419..60374132 100644 --- a/httpserver/IndexFiles.cpp +++ b/httpserver/IndexFiles.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "IndexFiles.h" std::vector IndexFiles::files; diff --git a/httpserver/MIMEType.cpp b/httpserver/MIMEType.cpp index 4f56ed64..2ed713d3 100644 --- a/httpserver/MIMEType.cpp +++ b/httpserver/MIMEType.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "MIMEType.h" std::map MIMEType::types; diff --git a/httpserver/dllmain.cpp b/httpserver/dllmain.cpp index 8963e90d..ec2071b9 100644 --- a/httpserver/dllmain.cpp +++ b/httpserver/dllmain.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/main.cpp b/main.cpp index a27771c8..68cee902 100644 --- a/main.cpp +++ b/main.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #define DEF_SERVER #include "Server.h" @@ -38,12 +38,12 @@ # include "win_service/nt_service.h" using namespace nt; #endif - -#ifndef _WIN32 -# include -# include -# include -#endif + +#ifndef _WIN32 +# include +# include +# include +#endif CServer *Server=NULL; @@ -51,11 +51,11 @@ using namespace std; bool run=true; bool no_server=false; -namespace -{ - std::string g_logfile; - std::string g_logfile_user; -} +namespace +{ + std::string g_logfile; + std::string g_logfile_user; +} void init_mutex_selthread(void); void destroy_mutex_selthread(void); @@ -66,14 +66,14 @@ void termination_handler(int signum) run=false; Server->Log("Shutting down (Signal "+nconvert(signum)+")", LL_WARNING); } - -void hub_handler(int signum) -{ - if(!g_logfile.empty()) - { + +void hub_handler(int signum) +{ + if(!g_logfile.empty()) + { Server->setLogFile(g_logfile, g_logfile_user); - } -} + } +} #endif #ifdef AS_SERVICE @@ -167,8 +167,8 @@ int main_fkt(int argc, char *argv[]) std::string logfile; std::string workingdir; bool daemon=false; - std::string daemon_user; - std::string pidfile; + std::string daemon_user; + std::string pidfile; for(int i=1;i1 && carg[0]=='-' ) @@ -248,8 +248,8 @@ int main_fkt(int argc, char *argv[]) if( carg[1]=='-' && carg.size()>2 ) p=carg.substr(2, carg.size()-2); else - p=carg.substr(1, carg.size()-1); - + p=carg.substr(1, carg.size()-1); + std::string v; if( narg.size()>0 && narg[0]!='-' ) @@ -264,10 +264,10 @@ int main_fkt(int argc, char *argv[]) { v=p.substr(g+1); p=p.substr(0,g); - } - else - { - v="true"; + } + else + { + v="true"; } } @@ -303,8 +303,8 @@ int main_fkt(int argc, char *argv[]) else { Server->setServerWorkingDir(Server->ConvertToUnicode(workingdir)); - } - + } + #ifndef _WIN32 if(daemon) @@ -329,33 +329,33 @@ int main_fkt(int argc, char *argv[]) { int status; waitpid(pid1, &status, 0); - exit(0); - } + exit(0); + } chdir(Server->ConvertToUTF8(Server->getServerWorkingDir()).c_str()); - - if(pidfile.empty()) - { - pidfile="/var/run/urbackup_srv.pid"; - } - - std::fstream pf; - pf.open(pidfile.c_str(), std::ios::out|std::ios::binary); - if(pf.is_open()) - { - pf << getpid(); - pf.close(); - } + + if(pidfile.empty()) + { + pidfile="/var/run/urbackup_srv.pid"; + } + + std::fstream pf; + pf.open(pidfile.c_str(), std::ios::out|std::ios::binary); + if(pf.is_open()) + { + pf << getpid(); + pf.close(); + } } -#endif - - - - +#endif + + + + if(!logfile.empty()) { - g_logfile=logfile; - g_logfile_user=daemon_user; + g_logfile=logfile; + g_logfile_user=daemon_user; Server->setLogFile(logfile, daemon_user); } @@ -370,51 +370,51 @@ int main_fkt(int argc, char *argv[]) Server->setLogLevel(LL_INFO); else if(loglevel=="error") Server->setLogLevel(LL_ERROR); - } - -#ifndef _WIN32 - if( !daemon_user.empty() && (getuid()==0 || geteuid()==0) ) - { - Server->Log("Changing user...", LL_DEBUG); - char buf[1000]; - passwd pwbuf; - passwd *pw; - int rc=getpwnam_r(daemon_user.c_str(), &pwbuf, buf, 1000, &pw); - if(pw!=NULL) - { - Server->Log("done."); - setgid(pw->pw_gid); - setuid(pw->pw_uid); - } - else - { - Server->Log("Unable to change user, probably because process uid is not root", LL_ERROR); - } - } -#endif + } + +#ifndef _WIN32 + if( !daemon_user.empty() && (getuid()==0 || geteuid()==0) ) + { + Server->Log("Changing user...", LL_DEBUG); + char buf[1000]; + passwd pwbuf; + passwd *pw; + int rc=getpwnam_r(daemon_user.c_str(), &pwbuf, buf, 1000, &pw); + if(pw!=NULL) + { + Server->Log("done."); + setgid(pw->pw_gid); + setuid(pw->pw_uid); + } + else + { + Server->Log("Unable to change user, probably because process uid is not root", LL_ERROR); + } + } +#endif if( sqlite3_threadsafe()==0 ) { Server->Log("SQLite3 wasn't compiled with the SQLITE_THREADSAFE. Exiting.", LL_ERROR); return 43; - } - //sqlite3_enable_shared_cache(1); - - { - str_nmap::iterator iter=srv_params.find("sqlite_tmpdir"); - if(iter!=srv_params.end() && !iter->second.empty()) - { - sqlite3_temp_directory=sqlite3_mprintf("%s", iter->second.c_str()); - } - } - - + } + //sqlite3_enable_shared_cache(1); + + { + str_nmap::iterator iter=srv_params.find("sqlite_tmpdir"); + if(iter!=srv_params.end() && !iter->second.empty()) + { + sqlite3_temp_directory=sqlite3_mprintf("%s", iter->second.c_str()); + } + } + + for( size_t i=0;iLoadDLL(plugins[i]) ) { Server->Log("Loading "+(std::string)plugins[i]+" failed", LL_ERROR); } - } + } CLoadbalancerClient *lbs=NULL; if( loadbalancer!="" ) @@ -427,16 +427,16 @@ int main_fkt(int argc, char *argv[]) #ifndef _WIN32 if (signal (SIGINT, termination_handler) == SIG_IGN) signal (SIGINT, SIG_IGN); - /*if(!daemon) - { + /*if(!daemon) + { if (signal (SIGHUP, termination_handler) == SIG_IGN) signal (SIGHUP, SIG_IGN); - } - else*/ - { + } + else*/ + { if (signal (SIGHUP, hub_handler) == SIG_IGN) signal (SIGHUP, SIG_IGN); - } + } if (signal (SIGTERM, termination_handler) == SIG_IGN) signal (SIGTERM, SIG_IGN); #endif @@ -449,11 +449,11 @@ int main_fkt(int argc, char *argv[]) { init_mutex_selthread(); c_at=new CAcceptThread(workers, port); - if(c_at->has_error()) - { - Server->Log("Error while starting listening to ports. Stopping server.", LL_ERROR); - run=false; - } + if(c_at->has_error()) + { + Server->Log("Error while starting listening to ports. Stopping server.", LL_ERROR); + run=false; + } #ifndef AS_SERVICE while(run==true) { @@ -611,4 +611,4 @@ int main(int argc, char *argv[]) service.start(); } } -#endif +#endif diff --git a/maintest.cpp b/maintest.cpp index 60636edb..f239fb00 100644 --- a/maintest.cpp +++ b/maintest.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../Interface/Thread.h" #include "ThreadPool.h" #include diff --git a/stringtools.cpp b/stringtools.cpp index a054e562..9118d8ce 100644 --- a/stringtools.cpp +++ b/stringtools.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "vld.h" #include @@ -1038,41 +1038,41 @@ void transformHTML(std::string &str) std::wstring EscapeSQLString(const std::wstring &pStr) { - std::wstring ret; + std::wstring ret; for(size_t i=0;i. -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "ChangeJournalWatcher.h" #include "../urbackupcommon/os_functions.h" #include "../Interface/Server.h" diff --git a/urbackupclient/ClientSend.cpp b/urbackupclient/ClientSend.cpp index 327dd2a6..c88a5902 100644 --- a/urbackupclient/ClientSend.cpp +++ b/urbackupclient/ClientSend.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "ClientSend.h" #include "../Interface/Mutex.h" #include "../Interface/Condition.h" diff --git a/urbackupclient/ClientService.cpp b/urbackupclient/ClientService.cpp index 2bd9eb0b..03a51095 100644 --- a/urbackupclient/ClientService.cpp +++ b/urbackupclient/ClientService.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupclient/DirectoryWatcherThread.cpp b/urbackupclient/DirectoryWatcherThread.cpp index aaf54909..9d624225 100644 --- a/urbackupclient/DirectoryWatcherThread.cpp +++ b/urbackupclient/DirectoryWatcherThread.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "DirectoryWatcherThread.h" #include "../Interface/Server.h" #include "../stringtools.h" @@ -33,12 +33,12 @@ const unsigned int mindifftime=120000; DirectoryWatcherThread::DirectoryWatcherThread(const std::vector &watchdirs) { do_stop=false; - watching=watchdirs; - - for(size_t i=0;i. -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "ServerIdentityMgr.h" #include "../Interface/Server.h" #include "../stringtools.h" @@ -28,23 +28,23 @@ IMutex *ServerIdentityMgr::mutex=NULL; IFileServ *ServerIdentityMgr::filesrv=NULL; std::vector ServerIdentityMgr::online_identities; std::vector ServerIdentityMgr::new_identities; - -#ifdef _WIN32 -const std::string server_ident_file="server_idents.txt"; -const std::string server_new_ident_file="new_server_idents.txt"; -#else -const std::string server_ident_file="urbackup/server_idents.txt"; -const std::string server_new_ident_file="urbackup/new_server_idents.txt"; -#endif + +#ifdef _WIN32 +const std::string server_ident_file="server_idents.txt"; +const std::string server_new_ident_file="new_server_idents.txt"; +#else +const std::string server_ident_file="urbackup/server_idents.txt"; +const std::string server_new_ident_file="urbackup/new_server_idents.txt"; +#endif void ServerIdentityMgr::init_mutex(void) { mutex=Server->createMutex(); -} - -void ServerIdentityMgr::destroy_mutex(void) -{ - Server->destroy(mutex); +} + +void ServerIdentityMgr::destroy_mutex(void) +{ + Server->destroy(mutex); } void ServerIdentityMgr::addServerIdentity(const std::string &pIdentity) @@ -124,53 +124,53 @@ size_t ServerIdentityMgr::numServerIdentities(void) { IScopedLock lock(mutex); return identities.size(); -} - -bool ServerIdentityMgr::isNewIdentity(const std::string &pIdentity) -{ - IScopedLock lock(mutex); - if( std::find(new_identities.begin(), new_identities.end(), pIdentity)!=new_identities.end()) - { - return false; - } - else - { - new_identities.push_back(pIdentity); - writeServerIdentities(); - return true; - } -} - -void ServerIdentityMgr::writeServerIdentities(void) -{ - IScopedLock lock(mutex); - std::string idents; - for(size_t i=0;igetTimeMS(); - for(size_t i=0;igetTimeMS(); + for(size_t i=0;i. -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include #include "CriticalSection.h" diff --git a/urbackupcommon/bufmgr.cpp b/urbackupcommon/bufmgr.cpp index 2ade5471..9ffbba5f 100644 --- a/urbackupcommon/bufmgr.cpp +++ b/urbackupcommon/bufmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupcommon/escape.cpp b/urbackupcommon/escape.cpp index 048c02db..0da2b2d9 100644 --- a/urbackupcommon/escape.cpp +++ b/urbackupcommon/escape.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include void unescapeMessage(std::string &msg) diff --git a/urbackupcommon/fileclient/tcpstack.cpp b/urbackupcommon/fileclient/tcpstack.cpp index e3422690..b01b9f9b 100644 --- a/urbackupcommon/fileclient/tcpstack.cpp +++ b/urbackupcommon/fileclient/tcpstack.cpp @@ -1,27 +1,27 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "tcpstack.h" #include "../../common/data.h" #include "../../md5.h" -#include - -#define SEND_TIMEOUT 10000 +#include + +#define SEND_TIMEOUT 10000 #define MAX_PACKET 4096 const unsigned int checksum_len=16; @@ -62,16 +62,16 @@ size_t CTCPStack::Send(IPipe* p, char* buf, size_t msglen) MAX_PACKETSIZE len=(MAX_PACKETSIZE)msglen; memcpy(&buffer[len_off], &len, sizeof(MAX_PACKETSIZE) ); - if(msglen>0) - { + if(msglen>0) + { memcpy(&buffer[msg_off], buf, msglen); - } - - if(add_checksum) - { - MD5 md((unsigned char*)&buffer[len_off], (unsigned int)msglen+sizeof(MAX_PACKETSIZE)); - memcpy(buffer, md.raw_digest_int(), checksum_len); - } + } + + if(add_checksum) + { + MD5 md((unsigned char*)&buffer[len_off], (unsigned int)msglen+sizeof(MAX_PACKETSIZE)); + memcpy(buffer, md.raw_digest_int(), checksum_len); + } size_t currpos=0; @@ -184,4 +184,4 @@ size_t CTCPStack::getBuffersize() void CTCPStack::setAddChecksum(bool b) { add_checksum=b; -} +} diff --git a/urbackupcommon/json.cpp b/urbackupcommon/json.cpp index 0de835dc..b876eef4 100644 --- a/urbackupcommon/json.cpp +++ b/urbackupcommon/json.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupcommon/os_functions_win.cpp b/urbackupcommon/os_functions_win.cpp index 782de52e..6d4013e2 100644 --- a/urbackupcommon/os_functions_win.cpp +++ b/urbackupcommon/os_functions_win.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/fileclient/FileClient.cpp b/urbackupserver/fileclient/FileClient.cpp index 4df64c0a..4395aaee 100644 --- a/urbackupserver/fileclient/FileClient.cpp +++ b/urbackupserver/fileclient/FileClient.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../../Interface/Server.h" #include "FileClient.h" @@ -27,11 +27,11 @@ #include #include -#include - -#ifndef _WIN32 -#include -#endif +#include + +#ifndef _WIN32 +#include +#endif extern std::string server_identity; @@ -97,20 +97,20 @@ FileClient::FileClient(bool enable_find_servers, int protocol_version, bool inte Tokenize(bcast_interfaces, bcast_filter, ";,"); } - ifaddrs *ifap; - int rc=getifaddrs(&ifap); - if(rc==0) - { - for(;ifap!=NULL;ifap=ifap->ifa_next) - { - bool found_name = bcast_filter.empty() || std::find(bcast_filter.begin(), bcast_filter.end(), ifap->ifa_name)!=bcast_filter.end(); - + ifaddrs *ifap; + int rc=getifaddrs(&ifap); + if(rc==0) + { + for(;ifap!=NULL;ifap=ifap->ifa_next) + { + bool found_name = bcast_filter.empty() || std::find(bcast_filter.begin(), bcast_filter.end(), ifap->ifa_name)!=bcast_filter.end(); + if(found_name && !(ifap->ifa_flags & IFF_LOOPBACK) && !(ifap->ifa_flags & IFF_POINTOPOINT) - && (ifap->ifa_flags & IFF_BROADCAST) - && ifap->ifa_addr->sa_family == AF_INET ) - { + && (ifap->ifa_flags & IFF_BROADCAST) + && ifap->ifa_addr->sa_family == AF_INET ) + { SOCKET udpsock=socket(AF_INET,SOCK_DGRAM,0); if(udpsock==-1) { @@ -133,39 +133,39 @@ FileClient::FileClient(bool enable_find_servers, int protocol_version, bool inte Server->Log(std::string("Binding to interface ")+std::string(ifap->ifa_name)+" for broadcasting...", LL_DEBUG); - rc = bind(udpsock, (struct sockaddr *)&source_addr, sizeof(source_addr)); - if(rc<0) - { - Server->Log(std::string("Binding UDP socket failed for interface ")+std::string(ifap->ifa_name), LL_ERROR); - } + rc = bind(udpsock, (struct sockaddr *)&source_addr, sizeof(source_addr)); + if(rc<0) + { + Server->Log(std::string("Binding UDP socket failed for interface ")+std::string(ifap->ifa_name), LL_ERROR); + } - rc = setsockopt(udpsock, SOL_SOCKET, SO_BROADCAST, (char*)&val, sizeof(BOOL) ); - if(rc<0) - { - Server->Log(std::string("Enabling SO_BROADCAST for UDP socket failed for interface ")+std::string(ifap->ifa_name), LL_ERROR); - closesocket(udpsock); - continue; - } - - #if defined(__FreeBSD__) - int optval=1; - if(setsockopt(udpsock, IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) - { - Server->Log(std::string("Error setting IP_ONESBCAST for interface " )+std::string(ifap->ifa_name), LL_ERROR); - } - #endif - - broadcast_addrs.push_back(*((struct sockaddr_in *)ifap->ifa_broadaddr)); - udpsocks.push_back(udpsock); - } - } - freeifaddrs(ifap); - } - else - { - Server->Log("Getting interface ips failed. errno="+nconvert(errno)+ - ". Server may not listen properly on all network devices when discovering clients.", LL_ERROR); - + rc = setsockopt(udpsock, SOL_SOCKET, SO_BROADCAST, (char*)&val, sizeof(BOOL) ); + if(rc<0) + { + Server->Log(std::string("Enabling SO_BROADCAST for UDP socket failed for interface ")+std::string(ifap->ifa_name), LL_ERROR); + closesocket(udpsock); + continue; + } + + #if defined(__FreeBSD__) + int optval=1; + if(setsockopt(udpsock, IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) + { + Server->Log(std::string("Error setting IP_ONESBCAST for interface " )+std::string(ifap->ifa_name), LL_ERROR); + } + #endif + + broadcast_addrs.push_back(*((struct sockaddr_in *)ifap->ifa_broadaddr)); + udpsocks.push_back(udpsock); + } + } + freeifaddrs(ifap); + } + else + { + Server->Log("Getting interface ips failed. errno="+nconvert(errno)+ + ". Server may not listen properly on all network devices when discovering clients.", LL_ERROR); + SOCKET udpsock=socket(AF_INET,SOCK_DGRAM,0); if(udpsock==-1) { @@ -186,21 +186,21 @@ FileClient::FileClient(bool enable_find_servers, int protocol_version, bool inte source_addr.sin_family = AF_INET; source_addr.sin_port = htons(UDP_SOURCE_PORT); - Server->Log("Binding to no interface for broadcasting. Entering IP on restore CD won't work.", LL_WARNING); - - rc = setsockopt(udpsock, SOL_SOCKET, SO_BROADCAST, (char*)&val, sizeof(BOOL) ); - if(rc<0) - { - Server->Log("Enabling SO_BROADCAST for UDP socket failed", LL_ERROR); - closesocket(udpsock); - } - else - { - udpsocks.push_back(udpsock); - source_addr.sin_addr.s_addr = INADDR_BROADCAST; - broadcast_addrs.push_back(source_addr); - } - } + Server->Log("Binding to no interface for broadcasting. Entering IP on restore CD won't work.", LL_WARNING); + + rc = setsockopt(udpsock, SOL_SOCKET, SO_BROADCAST, (char*)&val, sizeof(BOOL) ); + if(rc<0) + { + Server->Log("Enabling SO_BROADCAST for UDP socket failed", LL_ERROR); + closesocket(udpsock); + } + else + { + udpsocks.push_back(udpsock); + source_addr.sin_addr.s_addr = INADDR_BROADCAST; + broadcast_addrs.push_back(source_addr); + } + } } #else char hostname[MAX_PATH]; @@ -240,18 +240,18 @@ FileClient::FileClient(bool enable_find_servers, int protocol_version, bool inte source_addr.sin_port = htons(UDP_SOURCE_PORT); rc = bind(udpsock, (struct sockaddr *)&source_addr, sizeof(source_addr)); - if(rc<0) - { - Server->Log("Binding UDP socket failed", LL_ERROR); + if(rc<0) + { + Server->Log("Binding UDP socket failed", LL_ERROR); } setSockP(udpsock); BOOL val=TRUE; rc=setsockopt(udpsock, SOL_SOCKET, SO_BROADCAST, (char*)&val, sizeof(BOOL) ); - if(rc<0) - { - Server->Log("Failed setting SO_BROADCAST in FileClient", LL_ERROR); + if(rc<0) + { + Server->Log("Failed setting SO_BROADCAST in FileClient", LL_ERROR); } udpsocks.push_back(udpsock); @@ -302,79 +302,79 @@ _u32 FileClient::GetServers(bool start, const std::vector &addr_hints) if(start==true) { max_version=0; - for(size_t i=0;iLog("Sending broadcast failed!", LL_ERROR); - } - } - - if(!addr_hints.empty()) - { - for(size_t i=0;iLog("Error setting socket to not broadcast", LL_ERROR); - } - - #if defined(__FreeBSD__) - int optval=0; - if(setsockopt(udpsocks[i], IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) - { - Server->Log(std::string("Error setting IP_ONESBCAST" ), LL_ERROR); - } - #endif - + for(size_t i=0;iLog("Sending broadcast failed!", LL_ERROR); + } + } + + if(!addr_hints.empty()) + { + for(size_t i=0;iLog("Error setting socket to not broadcast", LL_ERROR); + } + + #if defined(__FreeBSD__) + int optval=0; + if(setsockopt(udpsocks[i], IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) + { + Server->Log(std::string("Error setting IP_ONESBCAST" ), LL_ERROR); + } + #endif + for(size_t j=0;jLog("Error setting socket to broadcast", LL_ERROR); - } - -#undef SETSOCK_CAST - - #if defined(__FreeBSD__) - optval=1; - if(setsockopt(udpsocks[i], IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) - { - Server->Log(std::string("Error setting IP_ONESBCAST" ), LL_ERROR); - } - #endif - } - } + } + + broadcast=1; + if(setsockopt(udpsocks[i], SOL_SOCKET, SO_BROADCAST, SETSOCK_CAST &broadcast, sizeof(int))==-1) + { + Server->Log("Error setting socket to broadcast", LL_ERROR); + } + +#undef SETSOCK_CAST + + #if defined(__FreeBSD__) + optval=1; + if(setsockopt(udpsocks[i], IPPROTO_IP, IP_ONESBCAST, &optval, sizeof(int))==-1) + { + Server->Log(std::string("Error setting IP_ONESBCAST" ), LL_ERROR); + } + #endif + } + } starttime=Server->getTimeMS(); diff --git a/urbackupserver/server.cpp b/urbackupserver/server.cpp index afe56fd7..538978fb 100644 --- a/urbackupserver/server.cpp +++ b/urbackupserver/server.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_channel.cpp b/urbackupserver/server_channel.cpp index 1416118d..eb9b1bc7 100644 --- a/urbackupserver/server_channel.cpp +++ b/urbackupserver/server_channel.cpp @@ -1,20 +1,20 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ #include "server_channel.h" @@ -31,7 +31,7 @@ #include "server_settings.h" #include "../urbackupcommon/capa_bits.h" #include "serverinterface/helper.h" -#include +#include #include #include @@ -82,7 +82,7 @@ server_get(pServer_get), clientid(clientid), settings(NULL), internet_mode(inter ServerChannelThread::~ServerChannelThread(void) { - delete settings; + delete settings; Server->destroy(mutex); } diff --git a/urbackupserver/server_cleanup.cpp b/urbackupserver/server_cleanup.cpp index 2049b140..5198255d 100644 --- a/urbackupserver/server_cleanup.cpp +++ b/urbackupserver/server_cleanup.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "server_cleanup.h" @@ -34,14 +34,14 @@ #include "snapshot_helper.h" #include "apps/cleanup_cmd.h" #include "dao/ServerCleanupDAO.h" -#include -#include +#include +#include IMutex *ServerCleanupThread::mutex=NULL; ICondition *ServerCleanupThread::cond=NULL; bool ServerCleanupThread::update_stats=false; IMutex *ServerCleanupThread::a_mutex=NULL; -bool ServerCleanupThread::update_stats_interruptible=false; +bool ServerCleanupThread::update_stats_interruptible=false; volatile bool ServerCleanupThread::do_quit=false; const unsigned int min_cleanup_interval=12*60*60; @@ -51,13 +51,13 @@ void ServerCleanupThread::initMutex(void) mutex=Server->createMutex(); cond=Server->createCondition(); a_mutex=Server->createMutex(); -} - -void ServerCleanupThread::destroyMutex(void) -{ - Server->destroy(mutex); - Server->destroy(cond); - Server->destroy(a_mutex); +} + +void ServerCleanupThread::destroyMutex(void) +{ + Server->destroy(mutex); + Server->destroy(cond); + Server->destroy(a_mutex); } ServerCleanupThread::ServerCleanupThread(CleanupAction cleanup_action) @@ -101,17 +101,17 @@ void ServerCleanupThread::operator()(void) return; } - unsigned int last_cleanup=0; - - { - IScopedLock lock(mutex); - cond->wait(&lock, 60000); - - if(do_quit) - { - delete this; - return; - } + unsigned int last_cleanup=0; + + { + IScopedLock lock(mutex); + cond->wait(&lock, 60000); + + if(do_quit) + { + delete this; + return; + } } { @@ -149,10 +149,10 @@ void ServerCleanupThread::operator()(void) if(!update_stats) { cond->wait(&lock, 3600000); - } - if(do_quit) - { - return; + } + if(do_quit) + { + return; } if(update_stats) { @@ -211,8 +211,8 @@ void ServerCleanupThread::operator()(void) last_cleanup=Server->getTimeSeconds(); } } - } - + } + delete this; } @@ -226,13 +226,13 @@ void ServerCleanupThread::updateStats(bool interruptible) void ServerCleanupThread::do_cleanup(void) { - db_results cache_res; - if(db->getEngineName()=="sqlite") - { + db_results cache_res; + if(db->getEngineName()=="sqlite") + { cache_res=db->Read("PRAGMA cache_size"); ServerSettings server_settings(db); db->Write("PRAGMA cache_size = -"+nconvert(server_settings.getSettings()->update_stats_cachesize)); - } + } removeerr.clear(); cleanup_images(); @@ -246,7 +246,7 @@ void ServerCleanupThread::do_cleanup(void) int64 amount=cleanup_amount(server_settings.getSettings()->global_soft_fs_quota, db); if(amountLog("Space to free: "+PrettyPrintBytes(total_space-amount), LL_INFO); + Server->Log("Space to free: "+PrettyPrintBytes(total_space-amount), LL_INFO); cleanup_images(total_space-amount); cleanup_files(total_space-amount); } @@ -274,18 +274,18 @@ bool ServerCleanupThread::do_cleanup(int64 minspace, bool switch_to_wal) ServerStatus::incrementServerNospcStalled(1); IScopedLock lock(a_mutex); - db_results cache_res; - if(db->getEngineName()=="sqlite") - { + db_results cache_res; + if(db->getEngineName()=="sqlite") + { cache_res=db->Read("PRAGMA cache_size"); ServerSettings server_settings(db); db->Write("PRAGMA cache_size = -"+nconvert(server_settings.getSettings()->update_stats_cachesize)); } - - if(minspace>0) - { - Server->Log("Space to free: "+PrettyPrintBytes(minspace), LL_INFO); - } + + if(minspace>0) + { + Server->Log("Space to free: "+PrettyPrintBytes(minspace), LL_INFO); + } removeerr.clear(); cleanup_images(minspace); @@ -478,7 +478,7 @@ int ServerCleanupThread::hasEnoughFreeSpace(int64 minspace, ServerSettings *sett return 1; } } - Server->Log("Free space: "+PrettyPrintBytes(available_space), LL_DEBUG); + Server->Log("Free space: "+PrettyPrintBytes(available_space), LL_DEBUG); } return 0; } @@ -564,7 +564,7 @@ bool ServerCleanupThread::cleanup_images_client(int clientid, int64 minspace, st int r=hasEnoughFreeSpace(minspace, &settings); if( r==-1 || r==1 ) return true; - + full_image_num=(int)getImagesFullNum(clientid, backupid, notit); } @@ -595,9 +595,9 @@ bool ServerCleanupThread::cleanup_images_client(int clientid, int64 minspace, st if(is!=-1) corr+=is; removeImage(assoc[i], false); } - if(!removeImage(backupid, true, corr)) - { - notit.push_back(backupid); + if(!removeImage(backupid, true, corr)) + { + notit.push_back(backupid); } else { @@ -613,8 +613,8 @@ bool ServerCleanupThread::cleanup_images_client(int clientid, int64 minspace, st int r=hasEnoughFreeSpace(minspace, &settings); if( r==-1 || r==1 ) return true; - - incr_image_num=(int)getImagesIncrNum(clientid, backupid, notit); + + incr_image_num=(int)getImagesIncrNum(clientid, backupid, notit); } return false; @@ -799,15 +799,15 @@ bool ServerCleanupThread::cleanup_one_filebackup_client(int clientid, int64 mins } bool b=deleteFileBackup(settings.getSettings()->backupfolder, clientid, backupid); filebid=backupid; - - Server->Log("Done.", LL_INFO); + + Server->Log("Done.", LL_INFO); - if(b) - { - return true; - } - - full_file_num=(int)getFilesFullNum(clientid, backupid); + if(b) + { + return true; + } + + full_file_num=(int)getFilesFullNum(clientid, backupid); } int incr_file_num=(int)getFilesIncrNum(clientid, backupid); @@ -820,15 +820,15 @@ bool ServerCleanupThread::cleanup_one_filebackup_client(int clientid, int64 mins { Server->Log(L"Deleting incremental file backup ( id="+convert(res_info.id)+L", backuptime="+res_info.backuptime+L", path="+res_info.path+L" ) from client \""+clientname.value+L"\" ( id="+convert(clientid)+L" ) ...", LL_INFO); } - bool b=deleteFileBackup(settings.getSettings()->backupfolder, clientid, backupid); - filebid=backupid; - - Server->Log("Done.", LL_INFO); + bool b=deleteFileBackup(settings.getSettings()->backupfolder, clientid, backupid); + filebid=backupid; - if(b) - { - return true; - } + Server->Log("Done.", LL_INFO); + + if(b) + { + return true; + } incr_file_num=(int)getFilesIncrNum(clientid, backupid); } @@ -874,21 +874,21 @@ size_t ServerCleanupThread::getFilesFullNum(int clientid, int &backupid_top) { std::vector res=cleanupdao->getFullNumFiles(clientid); std::vector no_err_res; - if(!removeerr.empty()) - { - for(size_t i=0;i res=cleanupdao->getIncrNumFiles(clientid); std::vector no_err_res; - if(!removeerr.empty()) - { - for(size_t i=0;iLog(L"Warning: Directory doesn't exist: \""+path+L"\"", LL_WARNING); - } - else - { - del=false; - removeerr.push_back(backupid); + if(!os_directory_exists(os_file_prefix(path))) + { + if(os_directory_exists(os_file_prefix(backupfolder))) + { + del=true; + } + Server->Log(L"Warning: Directory doesn't exist: \""+path+L"\"", LL_WARNING); + } + else + { + del=false; + removeerr.push_back(backupid); Server->Log(L"Error removing directory \""+path+L"\"", LL_ERROR); - err=true; - } - } - if(os_directory_exists(os_file_prefix(path)) ) - { - del=false; - Server->Log(L"Directory still exists. Deleting backup failed. Path: \""+path+L"\"", LL_ERROR); - err=true; - removeerr.push_back(backupid); - } - if(del || force_remove) + err=true; + } + } + if(os_directory_exists(os_file_prefix(path)) ) + { + del=false; + Server->Log(L"Directory still exists. Deleting backup failed. Path: \""+path+L"\"", LL_ERROR); + err=true; + removeerr.push_back(backupid); + } + if(del || force_remove) { db->DetachDBs(); db->BeginTransaction(); @@ -1028,8 +1028,8 @@ bool ServerCleanupThread::deleteFileBackup(const std::wstring &backupfolder, int } ServerStatus::updateActive(); - - return !err; + + return !err; } void ServerCleanupThread::removeClient(int clientid) @@ -1190,12 +1190,12 @@ void ServerCleanupThread::backup_database(void) BackupServerGet::sendMailToAdmins("Database integrity check failed", "Database integrity check failed before database backup. You should restore the UrBackup database from a backup or try to repair it."); } } -} - -void ServerCleanupThread::doQuit(void) -{ - do_quit=true; - cond->notify_all(); +} + +void ServerCleanupThread::doQuit(void) +{ + do_quit=true; + cond->notify_all(); } bool ServerCleanupThread::truncate_files_recurisve(std::wstring path) @@ -1239,9 +1239,9 @@ void ServerCleanupThread::removeUnknown(void) void ServerCleanupThread::enforce_quotas(void) { - db_results cache_res; - if(db->getEngineName()=="sqlite") - { + db_results cache_res; + if(db->getEngineName()=="sqlite") + { cache_res=db->Read("PRAGMA cache_size"); ServerSettings server_settings(db); db->Write("PRAGMA cache_size = -"+nconvert(server_settings.getSettings()->update_stats_cachesize)); @@ -1307,7 +1307,7 @@ bool ServerCleanupThread::enforce_quota(int clientid, std::ostringstream& log) log << "This requires enforcement of the quota." << std::endl; } - did_remove_something=false; + did_remove_something=false; int state=0; int nopc=0; while(used_storage.value>client_quota && nopc<2) @@ -1382,4 +1382,4 @@ bool ServerCleanupThread::enforce_quota(int clientid, std::ostringstream& log) } -#endif //CLIENT_ONLY +#endif //CLIENT_ONLY diff --git a/urbackupserver/server_get.cpp b/urbackupserver/server_get.cpp index 5a96209d..0df37ab1 100644 --- a/urbackupserver/server_get.cpp +++ b/urbackupserver/server_get.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_hash.cpp b/urbackupserver/server_hash.cpp index c8220057..f74876ba 100644 --- a/urbackupserver/server_hash.cpp +++ b/urbackupserver/server_hash.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_image.cpp b/urbackupserver/server_image.cpp index f142e51f..a7ba1e33 100644 --- a/urbackupserver/server_image.cpp +++ b/urbackupserver/server_image.cpp @@ -1,39 +1,39 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - -#include "server_get.h" - -#include "../Interface/Server.h" -#include "mbr_code.h" -#include "server_log.h" -#include "server_update_stats.h" -#include "../stringtools.h" -#include "server_cleanup.h" -#include "../fsimageplugin/IVHDFile.h" -#include "../fsimageplugin/IFSImageFactory.h" -#include "server_writer.h" -#include "zero_hash.h" -#include "server_running.h" -#include "../md5.h" - -#include -#include - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + +#include "server_get.h" + +#include "../Interface/Server.h" +#include "mbr_code.h" +#include "server_log.h" +#include "server_update_stats.h" +#include "../stringtools.h" +#include "server_cleanup.h" +#include "../fsimageplugin/IVHDFile.h" +#include "../fsimageplugin/IFSImageFactory.h" +#include "server_writer.h" +#include "zero_hash.h" +#include "server_running.h" +#include "../md5.h" + +#include +#include + const unsigned int stat_update_skip=20; const unsigned int sector_size=512; const unsigned int sha_size=32; @@ -152,7 +152,7 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP } std::wstring imagefn=constructImagePath(widen(sletter)); - + int64 free_space=os_free_space(os_file_prefix(ExtractFilePath(imagefn))); if(free_space!=-1 && free_spacedestroy(cc); + Server->destroy(cc); return false; } - } + } { std::string mbrd=getMBR(widen(sletter)); @@ -177,24 +177,24 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP else { IFile *mbr_file=Server->openFile(os_file_prefix(imagefn+L".mbr"), MODE_WRITE); - if(mbr_file!=NULL) - { + if(mbr_file!=NULL) + { _u32 w=mbr_file->Write(mbrd); - if(w!=mbrd.size()) - { - Server->Log("Error writing mbr data.", LL_ERROR); - Server->destroy(mbr_file); - Server->destroy(cc); - return false; - } + if(w!=mbrd.size()) + { + Server->Log("Error writing mbr data.", LL_ERROR); + Server->destroy(mbr_file); + Server->destroy(cc); + return false; + } Server->destroy(mbr_file); - } - else - { - Server->Log("Error creating file for writing MBR data.", LL_ERROR); - Server->destroy(cc); - return false; - } + } + else + { + Server->Log("Error creating file for writing MBR data.", LL_ERROR); + Server->destroy(cc); + return false; + } } } @@ -666,7 +666,7 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP ServerStatus::setServerStatus(status); if(vhdfile!=NULL) - { + { vhdfile->doExit(); Server->getThreadPool()->waitFor(vhdfile_ticket); vhdfile_err=vhdfile->hasError(); @@ -687,10 +687,10 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP q_update_images_size->Bind(clientid); q_update_images_size->Write(); q_update_images_size->Reset(); - if(vhdfile_err==false) - { + if(vhdfile_err==false) + { setBackupImageComplete(); - } + } db->EndTransaction(); Server->destroy(t_file); } @@ -852,16 +852,16 @@ bool BackupServerGet::doImage(const std::string &pLetter, const std::wstring &pP } ServerLogger::Log(clientid, "Timeout while transfering image data", LL_ERROR); do_image_cleanup: - if(cc!=NULL) - { + if(cc!=NULL) + { transferred_bytes+=cc->getTransferedBytes(); - } + } unsigned int passed_time=Server->getTimeMS()-image_backup_starttime; if(passed_time==0) passed_time=1; ServerLogger::Log(clientid, "Transferred "+PrettyPrintBytes(transferred_bytes)+" - Average speed: "+PrettyPrintSpeed((size_t)((transferred_bytes*1000)/(passed_time) )), LL_INFO ); - if(cc!=NULL) + if(cc!=NULL) Server->destroy(cc); - + if(vhdfile!=NULL) { if(blockdata!=NULL) @@ -1023,4 +1023,4 @@ int64 BackupServerGet::updateNextblock(int64 nextblock, int64 currblock, sha256_ } } return nextblock+1; -} +} diff --git a/urbackupserver/server_log.cpp b/urbackupserver/server_log.cpp index 418e24dd..85504945 100644 --- a/urbackupserver/server_log.cpp +++ b/urbackupserver/server_log.cpp @@ -1,20 +1,20 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ #include "server_log.h" #include "../stringtools.h" @@ -199,7 +199,7 @@ void ServerLogger::reset(int clientid) } } -std::vector ServerLogger::getCircularLogdata( int clientid, size_t minid ) +std::vector ServerLogger::getCircularLogdata( int clientid, size_t minid ) { IScopedLock lock(mutex); diff --git a/urbackupserver/server_ping.cpp b/urbackupserver/server_ping.cpp index ac412339..614b4b76 100644 --- a/urbackupserver/server_ping.cpp +++ b/urbackupserver/server_ping.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_prepare_hash.cpp b/urbackupserver/server_prepare_hash.cpp index 0960c345..d660dac2 100644 --- a/urbackupserver/server_prepare_hash.cpp +++ b/urbackupserver/server_prepare_hash.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "server_prepare_hash.h" @@ -27,16 +27,16 @@ #include "../urbackupcommon/os_functions.h" #include "../fileservplugin/chunk_settings.h" #include "../md5.h" -#include +#include BackupServerPrepareHash::BackupServerPrepareHash(IPipe *pPipe, IPipe *pOutput, int pClientid) { pipe=pPipe; output=pOutput; clientid=pClientid; - working=false; - chunk_patcher.setCallback(this); - has_error=false; + working=false; + chunk_patcher.setCallback(this); + has_error=false; } BackupServerPrepareHash::~BackupServerPrepareHash(void) @@ -48,7 +48,7 @@ void BackupServerPrepareHash::operator()(void) { while(true) { - working=false; + working=false; std::string data; size_t rc=pipe->Read(&data); if(data=="exit") @@ -65,8 +65,8 @@ void BackupServerPrepareHash::operator()(void) if(rc>0) { - working=true; - + working=true; + CRData rd(&data); std::string temp_fn; @@ -333,9 +333,9 @@ bool BackupServerPrepareHash::writeFileRepeat(IFile *f, const char *buf, size_t bool BackupServerPrepareHash::hasError(void) { - volatile bool r=has_error; - has_error=false; + volatile bool r=has_error; + has_error=false; return r; } -#endif //CLIENT_ONLY +#endif //CLIENT_ONLY diff --git a/urbackupserver/server_running.cpp b/urbackupserver/server_running.cpp index 72f27ccf..b2cfa1fd 100644 --- a/urbackupserver/server_running.cpp +++ b/urbackupserver/server_running.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_settings.cpp b/urbackupserver/server_settings.cpp index 3272ea0f..fae86459 100644 --- a/urbackupserver/server_settings.cpp +++ b/urbackupserver/server_settings.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -646,31 +646,31 @@ std::string ServerSettings::generateRandomBinaryKey(void) return key; } -int ServerSettings::getUpdateFreqImageIncr() -{ - updateInternal(NULL); - IScopedLock lock(g_mutex); - return settings_cache->settings->update_freq_image_incr; -} +int ServerSettings::getUpdateFreqImageIncr() +{ + updateInternal(NULL); + IScopedLock lock(g_mutex); + return settings_cache->settings->update_freq_image_incr; +} int ServerSettings::getUpdateFreqFileIncr() { - updateInternal(NULL); - IScopedLock lock(g_mutex); + updateInternal(NULL); + IScopedLock lock(g_mutex); return settings_cache->settings->update_freq_incr; } -int ServerSettings::getUpdateFreqImageFull() -{ - updateInternal(NULL); - IScopedLock lock(g_mutex); - return settings_cache->settings->update_freq_image_full; -} +int ServerSettings::getUpdateFreqImageFull() +{ + updateInternal(NULL); + IScopedLock lock(g_mutex); + return settings_cache->settings->update_freq_image_full; +} int ServerSettings::getUpdateFreqFileFull() { - updateInternal(NULL); - IScopedLock lock(g_mutex); + updateInternal(NULL); + IScopedLock lock(g_mutex); return settings_cache->settings->update_freq_full; } diff --git a/urbackupserver/server_status.cpp b/urbackupserver/server_status.cpp index 2cea221a..6ca6e784 100644 --- a/urbackupserver/server_status.cpp +++ b/urbackupserver/server_status.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/server_update.cpp b/urbackupserver/server_update.cpp index ca636ee8..af293a9b 100644 --- a/urbackupserver/server_update.cpp +++ b/urbackupserver/server_update.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #define _CRT_SECURE_NO_WARNINGS #include "server_update.h" @@ -24,7 +24,7 @@ #include "../Interface/File.h" #include "../stringtools.h" #include "../urbackupcommon/os_functions.h" -#include +#include extern IDownloadFactory *download_fak; @@ -85,12 +85,12 @@ bool ServerUpdate::waitForDownload(IFileDownload *dl) uchar rc=dl->download(); if(rc==FD_ERR_SUCCESS) { - Server->Log("Downloaded file successfully", LL_INFO); + Server->Log("Downloaded file successfully", LL_INFO); return true; } else if(rc==FD_ERR_TIMEOUT || rc==FD_ERR_SOCKET_ERROR || rc==FD_ERR_FILE_DOESNT_EXIST || rc==FD_ERR_ERROR ) { - Server->Log("Download err: "+dl->getErrorString(rc), LL_ERROR); + Server->Log("Download err: "+dl->getErrorString(rc), LL_ERROR); return false; } } @@ -114,7 +114,7 @@ void ServerUpdate::operator()(void) if(tmp==NULL) return; std::string tfn=tmp->getFilename(); Server->destroy(tmp); - Server->Log("Downloading version file...", LL_INFO); + Server->Log("Downloading version file...", LL_INFO); dl->download("http://update1.urbackup.org/version.txt", tfn); if(!waitForDownload(dl)) @@ -131,14 +131,14 @@ void ServerUpdate::operator()(void) if(atoi(version.c_str())>atoi(curr_version.c_str())) { - Server->Log("Downloading signature...", LL_INFO); + Server->Log("Downloading signature...", LL_INFO); dl->download("http://update1.urbackup.org/UrBackupUpdate.sig", "urbackup/UrBackupUpdate.sig"); if(!waitForDownload(dl)) { download_fak->destroyFileDownload(dl); return; } - Server->Log("Downloading update...", LL_INFO); + Server->Log("Downloading update...", LL_INFO); dl->download("http://update1.urbackup.org/UrBackupUpdate.exe", "urbackup/UrBackupUpdate.exe"); if(!waitForDownload(dl)) { diff --git a/urbackupserver/server_writer.cpp b/urbackupserver/server_writer.cpp index 2c0f9411..f6ba28f0 100644 --- a/urbackupserver/server_writer.cpp +++ b/urbackupserver/server_writer.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "server_writer.h" diff --git a/urbackupserver/serverinterface/backups.cpp b/urbackupserver/serverinterface/backups.cpp index 92c7c2bb..658db87c 100644 --- a/urbackupserver/serverinterface/backups.cpp +++ b/urbackupserver/serverinterface/backups.cpp @@ -1,20 +1,20 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ #include "action_header.h" #include "../../urbackupcommon/os_functions.h" diff --git a/urbackupserver/serverinterface/getimage.cpp b/urbackupserver/serverinterface/getimage.cpp index 8a49e3b2..ad003e44 100644 --- a/urbackupserver/serverinterface/getimage.cpp +++ b/urbackupserver/serverinterface/getimage.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/serverinterface/helper.cpp b/urbackupserver/serverinterface/helper.cpp index b7b8e8cc..8b6573ae 100644 --- a/urbackupserver/serverinterface/helper.cpp +++ b/urbackupserver/serverinterface/helper.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -221,14 +221,7 @@ void Helper::releaseAll(void) std::string Helper::getTimeFormatString(void) { - if(language=="de") - { - return "%d.%m.%Y %H:%M"; - } - else - { - return "%Y-%m-%d %H:%M"; - } + return "%Y-%m-%d %H:%M"; } std::string Helper::getLanguage(void) diff --git a/urbackupserver/serverinterface/lastacts.cpp b/urbackupserver/serverinterface/lastacts.cpp index a8a6d308..e493629c 100644 --- a/urbackupserver/serverinterface/lastacts.cpp +++ b/urbackupserver/serverinterface/lastacts.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/login.cpp b/urbackupserver/serverinterface/login.cpp index b04d9b0a..c4f187ea 100644 --- a/urbackupserver/serverinterface/login.cpp +++ b/urbackupserver/serverinterface/login.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/logs.cpp b/urbackupserver/serverinterface/logs.cpp index 69d169fa..28993683 100644 --- a/urbackupserver/serverinterface/logs.cpp +++ b/urbackupserver/serverinterface/logs.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/serverinterface/piegraph.cpp b/urbackupserver/serverinterface/piegraph.cpp index ad3311af..3bc220fd 100644 --- a/urbackupserver/serverinterface/piegraph.cpp +++ b/urbackupserver/serverinterface/piegraph.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/progress.cpp b/urbackupserver/serverinterface/progress.cpp index 57cccf9b..76442fa3 100644 --- a/urbackupserver/serverinterface/progress.cpp +++ b/urbackupserver/serverinterface/progress.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/salt.cpp b/urbackupserver/serverinterface/salt.cpp index 79ac5214..00343750 100644 --- a/urbackupserver/serverinterface/salt.cpp +++ b/urbackupserver/serverinterface/salt.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/settings.cpp b/urbackupserver/serverinterface/settings.cpp index 9a89a8e0..c59b07da 100644 --- a/urbackupserver/serverinterface/settings.cpp +++ b/urbackupserver/serverinterface/settings.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -90,14 +90,14 @@ JSON::Object getJSONClientSettings(ServerSettings &settings) SET_SETTING(internet_full_file_backups); SET_SETTING(silent_update); SET_SETTING(client_quota); - SET_SETTING(local_full_file_transfer_mode); - SET_SETTING(internet_full_file_transfer_mode); - SET_SETTING(local_incr_file_transfer_mode); - SET_SETTING(internet_incr_file_transfer_mode); - SET_SETTING(local_image_transfer_mode); - SET_SETTING(internet_image_transfer_mode); - SET_SETTING(file_hash_collect_amount); - SET_SETTING(file_hash_collect_timeout); + SET_SETTING(local_full_file_transfer_mode); + SET_SETTING(internet_full_file_transfer_mode); + SET_SETTING(local_incr_file_transfer_mode); + SET_SETTING(internet_incr_file_transfer_mode); + SET_SETTING(local_image_transfer_mode); + SET_SETTING(internet_image_transfer_mode); + SET_SETTING(file_hash_collect_amount); + SET_SETTING(file_hash_collect_timeout); SET_SETTING(file_hash_collect_cachesize); SET_SETTING(end_to_end_file_backup_verification); SET_SETTING(internet_calculate_filehashes_on_client); diff --git a/urbackupserver/serverinterface/shutdown.cpp b/urbackupserver/serverinterface/shutdown.cpp index b5ed7f2e..03f19a5e 100644 --- a/urbackupserver/serverinterface/shutdown.cpp +++ b/urbackupserver/serverinterface/shutdown.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/urbackupserver/serverinterface/usage.cpp b/urbackupserver/serverinterface/usage.cpp index e7954d7f..eaa2d842 100644 --- a/urbackupserver/serverinterface/usage.cpp +++ b/urbackupserver/serverinterface/usage.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/serverinterface/usagegraph.cpp b/urbackupserver/serverinterface/usagegraph.cpp index 463f41c7..3ccc4467 100644 --- a/urbackupserver/serverinterface/usagegraph.cpp +++ b/urbackupserver/serverinterface/usagegraph.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" @@ -82,8 +82,8 @@ ACTION_IMPL(usagegraph) ( ( clientid==-1 && helper.getRights("piegraph")=="all" ) || ( clientid!=-1 && (client_id_found || rights=="all") ) ) ) { - helper.releaseAll(); - + helper.releaseAll(); + std::wstring scale=GET[L"scale"]; std::string t_where=" 0=0"; @@ -102,21 +102,21 @@ ACTION_IMPL(usagegraph) c_lim=watoi(res_c[0][L"c"]); } - IQuery *q=db->Prepare("SELECT id, (MAX(b.bytes_used_files)+MAX(b.bytes_used_images)) AS used, strftime('"+date_format_str+"', MAX(b.created), 'localtime') AS tdate, strftime('"+date_format_str_short+"', MAX(b.created), 'localtime') AS tdate_short " - "FROM " - "(" - "SELECT MAX(created) AS mcreated " - "FROM " - "(SELECT * FROM clients_hist WHERE "+t_where+" AND created>date('now','-1 month') ) " - "GROUP BY strftime('"+date_format_str+"', created, 'localtime'), id " - "HAVING mcreated>date('now','-1 month') " - "ORDER BY mcreated DESC " - "LIMIT "+nconvert(c_lim*(n_items*2))+" " - ") a " - "INNER JOIN clients_hist b ON a.mcreated=b.created WHERE "+t_where+" AND b.created>date('now','-1 month') " - "GROUP BY strftime('"+date_format_str+"', b.created, 'localtime'), id " - "ORDER BY b.created DESC"); - + IQuery *q=db->Prepare("SELECT id, (MAX(b.bytes_used_files)+MAX(b.bytes_used_images)) AS used, strftime('"+date_format_str+"', MAX(b.created), 'localtime') AS tdate, strftime('"+date_format_str_short+"', MAX(b.created), 'localtime') AS tdate_short " + "FROM " + "(" + "SELECT MAX(created) AS mcreated " + "FROM " + "(SELECT * FROM clients_hist WHERE "+t_where+" AND created>date('now','-1 month') ) " + "GROUP BY strftime('"+date_format_str+"', created, 'localtime'), id " + "HAVING mcreated>date('now','-1 month') " + "ORDER BY mcreated DESC " + "LIMIT "+nconvert(c_lim*(n_items*2))+" " + ") a " + "INNER JOIN clients_hist b ON a.mcreated=b.created WHERE "+t_where+" AND b.created>date('now','-1 month') " + "GROUP BY strftime('"+date_format_str+"', b.created, 'localtime'), id " + "ORDER BY b.created DESC"); + db_results res=q->Read(); std::vector used; for(size_t i=0;i. -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #ifndef CLIENT_ONLY #include "action_header.h" diff --git a/urbackupserver/treediff/TreeDiff.cpp b/urbackupserver/treediff/TreeDiff.cpp index 4d919995..cdc0d93d 100644 --- a/urbackupserver/treediff/TreeDiff.cpp +++ b/urbackupserver/treediff/TreeDiff.cpp @@ -1,19 +1,19 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . **************************************************************************/ #include "TreeDiff.h" diff --git a/urbackupserver/treediff/TreeNode.cpp b/urbackupserver/treediff/TreeNode.cpp index b9139cfd..2af68d64 100644 --- a/urbackupserver/treediff/TreeNode.cpp +++ b/urbackupserver/treediff/TreeNode.cpp @@ -1,19 +1,19 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . **************************************************************************/ #include "TreeNode.h" diff --git a/urbackupserver/treediff/TreeReader.cpp b/urbackupserver/treediff/TreeReader.cpp index 028a328b..84756ea0 100644 --- a/urbackupserver/treediff/TreeReader.cpp +++ b/urbackupserver/treediff/TreeReader.cpp @@ -1,25 +1,25 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . **************************************************************************/ #include "TreeReader.h" #include #include -#include +#include #include #include "../../stringtools.h" #include "../../urbackupcommon/os_functions.h" diff --git a/urlplugin/dllmain.cpp b/urlplugin/dllmain.cpp index f4cedada..6b96bfaa 100644 --- a/urlplugin/dllmain.cpp +++ b/urlplugin/dllmain.cpp @@ -1,21 +1,21 @@ -/************************************************************************* -* UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -**************************************************************************/ - +/************************************************************************* +* UrBackup - Client/Server backup system +* Copyright (C) 2011-2014 Martin Raiber +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +**************************************************************************/ + #include "../vld.h" #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec (dllexport) diff --git a/urlplugin/pluginmgr.cpp b/urlplugin/pluginmgr.cpp index 86c8b6f7..7b938f2c 100644 --- a/urlplugin/pluginmgr.cpp +++ b/urlplugin/pluginmgr.cpp @@ -1,6 +1,6 @@ /************************************************************************* * UrBackup - Client/Server backup system -* Copyright (C) 2011 Martin Raiber +* Copyright (C) 2011-2014 Martin Raiber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,18 +16,18 @@ * along with this program. If not, see . **************************************************************************/ -#include "../vld.h" -#include "pluginmgr.h" -#include "UrlFactory.h" - -IPlugin *CUrlPluginMgr::createPluginInstance(str_map ¶ms) -{ - return new UrlFactory(); -} - -void CUrlPluginMgr::destroyPluginInstance(IPlugin *plugin) -{ - UrlFactory *s=(UrlFactory*)plugin; - delete s; -} - +#include "../vld.h" +#include "pluginmgr.h" +#include "UrlFactory.h" + +IPlugin *CUrlPluginMgr::createPluginInstance(str_map ¶ms) +{ + return new UrlFactory(); +} + +void CUrlPluginMgr::destroyPluginInstance(IPlugin *plugin) +{ + UrlFactory *s=(UrlFactory*)plugin; + delete s; +} +