Repository: nifi-minifi-cpp Updated Branches: refs/heads/master b6ada214a -> f06721a40 (forced update)
MINIFI-235: Add curly braces per review This closes #64 Signed-off-by: Jeremy Dyer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/f06721a4 Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/f06721a4 Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/f06721a4 Branch: refs/heads/master Commit: f06721a40e47f6d39cb735f17a9a96441cc975c1 Parents: a1f1d7c Author: Marc Parisi <[email protected]> Authored: Wed Mar 8 19:12:45 2017 -0500 Committer: Jeremy Dyer <[email protected]> Committed: Wed Mar 8 19:42:25 2017 -0500 ---------------------------------------------------------------------- libminifi/src/io/ClientSocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/f06721a4/libminifi/src/io/ClientSocket.cpp ---------------------------------------------------------------------- diff --git a/libminifi/src/io/ClientSocket.cpp b/libminifi/src/io/ClientSocket.cpp index 4f32eec..ab391a4 100644 --- a/libminifi/src/io/ClientSocket.cpp +++ b/libminifi/src/io/ClientSocket.cpp @@ -109,9 +109,13 @@ int8_t Socket::createConnection(const addrinfo *p) { // use any address if you are connecting to the local machine for testing // otherwise we must use the requested hostname if (IsNullOrEmpty(requested_hostname_) || requested_hostname_=="localhost") + { sa_loc->sin_addr.s_addr = htonl(INADDR_ANY); + } else + { sa_loc->sin_addr.s_addr = inet_addr(requested_hostname_.c_str()); + } if (connect(socket_file_descriptor_, p->ai_addr, p->ai_addrlen) == -1) { close(socket_file_descriptor_); socket_file_descriptor_ = -1;
