You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2018/03/29 10:42:28 UTC

[geode-native] branch feature/GEODE-4946-msvc-warn updated (d486ea6 -> 5583e3a)

This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a change to branch feature/GEODE-4946-msvc-warn
in repository https://gitbox.apache.org/repos/asf/geode-native.git.


    from d486ea6  PCH warning free
     new af63987  Fixes for linux
     new 5583e3a  Fixes socket type warning.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cryptoimpl/SSLImpl.cpp      |  5 +++--
 tests/cpp/fwklib/TcpIpc.cpp | 18 +++++++++---------
 tests/cpp/fwklib/TcpIpc.hpp |  6 +++---
 3 files changed, 15 insertions(+), 14 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
jbarrett@apache.org.

[geode-native] 02/02: Fixes socket type warning.

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch feature/GEODE-4946-msvc-warn
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit 5583e3ad8d3e3f9651eee2fc062d14ffc8e59cd5
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Mar 29 10:41:56 2018 +0000

    Fixes socket type warning.
---
 tests/cpp/fwklib/TcpIpc.cpp | 18 +++++++++---------
 tests/cpp/fwklib/TcpIpc.hpp |  6 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/cpp/fwklib/TcpIpc.cpp b/tests/cpp/fwklib/TcpIpc.cpp
index 2dab7cb..22af7ae 100644
--- a/tests/cpp/fwklib/TcpIpc.cpp
+++ b/tests/cpp/fwklib/TcpIpc.cpp
@@ -33,7 +33,7 @@
 using namespace apache::geode::client;
 using namespace apache::geode::client::testframework;
 
-void TcpIpc::clearNagle(int32_t sock) {
+void TcpIpc::clearNagle(ACE_HANDLE sock) {
   int32_t val = 1;
 #ifdef WIN32
   const char *param = (const char *)&val;
@@ -42,12 +42,12 @@ void TcpIpc::clearNagle(int32_t sock) {
 #endif
   int32_t plen = sizeof(param);
 
-  if (0 != setsockopt(sock, IPPROTO_TCP, 1, param, plen)) {
+  if (0 != ACE_OS::setsockopt(sock, IPPROTO_TCP, 1, param, plen)) {
     FWKSEVERE("Failed to set NAGLE on socket.  Errno: " << errno);
   }
 }
 
-int32_t TcpIpc::getSize(int32_t sock, int32_t flag) {
+int32_t TcpIpc::getSize(ACE_HANDLE sock, int32_t flag) {
   int32_t val = 0;
 #ifdef _WIN32
   char *param = (char *)&val;
@@ -56,7 +56,7 @@ int32_t TcpIpc::getSize(int32_t sock, int32_t flag) {
 #endif
   socklen_t plen = sizeof(val);
 
-  if (0 != getsockopt(sock, SOL_SOCKET, flag, param, &plen)) {
+  if (0 != ACE_OS::getsockopt(sock, SOL_SOCKET, flag, param, &plen)) {
     FWKSEVERE("Failed to get buff size for flag "
               << flag << " on socket.  Errno: " << errno);
   }
@@ -66,7 +66,7 @@ int32_t TcpIpc::getSize(int32_t sock, int32_t flag) {
   return val;
 }
 
-int32_t TcpIpc::setSize(int32_t sock, int32_t flag, int32_t size) {
+int32_t TcpIpc::setSize(ACE_HANDLE sock, int32_t flag, int32_t size) {
   int32_t val = 0;
   if (size <= 0) return 0;
 
@@ -88,8 +88,8 @@ int32_t TcpIpc::setSize(int32_t sock, int32_t flag, int32_t size) {
   while (lastRed != red) {
     lastRed = red;
     val += inc;
-    setsockopt(sock, SOL_SOCKET, flag, cparam, clen);
-    if (0 != getsockopt(sock, SOL_SOCKET, flag, param, &plen)) {
+    ACE_OS::setsockopt(sock, SOL_SOCKET, flag, cparam, clen);
+    if (0 != ACE_OS::getsockopt(sock, SOL_SOCKET, flag, param, &plen)) {
       FWKSEVERE("Failed to get buff size for flag "
                 << flag << " on socket.  Errno: " << errno);
     }
@@ -102,7 +102,7 @@ int32_t TcpIpc::setSize(int32_t sock, int32_t flag, int32_t size) {
 }
 
 void TcpIpc::init(int32_t sockBufferSize) {
-  int32_t sock = (int32_t)socket(AF_INET, SOCK_STREAM, 0);
+  auto sock = ACE_OS::socket(AF_INET, SOCK_STREAM, 0);
   if (sock < 0) {
     FWKSEVERE("Failed to create socket.  Errno: " << errno);
   }
@@ -116,7 +116,7 @@ void TcpIpc::init(int32_t sockBufferSize) {
     int32_t size = getSize(sock, SO_SNDBUF);
     size = getSize(sock, SO_RCVBUF);
   }
-  m_io = new ACE_SOCK_Stream((ACE_HANDLE)sock);
+  m_io = new ACE_SOCK_Stream(sock);
   ACE_OS::signal(SIGPIPE, SIG_IGN);  // Ignore broken pipe
 }
 
diff --git a/tests/cpp/fwklib/TcpIpc.hpp b/tests/cpp/fwklib/TcpIpc.hpp
index c4e20f0..d5f2ada 100644
--- a/tests/cpp/fwklib/TcpIpc.hpp
+++ b/tests/cpp/fwklib/TcpIpc.hpp
@@ -37,9 +37,9 @@ class TcpIpc {
   std::string m_ipaddr;
 
   void init(int32_t sockBufferSize = 0);
-  void clearNagle(int32_t sock);
-  int32_t setSize(int32_t sock, int32_t flag, int32_t size);
-  int32_t getSize(int32_t sock, int32_t flag);
+  void clearNagle(ACE_HANDLE sock);
+  int32_t setSize(ACE_HANDLE sock, int32_t flag, int32_t size);
+  int32_t getSize(ACE_HANDLE sock, int32_t flag);
 
  public:
   TcpIpc(std::string& ipaddr, int32_t sockBufferSize = 0) : m_ipaddr(ipaddr) {

-- 
To stop receiving notification emails like this one, please contact
jbarrett@apache.org.

[geode-native] 01/02: Fixes for linux

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch feature/GEODE-4946-msvc-warn
in repository https://gitbox.apache.org/repos/asf/geode-native.git

commit af63987ed56638d72b3036b70c02e6f1b7df8850
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Mar 29 10:24:23 2018 +0000

    Fixes for linux
---
 cryptoimpl/SSLImpl.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cryptoimpl/SSLImpl.cpp b/cryptoimpl/SSLImpl.cpp
index a70f6d6..9fa0835 100644
--- a/cryptoimpl/SSLImpl.cpp
+++ b/cryptoimpl/SSLImpl.cpp
@@ -39,12 +39,13 @@ void gf_destroy_SslImpl(void *impl) {
   delete theLib;
 }
 
-extern "C" static int pem_passwd_cb(char *buf, int size, int rwflag,
-                                    void *passwd) {
+extern "C" {
+static int pem_passwd_cb(char *buf, int size, int rwflag, void *passwd) {
   strncpy(buf, (char *)passwd, size);
   buf[size - 1] = '\0';
   return static_cast<int>(strlen(buf));
 }
+}
 
 SSLImpl::SSLImpl(ACE_HANDLE sock, const char *pubkeyfile,
                  const char *privkeyfile, const char *password) {

-- 
To stop receiving notification emails like this one, please contact
jbarrett@apache.org.