[Box Backup-commit] [boxbackup/boxbackup] 869c34: Refactor GetLine

GitHub noreply at github.com
Thu Sep 28 22:56:49 BST 2017


  Branch: refs/heads/s3_support_merge
  Home:   https://github.com/boxbackup/boxbackup
  Commit: 869c344e7b15f17830319920ac1d58decc44503a
      https://github.com/boxbackup/boxbackup/commit/869c344e7b15f17830319920ac1d58decc44503a
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M bin/bbackupctl/bbackupctl.cpp
    M bin/bbackupquery/bbackupquery.cpp
    M lib/bbackupd/BackupDaemon.cpp
    M lib/bbstored/BBStoreDHousekeeping.cpp
    M lib/common/CommonException.txt
    M lib/common/FdGetLine.cpp
    M lib/common/FdGetLine.h
    R lib/common/GetLine.cpp
    R lib/common/GetLine.h
    M lib/common/IOStream.cpp
    M lib/common/IOStreamGetLine.cpp
    M lib/common/IOStreamGetLine.h
    A lib/common/LineBuffer.cpp
    A lib/common/LineBuffer.h
    M lib/httpserver/HTTPException.txt
    M lib/httpserver/HTTPHeaders.cpp
    M lib/httpserver/HTTPRequest.cpp
    M lib/httpserver/HTTPResponse.cpp
    M lib/httpserver/S3Simulator.cpp
    M lib/httpserver/S3Simulator.h
    M lib/server/ServerControl.cpp
    M lib/server/SocketStream.cpp
    A test/backupstore/testfiles/bbackupd.conf
    A test/backupstore/testfiles/s3simulator.conf
    M test/backupstorefix/testbackupstorefix.cpp
    M test/basicserver/testbasicserver.cpp
    M test/bbackupd/testbbackupd.cpp
    M test/common/testcommon.cpp

  Log Message:
  -----------
  Refactor GetLine

The class name was a problem, because the method that we want to call on it is
also called GetLine, which looks too much like a constructor in C++, so I
renamed it to LineBuffer.  I haven't yet renamed the child classes.

Also, it was impossible to distinguish between the different causes of
GetLine() returning false (timeout and signal) and EOF could only be checked by
calling a different function. Now all of these causes throw different
exceptions.

This really fixes the problem with attaching a debugger to a process waiting in
GetLine, which would previously cause the read() to return immediately with
EINTR, which we never retried because it looked like a timeout.


  Commit: 0a8e80c497cfb9fd88587a0716d3e3ea938b03eb
      https://github.com/boxbackup/boxbackup/commit/0a8e80c497cfb9fd88587a0716d3e3ea938b03eb
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/common/DebugMemLeakFinder.cpp
    M lib/common/MemLeakFinder.h

  Log Message:
  -----------
  Implement placement operator delete

"If the object is being created as part of a new expression, and an exception
is thrown, the object’s memory is deallocated by calling the appropriate
deallocation function. If the object is being created with a placement new
operator, the corresponding placement delete operator is called—that is, the
delete function that takes the same additional parameters as the placement new
operator. If no matching placement delete is found, no deallocation takes
place."

So to avoid memory leaks, we need to implement placement delete operators that
correspond to our placement new, which we use for leak detection (ironically)
in debug builds.


  Commit: 85e590e914bd60582dd90fde4002e5450cd649bc
      https://github.com/boxbackup/boxbackup/commit/85e590e914bd60582dd90fde4002e5450cd649bc
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/backupclient/BackupDaemonConfigVerify.cpp
    M lib/backupstore/BackupAccountControl.cpp
    M lib/httpserver/S3Client.h

  Log Message:
  -----------
  Enable support for S3 virtual hosts in BackupAccountControl

This enables the S3 bucket name to be included in the virtual hostname, for
example bucketname.s3.amazonaws.com, when connecting to a different hostname
such as localhost. This makes bucket names usable in tests with
BackupAccountControl.


  Commit: cce5529be5ce29ddc10c481751d8a96790f8a638
      https://github.com/boxbackup/boxbackup/commit/cce5529be5ce29ddc10c481751d8a96790f8a638
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/backupstore/BackupFileSystem.cpp
    M lib/backupstore/BackupFileSystem.h
    M lib/backupstore/BackupStoreException.txt

  Log Message:
  -----------
  Properly implement S3BackupFileSystem::GetPermanentRefCountDatabase


  Commit: 9efb463d7ba653f4a64ea497471bd98039a13710
      https://github.com/boxbackup/boxbackup/commit/9efb463d7ba653f4a64ea497471bd98039a13710
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/backupstore/BackupFileSystem.cpp

  Log Message:
  -----------
  Remove always-false assertion in S3BackupFileSystem::GetDirectory

This was designed to stop untested code from running. Now we are ready to use
this code, with tests soon to come.


  Commit: a24c2bbdbe4541286e4289b0d64270e50f23c5f3
      https://github.com/boxbackup/boxbackup/commit/a24c2bbdbe4541286e4289b0d64270e50f23c5f3
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/backupstore/BackupFileSystem.h
    M lib/backupstore/StoreTestUtils.cpp
    M lib/backupstore/StoreTestUtils.h
    M test/backupstore/testbackupstore.cpp

  Log Message:
  -----------
  Add store test helpers for specialised tests


  Commit: 25c82168920b24c8963e2cf6792fa0e9dc640d51
      https://github.com/boxbackup/boxbackup/commit/25c82168920b24c8963e2cf6792fa0e9dc640d51
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-28 (Thu, 28 Sep 2017)

  Changed paths:
    M lib/backupstore/BackupStoreContext.h
    M test/backupstore/testbackupstore.cpp

  Log Message:
  -----------
  Make BackupStoreContext::ClearDirectoryCache() public

Needed to clear the cache in backupstore tests specialised for S3.


Compare: https://github.com/boxbackup/boxbackup/compare/03cd458395b4...25c82168920b


More information about the Boxbackup-commit mailing list