Skip to content

Better TSize support, source IP/port check and more

Compare
Choose a tag to compare
@pin pin released this 25 Aug 18:41
· 106 commits to master since this release

New Features (fully backward-compatible):

  • Uses Seek in case sender asked to send tsize option and io.Reader provided to ReadFrom method satisfy io.Seeker interface. In many cases (e.g. when os.File is used as an argument to ReadFrom) there is no need anymore to explicitly SetSize using OutgoingTransfer interface.
  • Default backoff jitter can be can be overridden in clients and servers by providing a custom backoff calculation function. See SetBackoff method. Implemented by @acd
  • RemoteAddr method allows retrieving remote peer's IP address and port. It can be particularly useful for logging from inside request handlers. Implemented by @acd

Protocol implementation improvements by @acd:

  • Remote port / TID check during transmission.
  • Remote IP address check (necessary due to the use of unconnected UDP sockets).

Fixes:

  • Close UDP connection at the end of a transfer. No connections piling up on OS X anymore, no need to bump ulimit to allow more open file descriptors.
  • Correct server IP in unit-tests allows reliable unit-tests execution on OS X. It was discovered during remote IP check testing and was fixed by @acd. No test flaps on OS X anymore.