[Box Backup-commit] [boxbackup/boxbackup] e8a965: Refactor GetLine

GitHub noreply at github.com
Mon Sep 25 21:54:50 BST 2017


  Branch: refs/heads/s3_support_merge
  Home:   https://github.com/boxbackup/boxbackup
  Commit: e8a9658d62b5a9427ae2de7661210f30434c5865
      https://github.com/boxbackup/boxbackup/commit/e8a9658d62b5a9427ae2de7661210f30434c5865
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: 74a49a6b07d96b1cccc22944c4bd5baa0581b9c5
      https://github.com/boxbackup/boxbackup/commit/74a49a6b07d96b1cccc22944c4bd5baa0581b9c5
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: efbade56b3b2c0a42ea88f3370f55bac660cd19c
      https://github.com/boxbackup/boxbackup/commit/efbade56b3b2c0a42ea88f3370f55bac660cd19c
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: 264bd77ed11566df175018950febda7c2ddc4ffb
      https://github.com/boxbackup/boxbackup/commit/264bd77ed11566df175018950febda7c2ddc4ffb
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: 364cf5cb732cddbf77d98eca232d5525ac22960a
      https://github.com/boxbackup/boxbackup/commit/364cf5cb732cddbf77d98eca232d5525ac22960a
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: 0749b077a8f6d5c156b4d29b2c3d9d3c593e169d
      https://github.com/boxbackup/boxbackup/commit/0749b077a8f6d5c156b4d29b2c3d9d3c593e169d
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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: 62e91dd81619d378b72fdff8f4a784675f34486d
      https://github.com/boxbackup/boxbackup/commit/62e91dd81619d378b72fdff8f4a784675f34486d
  Author: Chris Wilson <chris+github at qwirx.com>
  Date:   2017-09-25 (Mon, 25 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/4a3d22adc022...62e91dd81619


More information about the Boxbackup-commit mailing list