Skip to content

Commit

Permalink
Merge Arnaud Grandville's Windows fixes.
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/agrandville/boxbackup into appveyor
  • Loading branch information
qris committed Dec 9, 2015
2 parents 94abf43 + 57198ec commit d4cd52e
Show file tree
Hide file tree
Showing 25 changed files with 1,805 additions and 451 deletions.
30 changes: 19 additions & 11 deletions .travis.yml
@@ -1,12 +1,15 @@
language: cpp
branches:
only:
- master

compiler:
- gcc
- clang
cache: apt

cache:
- apt
- ccache

sudo: false

addons:
apt:
packages:
Expand All @@ -17,12 +20,17 @@ addons:
- xsltproc
- zlib1g-dev

before_script:
- ./bootstrap
- ./configure
- make
before_script:
- ccache -s
- ./bootstrap
- ./configure CC="ccache $CC" CXX="ccache $CXX"
- grep CXX config.status
- make

script:
- ./runtest.pl ALL debug
- ./runtest.pl ALL release
env:
- TEST_TARGET=debug
- TEST_TARGET=release

script:
- ./runtest.pl ALL $TEST_TARGET
- ccache -s
21 changes: 21 additions & 0 deletions README.md
@@ -0,0 +1,21 @@
# Box Backup

![Travis CI](https://travis-ci.org/boxbackup/boxbackup.svg?branch=master)

Box Backup is an open source, completely automatic, secure, encrypted on-line backup system.

It has the following key features:

* All backed up data is stored on the server in files on a filesystem - no tape, archive or other special devices are required.
* The server is trusted only to make files available when they are required - all data is encrypted and can be decoded only by the original client. This makes it ideal for backing up over an untrusted network (such as the Internet), or where the server is in an uncontrolled environment.
* A backup daemon runs on systems to be backed up, and copies encrypted data to the server when it notices changes - so backups are continuous and up-to-date (although traditional snapshot backups are possible too).
* Only changes within files are sent to the server, just like rsync, minimising the bandwidth used between clients and server. This makes it particularly suitable for backing up between distant locations, or over the Internet.
* It behaves like tape - old file versions and deleted files are available.
* Old versions of files on the server are stored as changes from the current version, minimising the storage space required on the server. Files are the server are also compressed to minimise their size.
* Choice of backup behaviour - it can be optimised for document or server backup.
* It is designed to be easy and cheap to run a server. It has a portable implementation, and optional RAID implemented in userland for reliability without complex server setup or expensive hardware.

Please see the [website](https://www.boxbackup.org) for more information, including installation instructions.

Box Backup is distributed under a [mixed BSD/GPL license](https://github.com/boxbackup/boxbackup/blob/master/LICENSE.txt).

22 changes: 15 additions & 7 deletions bin/bbackupd/BackupClientContext.cpp
Expand Up @@ -247,6 +247,11 @@ BackupProtocolCallable &BackupClientContext::GetConnection()
return *mapConnection;
}

BackupProtocolCallable* BackupClientContext::GetOpenConnection() const
{
return mapConnection.get();
}

// --------------------------------------------------------------------------
//
// Function
Expand All @@ -257,18 +262,19 @@ BackupProtocolCallable &BackupClientContext::GetConnection()
// --------------------------------------------------------------------------
void BackupClientContext::CloseAnyOpenConnection()
{
if(mapConnection.get())
BackupProtocolCallable* pConnection(GetOpenConnection());
if(pConnection)
{
try
{
// Quit nicely
mapConnection->QueryFinished();
pConnection->QueryFinished();
}
catch(...)
{
// Ignore errors here
}

// Delete it anyway.
mapConnection.reset();
}
Expand Down Expand Up @@ -299,9 +305,10 @@ void BackupClientContext::CloseAnyOpenConnection()
// --------------------------------------------------------------------------
int BackupClientContext::GetTimeout() const
{
if(mapConnection.get())
BackupProtocolCallable* pConnection(GetOpenConnection());
if(pConnection)
{
return mapConnection->GetTimeout();
return pConnection->GetTimeout();
}

return (15*60*1000);
Expand Down Expand Up @@ -543,7 +550,8 @@ void BackupClientContext::UnManageDiffProcess()
// --------------------------------------------------------------------------
void BackupClientContext::DoKeepAlive()
{
if (!mapConnection.get())
BackupProtocolCallable* pConnection(GetOpenConnection());
if (!pConnection)
{
return;
}
Expand All @@ -559,7 +567,7 @@ void BackupClientContext::DoKeepAlive()
}

BOX_TRACE("KeepAliveTime reached, sending keep-alive message");
mapConnection->QueryGetIsAlive();
pConnection->QueryGetIsAlive();

mKeepAliveTimer.Reset(mKeepAliveTime * MILLI_SEC_IN_SEC);
}
Expand Down
11 changes: 8 additions & 3 deletions bin/bbackupd/BackupClientContext.h
Expand Up @@ -54,11 +54,16 @@ class BackupClientContext : public DiffTimer
bool TcpNiceMode
);
virtual ~BackupClientContext();

private:
BackupClientContext(const BackupClientContext &);
public:

virtual BackupProtocolCallable &GetConnection();
public:
// GetConnection() will open a connection if none is currently open.
virtual BackupProtocolCallable& GetConnection();
// GetOpenConnection() will not open a connection, just return NULL if there is
// no connection already open.
virtual BackupProtocolCallable* GetOpenConnection() const;
void CloseAnyOpenConnection();
int GetTimeout() const;
BackupClientDeleteList &GetDeleteList();
Expand Down Expand Up @@ -167,7 +172,7 @@ class BackupClientContext : public DiffTimer
// Created: 04/19/2005
//
// --------------------------------------------------------------------------
void SetKeepAliveTime(int iSeconds);
virtual void SetKeepAliveTime(int iSeconds);

// --------------------------------------------------------------------------
//
Expand Down
117 changes: 117 additions & 0 deletions infrastructure/msvc/2013/bbackupctl.vcxproj
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9FD51412-E945-4457-A17A-CA3C505CF431}</ProjectGuid>
<RootNamespace>bbackupctl</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\..\..\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)..\..\..\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)..\..\..\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)..\..\..\$(Configuration)\$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\lib\backupclient;$(ProjectDir)..\..\..\lib\backupstore;$(ProjectDir)..\..\..\lib\common;$(ProjectDir)..\..\..\lib\compress;$(ProjectDir)..\..\..\lib\crypto;$(ProjectDir)..\..\..\lib\server;$(ProjectDir)..\..\..\lib\win32;$(ProjectDir)..\..\..\bin\bbackupd;$(ProjectDir)..\..\..\..\openssl\include;$(ProjectDir)..\..\..\..\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC;QDBM_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4521</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalDependencies>$(OutDir)\libbackupclient.lib;$(OutDir)\libbackupstore.lib;VssApi.lib;Ws2_32.lib;Advapi32.lib;User32.lib;Gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\lib\backupclient;$(ProjectDir)..\..\..\lib\backupstore;$(ProjectDir)..\..\..\lib\common;$(ProjectDir)..\..\..\lib\compress;$(ProjectDir)..\..\..\lib\crypto;$(ProjectDir)..\..\..\lib\server;$(ProjectDir)..\..\..\lib\win32;$(ProjectDir)..\..\..\bin\bbackupd;$(ProjectDir)..\..\..\..\openssl\include;$(ProjectDir)..\..\..\..\zlib\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;BOX_RELEASE_BUILD;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;PCRE_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4521</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>$(OutDir)\libbackupclient.lib;$(OutDir)\libbackupstore.lib;VssApi.lib;Ws2_32.lib;Advapi32.lib;User32.lib;Gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)bbackupctl.exe</OutputFile>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\bin\bbackupctl\bbackupctl.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\lib\win32\messages.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="common.vcxproj">
<Project>{a089cee6-ebf0-4232-a0c0-74850a8127a6}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="libbackupclient.vcxproj">
<Project>{32604097-c934-4711-b1ad-206336640e70}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

0 comments on commit d4cd52e

Please sign in to comment.