update SocketAddress::setFromPath() to take a StringPiece
Summary:Update setFromPath() to accept a StringPiece rather than just std::string
or a plain const char*.
Also fix two other minor issues:
- Leave the old address untouched on failure. Previously it could leave the
SocketAddress in a partially updated state.
- Don't assume the input is nul terminated. Previously the input code read
one past the specified input length, and copied this into the address,
assuming it was a nul terminator. The new code explicitly writes a 0 byte.
Reviewed By: yfeldblum
Differential Revision:
D3119882
fb-gh-sync-id:
3e2258f42034b4f470ade0a23ea085e132a3dd0f
fbshipit-source-id:
3e2258f42034b4f470ade0a23ea085e132a3dd0f