MINIFI-235: Add curly braces per review 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/b6ada214 Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/b6ada214 Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/b6ada214 Branch: refs/heads/master Commit: b6ada214ac0476128906c2b01c93f898ceaba515 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:39:55 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/b6ada214/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;
