[Box Backup-commit] [boxbackup/boxbackup] 22febb: Refactor GetLine

GitHub noreply at github.com
Thu Sep 28 23:14:56 BST 2017


  Branch: refs/heads/s3_support_merge
  Home:   https://github.com/boxbackup/boxbackup
  Commit: 22febb636d6aa3b47d84ffdf885c6f2e739da96b
      https://github.com/boxbackup/boxbackup/commit/22febb636d6aa3b47d84ffdf885c6f2e739da96b
  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: 71a86a0069f2b583e4cad701b49d03845a63ed6d
      https://github.com/boxbackup/boxbackup/commit/71a86a0069f2b583e4cad701b49d03845a63ed6d
  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: ea0aa9ee54dfabf94fc41a4563ce58c5061d20ed
      https://github.com/boxbackup/boxbackup/commit/ea0aa9ee54dfabf94fc41a4563ce58c5061d20ed
  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: ee9028c889a686f5dad00478edc273172ab1aafe
      https://github.com/boxbackup/boxbackup/commit/ee9028c889a686f5dad00478edc273172ab1aafe
  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: c5c64f488e214f4b6fc9b56f029111da5831208c
      https://github.com/boxbackup/boxbackup/commit/c5c64f488e214f4b6fc9b56f029111da5831208c
  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: a6a058cb98a4b826b3810301ea4590c3077839fd
      https://github.com/boxbackup/boxbackup/commit/a6a058cb98a4b826b3810301ea4590c3077839fd
  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: 707b67501528f32e42430f31e09454bd984c9f8b
      https://github.com/boxbackup/boxbackup/commit/707b67501528f32e42430f31e09454bd984c9f8b
  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/25c82168920b...707b67501528


More information about the Boxbackup-commit mailing list