thrift git commit: THRIFT-4007: TTransport.py micro-optimization: don't call len(chunk) twice Client: Python Patch: Nate Jensen <nathan.jen...@raytheon.com>

2017-02-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 2d6060d88 -> de9c330b2


THRIFT-4007: TTransport.py micro-optimization: don't call len(chunk) twice
Client: Python
Patch: Nate Jensen 

This closes #1121


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/de9c330b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/de9c330b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/de9c330b

Branch: refs/heads/master
Commit: de9c330b24c9190078eefb68c864d2a41a4dee07
Parents: 2d6060d
Author: James E. King, III 
Authored: Wed Feb 1 07:16:28 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 1 07:16:28 2017 -0500

--
 lib/py/src/transport/TTransport.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/de9c330b/lib/py/src/transport/TTransport.py
--
diff --git a/lib/py/src/transport/TTransport.py 
b/lib/py/src/transport/TTransport.py
index 5283fce..a3e9725 100644
--- a/lib/py/src/transport/TTransport.py
+++ b/lib/py/src/transport/TTransport.py
@@ -58,10 +58,11 @@ class TTransportBase(object):
 have = 0
 while (have < sz):
 chunk = self.read(sz - have)
-have += len(chunk)
+chunkLen = len(chunk)
+have += chunkLen
 buff += chunk
 
-if len(chunk) == 0:
+if chunkLen == 0:
 raise EOFError()
 
 return buff



thrift git commit: THRIFT-4076 fix appveyor ant issue Client: Build

2017-02-08 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 3a8bbbd4a -> bdd0b73a8


THRIFT-4076 fix appveyor ant issue
Client: Build

This closes #1180


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bdd0b73a
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bdd0b73a
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bdd0b73a

Branch: refs/heads/master
Commit: bdd0b73a89f518917d23b35129226b89631e39fa
Parents: 3a8bbbd
Author: James E. King, III 
Authored: Wed Feb 8 12:27:57 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 8 12:27:57 2017 -0500

--
 appveyor.yml | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bdd0b73a/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index 82ce366..aeb9d59 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -52,18 +52,22 @@ install:
 - move WIN32-Code\event2\* include\event2\
 - move *.h include\
 - cd ..
-- appveyor-retry cinst -y winflexbison
-- appveyor DownloadFile 
http://www.us.apache.org/dist/ant/binaries/apache-ant-%ANT_VERSION%-bin.zip
-- 7z x apache-ant-%ANT_VERSION%-bin.zip > nul
+- appveyor-retry cinst -y ant
+- appveyor-retry cinst -y winflexbison3
+## appveyor DownloadFile 
http://www.us.apache.org/dist/ant/binaries/apache-ant-%ANT_VERSION%-bin.zip
+# 7z x apache-ant-%ANT_VERSION%-bin.zip > nul
 - cd %APPVEYOR_BUILD_FOLDER%
 # TODO: Enable Haskell build
 # - cinst HaskellPlatform -version 2014.2.0.0
 
 
 build_script:
-- set PATH=C:\ProgramData\chocolatey\bin;C:\apache-ant-%ANT_VERSION%\bin;%PATH%
-- set JAVA_HOME=C:\Program Files\Java\jdk1.7.0
-- set PATH=%JAVA_HOME%\bin;%PATH%
+- echo PATH=%PATH%
+- set PATH=C:\ProgramData\chocolatey\bin;%PATH%
+## installation of ant brings in the latest jdk and sets JAVA_HOME
+- echo JAVA_HOME=%JAVA_HOME%
+## set JAVA_HOME=C:\Program Files\Java\jdk1.7.0
+## set PATH=%JAVA_HOME%\bin;%PATH%
 # - set PATH=%PATH%;C:\Program Files (x86)\Haskell Platform\2014.2.0.0\bin
 # - set PATH=%PATH%;C:\Program Files (x86)\Haskell 
Platform\2014.2.0.0\lib\extralibs\bin
 - set PATH=C:\Python27-x64\scripts;C:\Python27-x64;%PATH%



thrift git commit: THRIFT-4043 ensure perl files do not end up in /usr/lib/Thrift Client: Build

2017-02-08 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master bdd0b73a8 -> bd257f1b9


THRIFT-4043 ensure perl files do not end up in /usr/lib/Thrift
Client: Build

This closes #1174


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bd257f1b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bd257f1b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bd257f1b

Branch: refs/heads/master
Commit: bd257f1b9058c1ea7fc12b0a312fe7fa3de86a7e
Parents: bdd0b73
Author: James E. King, III 
Authored: Wed Feb 8 13:05:33 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 8 13:05:33 2017 -0500

--
 debian/rules | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bd257f1b/debian/rules
--
diff --git a/debian/rules b/debian/rules
index 46a7f92..53aec3c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -130,7 +130,8 @@ install-indep:
 
# Perl
$(MAKE) -C $(CURDIR)/lib/perl install 
DESTDIR=$(CURDIR)/debian/libthrift-perl
-   mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 
$(CURDIR)/debian/libthrift-perl/usr/lib
+   mkdir -p $(CURDIR)/debian/libthrift-perl/usr/share
+   mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 
$(CURDIR)/debian/libthrift-perl/usr/share
rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib
rmdir $(CURDIR)/debian/libthrift-perl/usr/local
 



thrift git commit: THRIFT-3896 fix map type with string key can not access deserialized by php extension Client: php Patch: feid...@anjuke.com

2017-02-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master a3d6be906 -> 3a8bbbd4a


THRIFT-3896 fix map type with string key can not access deserialized by php 
extension
Client: php
Patch: feid...@anjuke.com

This closes #1062


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3a8bbbd4
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3a8bbbd4
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3a8bbbd4

Branch: refs/heads/master
Commit: 3a8bbbd4a68fb28f2b33a7ee9e81ba3dd4a929a5
Parents: a3d6be9
Author: James E. King, III 
Authored: Mon Feb 6 12:57:21 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 6 12:57:21 2017 -0500

--
 lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp  | 4 ++--
 lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/3a8bbbd4/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
--
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp 
b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
index a0de645..f9b3ad7 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
@@ -543,7 +543,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
 }
 else {
   if (Z_TYPE_P(key) != IS_STRING) convert_to_string(key);
-  zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, , sizeof(zval *), NULL);
+  zend_symtable_update(return_value->value.ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, , sizeof(zval *), NULL);
 }
 zval_ptr_dtor();
   }
@@ -589,7 +589,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
 }
 else {
   if (Z_TYPE_P(key) != IS_STRING) convert_to_string(key);
-  zend_hash_update(return_value->value.ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, , sizeof(zval *), NULL);
+  zend_symtable_update(return_value->value.ht, Z_STRVAL_P(key), 
Z_STRLEN_P(key) + 1, , sizeof(zval *), NULL);
 }
 zval_ptr_dtor();
   }

http://git-wip-us.apache.org/repos/asf/thrift/blob/3a8bbbd4/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
--
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp 
b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
index 59fa30a..13cdf22 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
@@ -594,7 +594,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
   zend_hash_index_update(Z_ARR_P(return_value), Z_LVAL(key), );
 } else {
   if (Z_TYPE(key) != IS_STRING) convert_to_string();
-  zend_hash_update(Z_ARR_P(return_value), Z_STR(key), );
+  zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), );
 }
   }
   return; // return_value already populated
@@ -634,7 +634,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
   zend_hash_index_update(Z_ARR_P(return_value), Z_LVAL(key), );
 } else {
   if (Z_TYPE(key) != IS_STRING) convert_to_string();
-  zend_hash_update(Z_ARR_P(return_value), Z_STR(key), );
+  zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), );
 }
   }
   return;



thrift git commit: THRIFT-4068 fix comment in java server socket code Client: Java Patch: pigbrain <hyundong....@nhnent.com>

2017-02-03 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master de9c330b2 -> a3d6be906


THRIFT-4068 fix comment in java server socket code
Client: Java
Patch: pigbrain 

This closes #1177


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/a3d6be90
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/a3d6be90
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/a3d6be90

Branch: refs/heads/master
Commit: a3d6be906b339ce4e55e8fb8d98ff11480792949
Parents: de9c330
Author: James E. King, III 
Authored: Sat Feb 4 00:23:55 2017 -0500
Committer: James E. King, III 
Committed: Sat Feb 4 00:23:55 2017 -0500

--
 lib/java/src/org/apache/thrift/transport/TServerSocket.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/a3d6be90/lib/java/src/org/apache/thrift/transport/TServerSocket.java
--
diff --git a/lib/java/src/org/apache/thrift/transport/TServerSocket.java 
b/lib/java/src/org/apache/thrift/transport/TServerSocket.java
index 7bd87f4..79f7b7f 100644
--- a/lib/java/src/org/apache/thrift/transport/TServerSocket.java
+++ b/lib/java/src/org/apache/thrift/transport/TServerSocket.java
@@ -111,7 +111,7 @@ public class TServerSocket extends TServerTransport {
   }
 
   public void listen() throws TTransportException {
-// Make sure not to block on accept
+// Make sure to block on accept
 if (serverSocket_ != null) {
   try {
 serverSocket_.setSoTimeout(0);



thrift git commit: THRIFT-4046 fix PlatformSocket.h for mingw64/msys2 and provide instructions for building with cmake under that toolchain Client: cmake Patch: James E. King, III <jk...@apache.org>

2017-01-31 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 34bd992bc -> 2d6060d88


THRIFT-4046 fix PlatformSocket.h for mingw64/msys2 and provide instructions for 
building with cmake under that toolchain
Client: cmake
Patch: James E. King, III 

This closes #1171


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2d6060d8
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2d6060d8
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2d6060d8

Branch: refs/heads/master
Commit: 2d6060d882069ed3e3d6302aa63ea7eb4bb155ad
Parents: 34bd992
Author: James E. King, III 
Authored: Tue Jan 31 16:17:03 2017 -0500
Committer: James E. King, III 
Committed: Tue Jan 31 16:17:53 2017 -0500

--
 build/cmake/README-MSYS2.md   | 63 ++
 lib/cpp/src/thrift/transport/PlatformSocket.h |  3 ++
 2 files changed, 66 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/2d6060d8/build/cmake/README-MSYS2.md
--
diff --git a/build/cmake/README-MSYS2.md b/build/cmake/README-MSYS2.md
new file mode 100644
index 000..06c0205
--- /dev/null
+++ b/build/cmake/README-MSYS2.md
@@ -0,0 +1,63 @@
+
+
+# Building thrift on Windows (MinGW64/MSYS2)
+
+Thrift uses cmake to make it easier to build the project on multiple 
platforms, however to build a fully functional and production ready thrift on 
Windows requires a number of third party libraries to be obtained.  Once third 
party libraries are ready, the right combination of options must be passed to 
cmake in order to generate the correct environment.
+
+> Note: libevent and libevent-devel do not work with this toolchain as they do 
not properly detect mingw64 and expect some headers to exist that do not, so 
the non-blocking server is not currently built into this solution.
+
+## MSYS2
+
+Download and fully upgrade msys2 following the instructions at:
+
+https://msys2.github.io/
+
+Install the necessary toolchain items for C++:
+
+$ pacman -S bison flex openssl openssl-devel \
+mingw-w64-x86_64-boost mingw-w64-x86_64-cmake \
+mingw-w64-x86_64-toolchain zlib zlib-devel
+
+Update your msys2 bash path to include /mingw64/bin by adding a line to your 
~/.bash_profiles using this command:
+
+echo "export PATH=/mingw64/bin:\$PATH" >> ~/.bash_profile
+
+After that, close your shell and open a new one.
+
+Use cmake to create a MinGW makefile, out of tree (assumes you are in the top 
level of the thrift source tree):
+
+mkdir ../thrift-build
+cd ../thrift-build
+cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make \
+   -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe \
+   -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe \
+   -DWITH_BOOSTTHREADS=ON -DWITH_LIBEVENT=OFF \
+   -DWITH_SHARED_LIB=OFF -DWITH_STATIC_LIB=ON \
+   -DWITH_JAVA=OFF -DWITH_PYTHON=OFF -DWITH_PERL=OFF \
+   ../thrift
+
+Build thrift (inside thrift-build):
+
+cmake --build .
+
+Run the tests (inside thrift-build):
+
+ctest
+
+> If you run into issues, check Apache Jira THRIFT-4046 for patches relating 
to MinGW64/MSYS2 builds.
+
+## Tested With
+
+msys2 64-bit 2016-10-26 distribution
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/thrift/blob/2d6060d8/lib/cpp/src/thrift/transport/PlatformSocket.h
--
diff --git a/lib/cpp/src/thrift/transport/PlatformSocket.h 
b/lib/cpp/src/thrift/transport/PlatformSocket.h
index e7addd6..b8974ba 100644
--- a/lib/cpp/src/thrift/transport/PlatformSocket.h
+++ b/lib/cpp/src/thrift/transport/PlatformSocket.h
@@ -78,6 +78,9 @@
 #define THRIFT_POLLOUT POLLOUT
 #  endif //WINVER
 #  define THRIFT_SHUT_RDWR SD_BOTH
+#  if _WIN32_WINNT < 0x0600
+#define AI_ADDRCONFIG 0
+#  endif
 #else //not _WIN32
 #  include 
 #  define THRIFT_GET_SOCKET_ERROR errno



thrift git commit: THRIFT-4040 Add real cause of TNonblockingServerSocket error to exception Client: Java Patch: Dmitry Roenko <sav...@gmail.com>

2017-01-23 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 330b3f814 -> 55f976e0d


THRIFT-4040 Add real cause of TNonblockingServerSocket error to exception
Client: Java
Patch: Dmitry Roenko 

This closes #1116


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/55f976e0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/55f976e0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/55f976e0

Branch: refs/heads/master
Commit: 55f976e0decefb284b0f0a459745dd57f038ab4f
Parents: 330b3f8
Author: James E. King, III 
Authored: Mon Jan 23 09:06:27 2017 -0500
Committer: James E. King, III 
Committed: Mon Jan 23 09:06:27 2017 -0500

--
 .../src/org/apache/thrift/transport/TNonblockingServerSocket.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/55f976e0/lib/java/src/org/apache/thrift/transport/TNonblockingServerSocket.java
--
diff --git 
a/lib/java/src/org/apache/thrift/transport/TNonblockingServerSocket.java 
b/lib/java/src/org/apache/thrift/transport/TNonblockingServerSocket.java
index 44fe273..ef82ac2 100644
--- a/lib/java/src/org/apache/thrift/transport/TNonblockingServerSocket.java
+++ b/lib/java/src/org/apache/thrift/transport/TNonblockingServerSocket.java
@@ -93,7 +93,7 @@ public class TNonblockingServerSocket extends 
TNonblockingServerTransport {
   serverSocket_.bind(args.bindAddr, args.backlog);
 } catch (IOException ioe) {
   serverSocket_ = null;
-  throw new TTransportException("Could not create ServerSocket on address 
" + args.bindAddr.toString() + ".");
+  throw new TTransportException("Could not create ServerSocket on address 
" + args.bindAddr.toString() + ".", ioe);
 }
   }
 



thrift git commit: THRIFT-4034 compiler build fixes for macos sierra and some cmake cleanup for compiler Compiler Patch: Robert Lu <robberp...@gmail.com>

2017-01-23 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 4194562c6 -> 330b3f814


THRIFT-4034 compiler build fixes for macos sierra and some cmake cleanup for 
compiler
Compiler
Patch: Robert Lu 

This closes #1161


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/330b3f81
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/330b3f81
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/330b3f81

Branch: refs/heads/master
Commit: 330b3f814a33ab8a740fca4da29106bd7e219b1d
Parents: 4194562
Author: James E. King, III 
Authored: Mon Jan 23 08:52:04 2017 -0500
Committer: James E. King, III 
Committed: Mon Jan 23 08:52:04 2017 -0500

--
 appveyor.yml   |  3 --
 compiler/cpp/CMakeLists.txt| 24 +++---
 compiler/cpp/README.md | 58 +
 compiler/cpp/src/thrift/thrifty.yy |  3 ++
 4 files changed, 53 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/330b3f81/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index e7ab87d..82ce366 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -42,9 +42,6 @@ install:
 - cmake -G "Visual Studio 14 2015 Win64" .
 - cmake --build . --config release
 - cd ..
-  # OpenSSL
-- C:\Python35-x64\python 
%APPVEYOR_BUILD_FOLDER%\build\appveyor\download_openssl.py
-- ps: Start-Process "Win64OpenSSL.exe" -ArgumentList "/silent /verysilent /sp- 
/suppressmsgboxes" -Wait
   # Libevent
 - appveyor DownloadFile 
https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
 - 7z x libevent-2.0.22-stable.tar.gz -so | 7z x -si -ttar > nul

http://git-wip-us.apache.org/repos/asf/thrift/blob/330b3f81/compiler/cpp/CMakeLists.txt
--
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 059c3bf..9f7585d 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -16,6 +16,7 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+cmake_minimum_required(VERSION 2.8.12)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in 
${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
 if(MSVC)
@@ -30,24 +31,21 @@ endif()
 find_package(FLEX REQUIRED)
 find_package(BISON REQUIRED)
 
+# create directory for thrifty and thriftl
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/thrift/)
+
 # Create flex and bison files and build the lib parse static library
 BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thrifty.yy 
${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc)
 FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/thriftl.ll 
${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc)
 ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
 
-# HACK: Work around the fact that bison crates a .hh file but we need a .h file
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
-   COMMAND ${CMAKE_COMMAND} -E copy 
${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh 
${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
-   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh
-   )
-
-set(libparse_SOURCES
+set(parse_SOURCES
 ${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.cc
 ${CMAKE_CURRENT_BINARY_DIR}/thrift/thriftl.cc
-${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.h
+${CMAKE_CURRENT_BINARY_DIR}/thrift/thrifty.hh
 )
 
-add_library(libparse STATIC ${libparse_SOURCES})
+add_library(parse STATIC ${parse_SOURCES})
 
 # Create the thrift compiler
 set(compiler_core
@@ -112,6 +110,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
 if(NOT ${WITH_PLUGIN})
 list(APPEND thrift-compiler_SOURCES ${compiler_core})
 endif()
+
 add_executable(thrift-compiler ${thrift-compiler_SOURCES})
 
 if(${WITH_PLUGIN})
@@ -120,7 +119,7 @@ if(${WITH_PLUGIN})
 src/thrift/audit/t_audit.cpp
 src/thrift/generate/t_cpp_generator.cc
 )
-target_link_libraries(thrift-bootstrap libparse)
+target_link_libraries(thrift-bootstrap parse)
 
 set(PLUGIN_GEN_SOURCES
 ${CMAKE_CURRENT_BINARY_DIR}/thrift/plugin/plugin_types.h
@@ -153,11 +152,12 @@ if(${WITH_PLUGIN})
 LINK_AGAINST_THRIFT_LIBRARY(thrift-compiler thriftc)
 endif()
 
+set_target_properties(thrift-compiler PROPERTIES RUNTIME_OUTPUT_DIRECTORY bin/)
 set_target_properties(thrift-compiler PROPERTIES OUTPUT_NAME thrift)
 
-target_link_libraries(thrift-compiler libparse)
+target_link_libraries(thrift-compiler parse)
 
-install(TARGETS thrift-compiler DESTINATION "${BIN_INSTALL_DIR}")
+install(TARGETS thrift-compiler DESTINATION bin)
 
 if(${WITH_PLUGIN})
   # 

thrift git commit: THRIFT-3926 There should be an error emitted when http status code is not 200 Client: nodejs Patch: lifei <li...@bytedance.com>

2017-01-24 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b62247e0e -> 3d6e2a507


THRIFT-3926 There should be an error emitted when http status code is not 200
Client: nodejs
Patch: lifei 

This closes #1086


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3d6e2a50
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3d6e2a50
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3d6e2a50

Branch: refs/heads/master
Commit: 3d6e2a507159e51d486e4e2674a1dca5fc227279
Parents: b62247e
Author: James E. King, III 
Authored: Tue Jan 24 23:29:52 2017 -0500
Committer: James E. King, III 
Committed: Tue Jan 24 23:31:54 2017 -0500

--
 lib/nodejs/lib/thrift/http_connection.js | 15 +++
 1 file changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/3d6e2a50/lib/nodejs/lib/thrift/http_connection.js
--
diff --git a/lib/nodejs/lib/thrift/http_connection.js 
b/lib/nodejs/lib/thrift/http_connection.js
index 18bfadb..163e5b7 100644
--- a/lib/nodejs/lib/thrift/http_connection.js
+++ b/lib/nodejs/lib/thrift/http_connection.js
@@ -169,6 +169,10 @@ var HttpConnection = exports.HttpConnection = 
function(host, port, options) {
 var data = [];
 var dataLen = 0;
 
+if (response.statusCode !== 200) {
+  this.emit("error", new THTTPException(statusCode, response));
+}
+
 response.on('error', function (e) {
   self.emit("error", e);
 });
@@ -236,3 +240,14 @@ exports.createHttpConnection = function(host, port, 
options) {
 
 exports.createHttpClient = createClient
 
+
+function THTTPException(statusCode, response) {
+  thrift.TApplicationException.call(this);
+  Error.captureStackTrace(this, this.constructor);
+  this.name = this.constructor.name;
+  this.statusCode = statusCode;
+  this.response = response;
+  this.type = thrift.TApplicationExceptionType.PROTOCOL_ERROR;
+  this.message = "Received a response with a bad HTTP status code: " + 
response.statusCode;
+}
+util.inherits(THTTPException, thrift.TApplicationException);
\ No newline at end of file



thrift git commit: Remove deprecated bower json property Client: nodejs Patch: Kevin Kirsche <kev.kirs...@gmail.com>

2017-01-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master de3e17ad3 -> b88a25a47


Remove deprecated bower json property
Client: nodejs
Patch: Kevin Kirsche 

This closes #520


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b88a25a4
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b88a25a4
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b88a25a4

Branch: refs/heads/master
Commit: b88a25a47fcf1f63a85ce2d11a8e6579085997a9
Parents: de3e17a
Author: James E. King, III 
Authored: Fri Jan 27 23:47:12 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 27 23:47:16 2017 -0500

--
 bower.json | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/b88a25a4/bower.json
--
diff --git a/bower.json b/bower.json
index e0612e3..1092c65 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,5 @@
 {
   "name": "thrift",
-  "version": "0.9.3",
   "homepage": "https://git-wip-us.apache.org/repos/asf/thrift.git;,
   "authors": [
 "Apache Thrift "



thrift git commit: THRIFT-3854 add a way in java to clear TFramedTransport read buffers Client: Java Patch: Chris Lockfort <clockf...@palantir.com>

2017-01-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 988b3e9bd -> de3e17ad3


THRIFT-3854 add a way in java to clear TFramedTransport read buffers
Client: Java
Patch: Chris Lockfort 

This closes #1164
This closes #1081


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/de3e17ad
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/de3e17ad
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/de3e17ad

Branch: refs/heads/master
Commit: de3e17ad39a57163a42ab89d559356f4cee27c4a
Parents: 988b3e9
Author: James E. King, III 
Authored: Fri Jan 27 23:36:31 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 27 23:36:31 2017 -0500

--
 .../thrift/transport/TFastFramedTransport.java  |  8 +-
 .../thrift/transport/TFramedTransport.java  | 15 ++-
 .../transport/TestTFastFramedTransport.java |  6 +++--
 .../thrift/transport/TestTFramedTransport.java  | 28 
 4 files changed, 48 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/de3e17ad/lib/java/src/org/apache/thrift/transport/TFastFramedTransport.java
--
diff --git a/lib/java/src/org/apache/thrift/transport/TFastFramedTransport.java 
b/lib/java/src/org/apache/thrift/transport/TFastFramedTransport.java
index 0398ca7..d265600 100644
--- a/lib/java/src/org/apache/thrift/transport/TFastFramedTransport.java
+++ b/lib/java/src/org/apache/thrift/transport/TFastFramedTransport.java
@@ -65,7 +65,8 @@ public class TFastFramedTransport extends TTransport {
 
   private final TTransport underlying;
   private final AutoExpandingBufferWriteTransport writeBuffer;
-  private final AutoExpandingBufferReadTransport readBuffer;
+  private AutoExpandingBufferReadTransport readBuffer;
+  private final int initialBufferCapacity;
   private final byte[] i32buf = new byte[4];
   private final int maxLength;
 
@@ -104,6 +105,7 @@ public class TFastFramedTransport extends TTransport {
   public TFastFramedTransport(TTransport underlying, int 
initialBufferCapacity, int maxLength) {
 this.underlying = underlying;
 this.maxLength = maxLength;
+this.initialBufferCapacity = initialBufferCapacity;
 writeBuffer = new AutoExpandingBufferWriteTransport(initialBufferCapacity, 
1.5);
 readBuffer = new AutoExpandingBufferReadTransport(initialBufferCapacity, 
1.5);
   }
@@ -164,6 +166,10 @@ public class TFastFramedTransport extends TTransport {
 readBuffer.consumeBuffer(len);
   }
 
+  public void clear() {
+readBuffer = new AutoExpandingBufferReadTransport(initialBufferCapacity, 
1.5);
+  }
+
   @Override
   public void flush() throws TTransportException {
 int length = writeBuffer.getPos();

http://git-wip-us.apache.org/repos/asf/thrift/blob/de3e17ad/lib/java/src/org/apache/thrift/transport/TFramedTransport.java
--
diff --git a/lib/java/src/org/apache/thrift/transport/TFramedTransport.java 
b/lib/java/src/org/apache/thrift/transport/TFramedTransport.java
index f7d220c..fa531ef 100644
--- a/lib/java/src/org/apache/thrift/transport/TFramedTransport.java
+++ b/lib/java/src/org/apache/thrift/transport/TFramedTransport.java
@@ -45,7 +45,8 @@ public class TFramedTransport extends TTransport {
   /**
* Buffer for input
*/
-  private TMemoryInputTransport readBuffer_ = new TMemoryInputTransport(new 
byte[0]);
+  private final TMemoryInputTransport readBuffer_ =
+new TMemoryInputTransport(new byte[0]);
 
   public static class Factory extends TTransportFactory {
 private int maxLength_;
@@ -90,11 +91,9 @@ public class TFramedTransport extends TTransport {
   }
 
   public int read(byte[] buf, int off, int len) throws TTransportException {
-if (readBuffer_ != null) {
-  int got = readBuffer_.read(buf, off, len);
-  if (got > 0) {
-return got;
-  }
+int got = readBuffer_.read(buf, off, len);
+if (got > 0) {
+  return got;
 }
 
 // Read another frame of data
@@ -123,6 +122,10 @@ public class TFramedTransport extends TTransport {
 readBuffer_.consumeBuffer(len);
   }
 
+  public void clear() {
+readBuffer_.clear();
+  }
+
   private final byte[] i32buf = new byte[4];
 
   private void readFrame() throws TTransportException {

http://git-wip-us.apache.org/repos/asf/thrift/blob/de3e17ad/lib/java/test/org/apache/thrift/transport/TestTFastFramedTransport.java
--
diff --git 
a/lib/java/test/org/apache/thrift/transport/TestTFastFramedTransport.java 
b/lib/java/test/org/apache/thrift/transport/TestTFastFramedTransport.java
index 11fbdf4..06ee206 100644
--- 

thrift git commit: THRIFT-4042 set zip_safe=False in python build to prevent egg ExtractionError Client: Python

2017-01-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 96be8c8d9 -> 988b3e9bd


THRIFT-4042 set zip_safe=False in python build to prevent egg ExtractionError
Client: Python

This closes #1165


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/988b3e9b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/988b3e9b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/988b3e9b

Branch: refs/heads/master
Commit: 988b3e9bde9ef687dd09311c9842c8a5bf24e608
Parents: 96be8c8
Author: Chandler May 
Authored: Fri Jan 27 16:21:40 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 27 23:33:19 2017 -0500

--
 lib/py/setup.py | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/988b3e9b/lib/py/setup.py
--
diff --git a/lib/py/setup.py b/lib/py/setup.py
index 99b7172..d065573 100644
--- a/lib/py/setup.py
+++ b/lib/py/setup.py
@@ -117,6 +117,7 @@ def run_setup(with_binary):
   'Topic :: Software Development :: Libraries',
   'Topic :: System :: Networking'
   ],
+  zip_safe=False,
   **extensions
   )
 



thrift git commit: THRIFT-4044 work around an hspec-core 2.4.0 library issue causing all build job #17 on Travis CI to fail Client: Haskell

2017-01-28 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b88a25a47 -> 8656670fe


THRIFT-4044 work around an hspec-core 2.4.0 library issue causing all build job 
#17 on Travis CI to fail
Client: Haskell

This closes #1168


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/8656670f
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/8656670f
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/8656670f

Branch: refs/heads/master
Commit: 8656670fe27408f81d35b10c5edabfaebfbd17fe
Parents: b88a25a
Author: James E. King, III 
Authored: Sat Jan 28 16:00:09 2017 -0500
Committer: James E. King, III 
Committed: Sat Jan 28 16:00:09 2017 -0500

--
 lib/hs/Thrift.cabal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/8656670f/lib/hs/Thrift.cabal
--
diff --git a/lib/hs/Thrift.cabal b/lib/hs/Thrift.cabal
index 99c9749..f919127 100644
--- a/lib/hs/Thrift.cabal
+++ b/lib/hs/Thrift.cabal
@@ -40,7 +40,7 @@ Library
   Hs-Source-Dirs:
 src
   Build-Depends:
-base >= 4, base < 5, containers, ghc-prim, attoparsec, binary, bytestring 
>= 0.10, base64-bytestring, hashable, HTTP, text, unordered-containers >= 
0.2.6, vector >= 0.10.12.2, QuickCheck >= 2.8.2, split
+base >= 4, base < 5, containers, ghc-prim, attoparsec, binary, bytestring 
>= 0.10, base64-bytestring, hashable, HTTP, text, hspec-core < 2.4.0, 
unordered-containers >= 0.2.6, vector >= 0.10.12.2, QuickCheck >= 2.8.2, split
   if flag(network-uri)
  build-depends: network-uri >= 2.6, network >= 2.6
   else



thrift git commit: THRIFT-4045 Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix building with Address Sanitizer Client: C++ Patch: Dawid Drechny <dawid.drec...@tomtom.com>

2017-01-28 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 8656670fe -> 8d377fa6b


THRIFT-4045 Remove AC_FUNC_MALLOC and AC_FUNC_REALLOC to fix building with 
Address Sanitizer
Client: C++
Patch: Dawid Drechny 

This closes #1065
This closes #1169


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/8d377fa6
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/8d377fa6
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/8d377fa6

Branch: refs/heads/master
Commit: 8d377fa6befb6ef9fd2364b5cc2972406e2a92a3
Parents: 8656670
Author: James E. King, III 
Authored: Sat Jan 28 18:27:26 2017 -0500
Committer: James E. King, III 
Committed: Sat Jan 28 18:27:26 2017 -0500

--
 configure.ac | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/8d377fa6/configure.ac
--
diff --git a/configure.ac b/configure.ac
index 6415e3d..8a15ede 100755
--- a/configure.ac
+++ b/configure.ac
@@ -657,9 +657,7 @@ AC_CHECK_DECL([AI_ADDRCONFIG], [],
 
 AC_FUNC_ALLOCA
 AC_FUNC_FORK
-AC_FUNC_MALLOC
 AC_FUNC_MEMCMP
-AC_FUNC_REALLOC
 AC_FUNC_SELECT_ARGTYPES
 AC_FUNC_STAT
 AC_FUNC_STRERROR_R



thrift git commit: THRIFT-3892 support OpenSSL before 0.9.8f during build Client: C++ Patch: Udit Raikwar <udit...@users.noreply.github.com>

2017-01-25 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 3d6e2a507 -> 6fe7fa1b7


THRIFT-3892 support OpenSSL before 0.9.8f during build
Client: C++
Patch: Udit Raikwar 

This closes #1057


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6fe7fa1b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6fe7fa1b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6fe7fa1b

Branch: refs/heads/master
Commit: 6fe7fa1b7ed72215a59e93c680a209a99530fada
Parents: 3d6e2a5
Author: James E. King, III 
Authored: Wed Jan 25 09:43:24 2017 -0500
Committer: James E. King, III 
Committed: Wed Jan 25 09:43:24 2017 -0500

--
 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/6fe7fa1b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp 
b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 0af20cb..4c7be6d 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -484,8 +484,11 @@ void TSSLSocket::checkHandshake() {
   }
 } while (rc == 2);
   } else {
-// set the SNI hostname
-SSL_set_tlsext_host_name(ssl_, getHost().c_str());
+// OpenSSL < 0.9.8f does not have SSL_set_tlsext_host_name()
+#if defined(SSL_set_tlsext_host_name)
+  // set the SNI hostname
+  SSL_set_tlsext_host_name(ssl_, getHost().c_str());
+#endif
 do {
   rc = SSL_connect(ssl_);
   if (rc <= 0) {



thrift git commit: Build fails using Java 1.8 with Ant < 1.9 Client: Java Patch: Adinata <mail.die...@gmail.com>

2017-01-25 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 8b96bfbf1 -> cf2548940


Build fails using Java 1.8 with Ant < 1.9
Client: Java
Patch: Adinata 

This closes #1060


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/cf254894
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/cf254894
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/cf254894

Branch: refs/heads/master
Commit: cf254894026988c7aa1e9742117c091f902cc838
Parents: 8b96bfb
Author: James E. King, III 
Authored: Wed Jan 25 20:34:04 2017 -0500
Committer: James E. King, III 
Committed: Wed Jan 25 20:34:04 2017 -0500

--
 lib/java/build.xml  | 12 ++--
 lib/js/test/build.xml   |  4 ++--
 tutorial/java/build.xml |  4 ++--
 tutorial/js/build.xml   |  6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/cf254894/lib/java/build.xml
--
diff --git a/lib/java/build.xml b/lib/java/build.xml
index 40e5284..40cd4f6 100644
--- a/lib/java/build.xml
+++ b/lib/java/build.xml
@@ -95,7 +95,7 @@
   
 
   
-
   
 
@@ -169,23 +169,23 @@
   
 
   
-
+
   
   
 
-
+
   
   
 
-
+
   
   
 
-
+
   
   
 
-
+
   
   
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/cf254894/lib/js/test/build.xml
--
diff --git a/lib/js/test/build.xml b/lib/js/test/build.xml
index b3a6b3e..a905fde 100755
--- a/lib/js/test/build.xml
+++ b/lib/js/test/build.xml
@@ -100,8 +100,8 @@
 
   
 
-
-
+
+
   
 
   

http://git-wip-us.apache.org/repos/asf/thrift/blob/cf254894/tutorial/java/build.xml
--
diff --git a/tutorial/java/build.xml b/tutorial/java/build.xml
index 7638d5b..c895ea9 100644
--- a/tutorial/java/build.xml
+++ b/tutorial/java/build.xml
@@ -50,8 +50,8 @@
   
 
   
-
-
+
+
   
 
   

http://git-wip-us.apache.org/repos/asf/thrift/blob/cf254894/tutorial/js/build.xml
--
diff --git a/tutorial/js/build.xml b/tutorial/js/build.xml
index a9a9ad4..2df2e71 100644
--- a/tutorial/js/build.xml
+++ b/tutorial/js/build.xml
@@ -51,13 +51,13 @@
   
 
   
-
-
+
+
   
   
   
 
-
+
   
 
   



thrift git commit: THRIFT-4033 disable thrift compiler plug-in support by default, as the thrift-compiler packaging is not ready for it yet

2017-01-25 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master cf2548940 -> 71eba643d


THRIFT-4033 disable thrift compiler plug-in support by default, as the 
thrift-compiler packaging is not ready for it yet

This closes #1157


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/71eba643
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/71eba643
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/71eba643

Branch: refs/heads/master
Commit: 71eba643ddc10bd2a9f614348567bfc1f63d8d06
Parents: cf25489
Author: James E. King, III 
Authored: Wed Jan 25 20:41:06 2017 -0500
Committer: James E. King, III 
Committed: Wed Jan 25 20:41:06 2017 -0500

--
 build/cmake/DefineOptions.cmake | 3 +--
 build/cmake/DefinePlatformSpecifc.cmake | 7 ++-
 configure.ac| 8 +++-
 debian/rules| 8 
 4 files changed, 10 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/71eba643/build/cmake/DefineOptions.cmake
--
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 0c853b1..c2bc717 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -84,7 +84,7 @@ if(WITH_CPP)
 endif()
 CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON
"BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF)
-CMAKE_DEPENDENT_OPTION(WITH_PLUGIN "Build compiler plugin support" ON
+CMAKE_DEPENDENT_OPTION(WITH_PLUGIN "Build compiler plugin support" OFF
"BUILD_COMPILER;BUILD_CPP" OFF)
 
 # C GLib
@@ -164,7 +164,6 @@ message(STATUS "Thrift package version: 
  ${PACKAGE_VERSION}
 message(STATUS "Build configuration Summary")
 message(STATUS "  Build Thrift compiler:  
${BUILD_COMPILER}")
 message(STATUS "  Build compiler plugin support:  ${WITH_PLUGIN}")
-MESSAGE_DEP(PLUGIN_COMPILER_NOT_TOO_OLD "Disabled due to older compiler")
 message(STATUS "  Build with unit tests:  
${BUILD_TESTING}")
 MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid 
THRIFT_COMPILER is given")
 message(STATUS "  Build examples: 
${BUILD_EXAMPLES}")

http://git-wip-us.apache.org/repos/asf/thrift/blob/71eba643/build/cmake/DefinePlatformSpecifc.cmake
--
diff --git a/build/cmake/DefinePlatformSpecifc.cmake 
b/build/cmake/DefinePlatformSpecifc.cmake
index 496134c..f70ec0d 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -108,11 +108,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR 
CMAKE_CXX_COMPILER_ID
   endif()
 endif()
 
-# If gcc older than 4.8 is detected, disable new compiler plug-in support (see 
THRIFT-3937)
-set(PLUGIN_COMPILER_NOT_TOO_OLD ON) # simplifies messaging in DefineOptions 
summary
+# If gcc older than 4.8 is detected and plugin support was requested, fail fast
 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION 
VERSION_LESS "4.8" AND WITH_PLUGIN)
-  message(STATUS "Disabling compiler plug-in support to work with older gcc 
compiler")
-  set(WITH_PLUGIN OFF)
-  set(PLUGIN_COMPILER_NOT_TOO_OLD OFF)
+  message(SEND_ERROR "Thrift compiler plug-in support is not possible with 
older gcc ( < 4.8 ) compiler")
 endif()
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/71eba643/configure.ac
--
diff --git a/configure.ac b/configure.ac
index 0452a15..6415e3d 100755
--- a/configure.ac
+++ b/configure.ac
@@ -552,8 +552,8 @@ fi
 AM_CONDITIONAL(WITH_TESTS, [test "$have_tests" = "yes"])
 
 AC_ARG_ENABLE([plugin],
-  AS_HELP_STRING([--enable-plugin], [build compiler plugin support 
[default=yes]]),
-  [], enable_plugin=yes
+  AS_HELP_STRING([--enable-plugin], [build compiler plugin support 
[default=no]]),
+  [], enable_plugin=no
 )
 have_plugin=yes
 if test "$have_cpp" = "no" ; then
@@ -562,9 +562,7 @@ fi
 if test "$enable_plugin" = "no"; then
   have_plugin="no"
 fi
-if test "$have_plugin" = "yes" ; then
-  
AC_CONFIG_LINKS([compiler/cpp/test/plugin/t_cpp_generator.cc:compiler/cpp/src/thrift/generate/t_cpp_generator.cc])
-fi
+AC_CONFIG_LINKS([compiler/cpp/test/plugin/t_cpp_generator.cc:compiler/cpp/src/thrift/generate/t_cpp_generator.cc])
 AM_CONDITIONAL(WITH_PLUGIN, [test "$have_plugin" = "yes"])
 
 AC_ARG_ENABLE([tutorial],

http://git-wip-us.apache.org/repos/asf/thrift/blob/71eba643/debian/rules
--
diff --git a/debian/rules b/debian/rules
index 

thrift git commit: THRIFT-3550 make a script to build perl cpan module and update perl dependencies for cpan

2017-01-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 71eba643d -> f3490c5f8


THRIFT-3550 make a script to build perl cpan module and update perl 
dependencies for cpan


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f3490c5f
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f3490c5f
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f3490c5f

Branch: refs/heads/master
Commit: f3490c5f8e2e871f75ea540126f9fb233cf71601
Parents: 71eba64
Author: James E. King, III 
Authored: Fri Jan 27 09:43:18 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 27 09:43:18 2017 -0500

--
 lib/perl/Makefile.PL| 15 +--
 lib/perl/build-cpan-dist.sh |  9 +
 2 files changed, 18 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/f3490c5f/lib/perl/Makefile.PL
--
diff --git a/lib/perl/Makefile.PL b/lib/perl/Makefile.PL
index ceca86f..92b05ba 100644
--- a/lib/perl/Makefile.PL
+++ b/lib/perl/Makefile.PL
@@ -18,12 +18,15 @@
 #
 
 use ExtUtils::MakeMaker;
-WriteMakefile( 'NAME' => 'Thrift',
-   'VERSION_FROM' => 'lib/Thrift.pm',
-   'PREREQ_PM'  => {
+WriteMakefile( NAME => 'Thrift',
+   VERSION_FROM => 'lib/Thrift.pm',
+   MIN_PERL_VERSION => '5.006',
+   PREREQ_PM => {
'Bit::Vector' => 0,
-   'Class::Accessor' => 0
+   'Class::Accessor' => 0,
+   'IO::Socket::INET' => 0
},
-   ($] >= 5.005 ?
- (AUTHOR => 'Apache Thrift ') : 
()),
+   ($] >= 5.006 ?
+ (AUTHOR => 'Apache Thrift ') : ()),
);
+

http://git-wip-us.apache.org/repos/asf/thrift/blob/f3490c5f/lib/perl/build-cpan-dist.sh
--
diff --git a/lib/perl/build-cpan-dist.sh b/lib/perl/build-cpan-dist.sh
new file mode 100755
index 000..1765e6d
--- /dev/null
+++ b/lib/perl/build-cpan-dist.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+#
+# This script is intended to be used after tagging the repository and updating
+# the version files for a release.  It will create a CPAN archive.
+
+perl Makefile.PL
+make
+make manifest
+make dist



thrift git commit: THRIFT-3550 add some information about thrift to the perl library README directing folks to the official web site for more info

2017-01-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master f3490c5f8 -> 96be8c8d9


THRIFT-3550 add some information about thrift to the perl library README 
directing folks to the official web site for more info


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/96be8c8d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/96be8c8d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/96be8c8d

Branch: refs/heads/master
Commit: 96be8c8d9408548966b3fb2895a8b84ac1045a37
Parents: f3490c5
Author: James E. King, III 
Authored: Fri Jan 27 11:45:57 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 27 11:45:57 2017 -0500

--
 lib/perl/README.md | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/96be8c8d/lib/perl/README.md
--
diff --git a/lib/perl/README.md b/lib/perl/README.md
index 51247e0..e6451ec 100644
--- a/lib/perl/README.md
+++ b/lib/perl/README.md
@@ -20,8 +20,21 @@ KIND, either express or implied. See the License for the
 specific language governing permissions and limitations
 under the License.
 
+Summary
+===
+
+Apache Thrift is a software framework for scalable cross-language services 
development.
+It combines a software stack with a code generation engine to build services 
that work
+efficiently and seamlessly between many programming languages.  A 
language-neutral IDL
+is used to generate functioning client libraries and server-side handling 
frameworks.
+
+For More Information
+
+
+See the [Apache Thrift Web Site](http://thrift.apache.org/) for more 
information.
+
 Using Thrift with Perl
-=
+==
 
 Thrift requires Perl >= 5.6.0
 



thrift git commit: THRIFT-4076: pick up PATH changes and JAVA_HOME from the registry after using chocolatey to install ant (and jdk, which it depends on)

2017-02-21 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 43fb34df2 -> 8615fee79


THRIFT-4076: pick up PATH changes and JAVA_HOME from the registry after using 
chocolatey to install ant (and jdk, which it depends on)

This closes #1201


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/8615fee7
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/8615fee7
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/8615fee7

Branch: refs/heads/master
Commit: 8615fee798be60dc94adaaa6b31b1db8566a2ead
Parents: 43fb34d
Author: James E. King, III 
Authored: Tue Feb 21 21:29:17 2017 -0500
Committer: James E. King, III 
Committed: Tue Feb 21 21:29:17 2017 -0500

--
 appveyor.yml | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/8615fee7/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index aeb9d59..a4df229 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -29,8 +29,6 @@ os:
 environment:
   BOOST_ROOT: C:\Libraries\boost_1_59_0
   BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
-  # Unfurtunately, this version needs manual update because old versions are 
quickly deleted.
-  ANT_VERSION: 1.9.8
 
 install:
 - '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64'
@@ -54,8 +52,8 @@ install:
 - cd ..
 - appveyor-retry cinst -y ant
 - appveyor-retry cinst -y winflexbison3
-## appveyor DownloadFile 
http://www.us.apache.org/dist/ant/binaries/apache-ant-%ANT_VERSION%-bin.zip
-# 7z x apache-ant-%ANT_VERSION%-bin.zip > nul
+# installation of ant brings in the latest jdk and sets JAVA_HOME - we need to 
pick these up from the registry
+- refreshenv
 - cd %APPVEYOR_BUILD_FOLDER%
 # TODO: Enable Haskell build
 # - cinst HaskellPlatform -version 2014.2.0.0
@@ -64,10 +62,8 @@ install:
 build_script:
 - echo PATH=%PATH%
 - set PATH=C:\ProgramData\chocolatey\bin;%PATH%
-## installation of ant brings in the latest jdk and sets JAVA_HOME
 - echo JAVA_HOME=%JAVA_HOME%
-## set JAVA_HOME=C:\Program Files\Java\jdk1.7.0
-## set PATH=%JAVA_HOME%\bin;%PATH%
+# TODO: Enable Haskell build
 # - set PATH=%PATH%;C:\Program Files (x86)\Haskell Platform\2014.2.0.0\bin
 # - set PATH=%PATH%;C:\Program Files (x86)\Haskell 
Platform\2014.2.0.0\lib\extralibs\bin
 - set PATH=C:\Python27-x64\scripts;C:\Python27-x64;%PATH%



thrift git commit: THRIFT-4077: fix Appveyor warnings (VS2015) in PlatformSocket.h Client: C++

2017-02-20 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 4d651ab06 -> 239233afb


THRIFT-4077: fix Appveyor warnings (VS2015) in PlatformSocket.h
Client: C++

This closes #1198


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/239233af
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/239233af
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/239233af

Branch: refs/heads/master
Commit: 239233afb6fd5bd2fb81743e88303c9ac17d7edb
Parents: 4d651ab
Author: James E. King, III 
Authored: Mon Feb 20 08:04:12 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 20 08:04:12 2017 -0500

--
 lib/cpp/src/thrift/transport/PlatformSocket.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/239233af/lib/cpp/src/thrift/transport/PlatformSocket.h
--
diff --git a/lib/cpp/src/thrift/transport/PlatformSocket.h 
b/lib/cpp/src/thrift/transport/PlatformSocket.h
index b8974ba..1890b60 100644
--- a/lib/cpp/src/thrift/transport/PlatformSocket.h
+++ b/lib/cpp/src/thrift/transport/PlatformSocket.h
@@ -23,6 +23,7 @@
 #  define _THRIFT_TRANSPORT_PLATFORM_SOCKET_H_
 
 #ifdef _WIN32
+#  include 
 #  define THRIFT_GET_SOCKET_ERROR ::WSAGetLastError()
 #  define THRIFT_ERRNO (*_errno())
 #  define THRIFT_EINPROGRESS WSAEINPROGRESS
@@ -78,8 +79,8 @@
 #define THRIFT_POLLOUT POLLOUT
 #  endif //WINVER
 #  define THRIFT_SHUT_RDWR SD_BOTH
-#  if _WIN32_WINNT < 0x0600
-#define AI_ADDRCONFIG 0
+#  if !defined(AI_ADDRCONFIG)
+#define AI_ADDRCONFIG 0x0400
 #  endif
 #else //not _WIN32
 #  include 



thrift git commit: THRIFT-4084: Add a SSL/TLS negotiation check to crossfeature to verify SSLv3 is not active and that at least one of TLSv1.0 through 1.2 are accepted. Client: csharp, d, go, nodejs,

2017-02-20 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 239233afb -> 06190874c


THRIFT-4084: Add a SSL/TLS negotiation check to crossfeature to verify SSLv3 is 
not active and that at least one of TLSv1.0 through 1.2 are accepted.
Client: csharp, d, go, nodejs, perl

This closes #1197


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/06190874
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/06190874
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/06190874

Branch: refs/heads/master
Commit: 06190874c8ba8f3a0c7ae83a59965d56c205e080
Parents: 239233a
Author: James E. King, III 
Authored: Mon Feb 20 08:52:11 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 20 08:52:11 2017 -0500

--
 .../cpp/src/thrift/generate/t_cpp_generator.cc  |  2 +-
 configure.ac|  6 +-
 lib/csharp/src/Transport/TTLSServerSocket.cs|  4 +-
 lib/d/src/thrift/transport/ssl.d|  4 +-
 lib/go/thrift/ssl_server_socket.go  |  5 +-
 lib/go/thrift/ssl_socket.go |  3 +
 lib/nodejs/lib/thrift/connection.js |  8 ++-
 lib/nodejs/lib/thrift/server.js |  6 ++
 lib/perl/lib/Thrift/SSLServerSocket.pm  |  6 +-
 lib/perl/lib/Thrift/SSLSocket.pm|  6 +-
 test/cpp/src/TestClient.cpp | 15 -
 test/features/Makefile.am   |  2 +
 test/features/nosslv3.sh| 52 ++
 test/features/tests.json| 22 ++
 test/features/tls.sh| 71 
 test/known_failures_Linux.json  | 10 +--
 test/tests.json |  9 ++-
 17 files changed, 205 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/06190874/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc 
b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index 869d802..c7eec48 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -4452,4 +4452,4 @@ THRIFT_REGISTER_GENERATOR(
 "include_prefix:  Use full include paths in generated files.\n"
 "moveable_types:  Generate move constructors and assignment 
operators.\n"
 "no_ostream_operators:\n"
-" Omit generation of ostream definitions.\n");
+" Omit generation of ostream definitions.\n")

http://git-wip-us.apache.org/repos/asf/thrift/blob/06190874/configure.ac
--
diff --git a/configure.ac b/configure.ac
index a889f75..bb25495 100755
--- a/configure.ac
+++ b/configure.ac
@@ -911,8 +911,8 @@ if test "$have_cpp" = "yes" ; then
   echo "C++ Library:"
   echo "   Build TZlibTransport .. : $have_zlib"
   echo "   Build TNonblockingServer .. : $have_libevent"
-  echo "   Build TQTcpServer (Qt4)  : $have_qt"
-  echo "   Build TQTcpServer (Qt5)  : $have_qt5"
+  echo "   Build TQTcpServer (Qt4) ... : $have_qt"
+  echo "   Build TQTcpServer (Qt5) ... : $have_qt5"
 fi
 if test "$have_java" = "yes" ; then
   echo
@@ -1004,7 +1004,7 @@ fi
 if test "$have_lua" = "yes" ; then
   echo
   echo "Lua Library:"
-  echo "   Using Lua .. : $LUA"
+  echo "   Using Lua . : $LUA"
 fi
 if test "$have_rs" = "yes" ; then
   echo

http://git-wip-us.apache.org/repos/asf/thrift/blob/06190874/lib/csharp/src/Transport/TTLSServerSocket.cs
--
diff --git a/lib/csharp/src/Transport/TTLSServerSocket.cs 
b/lib/csharp/src/Transport/TTLSServerSocket.cs
index 86a4494..d51c217 100644
--- a/lib/csharp/src/Transport/TTLSServerSocket.cs
+++ b/lib/csharp/src/Transport/TTLSServerSocket.cs
@@ -108,7 +108,7 @@ namespace Thrift.Transport
 X509Certificate2 certificate,
 RemoteCertificateValidationCallback clientCertValidator = null,
 LocalCertificateSelectionCallback 
localCertificateSelectionCallback = null,
-// TODO: Enable Tls1 and Tls2 (TLS 1.1 and 1.2) by default once we 
start using .NET 4.5+.
+// TODO: Enable Tls11 and Tls12 (TLS 1.1 and 1.2) by default once 
we start using .NET 4.5+.
 SslProtocols sslProtocols = SslProtocols.Tls)
 {
 if (!certificate.HasPrivateKey)
@@ -126,7 +126,7 @@ namespace Thrift.Transport
 try
 {
 // Create server socket
-   this.server = 

thrift git commit: THRIFT-3706: Implement multiplexed protocol client and test client for c_glib; test server for java; integrate into crosstest Client: c_glib

2017-02-20 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 06190874c -> bc0082e02


THRIFT-3706: Implement multiplexed protocol client and test client for c_glib; 
test server for java; integrate into crosstest
Client: c_glib

This closes #1191
This closes #1199


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bc0082e0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bc0082e0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bc0082e0

Branch: refs/heads/master
Commit: bc0082e02357de2f30b997188bdfa94d703331f4
Parents: 0619087
Author: Gonzalo Aguilar Delgado 
Authored: Fri Mar 4 13:16:22 2016 +0100
Committer: James E. King, III 
Committed: Mon Feb 20 14:04:17 2017 -0500

--
 lib/c_glib/Makefile.am  |   6 +-
 .../protocol/thrift_multiplexed_protocol.c  | 187 ++
 .../protocol/thrift_multiplexed_protocol.h  |  77 +++
 .../c_glib/protocol/thrift_protocol_decorator.c | 651 +++
 .../c_glib/protocol/thrift_protocol_decorator.h |  77 +++
 .../test/org/apache/thrift/test/TestServer.java |  62 +-
 test/c_glib/src/test_client.c   |  57 +-
 test/crossrunner/report.py  |   8 +-
 test/tests.json |  10 +-
 9 files changed, 1103 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bc0082e0/lib/c_glib/Makefile.am
--
diff --git a/lib/c_glib/Makefile.am b/lib/c_glib/Makefile.am
index b66c89b..8e7bf88 100755
--- a/lib/c_glib/Makefile.am
+++ b/lib/c_glib/Makefile.am
@@ -35,8 +35,10 @@ libthrift_c_glib_la_SOURCES = src/thrift/c_glib/thrift.c \
   src/thrift/c_glib/processor/thrift_processor.c \
   
src/thrift/c_glib/processor/thrift_dispatch_processor.c \
   src/thrift/c_glib/protocol/thrift_protocol.c \
+  
src/thrift/c_glib/protocol/thrift_protocol_decorator.c \
   
src/thrift/c_glib/protocol/thrift_protocol_factory.c \
   
src/thrift/c_glib/protocol/thrift_binary_protocol.c \
+  
src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c \
   
src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c \
   
src/thrift/c_glib/protocol/thrift_compact_protocol.c \
   
src/thrift/c_glib/protocol/thrift_compact_protocol_factory.c \
@@ -67,11 +69,13 @@ include_thrift_HEADERS = \
 
 include_protocoldir = $(include_thriftdir)/protocol
 include_protocol_HEADERS = src/thrift/c_glib/protocol/thrift_protocol.h \
+   
src/thrift/c_glib/protocol/thrift_protocol_decorator.h \

src/thrift/c_glib/protocol/thrift_protocol_factory.h \
src/thrift/c_glib/protocol/thrift_binary_protocol.h 
\

src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h \

src/thrift/c_glib/protocol/thrift_compact_protocol.h \
-   
src/thrift/c_glib/protocol/thrift_compact_protocol_factory.h
+   
src/thrift/c_glib/protocol/thrift_compact_protocol_factory.h \
+   
src/thrift/c_glib/protocol/thrift_multiplexed_protocol.h 
 
 include_transportdir = $(include_thriftdir)/transport
 include_transport_HEADERS = 
src/thrift/c_glib/transport/thrift_buffered_transport.h \

http://git-wip-us.apache.org/repos/asf/thrift/blob/bc0082e0/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
--
diff --git 
a/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c 
b/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
new file mode 100644
index 000..86f8097
--- /dev/null
+++ b/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 

thrift git commit: THRIFT-4102 remove useless code cause performance problem Client: python

2017-02-24 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master e66b8fcde -> e2bc97275


THRIFT-4102 remove useless code cause performance problem
Client: python

This closes #1203


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e2bc9727
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e2bc9727
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e2bc9727

Branch: refs/heads/master
Commit: e2bc9727500584e055ce603bf95f00165c657ec2
Parents: e66b8fc
Author: Yao Jin 
Authored: Thu Feb 23 13:49:45 2017 +0800
Committer: James E. King, III 
Committed: Fri Feb 24 10:28:27 2017 -0500

--
 lib/py/src/transport/TTransport.py | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/e2bc9727/lib/py/src/transport/TTransport.py
--
diff --git a/lib/py/src/transport/TTransport.py 
b/lib/py/src/transport/TTransport.py
index ae01ac6..c8855ca 100644
--- a/lib/py/src/transport/TTransport.py
+++ b/lib/py/src/transport/TTransport.py
@@ -169,7 +169,6 @@ class TBufferedTransport(TTransportBase, 
CReadableTransport):
 # on exception reset wbuf so it doesn't contain a partial function 
call
 self.__wbuf = BufferIO()
 raise e
-self.__wbuf.getvalue()
 
 def flush(self):
 out = self.__wbuf.getvalue()



thrift git commit: THRIFT-3706: added cross test support for backwards compatible multiplexed server, added c_glib testBinary, fixed a number of glib object reference issues Client: c_glib, java

2017-02-22 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 4361ecc3a -> 37aac3bb5


THRIFT-3706: added cross test support for backwards compatible multiplexed 
server, added c_glib testBinary, fixed a number of glib object reference issues
Client: c_glib, java

This closes #1200


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/37aac3bb
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/37aac3bb
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/37aac3bb

Branch: refs/heads/master
Commit: 37aac3bb58b9a7413b25e5eba4fb95fc8796cd3c
Parents: 4361ecc
Author: James E. King, III 
Authored: Tue Feb 21 14:01:09 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 22 12:46:04 2017 -0500

--
 .../protocol/thrift_multiplexed_protocol.c  | 190 +--
 .../protocol/thrift_multiplexed_protocol.h  |   3 +-
 .../thrift/c_glib/protocol/thrift_protocol.c|  41 ++-
 .../c_glib/protocol/thrift_protocol_decorator.c | 329 +--
 .../c_glib/protocol/thrift_protocol_decorator.h |  15 +-
 .../src/thrift/c_glib/server/thrift_server.c|  35 +-
 .../c_glib/transport/thrift_server_socket.c |   4 +-
 .../c_glib/transport/thrift_server_socket.h |   2 +-
 .../src/thrift/c_glib/transport/thrift_socket.c |  11 +-
 .../src/thrift/c_glib/transport/thrift_socket.h |   5 +-
 lib/c_glib/test/testcontainertest.c |  15 +-
 .../test/org/apache/thrift/test/TestServer.java |  34 +-
 test/c_glib/src/test_client.c   | 299 -
 test/tests.json |  18 +-
 14 files changed, 561 insertions(+), 440 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/37aac3bb/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
--
diff --git 
a/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c 
b/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
index 86f8097..dec4dbd 100644
--- a/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
+++ b/lib/c_glib/src/thrift/c_glib/protocol/thrift_multiplexed_protocol.c
@@ -31,7 +31,6 @@
 enum
 {
   PROP_THRIFT_MULTIPLEXED_PROTOCOL_SERVICE_NAME = 1,
-  PROP_THRIFT_MULTIPLEXED_PROTOCOL_SEPARATOR,
   PROP_THRIFT_MULTIPLEXED_PROTOCOL_END
 };
 
@@ -42,114 +41,95 @@ static GParamSpec 
*thrift_multiplexed_protocol_obj_properties[PROP_THRIFT_MULTIP
 
 gint32
 thrift_multiplexed_protocol_write_message_begin (ThriftMultiplexedProtocol 
*protocol,
-   const gchar *name, const ThriftMessageType message_type,
-   const gint32 seqid, GError **error)
+const gchar *name, const ThriftMessageType message_type,
+const gint32 seqid, GError **error)
 {
-   gint32 ret;
-   gchar *service_name = NULL;
-   g_return_val_if_fail (THRIFT_IS_MULTIPLEXED_PROTOCOL (protocol), -1);
+  gint32 ret;
+  gchar *service_name = NULL;
+  g_return_val_if_fail (THRIFT_IS_MULTIPLEXED_PROTOCOL (protocol), -1);
 
-   ThriftMultiplexedProtocol *self = THRIFT_MULTIPLEXED_PROTOCOL 
(protocol);
-   ThriftMultiplexedProtocolClass *multiplexClass = 
THRIFT_MULTIPLEXED_PROTOCOL_GET_CLASS(self);
-   ThriftProtocolClass *cls = THRIFT_PROTOCOL_CLASS (multiplexClass);
+  ThriftMultiplexedProtocol *self = THRIFT_MULTIPLEXED_PROTOCOL (protocol);
+  ThriftMultiplexedProtocolClass *multiplexClass = 
THRIFT_MULTIPLEXED_PROTOCOL_GET_CLASS(self);
+  ThriftProtocolClass *cls = THRIFT_PROTOCOL_CLASS (multiplexClass);
 
-   if( (message_type == T_CALL || message_type == T_ONEWAY) && 
self->service_name != NULL) {
-   service_name = g_strdup_printf("%s%s%s", self->service_name, 
self->separator, name);
+  if( (message_type == T_CALL || message_type == T_ONEWAY) && 
self->service_name != NULL) {
+service_name = g_strdup_printf("%s%s%s", self->service_name, 
THRIFT_MULTIPLEXED_PROTOCOL_DEFAULT_SEPARATOR, name);
+  }else{
+service_name = g_strdup(name);
+  }
 
-   }else{
-   service_name = g_strdup(name);
-   }
+  // relay to the protocol_decorator
+  ret = thrift_protocol_decorator_write_message_begin(protocol, service_name, 
message_type, seqid, error);
 
-   // relay to the protocol_decorator
-   ret = thrift_protocol_decorator_write_message_begin(protocol, 
service_name, message_type, seqid, error);
+  g_free(service_name);
 
-   g_free(service_name);
-
-   return ret;
+  return ret;
 }
 
 
-
-
 static void
 thrift_multiplexed_protocol_set_property (GObject  *object,
-   guint property_id,
-   const GValue *value,
-   GParamSpec   *pspec)
+guint property_id,
+const GValue *value,
+GParamSpec   

thrift git commit: THRIFT-3984 PHP7 extension causes segfault

2017-02-23 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 37aac3bb5 -> e66b8fcde


THRIFT-3984 PHP7 extension causes segfault

The PHP 7 extension can sometimes free strings it does not own,
when serializing string map keys, or the name of called methods.
The latter case was somewhat migitated since the double-free has no
effect on interned strings.
Using ZVAL_STR_COPY instead of ZVAL_STR will increment the reference
count, making the following destructor call correct.

Fix memory leak in PHP 7

Fix memory leak when deserializing maps or sets.
zend_hash_update will add its own reference to the key, so we need to
destruct the key zval to not leak.
We don't need to destruct the value, the hash table will take ownership
of it.

This closes #1152


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e66b8fcd
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e66b8fcd
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e66b8fcd

Branch: refs/heads/master
Commit: e66b8fcde3922ab9244908d9ca27d5084536e168
Parents: 37aac3b
Author: HÃ¥kon Hitland 
Authored: Mon Dec 5 18:42:41 2016 +0100
Committer: James E. King, III 
Committed: Thu Feb 23 11:43:45 2017 -0500

--
 .../thrift_protocol/php_thrift_protocol7.cpp|  6 ++-
 test/php/TestClient.php | 47 +++-
 2 files changed, 50 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/e66b8fcd/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
--
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp 
b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
index 13cdf22..da5b3de 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol7.cpp
@@ -596,6 +596,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
   if (Z_TYPE(key) != IS_STRING) convert_to_string();
   zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), );
 }
+zval_dtor();
   }
   return; // return_value already populated
 }
@@ -636,6 +637,7 @@ void binary_deserialize(int8_t thrift_typeID, 
PHPInputTransport& transport, zval
   if (Z_TYPE(key) != IS_STRING) convert_to_string();
   zend_symtable_update(Z_ARR_P(return_value), Z_STR(key), );
 }
+zval_dtor();
   }
   return;
 }
@@ -665,7 +667,7 @@ void binary_serialize_hashtable_key(int8_t keytype, 
PHPOutputTransport& transpor
   } else {
 char buf[64];
 if (res == HASH_KEY_IS_STRING) {
-  ZVAL_STR(, key);
+  ZVAL_STR_COPY(, key);
 } else {
   snprintf(buf, 64, "%ld", index);
   ZVAL_STRING(, buf);
@@ -822,7 +824,7 @@ void protocol_writeMessageBegin(zval* transport, 
zend_string* method_name, int32
   zval ret;
   zval writeMessagefn;
 
-  ZVAL_STR([0], method_name);
+  ZVAL_STR_COPY([0], method_name);
   ZVAL_LONG([1], msgtype);
   ZVAL_LONG([2], seqID);
   ZVAL_NULL();

http://git-wip-us.apache.org/repos/asf/thrift/blob/e66b8fcd/test/php/TestClient.php
--
diff --git a/test/php/TestClient.php b/test/php/TestClient.php
index c1f6435..76fd935 100755
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -266,6 +266,39 @@ if ($mapin != $mapout) {
 $exitcode |= ERR_CONTAINERS;
 }
 
+$mapout = array();
+for ($i = 0; $i < 10; $i++) {
+$mapout["key$i"] = "val$i";
+}
+print_r('testStringMap({');
+$first = true;
+foreach ($mapout as $key => $val) {
+  if ($first) {
+$first = false;
+  } else {
+print_r(", ");
+  }
+  print_r("\"$key\" => \"$val\"");
+}
+print_r("})");
+$mapin = $testClient->testStringMap($mapout);
+print_r(" = {");
+$first = true;
+foreach ($mapin as $key => $val) {
+  if ($first) {
+$first = false;
+  } else {
+print_r(", ");
+  }
+  print_r("\"$key\" => \"$val\"");
+}
+print_r("}\n");
+ksort($mapin);
+if ($mapin != $mapout) {
+echo "**FAILED**\n";
+$exitcode |= ERR_CONTAINERS;
+}
+
 /**
  * SET TEST
  */
@@ -459,7 +492,6 @@ try {
   print_r(' caught xception '.$x->errorCode.': '.$x->message."\n");
 }
 
-
 /**
  * Normal tests done.
  */
@@ -472,6 +504,19 @@ print_r("Total time: $elp ms\n");
  * Extraneous "I don't trust PHP to pack/unpack integer" tests
  */
 
+if ($protocol instanceof TBinaryProtocolAccelerated) {
+// Regression check: check that method name is not double-freed
+// Method name should not be an interned string.
+$method_name = "Void";
+$method_name = "test$method_name";
+
+$seqid = 0;
+$args = new \ThriftTest\ThriftTest_testVoid_args();
+

thrift git commit: THRIFT-3973: Provide some tools to make it easier to build thrift C++ on Windows Client: C++

2017-02-19 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 655b9b6ef -> 4d651ab06


THRIFT-3973: Provide some tools to make it easier to build thrift C++ on Windows
Client: C++

This closes #1162


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4d651ab0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4d651ab0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4d651ab0

Branch: refs/heads/master
Commit: 4d651ab06aad566d6eaf67c67133befa0117b12f
Parents: 655b9b6
Author: James E. King, III 
Authored: Sun Feb 19 22:19:55 2017 -0500
Committer: James E. King, III 
Committed: Sun Feb 19 22:19:55 2017 -0500

--
 build/wincpp/README.md | 219 
 build/wincpp/build-thrift-compiler.bat |  79 +++
 build/wincpp/build-thrift.bat  | 164 +++
 build/wincpp/scripts/cl_setarch.bat|  47 +
 build/wincpp/scripts/cl_setcompiler.bat|  58 ++
 build/wincpp/scripts/cl_setgenerator.bat   |  69 ++
 build/wincpp/scripts/tpversions.bat|  24 +++
 build/wincpp/thirdparty/src/build-libevent.bat |  86 
 build/wincpp/thirdparty/src/build-openssl.bat  | 106 ++
 build/wincpp/thirdparty/src/build-zlib.bat |  75 +++
 10 files changed, 927 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/4d651ab0/build/wincpp/README.md
--
diff --git a/build/wincpp/README.md b/build/wincpp/README.md
new file mode 100644
index 000..a231780
--- /dev/null
+++ b/build/wincpp/README.md
@@ -0,0 +1,219 @@
+
+
+# Building thrift on Windows (Native)
+
+Thrift uses cmake to make it easier to build the project on multiple 
platforms, however to build a fully functional and production ready thrift on 
Windows requires a number of third party libraries to be obtained or built.  
Once third party libraries are ready, the right combination of options must be 
passed to cmake in order to generate the correct environment.
+
+## Summary
+
+These instructions will help you build thrift for windows using Visual
+Studio 2010 or later.  The contributed batch files will help you build
+the third party libraries needed for complete thrift functionality as
+well as thrift itself.
+
+These instructions follow a directory layout that looks like the following:
+
+workspace\
+  build\   - this is where the out-of-tree thrift cmake builds are 
generated
+  dist\- this is where the thrift build results end up
+  thirdparty\  - this is where all third party binaries and libraries live
+build\   - this is where all third party out-of-tree builds are 
generated
+   (except for openssl, which only builds in-tree)
+dist\- this is where all third party distributions end up
+src\ - this is where all third party source projects live
+  scripts\ - batch files used to set environment variables for builds
+  thrift\  - this is where the thrift source project lives
+
+Create a "workspace" directory somewhere on your system and then copy the 
contents of this
+directory to there, then clone or unpack thrift into `workspace\thrift`.
+
+## Third Party Libraries
+
+Batch scripts are provided to build some third party libraries.  You must 
download them and place them into the directory noted for each.  You can use 
different versions if you prefer; these instructions were made with the 
versions listed.  
+
+> TIP: To modify the versions used in the batch scripts, look in 
scripts\tpversions.bat.
+
+Build them in the order listed to satisfy their dependencies.
+
+### winflexbison
+
+source: web site
+  location: 
https://sourceforge.net/projects/winflexbison/files/win_flex_bison-latest.zip/download
+   version: "latest"
+ directory: workspace\thirdparty\dist\winflexbison
+
+This package is required to build the compiler.  This third party package does 
not need to be built as it is a binary distribution of the "bison" and "flex" 
tools normally found on Unix boxes.
+
+> TIP: If you are only interested in building the compiler, you can skip the 
remaining third party libraries.
+
+### zlib
+
+source: web site
+  location: http://zlib.net/
+   version: 1.2.9
+ directory: workspace\thirdparty\src\zlib-1.2.9
+
+To build, open the appropriate Visual Studio command prompt and then run 
+the build-zlib.bat script in thirdparty\src.
+ 
+### openssl
+
+source: web site
+  location: https://www.openssl.org/
+   version: 1.1.0c
+ directory: workspace\thirdparty\src\openssl-1.1.0c
+depends-on: zlib
+
+If you are using openssl-1.1.0 or later, they changed 

thrift git commit: THRIFT-4095: add multiplexed protocol to Travis CI jobs 1 and 2 for make cross

2017-02-18 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 377719c2d -> 736075d2a


THRIFT-4095: add multiplexed protocol to Travis CI jobs 1 and 2 for make cross


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/736075d2
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/736075d2
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/736075d2

Branch: refs/heads/master
Commit: 736075d2ac9ff4a449a3446320c270d864f8e616
Parents: 377719c
Author: James E. King, III 
Authored: Sat Feb 18 13:55:30 2017 -0500
Committer: James E. King, III 
Committed: Sat Feb 18 13:55:30 2017 -0500

--
 .travis.yml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/736075d2/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 81a88c3..70293ed 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,14 +42,14 @@ env:
 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS"  # only 
meaningful for CMake builds
 
   matrix:
-- TEST_NAME="Cross Language Tests (Binary and Header Protocols)"
+- TEST_NAME="Cross Language Tests (Binary, Header, Multiplexed Protocols)"
   SCRIPT="cross-test.sh"
-  BUILD_ARG="-'(binary|header)'"
+  BUILD_ARG="-'(binary|header|multiplexed)'"
   BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
 
-- TEST_NAME="Cross Language Tests (Debian) (Binary and Header Protocols)"
+- TEST_NAME="Cross Language Tests (Debian) (Binary, Header, Multiplexed 
Protocols)"
   SCRIPT="cross-test.sh"
-  BUILD_ARG="-'(binary|header)'"
+  BUILD_ARG="-'(binary|header|multiplexed)'"
   BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
   DISTRO=debian
 



thrift git commit: THRIFT-2504: Add default processor to java multiplexed processor to handle older clients Client: Java

2017-02-18 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 736075d2a -> 400b346db


THRIFT-2504: Add default processor to java multiplexed processor to handle 
older clients
Client: Java

This closes #114
This closes #1195


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/400b346d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/400b346d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/400b346d

Branch: refs/heads/master
Commit: 400b346db2510fffa06c0ced11105e3618ce5367
Parents: 736075d
Author: Aleksey Pesternikov 
Authored: Thu May 1 13:58:18 2014 -0700
Committer: James E. King, III 
Committed: Sat Feb 18 13:58:21 2017 -0500

--
 lib/java/build.xml  |  1 +
 .../apache/thrift/TMultiplexedProcessor.java| 17 +++-
 .../apache/thrift/TestMultiplexedProcessor.java | 86 
 3 files changed, 101 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/400b346d/lib/java/build.xml
--
diff --git a/lib/java/build.xml b/lib/java/build.xml
index 40cd4f6..6af9f27 100644
--- a/lib/java/build.xml
+++ b/lib/java/build.xml
@@ -372,6 +372,7 @@
 
   
   
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/400b346d/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java
--
diff --git a/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java 
b/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java
index f6547ac..d0c5603 100644
--- a/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java
+++ b/lib/java/src/org/apache/thrift/TMultiplexedProcessor.java
@@ -52,6 +52,7 @@ public class TMultiplexedProcessor implements TProcessor {
 
 private final Map SERVICE_PROCESSOR_MAP
 = new HashMap();
+private TProcessor defaultProcessor;
 
 /**
  * 'Register' a service with this TMultiplexedProcessor.  This
@@ -68,6 +69,14 @@ public class TMultiplexedProcessor implements TProcessor {
 }
 
 /**
+ * Register a service to be called to process queries without service name
+ * @param processor
+ */
+public void registerDefault(TProcessor processor) {
+defaultProcessor = processor;
+}
+
+/**
  * This implementation of process performs the following 
steps:
  *
  * 
@@ -77,7 +86,7 @@ public class TMultiplexedProcessor implements TProcessor {
  * Dispatch to the processor, with a decorated instance of 
TProtocol
  * that allows readMessageBegin() to return the original 
TMessage.
  * 
- *  
+ *
  * @throws TException If the message type is not CALL or ONEWAY, if
  * the service name was not found in the message, or if the service
  * name was not found in the service map.  You called {@link 
#registerProcessor(String, TProcessor) registerProcessor}
@@ -92,14 +101,16 @@ public class TMultiplexedProcessor implements TProcessor {
 TMessage message = iprot.readMessageBegin();
 
 if (message.type != TMessageType.CALL && message.type != 
TMessageType.ONEWAY) {
-// TODO Apache Guys - Can the server ever get an EXCEPTION or 
REPLY?
-// TODO Should we check for this here?
 throw new TException("This should not have happened!?");
 }
 
 // Extract the service name
 int index = message.name.indexOf(TMultiplexedProtocol.SEPARATOR);
 if (index < 0) {
+  if (defaultProcessor != null) {
+// Dispatch processing to the stored processor
+return defaultProcessor.process(new 
StoredMessageProtocol(iprot, message), oprot);
+  }
 throw new TException("Service name not found in message name: " + 
message.name + ".  Did you " +
 "forget to use a TMultiplexProtocol in your client?");
 }

http://git-wip-us.apache.org/repos/asf/thrift/blob/400b346d/lib/java/test/org/apache/thrift/TestMultiplexedProcessor.java
--
diff --git a/lib/java/test/org/apache/thrift/TestMultiplexedProcessor.java 
b/lib/java/test/org/apache/thrift/TestMultiplexedProcessor.java
new file mode 100644
index 000..01776ca
--- /dev/null
+++ b/lib/java/test/org/apache/thrift/TestMultiplexedProcessor.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache 

thrift git commit: THRIFT-3921: Add ostream operator<< functions for enums (working with THRIFT-4060) Client: C++

2017-02-18 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 400b346db -> 655b9b6ef


THRIFT-3921: Add ostream operator<< functions for enums (working with 
THRIFT-4060)
Client: C++

This closes #1083
This closes #1194


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/655b9b6e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/655b9b6e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/655b9b6e

Branch: refs/heads/master
Commit: 655b9b6ef86c45b423a194abee2a9cd057a16a74
Parents: 400b346
Author: Vivek Jain 
Authored: Wed Sep 7 10:34:25 2016 -0700
Committer: James E. King, III 
Committed: Sat Feb 18 14:30:46 2017 -0500

--
 .../cpp/src/thrift/generate/t_cpp_generator.cc  | 42 
 lib/cpp/test/EnumTest.cpp   | 35 +++-
 test/EnumTest.thrift|  5 +++
 3 files changed, 80 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/655b9b6e/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc 
b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index 1c82e09..869d802 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -107,6 +107,7 @@ public:
 
   void generate_typedef(t_typedef* ttypedef);
   void generate_enum(t_enum* tenum);
+  void generate_enum_ostream_operator(t_enum* tenum);
   void generate_forward_declaration(t_struct* tstruct);
   void generate_struct(t_struct* tstruct) { generate_cpp_struct(tstruct, 
false); }
   void generate_xception(t_struct* txception) { generate_cpp_struct(txception, 
true); }
@@ -566,6 +567,47 @@ void t_cpp_generator::generate_enum(t_enum* tenum) {
 << tenum->get_name() << "Values"
 << ", _k" << tenum->get_name() << "Names), "
 << "::apache::thrift::TEnumIterator(-1, NULL, NULL));" << endl 
<< endl;
+
+  generate_enum_ostream_operator(tenum);
+}
+
+void t_cpp_generator::generate_enum_ostream_operator(t_enum* tenum) {
+
+  // If we've been told the consuming application will provide an ostream
+  // operator definition then we only make a declaration:
+
+  if (!has_custom_ostream(tenum)) {
+f_types_ << "inline ";
+  }
+
+  f_types_ << "std::ostream& operator<<(std::ostream& out, const ";
+  if (gen_pure_enums_) {
+f_types_ << tenum->get_name();
+  } else {
+f_types_ << tenum->get_name() << "::type&";
+  }
+  f_types_ << " val)";
+  if (has_custom_ostream(tenum)) {
+f_types_ << ";";
+  } else {
+scope_up(f_types_);
+
+f_types_ << indent() << "std::map::const_iterator it = _"
+ << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << endl;
+f_types_ << indent() << "if (it != _" << tenum->get_name() << 
"_VALUES_TO_NAMES.end()) {" << endl;
+indent_up();
+f_types_ << indent() << "out << it->second;" << endl;
+indent_down();
+f_types_ << indent() << "} else {" << endl;
+indent_up();
+f_types_ << indent() << "out << static_cast(val);" << endl;
+indent_down();
+f_types_ << indent() << "}" << endl;
+
+f_types_ << indent() << "return out;" << endl;
+scope_down(f_types_);
+  }
+  f_types_ << endl;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/thrift/blob/655b9b6e/lib/cpp/test/EnumTest.cpp
--
diff --git a/lib/cpp/test/EnumTest.cpp b/lib/cpp/test/EnumTest.cpp
index 0e34b16..c935bc4 100644
--- a/lib/cpp/test/EnumTest.cpp
+++ b/lib/cpp/test/EnumTest.cpp
@@ -20,9 +20,15 @@
 #include 
 #include "gen-cpp/EnumTest_types.h"
 
+std::ostream& operator <<(std::ostream& os, const 
MyEnumWithCustomOstream::type& val)
+{
+  os << "{" << (int)val << ":CUSTOM!" << "}";
+  return os;
+}
+
 BOOST_AUTO_TEST_SUITE(EnumTest)
 
-BOOST_AUTO_TEST_CASE(test_enum) {
+BOOST_AUTO_TEST_CASE(test_enum_value) {
   // Check that all the enum values match what we expect
   BOOST_CHECK_EQUAL(MyEnum1::ME1_0, 0);
   BOOST_CHECK_EQUAL(MyEnum1::ME1_1, 1);
@@ -47,9 +53,34 @@ BOOST_AUTO_TEST_CASE(test_enum) {
   BOOST_CHECK_EQUAL(MyEnum4::ME4_A, 0x7ffd);
   BOOST_CHECK_EQUAL(MyEnum4::ME4_B, 0x7ffe);
   BOOST_CHECK_EQUAL(MyEnum4::ME4_C, 0x7fff);
+
+  BOOST_CHECK_EQUAL(MyEnum5::e1, 0);
+  BOOST_CHECK_EQUAL(MyEnum5::e2, 42);
+}
+
+template 
+std::string EnumToString(_T e)
+{
+  std::stringstream ss;
+  ss << e;
+  return ss.str();
+}
+
+
+BOOST_AUTO_TEST_CASE(test_enum_ostream)
+{
+  BOOST_CHECK_EQUAL(EnumToString(MyEnum1::ME1_0), "ME1_0");
+  BOOST_CHECK_EQUAL(EnumToString(MyEnum5::e2), "e2");
+  BOOST_CHECK_EQUAL(EnumToString(MyEnum3::ME3_N1), 

thrift git commit: THRIFT-3369 Provide SSL/TLS client for c_glib Client: c_glib Patch: Gonzalo Aguilar Delgado <gagui...@level2crm.com>

2017-02-13 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master e8ba7877b -> 36628a28e


THRIFT-3369 Provide SSL/TLS client for c_glib
Client: c_glib
Patch: Gonzalo Aguilar Delgado 

This closes #1185


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/36628a28
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/36628a28
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/36628a28

Branch: refs/heads/master
Commit: 36628a28e975e4d680fff66eec3e66c06ca86bf2
Parents: e8ba787
Author: James E. King, III 
Authored: Mon Feb 13 15:25:41 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 13 15:25:41 2017 -0500

--
 .gitignore  |   3 +
 configure.ac|   9 +-
 lib/c_glib/CMakeLists.txt   |  11 +
 lib/c_glib/Makefile.am  |   6 +-
 .../c_glib/transport/thrift_platform_socket.h   | 120 +++
 .../thrift/c_glib/transport/thrift_ssl_socket.c | 770 +++
 .../thrift/c_glib/transport/thrift_ssl_socket.h | 181 +
 lib/c_glib/test/Makefile.am |  15 +-
 lib/c_glib/test/testtransportsslsocket.c| 581 ++
 lib/py/src/transport/TSSLSocket.py  |   4 +-
 test/c_glib/src/test_client.c   |  64 +-
 test/known_failures_Linux.json  |  10 +-
 test/tests.json |   3 +
 tutorial/c_glib/Makefile.am |   5 +-
 14 files changed, 1752 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/36628a28/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 0a98a13..288f1b2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -150,6 +150,7 @@ project.lock.json
 /lib/c_glib/test/testframedtransport
 /lib/c_glib/test/testmemorybuffer
 /lib/c_glib/test/testoptionalrequired
+/lib/c_glib/test/testtransportsslsocket
 /lib/c_glib/test/testsimpleserver
 /lib/c_glib/test/teststruct
 /lib/c_glib/test/testthrifttest
@@ -215,6 +216,8 @@ project.lock.json
 /lib/haxe/test/bin
 /lib/hs/dist
 /lib/java/build
+/lib/js/dist
+/lib/js/doc
 /lib/js/test/build
 /lib/netcore/**/.vs
 /lib/netcore/**/bin

http://git-wip-us.apache.org/repos/asf/thrift/blob/36628a28/configure.ac
--
diff --git a/configure.ac b/configure.ac
index 8a15ede..09c6d9e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -132,7 +132,6 @@ if test "$enable_libs" = "no"; then
   with_rs="no"
 fi
 
-
 AX_THRIFT_LIB(cpp, [C++], yes)
 have_cpp=no
 if test "$with_cpp" = "yes";  then
@@ -147,8 +146,6 @@ if test "$with_cpp" = "yes";  then
 have_cpp="yes"
   fi
 
-  AX_CHECK_OPENSSL()
-
   AX_LIB_EVENT([1.0])
   have_libevent=$success
 
@@ -199,6 +196,12 @@ if test "$with_c_glib" = "yes"; then
 fi
 AM_CONDITIONAL(WITH_C_GLIB, [test "$have_glib2" = "yes" -a "$have_gobject2" = 
"yes"])
 
+echo "OpenSSL check"
+if test "$have_cpp" = "yes" -o "$have_c_glib" = "yes";  then
+   echo "Have cpp or c so we check for OpenSSL"
+   AX_CHECK_OPENSSL()
+fi
+
 AX_THRIFT_LIB(csharp, [C#], yes)
 if test "$with_csharp" = "yes";  then
   PKG_CHECK_MODULES(MONO, mono >= 2.11.0, mono_2_11=yes, mono_2_11=no)

http://git-wip-us.apache.org/repos/asf/thrift/blob/36628a28/lib/c_glib/CMakeLists.txt
--
diff --git a/lib/c_glib/CMakeLists.txt b/lib/c_glib/CMakeLists.txt
index dd9892c..5e277f0 100644
--- a/lib/c_glib/CMakeLists.txt
+++ b/lib/c_glib/CMakeLists.txt
@@ -54,6 +54,17 @@ set(thrift_c_glib_SOURCES
 src/thrift/c_glib/server/thrift_simple_server.c
 )
 
+# If OpenSSL is not found just ignore the OpenSSL stuff
+find_package(OpenSSL)
+if(OPENSSL_FOUND AND WITH_OPENSSL)
+list( APPEND thriftcpp_SOURCES
+   src/thrift/c_glib/transport/thrift_ssl_socket.c
+)
+include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
+list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
+endif()
+
+
 # Contains the thrift specific ADD_LIBRARY_THRIFT and 
TARGET_LINK_LIBRARIES_THRIFT
 include(ThriftMacros)
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/36628a28/lib/c_glib/Makefile.am
--
diff --git a/lib/c_glib/Makefile.am b/lib/c_glib/Makefile.am
index 452f6a4..b66c89b 100755
--- a/lib/c_glib/Makefile.am
+++ b/lib/c_glib/Makefile.am
@@ -45,6 +45,7 @@ libthrift_c_glib_la_SOURCES = src/thrift/c_glib/thrift.c \
   
src/thrift/c_glib/transport/thrift_buffered_transport_factory.c \
   
src/thrift/c_glib/transport/thrift_framed_transport_factory.c \
 

thrift git commit: THRIFT-4060 add better support in the cpp generator for custom ostream operators on structures Client: C++

2017-02-13 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 36628a28e -> b4c190b6e


THRIFT-4060 add better support in the cpp generator for custom ostream 
operators on structures
Client: C++

This closes #1172


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b4c190b6
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b4c190b6
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b4c190b6

Branch: refs/heads/master
Commit: b4c190b6ea960c20a420089b1431042e435c73e9
Parents: 36628a2
Author: James E. King, III 
Authored: Mon Feb 13 16:39:59 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 13 16:39:59 2017 -0500

--
 .gitignore  |  1 +
 .../cpp/src/thrift/generate/t_cpp_generator.cc  | 61 ++
 lib/cpp/test/AnnotationTest.cpp | 68 
 lib/cpp/test/CMakeLists.txt | 19 +-
 lib/cpp/test/Makefile.am| 20 +-
 test/AnnotationTest.thrift  |  9 +++
 6 files changed, 163 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/b4c190b6/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 288f1b2..88bb9c6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -102,6 +102,7 @@ project.lock.json
 /lib/cpp/src/thrift/stamp-h2
 /lib/cpp/test/Benchmark
 /lib/cpp/test/AllProtocolsTest
+/lib/cpp/test/AnnotationTest
 /lib/cpp/test/DebugProtoTest
 /lib/cpp/test/DenseProtoTest
 /lib/cpp/test/EnumTest

http://git-wip-us.apache.org/repos/asf/thrift/blob/b4c190b6/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc 
b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index cbe8da2..1c82e09 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -64,6 +64,8 @@ public:
 gen_templates_ = false;
 gen_templates_only_ = false;
 gen_moveable_ = false;
+gen_no_ostream_operators_ = false;
+
 for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
   if( iter->first.compare("pure_enums") == 0) {
 gen_pure_enums_ = true;
@@ -80,6 +82,8 @@ public:
 gen_templates_only_ = (iter->second == "only");
   } else if( iter->first.compare("moveable_types") == 0) {
 gen_moveable_ = true;
+  } else if ( iter->first.compare("no_ostream_operators") == 0) {
+gen_no_ostream_operators_ = true;
   } else {
 throw "unknown option cpp:" + iter->first;
   }
@@ -260,6 +264,22 @@ public:
 
   void set_use_include_prefix(bool use_include_prefix) { use_include_prefix_ = 
use_include_prefix; }
 
+  /**
+   * The compiler option "no_thrift_ostream_impl" can be used to prevent
+   * the compiler from emitting implementations for operator <<.  In this
+   * case the consuming application must provide any needed to build.
+   *
+   * To disable this on a per structure bases, one can alternatively set
+   * the annotation "cpp.customostream" to prevent thrift from emitting an
+   * operator << (std::ostream&).
+   *
+   * See AnnotationTest for validation of this annotation feature.
+   */
+  bool has_custom_ostream(t_type* ttype) const {
+return (gen_no_ostream_operators_) ||
+   (ttype->annotations_.find("cpp.customostream") != 
ttype->annotations_.end());
+  }
+
 private:
   /**
* Returns the include prefix to use for a file generated by program, or the
@@ -289,6 +309,11 @@ private:
   bool gen_moveable_;
 
   /**
+   * True if we should generate ostream definitions
+   */
+  bool gen_no_ostream_operators_;
+
+  /**
* True iff we should use a path prefix in our #include statements for other
* thrift-generated header files.
*/
@@ -751,7 +776,11 @@ void t_cpp_generator::generate_cpp_struct(t_struct* 
tstruct, bool is_exception)
   if (gen_moveable_) {
 generate_move_assignment_operator(f_types_impl_, tstruct);
   }
-  generate_struct_print_method(f_types_impl_, tstruct);
+
+  if (!has_custom_ostream(tstruct)) {
+generate_struct_print_method(f_types_impl_, tstruct);
+  }
+
   if (is_exception) {
 generate_exception_what_method(f_types_impl_, tstruct);
   }
@@ -1094,7 +1123,7 @@ void 
t_cpp_generator::generate_struct_declaration(ofstream& out,
   }
   out << endl;
 
-  if (is_user_struct) {
+  if (is_user_struct && !has_custom_ostream(tstruct)) {
 out << indent() << "virtual ";
 generate_struct_print_method_decl(out, NULL);
 out << ";" << endl;
@@ -1467,14 +1496,22 @@ void t_cpp_generator::generate_struct_swap(ofstream& 

thrift git commit: THRIFT-4084: only join threads if joinable Client: cpp Patch: Chris Grebeldinger <cgreb...@gmail.com>

2017-02-13 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b4c190b6e -> 0a660ee28


THRIFT-4084: only join threads if joinable
Client: cpp
Patch: Chris Grebeldinger 

This closes #1188


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/0a660ee2
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/0a660ee2
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/0a660ee2

Branch: refs/heads/master
Commit: 0a660ee285e4a4cbac8f702168c40fd4ef5495d1
Parents: b4c190b
Author: James E. King, III 
Authored: Mon Feb 13 18:25:56 2017 -0500
Committer: James E. King, III 
Committed: Mon Feb 13 18:25:56 2017 -0500

--
 lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp | 2 +-
 lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/0a660ee2/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
index 6adcb68..8afabf9 100644
--- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
@@ -61,7 +61,7 @@ public:
   }
 
   ~BoostThread() {
-if (!detached_) {
+if (!detached_ && thread_->joinable()) {
   try {
 join();
   } catch (...) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/0a660ee2/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
index 66c7e75..4fca8da 100644
--- a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
@@ -61,7 +61,7 @@ public:
   }
 
   ~StdThread() {
-if (!detached_) {
+if (!detached_ && thread_->joinable()) {
   try {
 join();
   } catch (...) {



thrift git commit: THRIFT-3622: remove auto_ptr use in the codebase because it is deprecated Client: C++

2017-02-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 3590f1e7c -> e1832c354


THRIFT-3622: remove auto_ptr use in the codebase because it is deprecated
Client: C++

This closes #1183


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e1832c35
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e1832c35
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e1832c35

Branch: refs/heads/master
Commit: e1832c354391deb0e0ce94a62ff32e8ce1c83fd3
Parents: 3590f1e
Author: James E. King, III 
Authored: Fri Feb 10 13:03:10 2017 -0500
Committer: James E. King, III 
Committed: Fri Feb 10 13:03:10 2017 -0500

--
 lib/cpp/src/thrift/async/TEvhttpServer.cpp  |  4 +--
 .../thrift/concurrency/BoostThreadFactory.cpp   |  8 +++---
 lib/cpp/src/thrift/transport/TFileTransport.cpp | 27 +---
 lib/cpp/test/DebugProtoTest.cpp |  7 ++---
 lib/cpp/test/JSONProtoTest.cpp  |  7 ++---
 5 files changed, 38 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/e1832c35/lib/cpp/src/thrift/async/TEvhttpServer.cpp
--
diff --git a/lib/cpp/src/thrift/async/TEvhttpServer.cpp 
b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
index 57d0d61..4fa41f8 100644
--- a/lib/cpp/src/thrift/async/TEvhttpServer.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpServer.cpp
@@ -20,10 +20,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-
 #include 
 
 #ifndef HTTP_INTERNAL // libevent < 2
@@ -118,7 +118,7 @@ void TEvhttpServer::process(struct evhttp_request* req) {
 
 void TEvhttpServer::complete(RequestContext* ctx, bool success) {
   (void)success;
-  std::auto_ptr ptr(ctx);
+  boost::scoped_ptr ptr(ctx);
 
   int code = success ? 200 : 400;
   const char* reason = success ? "OK" : "Bad Request";

http://git-wip-us.apache.org/repos/asf/thrift/blob/e1832c35/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
index a72d38b..6adcb68 100644
--- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
@@ -26,8 +26,9 @@
 
 #include 
 
-#include 
+#include 
 #include 
+#include 
 
 namespace apache {
 namespace thrift {
@@ -48,7 +49,7 @@ public:
   static void* threadMain(void* arg);
 
 private:
-  std::auto_ptr thread_;
+  boost::scoped_ptr thread_;
   STATE state_;
   weak_ptr self_;
   bool detached_;
@@ -80,8 +81,7 @@ public:
 
 state_ = starting;
 
-thread_
-= std::auto_ptr(new 
boost::thread(boost::bind(threadMain, (void*)selfRef)));
+thread_.reset(new boost::thread(boost::bind(threadMain, (void*)selfRef)));
 
 if (detached_)
   thread_->detach();

http://git-wip-us.apache.org/repos/asf/thrift/blob/e1832c35/lib/cpp/src/thrift/transport/TFileTransport.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.cpp 
b/lib/cpp/src/thrift/transport/TFileTransport.cpp
index 85e88b9..e49f81c 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.cpp
+++ b/lib/cpp/src/thrift/transport/TFileTransport.cpp
@@ -24,6 +24,16 @@
 #include 
 #include 
 
+#include 
+#include 
+#if (BOOST_VERSION >= 105700)
+#include 
+using boost::movelib::unique_ptr;
+#else
+#include 
+using boost::interprocess::unique_ptr;
+#endif
+
 #ifdef HAVE_SYS_TIME_H
 #include 
 #else
@@ -52,9 +62,12 @@ namespace apache {
 namespace thrift {
 namespace transport {
 
-using boost::scoped_ptr;
 using boost::shared_ptr;
-using namespace std;
+using std::cerr;
+using std::cout;
+using std::endl;
+using std::min;
+using std::string;
 using namespace apache::thrift::protocol;
 using namespace apache::thrift::concurrency;
 
@@ -192,6 +205,14 @@ void TFileTransport::write(const uint8_t* buf, uint32_t 
len) {
   enqueueEvent(buf, len);
 }
 
+// this is needed until boost 1.57 as the older unique_ptr implementation
+// has no default deleter in interprocess
+template 
+struct uniqueDeleter
+{
+  void operator()(_T *ptr) const { delete ptr; }
+};
+
 void TFileTransport::enqueueEvent(const uint8_t* buf, uint32_t eventLen) {
   // can't enqueue more events if file is going to close
   if (closing_) {
@@ -209,7 +230,7 @@ void TFileTransport::enqueueEvent(const uint8_t* buf, 
uint32_t eventLen) {
 return;
   }
 
-  std::auto_ptr toEnqueue(new eventInfo());
+  unique_ptr toEnqueue(new eventInfo());
   toEnqueue->eventBuff_ = new uint8_t[(sizeof(uint8_t) * eventLen) + 4];
 
   // first 4 bytes is the event 

thrift git commit: THRIFT-4075: better support for headers-only boost with mingw Client: C++

2017-02-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master e1832c354 -> bff044667


THRIFT-4075: better support for headers-only boost with mingw
Client: C++

This closes #1184


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bff04466
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bff04466
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bff04466

Branch: refs/heads/master
Commit: bff044667caf8a8c2b0dd30ed11b328ff2902cf5
Parents: e1832c3
Author: James E. King, III 
Authored: Sat Feb 11 01:18:03 2017 -0500
Committer: James E. King, III 
Committed: Sat Feb 11 01:18:03 2017 -0500

--
 lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h | 2 +-
 lib/cpp/src/thrift/windows/config.h | 8 
 2 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bff04466/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
--
diff --git a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h 
b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
index 56684bb..dd0c5c9 100644
--- a/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
+++ b/lib/cpp/src/thrift/windows/OverlappedSubmissionThread.h
@@ -63,7 +63,7 @@ namespace apache {
 namespace thrift {
 namespace transport {
 
-DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) struct TOverlappedWorkItem : 
public SLIST_ENTRY {
+struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) TOverlappedWorkItem : 
public SLIST_ENTRY {
   TOverlappedWorkItem();
 
   enum action_t {

http://git-wip-us.apache.org/repos/asf/thrift/blob/bff04466/lib/cpp/src/thrift/windows/config.h
--
diff --git a/lib/cpp/src/thrift/windows/config.h 
b/lib/cpp/src/thrift/windows/config.h
index cde9de6..f54cb5e 100644
--- a/lib/cpp/src/thrift/windows/config.h
+++ b/lib/cpp/src/thrift/windows/config.h
@@ -28,8 +28,8 @@
 #error "This is a Windows header only"
 #endif
 
-// use std::thread in MSVC11 (2012) or newer
-#if _MSC_VER >= 1700
+// use std::thread in MSVC11 (2012) or newer and in MinGW
+#if (_MSC_VER >= 1700) || defined(__MINGW32__)
 #define USE_STD_THREAD 1
 #else
 // otherwise use boost threads
@@ -39,8 +39,8 @@
 // Something that defines PRId64 is required to build
 #define HAVE_INTTYPES_H 1
 
-// VS2010 or later has stdint.h
-#if _MSC_VER >= 1600
+// VS2010 or later has stdint.h as does MinGW
+#if (_MSC_VER >= 1600) || defined(__MINGW32__)
 #define HAVE_STDINT_H 1
 #endif
 



thrift git commit: THRIFT-4041: add ocaml and oasis to ubuntu and debian docker build images Client: OCaml

2017-02-14 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 0a660ee28 -> ec50ae0ed


THRIFT-4041: add ocaml and oasis to ubuntu and debian docker build images
Client: OCaml

This closes #1190


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ec50ae0e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ec50ae0e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ec50ae0e

Branch: refs/heads/master
Commit: ec50ae0ed59c06658da11d2ed54e1681a4ef5a3a
Parents: 0a660ee
Author: James E. King, III 
Authored: Tue Feb 14 16:12:11 2017 -0500
Committer: James E. King, III 
Committed: Tue Feb 14 16:12:11 2017 -0500

--
 build/docker/debian/Dockerfile |  9 +
 build/docker/ubuntu/Dockerfile | 10 ++
 2 files changed, 19 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/ec50ae0e/build/docker/debian/Dockerfile
--
diff --git a/build/docker/debian/Dockerfile b/build/docker/debian/Dockerfile
index 7c15109..9a16951 100644
--- a/build/docker/debian/Dockerfile
+++ b/build/docker/debian/Dockerfile
@@ -183,6 +183,15 @@ RUN curl -sSL 
http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd6
 # Dart
 ENV PATH /usr/lib/dart/bin:$PATH
 
+# OCaml
+RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > 
/etc/apt/sources.list.d/avsm-official-ocaml.list && \
+gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
+gpg --export --armor 61707B09 | apt-key add - && \
+apt-get update && \
+apt-get install -y ocaml opam && \
+opam init && \
+opam install oasis
+
 # Force utf8 locale to successfully build Haskell tf-random
 ENV LC_ALL C.UTF-8
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/ec50ae0e/build/docker/ubuntu/Dockerfile
--
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index 02f0b1e..b6cebb3 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -203,6 +203,16 @@ RUN curl -sSL 
http://downloads.dlang.org/releases/2.x/2.070.0/dmd_2.070.0-0_amd6
 # Dart
 ENV PATH /usr/lib/dart/bin:$PATH
 
+# OCaml
+RUN echo 'deb http://ppa.launchpad.net/avsm/ppa/ubuntu trusty main' > 
/etc/apt/sources.list.d/avsm-official-ocaml.list && \
+gpg --keyserver keyserver.ubuntu.com --recv 61707B09 && \
+gpg --export --armor 61707B09 | apt-key add - && \
+apt-get update && \
+apt-get install -y ocaml opam && \
+opam init && \
+opam install oasis
+
+
 ENV THRIFT_ROOT /thrift
 RUN mkdir -p $THRIFT_ROOT/src
 COPY Dockerfile $THRIFT_ROOT/



thrift git commit: THRIFT-4091 - revert THRIFT-4045 and remove unused test code in test/cpp Client: C++

2017-02-15 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master ec50ae0ed -> ab8ff1abf


THRIFT-4091 - revert THRIFT-4045 and remove unused test code in test/cpp
Client: C++

This closes #1192


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ab8ff1ab
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ab8ff1ab
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ab8ff1ab

Branch: refs/heads/master
Commit: ab8ff1abf74320f23bb692ca9ae83062503b2518
Parents: ec50ae0
Author: James E. King, III 
Authored: Wed Feb 15 14:12:37 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 15 14:12:37 2017 -0500

--
 configure.ac|   2 +
 test/cpp/Makefile.am|   4 +-
 test/cpp/realloc/Makefile   |  40 -
 test/cpp/realloc/realloc_test.c | 107 ---
 4 files changed, 3 insertions(+), 150 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/ab8ff1ab/configure.ac
--
diff --git a/configure.ac b/configure.ac
index 09c6d9e..a889f75 100755
--- a/configure.ac
+++ b/configure.ac
@@ -660,7 +660,9 @@ AC_CHECK_DECL([AI_ADDRCONFIG], [],
 
 AC_FUNC_ALLOCA
 AC_FUNC_FORK
+AC_FUNC_MALLOC
 AC_FUNC_MEMCMP
+AC_FUNC_REALLOC
 AC_FUNC_SELECT_ARGTYPES
 AC_FUNC_STAT
 AC_FUNC_STRERROR_R

http://git-wip-us.apache.org/repos/asf/thrift/blob/ab8ff1ab/test/cpp/Makefile.am
--
diff --git a/test/cpp/Makefile.am b/test/cpp/Makefile.am
index d825bdd..82dc518 100755
--- a/test/cpp/Makefile.am
+++ b/test/cpp/Makefile.am
@@ -120,6 +120,4 @@ EXTRA_DIST = \
src/TestClient.cpp \
src/TestServer.cpp \
src/StressTest.cpp \
-   src/StressTestNonBlocking.cpp \
-   realloc/realloc_test.c \
-   realloc/Makefile
+   src/StressTestNonBlocking.cpp

http://git-wip-us.apache.org/repos/asf/thrift/blob/ab8ff1ab/test/cpp/realloc/Makefile
--
diff --git a/test/cpp/realloc/Makefile b/test/cpp/realloc/Makefile
deleted file mode 100644
index f89bbb3..000
--- a/test/cpp/realloc/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# This probably should not go into "make check", because it is an experiment,
-# not a test.  Specifically, it is meant to determine how likely realloc is
-# to avoid a copy.  This is poorly documented.
-
-run: realloc_test
-   for it in 1 4 64 ; do \
-   for nb in 1 8 64 512 ; do \
-   for mins in 64 512 ; do \
-   for maxs in 2048 262144 ; do \
-   for db in 8 64 ; do \
-   ./realloc_test $$nb $$mins 
$$maxs $$db $$it \
-   ; done \
-   ; done \
-   ; done \
-   ; done \
-   ; done \
-   > raw_stats
-
-CFLAGS = -Wall -g -std=c99
-LDLIBS = -ldl
-realloc_test: realloc_test.c

http://git-wip-us.apache.org/repos/asf/thrift/blob/ab8ff1ab/test/cpp/realloc/realloc_test.c
--
diff --git a/test/cpp/realloc/realloc_test.c b/test/cpp/realloc/realloc_test.c
deleted file mode 100644
index f9763ad..000
--- a/test/cpp/realloc/realloc_test.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed 

thrift git commit: THRIFT-3272 (THRIFT-4066) fix perl SSL authentication support; fixed error in erlang test client using wrong key file and added CA Client: Perl

2017-02-15 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b28160b9c -> 377719c2d


THRIFT-3272 (THRIFT-4066) fix perl SSL authentication support; fixed error in 
erlang test client using wrong key file and added CA
Client: Perl

This closes #1189


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/377719c2
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/377719c2
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/377719c2

Branch: refs/heads/master
Commit: 377719c2d85f6f92df7a40e34a84129406f6deb4
Parents: b28160b
Author: James E. King, III 
Authored: Wed Feb 15 14:33:20 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 15 14:33:20 2017 -0500

--
 lib/perl/lib/Thrift/SSLServerSocket.pm | 26 +
 lib/perl/lib/Thrift/SSLSocket.pm   | 52 ++
 lib/perl/lib/Thrift/Socket.pm  | 81 -
 test/erl/src/test_client.erl   |  5 +-
 test/erl/src/test_thrift_server.erl|  2 +-
 test/known_failures_Linux.json | 27 ++
 test/perl/TestClient.pl| 20 +++
 test/perl/TestServer.pl| 14 ++---
 test/tests.json|  5 +-
 9 files changed, 132 insertions(+), 100 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/377719c2/lib/perl/lib/Thrift/SSLServerSocket.pm
--
diff --git a/lib/perl/lib/Thrift/SSLServerSocket.pm 
b/lib/perl/lib/Thrift/SSLServerSocket.pm
index 4daaf08..e885ede 100644
--- a/lib/perl/lib/Thrift/SSLServerSocket.pm
+++ b/lib/perl/lib/Thrift/SSLServerSocket.pm
@@ -48,21 +48,27 @@ sub new
 
 sub __client
 {
-   return new Thrift::SSLSocket();
+  return new Thrift::SSLSocket();
 }
 
 sub __listen
 {
 my $self = shift;
-return IO::Socket::SSL->new(LocalAddr => $self->{host},
-LocalPort => $self->{port},
-Proto => 'tcp',
-Listen=> $self->{queue},
-ReuseAddr => 1,
-SSL_cert_file => $self->{cert},
-SSL_key_file  => $self->{key},
-SSL_ca_file   => $self->{ca});
-}
+my $opts = {Listen=> $self->{queue},
+LocalAddr => $self->{host},
+LocalPort => $self->{port},
+Proto => 'tcp',
+ReuseAddr => 1};
+
+$opts->{SSL_ca_file}  = $self->{ca}  if defined $self->{ca};
+$opts->{SSL_cert_file}= $self->{cert}if defined $self->{cert};
+$opts->{SSL_cipher_list}  = $self->{ciphers} if defined $self->{ciphers};
+$opts->{SSL_key_file} = $self->{key} if defined $self->{key};
+$opts->{SSL_use_cert} = (defined $self->{cert}) ? 1 : 0;
+$opts->{SSL_verify_mode}  = (defined $self->{ca}) ? 
IO::Socket::SSL::SSL_VERIFY_PEER : IO::Socket::SSL::SSL_VERIFY_NONE;
+$opts->{SSL_version}  = (defined $self->{version}) ? $self->{version} 
: 'SSLv23:!SSLv2:!SSLv3';
 
+return IO::Socket::SSL->new(%$opts);
+}
 
 1;

http://git-wip-us.apache.org/repos/asf/thrift/blob/377719c2/lib/perl/lib/Thrift/SSLSocket.pm
--
diff --git a/lib/perl/lib/Thrift/SSLSocket.pm b/lib/perl/lib/Thrift/SSLSocket.pm
index 0d2edf8..046692e 100644
--- a/lib/perl/lib/Thrift/SSLSocket.pm
+++ b/lib/perl/lib/Thrift/SSLSocket.pm
@@ -29,10 +29,32 @@ use IO::Select;
 
 package Thrift::SSLSocket;
 
-# TODO: Does not provide cipher selection or authentication hooks yet.
-
 use base qw( Thrift::Socket );
 
+#
+# Construction and usage
+#
+# my $opts = {}
+# my $socket = new Thrift::SSLSocket(\%opts);
+#
+# options:
+#
+# Any option from Socket.pm is valid, and then:
+#
+# ca  => certificate authority file (PEM file) to authenticate the
+#server against; if not specified then the server is not
+#authenticated
+# cert=> certificate to use as the client; if not specified then
+#the client does not present one but still connects using
+#secure protocol
+# ciphers => allowed cipher list
+#(see 
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS)
+# key => certificate key for "cert" option
+# version => acceptable SSL/TLS versions - if not specified then the
+#default is to use SSLv23 handshake but only negotiate
+#at TLSv1.0 or later
+#
+
 sub new
 {
 my $classname = shift;
@@ -44,10 +66,20 @@ sub new
 sub __open
 {
 my $self = shift;
-return IO::Socket::SSL->new(PeerAddr => 

thrift git commit: THRIFT-2364: use oasis to build thrift for ocaml Client: OCaml Patch: Spiros Eliopoulos <selio...@gmail.com>

2017-02-15 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master ab8ff1abf -> b28160b9c


THRIFT-2364: use oasis to build thrift for ocaml
Client: OCaml
Patch: Spiros Eliopoulos 

This closes #1193


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b28160b9
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b28160b9
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b28160b9

Branch: refs/heads/master
Commit: b28160b9c38b7febc3843cf69c6abc12c4d79df5
Parents: ab8ff1a
Author: James E. King, III 
Authored: Wed Feb 15 14:23:44 2017 -0500
Committer: James E. King, III 
Committed: Wed Feb 15 14:23:44 2017 -0500

--
 lib/ocaml/.gitignore   |   11 +
 lib/ocaml/DEVELOPMENT  |   76 +++
 lib/ocaml/Makefile |   23 -
 lib/ocaml/OCamlMakefile| 1231 ---
 lib/ocaml/README-OCamlMakefile |  643 --
 lib/ocaml/descr|1 +
 lib/ocaml/opam |8 +
 lib/ocaml/url  |2 +
 8 files changed, 98 insertions(+), 1897 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/b28160b9/lib/ocaml/.gitignore
--
diff --git a/lib/ocaml/.gitignore b/lib/ocaml/.gitignore
new file mode 100644
index 000..0d9a6af
--- /dev/null
+++ b/lib/ocaml/.gitignore
@@ -0,0 +1,11 @@
+_build/
+_tags
+configure
+setup.data
+setup.ml
+myocamlbuild.ml
+*/META
+*/*.mllib
+*/*.mldylib
+Makefile
+OCamlMakefile

http://git-wip-us.apache.org/repos/asf/thrift/blob/b28160b9/lib/ocaml/DEVELOPMENT
--
diff --git a/lib/ocaml/DEVELOPMENT b/lib/ocaml/DEVELOPMENT
new file mode 100644
index 000..3d5a03c
--- /dev/null
+++ b/lib/ocaml/DEVELOPMENT
@@ -0,0 +1,76 @@
+Thrift OCaml Development
+
+
+Prerequisites
+-
+
+In order to build this library, you must have the following installed:
+
+  * The OCaml compiler, preferably >4.00
+  * The Oasis build tool
+
+In addition you may want to install OPAM, which will allow you to setup an
+OCaml development environment that's isolated from your system installation,
+much like virutalenv for Python or the myriad systems available for Ruby. If
+you have OPAM installed, then installing Oasis is as simple as running:
+
+  $ opam install oasis
+
+Building
+
+
+Once all the prerequisites have been installed, run the following commands:
+
+  $ oasis setup
+  $ ./configure
+  $ make
+
+The `oasis setup` command will generate the configure script and Makefile,
+along with other files that opam will use to create an installable library.
+The cofigure script will ensure that all build dependencies are installed, and
+make will actually build the library.
+
+To remove files that the compiler geneates, run:
+
+  $ make clean
+
+To remove those files _as well as_ files that the setup and configure process
+generates, run:
+
+  $ rm `cat .gitignore`
+
+Installing
+--
+
+If you're using opam, simply run the following command:
+
+  $ make install
+
+While development, you may want to install your latest build on the system to
+test against other libraries or programs. To do this, use:
+
+  $ make reinstall
+
+Distribution
+
+
+The de facto preferred method for distributing OCaml libraries is through the
+OPAM package repository. To publish the latest package, issue a pull request
+against the following github repository:
+
+  https://github.com/ocaml/opam-repository
+
+The pull requestion should add the following directory structure and files:
+
+  package
+|__thrift
+   |__thrift.
+  |__ descr
+  |__ opam
+  |__ url
+
+Templates for the following files can be found in the opam/ subdirectory of
+this library's root, with XXX(...) indicating fields that need to be filled
+out. You can find further documentation here:
+
+  http://opam.ocaml.org/doc/Packaging.html

http://git-wip-us.apache.org/repos/asf/thrift/blob/b28160b9/lib/ocaml/Makefile
--
diff --git a/lib/ocaml/Makefile b/lib/ocaml/Makefile
deleted file mode 100644
index 6abeee7..000
--- a/lib/ocaml/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   

thrift git commit: chore: install ruby-bundler Fixes recent build failures in the Travis CI environment.

2017-01-17 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 5f723cd53 -> e0ccbd6e6


chore: install ruby-bundler
Fixes recent build failures in the Travis CI environment.

This closes #1158


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/e0ccbd6e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/e0ccbd6e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/e0ccbd6e

Branch: refs/heads/master
Commit: e0ccbd6e62e14f32d7c5fe0f9cec6eff3259b863
Parents: 5f723cd
Author: Roger Meier 
Authored: Mon Jan 16 20:26:57 2017 +0100
Committer: James E. King, III 
Committed: Tue Jan 17 13:14:33 2017 -0500

--
 build/docker/debian/Dockerfile | 2 ++
 build/docker/ubuntu/Dockerfile | 1 +
 2 files changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/e0ccbd6e/build/docker/debian/Dockerfile
--
diff --git a/build/docker/debian/Dockerfile b/build/docker/debian/Dockerfile
index 99eda7a..7c15109 100644
--- a/build/docker/debian/Dockerfile
+++ b/build/docker/debian/Dockerfile
@@ -83,6 +83,8 @@ RUN apt-get update && apt-get install -y 
--no-install-recommends \
   libio-socket-ssl-perl \
   libnet-ssleay-perl
 
+RUN echo "deb http://ftp.debian.org/debian jessie-backports main" > 
/etc/apt/sources.list.d/jessie-backports.list
+RUN apt-get update && apt-get -t jessie-backports install -y ruby-bundler
 RUN apt-get update && apt-get install -y --no-install-recommends \
 `# Php dependencies` \
   php5 \

http://git-wip-us.apache.org/repos/asf/thrift/blob/e0ccbd6e/build/docker/ubuntu/Dockerfile
--
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index 7792aae..02f0b1e 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -95,6 +95,7 @@ RUN apt-get update && apt-get install -y 
--no-install-recommends \
 `# Ruby dependencies` \
   ruby \
   ruby-dev \
+  ruby-bundler \
 `# Perl dependencies` \
   libbit-vector-perl \
   libclass-accessor-class-perl \



thrift git commit: THRIFT-3873: fix various compiler warnings and overflow errors THRIFT-3847: change VERSION to PACKAGE_VERSION to avoid conflicts with third party or OS headers

2017-01-20 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master e0ccbd6e6 -> 7edc8faef


THRIFT-3873: fix various compiler warnings and overflow errors
THRIFT-3847: change VERSION to PACKAGE_VERSION to avoid conflicts with third 
party or OS headers

This closes #1128


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7edc8fae
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7edc8fae
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7edc8fae

Branch: refs/heads/master
Commit: 7edc8faefd391ce11eca3023a35cc54bcb2eb1af
Parents: e0ccbd6
Author: James E. King, III 
Authored: Fri Jan 20 10:11:41 2017 -0500
Committer: James E. King, III 
Committed: Fri Jan 20 10:12:06 2017 -0500

--
 build/cmake/ConfigureChecks.cmake   | 19 
 build/cmake/DefinePlatformSpecifc.cmake | 12 +
 build/cmake/FindInttypes.cmake  | 41 +
 build/cmake/FindLibevent.cmake  | 10 +++--
 build/cmake/config.h.in |  5 +--
 compiler/cpp/CMakeLists.txt |  8 
 .../cpp/src/thrift/generate/t_erl_generator.cc  | 15 +--
 .../cpp/src/thrift/generate/t_go_generator.cc   | 11 +++--
 compiler/cpp/src/thrift/thriftl.ll  | 16 +--
 compiler/cpp/src/thrift/thrifty.yy  |  4 ++
 compiler/cpp/src/thrift/windows/config.h|  8 +++-
 lib/cpp/src/thrift/protocol/THeaderProtocol.h   |  4 +-
 lib/cpp/src/thrift/protocol/TJSONProtocol.cpp   |  2 +-
 .../src/thrift/server/TNonblockingServer.cpp| 11 ++---
 .../src/thrift/transport/THeaderTransport.cpp   | 36 +--
 lib/cpp/src/thrift/transport/THeaderTransport.h | 12 +++--
 lib/cpp/src/thrift/transport/THttpClient.cpp|  3 +-
 lib/cpp/src/thrift/transport/THttpServer.cpp|  3 +-
 lib/cpp/src/thrift/transport/TServerSocket.cpp  |  4 --
 lib/cpp/src/thrift/transport/TSocket.cpp|  4 --
 .../src/thrift/transport/TTransportException.h  | 16 +++
 lib/cpp/src/thrift/windows/config.h |  4 +-
 lib/cpp/test/AllProtocolTests.tcc   |  8 ++--
 lib/cpp/test/CMakeLists.txt |  9 +++-
 lib/cpp/test/JSONProtoTest.cpp  |  3 +-
 lib/cpp/test/ZlibTest.cpp   | 10 -
 lib/cpp/test/processor/ServerThread.cpp |  2 +
 lib/cpp/test/processor/ServerThread.h   |  3 +-
 test/cpp/CMakeLists.txt |  1 -
 test/cpp/Makefile.am|  2 +-
 test/cpp/src/TestClient.cpp | 46 
 test/cpp/src/TestServer.cpp | 10 +++--
 tutorial/cpp/CMakeLists.txt |  8 +++-
 33 files changed, 248 insertions(+), 102 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/7edc8fae/build/cmake/ConfigureChecks.cmake
--
diff --git a/build/cmake/ConfigureChecks.cmake 
b/build/cmake/ConfigureChecks.cmake
index f650544..81223d8 100644
--- a/build/cmake/ConfigureChecks.cmake
+++ b/build/cmake/ConfigureChecks.cmake
@@ -17,17 +17,16 @@
 # under the License.
 #
 
-
-include(CheckSymbolExists)
+include(CheckFunctionExists)
 include(CheckIncludeFile)
 include(CheckIncludeFiles)
-include(CheckFunctionExists)
+include(CheckSymbolExists)
 
-# If AI_ADDRCONFIG is not defined we define it as 0
-check_symbol_exists(AI_ADDRCONFIG "sys/types.h;sys/socket.h;netdb.h" 
HAVE_AI_ADDRCONFIG)
-if(NOT HAVE_AI_ADDRCONFIG)
-set(AI_ADDRCONFIG 1)
-endif(NOT HAVE_AI_ADDRCONFIG)
+if (Inttypes_FOUND)
+  # This allows the inttypes.h and stdint.h checks to succeed on platforms that
+  # do not natively provide there.
+  set (CMAKE_REQUIRED_INCLUDES ${INTTYPES_INCLUDE_DIRS})
+endif ()
 
 check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
 check_include_file(fcntl.h HAVE_FCNTL_H)
@@ -72,5 +71,5 @@ set(VERSION ${thrift_VERSION})
 
 # generate a config.h file
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" 
"${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
-# HACK: Some files include thrift/config.h and some config.h so we include 
both. This should be cleaned up.
-include_directories("${CMAKE_CURRENT_BINARY_DIR}/thrift" 
"${CMAKE_CURRENT_BINARY_DIR}")
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}")

http://git-wip-us.apache.org/repos/asf/thrift/blob/7edc8fae/build/cmake/DefinePlatformSpecifc.cmake
--
diff --git a/build/cmake/DefinePlatformSpecifc.cmake 
b/build/cmake/DefinePlatformSpecifc.cmake
index e57ecc2..496134c 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -71,12 +71,24 @@ if(MSVC)
   message (FATAL_ERROR "Windows build does 

thrift git commit: THRIFT-3891 TNonblockingServer configured with more than one IO threads does not always return from serve() upon stop() Client: C++ Patch: additional changes by jk...@apache.org to

2017-02-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 5038466e5 -> 36d1b0dea


THRIFT-3891 TNonblockingServer configured with more than one IO threads does 
not always return from serve() upon stop()
Client: C++
Patch: additional changes by jk...@apache.org to improve the test and stop 
clean in all cases

This closes #1080
This closes #1196


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/36d1b0de
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/36d1b0de
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/36d1b0de

Branch: refs/heads/master
Commit: 36d1b0dea566c0dea06e321421e32a6cad0abb32
Parents: 5038466
Author: Buğra Gedik 
Authored: Sun Sep 4 17:18:15 2016 +0900
Committer: James E. King, III 
Committed: Mon Feb 27 23:44:35 2017 -0500

--
 .../src/thrift/server/TNonblockingServer.cpp| 54 ++--
 lib/cpp/test/TNonblockingServerTest.cpp | 37 +-
 2 files changed, 61 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/36d1b0de/lib/cpp/src/thrift/server/TNonblockingServer.cpp
--
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index 649910f..d4418bd 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -510,7 +510,7 @@ void TNonblockingServer::TConnection::workSocket() {
 
 // If there is no data to send, then let us move on
 if (writeBufferPos_ == writeBufferSize_) {
-  GlobalOutput("WARNING: Send state with no data to send\n");
+  GlobalOutput("WARNING: Send state with no data to send");
   transition();
   return;
 }
@@ -765,11 +765,9 @@ void TNonblockingServer::TConnection::setFlags(short 
eventFlags) {
   }
 
   // Delete a previously existing event
-  if (eventFlags_ != 0) {
-if (event_del(_) == -1) {
-  GlobalOutput("TConnection::setFlags event_del");
-  return;
-}
+  if (eventFlags_ && event_del(_) == -1) {
+GlobalOutput.perror("TConnection::setFlags() event_del", 
THRIFT_GET_SOCKET_ERROR);
+return;
   }
 
   // Update in memory structure
@@ -812,7 +810,7 @@ void TNonblockingServer::TConnection::setFlags(short 
eventFlags) {
 
   // Add the event
   if (event_add(_, 0) == -1) {
-GlobalOutput("TConnection::setFlags(): could not event_add");
+GlobalOutput.perror("TConnection::setFlags(): could not event_add", 
THRIFT_GET_SOCKET_ERROR);
   }
 }
 
@@ -820,9 +818,9 @@ void TNonblockingServer::TConnection::setFlags(short 
eventFlags) {
  * Closes a connection
  */
 void TNonblockingServer::TConnection::close() {
-  // Delete the registered libevent
-  if (event_del(_) == -1) {
+  if (eventFlags_ && event_del(_) == -1) {
 GlobalOutput.perror("TConnection::close() event_del", 
THRIFT_GET_SOCKET_ERROR);
+return;
   }
 
   if (serverEventHandler_) {
@@ -1066,7 +1064,7 @@ void TNonblockingServer::createAndListenOnSocket() {
   if (res->ai_family == AF_INET6) {
 int zero = 0;
 if (-1 == setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, 
const_cast_sockopt(), sizeof(zero))) {
-  GlobalOutput("TServerSocket::listen() IPV6_V6ONLY");
+  GlobalOutput.perror("TServerSocket::listen() IPV6_V6ONLY", 
THRIFT_GET_SOCKET_ERROR);
 }
   }
 #endif // #ifdef IPV6_V6ONLY
@@ -1486,6 +1484,7 @@ void TNonblockingIOThread::notifyHandler(evutil_socket_t 
fd, short which, void*
 if (nBytes == kSize) {
   if (connection == NULL) {
 // this is the command to stop our thread, exit the handler!
+ioThread->breakLoop(false);
 return;
   }
   connection->transition();
@@ -1496,6 +1495,7 @@ void TNonblockingIOThread::notifyHandler(evutil_socket_t 
fd, short which, void*
   return;
 } else if (nBytes == 0) {
   GlobalOutput.printf("notifyHandler: Notify socket closed!");
+  ioThread->breakLoop(false);
   // exit the loop
   break;
 } else { // nBytes < 0
@@ -1520,19 +1520,15 @@ void TNonblockingIOThread::breakLoop(bool error) {
 ::abort();
   }
 
-  // sets a flag so that the loop exits on the next event
-  event_base_loopbreak(eventBase_);
-
-  // event_base_loopbreak() only causes the loop to exit the next time
-  // it wakes up.  We need to force it to wake up, in case there are
-  // no real events it needs to process.
-  //
   // If we're running in the same thread, we can't use the notify(0)
   // mechanism to stop the thread, but happily if we're running in the
   // same thread, this means the thread can't be blocking in the event
   // loop either.
   if (!Thread::is_current(threadId_)) {
 notify(NULL);
+  } else {
+// cause the loop to stop ASAP - even 

thrift git commit: THRIFT-3921: fix ostream definitions so they are not inline because it confused template deduction Client: C++

2017-02-28 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 36d1b0dea -> c89e17228


THRIFT-3921: fix ostream definitions so they are not inline because it confused 
template deduction
Client: C++

This closes #1204


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/c89e1722
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c89e1722
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c89e1722

Branch: refs/heads/master
Commit: c89e172289129a0a700a20f11f4a157b7da789d2
Parents: 36d1b0d
Author: James E. King, III 
Authored: Tue Feb 28 12:25:28 2017 -0500
Committer: James E. King, III 
Committed: Tue Feb 28 12:25:28 2017 -0500

--
 .../cpp/src/thrift/generate/t_cpp_generator.cc  | 90 
 1 file changed, 53 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/c89e1722/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc 
b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index c7eec48..c6df8e9 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -107,7 +107,8 @@ public:
 
   void generate_typedef(t_typedef* ttypedef);
   void generate_enum(t_enum* tenum);
-  void generate_enum_ostream_operator(t_enum* tenum);
+  void generate_enum_ostream_operator_decl(std::ofstream& out, t_enum* tenum);
+  void generate_enum_ostream_operator(std::ofstream& out, t_enum* tenum);
   void generate_forward_declaration(t_struct* tstruct);
   void generate_struct(t_struct* tstruct) { generate_cpp_struct(tstruct, 
false); }
   void generate_xception(t_struct* txception) { generate_cpp_struct(txception, 
true); }
@@ -132,7 +133,8 @@ public:
   void generate_struct_definition(std::ofstream& out,
   std::ofstream& force_cpp_out,
   t_struct* tstruct,
-  bool setters = true);
+  bool setters = true,
+  bool is_user_struct = false);
   void generate_copy_constructor(std::ofstream& out, t_struct* tstruct, bool 
is_exception);
   void generate_move_constructor(std::ofstream& out, t_struct* tstruct, bool 
is_exception);
   void generate_constructor_helper(std::ofstream& out,
@@ -247,6 +249,7 @@ public:
const char* suffix,
bool include_values);
 
+  void generate_struct_ostream_operator_decl(std::ofstream& f, t_struct* 
tstruct);
   void generate_struct_ostream_operator(std::ofstream& f, t_struct* tstruct);
   void generate_struct_print_method_decl(std::ofstream& f, t_struct* tstruct);
   void generate_exception_what_method_decl(std::ofstream& f,
@@ -568,46 +571,53 @@ void t_cpp_generator::generate_enum(t_enum* tenum) {
 << ", _k" << tenum->get_name() << "Names), "
 << "::apache::thrift::TEnumIterator(-1, NULL, NULL));" << endl 
<< endl;
 
-  generate_enum_ostream_operator(tenum);
+  generate_enum_ostream_operator_decl(f_types_, tenum);
+  generate_enum_ostream_operator(f_types_impl_, tenum);
 }
 
-void t_cpp_generator::generate_enum_ostream_operator(t_enum* tenum) {
+void t_cpp_generator::generate_enum_ostream_operator_decl(std::ofstream& out, 
t_enum* tenum) {
+
+  out << "std::ostream& operator<<(std::ostream& out, const ";
+  if (gen_pure_enums_) {
+out << tenum->get_name();
+  } else {
+out << tenum->get_name() << "::type&";
+  }
+  out << " val);" << endl;
+  out << endl;
+}
+
+void t_cpp_generator::generate_enum_ostream_operator(std::ofstream& out, 
t_enum* tenum) {
 
   // If we've been told the consuming application will provide an ostream
   // operator definition then we only make a declaration:
 
   if (!has_custom_ostream(tenum)) {
-f_types_ << "inline ";
-  }
-
-  f_types_ << "std::ostream& operator<<(std::ostream& out, const ";
-  if (gen_pure_enums_) {
-f_types_ << tenum->get_name();
-  } else {
-f_types_ << tenum->get_name() << "::type&";
-  }
-  f_types_ << " val)";
-  if (has_custom_ostream(tenum)) {
-f_types_ << ";";
-  } else {
-scope_up(f_types_);
+out << "std::ostream& operator<<(std::ostream& out, const ";
+if (gen_pure_enums_) {
+  out << tenum->get_name();
+} else {
+  out << tenum->get_name() << "::type&";
+}
+out << " val) ";
+scope_up(out);
 
-f_types_ << indent() << "std::map::const_iterator it = _"
+out << indent() << "std::map::const_iterator it = _"
  << tenum->get_name() << "_VALUES_TO_NAMES.find(val);" << endl;
-f_types_ << 

thrift git commit: THRIFT-3958 Support CMake build type RelWithDebInfo using static RTL on Windows Client: C++

2016-11-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master f793c2b3a -> 94d4f3ee6


THRIFT-3958 Support CMake build type RelWithDebInfo using static RTL on Windows
Client: C++

This closes #1123


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/94d4f3ee
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/94d4f3ee
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/94d4f3ee

Branch: refs/heads/master
Commit: 94d4f3ee69d5a992f861c39f7d0c9bbd2d9af7a6
Parents: f793c2b
Author: Jim King 
Authored: Thu Nov 10 16:31:28 2016 -0500
Committer: Jim King 
Committed: Thu Nov 10 16:31:28 2016 -0500

--
 build/cmake/DefinePlatformSpecifc.cmake | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/94d4f3ee/build/cmake/DefinePlatformSpecifc.cmake
--
diff --git a/build/cmake/DefinePlatformSpecifc.cmake 
b/build/cmake/DefinePlatformSpecifc.cmake
index 40ec627..01fcd37 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -37,6 +37,7 @@ if(MSVC)
 # For Debug build types, append a "d" to the library names.
 set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
 set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set release library postfix" 
FORCE)
+set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "Set release library 
postfix" FORCE)
 
 # Build using /MT option instead of /MD if the WITH_MT options is set
 if(WITH_MT)
@@ -44,9 +45,11 @@ if(MSVC)
 CMAKE_CXX_FLAGS
 CMAKE_CXX_FLAGS_DEBUG
 CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELWITHDEBINFO
 CMAKE_C_FLAGS
 CMAKE_C_FLAGS_DEBUG
 CMAKE_C_FLAGS_RELEASE
+CMAKE_C_FLAGS_RELWITHDEBINFO
 )
 foreach(CompilerFlag ${CompilerFlags})
   string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")



thrift git commit: THRIFT-3957 TConnectedClient does not disconnect from clients when the receive timeout is reached. Client: C++ Patch: Claudius Heine <c...@denx.de>

2016-11-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 74c99ba38 -> f793c2b3a


THRIFT-3957 TConnectedClient does not disconnect from clients when the receive 
timeout is reached.
Client: C++
Patch: Claudius Heine 

This closes #1122


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f793c2b3
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f793c2b3
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f793c2b3

Branch: refs/heads/master
Commit: f793c2b3aab06af37b59a7fd96ef22c339a7b957
Parents: 74c99ba
Author: Jim King 
Authored: Thu Nov 10 15:08:21 2016 -0500
Committer: Jim King 
Committed: Thu Nov 10 15:08:21 2016 -0500

--
 lib/cpp/src/thrift/server/TConnectedClient.cpp | 34 ++---
 1 file changed, 16 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/f793c2b3/lib/cpp/src/thrift/server/TConnectedClient.cpp
--
diff --git a/lib/cpp/src/thrift/server/TConnectedClient.cpp 
b/lib/cpp/src/thrift/server/TConnectedClient.cpp
index c248e63..9583284 100644
--- a/lib/cpp/src/thrift/server/TConnectedClient.cpp
+++ b/lib/cpp/src/thrift/server/TConnectedClient.cpp
@@ -64,24 +64,22 @@ void TConnectedClient::run() {
   }
 } catch (const TTransportException& ttx) {
   switch (ttx.getType()) {
-  case TTransportException::TIMED_OUT:
-// Receive timeout - continue processing.
-continue;
-
-  case TTransportException::END_OF_FILE:
-  case TTransportException::INTERRUPTED:
-// Client disconnected or was interrupted.  No logging needed.  Done.
-done = true;
-break;
-
-  default: {
-// All other transport exceptions are logged.
-// State of connection is unknown.  Done.
-string errStr = string("TConnectedClient died: ") + ttx.what();
-GlobalOutput(errStr.c_str());
-done = true;
-break;
-  }
+case TTransportException::END_OF_FILE:
+case TTransportException::INTERRUPTED:
+case TTransportException::TIMED_OUT:
+  // Client disconnected or was interrupted or did not respond within 
the receive timeout.
+  // No logging needed.  Done.
+  done = true;
+  break;
+
+default: {
+  // All other transport exceptions are logged.
+  // State of connection is unknown.  Done.
+  string errStr = string("TConnectedClient died: ") + ttx.what();
+  GlobalOutput(errStr.c_str());
+  done = true;
+  break;
+}
   }
 } catch (const TException& tex) {
   string errStr = string("TConnectedClient processing exception: ") + 
tex.what();



thrift git commit: THRIFT-3932 fixed ThreadManager concurrency issues, added more tests in that area, did a little refactoring and prettying up along the way Client: C++

2016-11-12 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master ea5ea8b4c -> df89913b8


THRIFT-3932 fixed ThreadManager concurrency issues, added more tests in that 
area, did a little refactoring and prettying up along the way
Client: C++

This closes #1103


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/df89913b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/df89913b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/df89913b

Branch: refs/heads/master
Commit: df89913b8a952a46bc91264e0d96df9c69969efb
Parents: ea5ea8b
Author: James E. King, III 
Authored: Sat Nov 12 15:16:30 2016 -0500
Committer: James E. King, III 
Committed: Sat Nov 12 15:16:30 2016 -0500

--
 appveyor.yml|   5 +-
 build/docker/scripts/cmake.sh   |   3 +-
 .../thrift/concurrency/BoostThreadFactory.cpp   |  47 +-
 .../src/thrift/concurrency/BoostThreadFactory.h |  15 +-
 .../thrift/concurrency/PosixThreadFactory.cpp   | 177 +++-
 .../src/thrift/concurrency/PosixThreadFactory.h |  28 +-
 .../src/thrift/concurrency/StdThreadFactory.cpp |  46 +-
 .../src/thrift/concurrency/StdThreadFactory.h   |  15 +-
 lib/cpp/src/thrift/concurrency/Thread.h |  30 +-
 .../src/thrift/concurrency/ThreadManager.cpp| 382 
 lib/cpp/src/thrift/concurrency/ThreadManager.h  |  34 +-
 lib/cpp/src/thrift/concurrency/Util.h   |   2 +-
 lib/cpp/src/thrift/server/TThreadPoolServer.cpp |   2 +-
 lib/cpp/src/thrift/server/TThreadedServer.cpp   |   5 +-
 lib/cpp/src/thrift/server/TThreadedServer.h |  10 +-
 lib/cpp/test/TPipeInterruptTest.cpp |   2 +-
 lib/cpp/test/TServerIntegrationTest.cpp |  22 +-
 lib/cpp/test/concurrency/Tests.cpp  |  75 +++-
 lib/cpp/test/concurrency/ThreadFactoryTests.h   |  65 +--
 lib/cpp/test/concurrency/ThreadManagerTests.h   | 439 ---
 lib/cpp/test/concurrency/TimerManagerTests.h|  21 +-
 lib/cpp/test/processor/ProcessorTest.cpp|   2 +-
 test/cpp/src/TestServer.cpp |   2 +-
 23 files changed, 805 insertions(+), 624 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/df89913b/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index cfd8b51..03ee295 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -89,6 +89,5 @@ build_script:
 # CTest fails to invoke ant seemingly due to "ant.bat" v.s. "ant" (shell 
script) conflict.
 # Currently, everything that involves OpenSSL seems to hang forever on our 
Appveyor setup.
 # Also a few C++ tests hang (on Appveyor or on Windows in general).
-- ctest -C Release --timeout 600 -VV -E 
"(concurrency_test|processor_test|TInterruptTest|StressTestNonBlocking|OpenSSLManualInitTest|SecurityTest|PythonTestSSLSocket|python_test$|^Java)"
-
-#TODO make it perfect ;-r
+- ctest -C Release --timeout 600 -VV -E 
"(StressTestNonBlocking|PythonTestSSLSocket|python_test$|^Java)"
+# TODO make it perfect ;-r

http://git-wip-us.apache.org/repos/asf/thrift/blob/df89913b/build/docker/scripts/cmake.sh
--
diff --git a/build/docker/scripts/cmake.sh b/build/docker/scripts/cmake.sh
index 26ccb10..6508e71 100755
--- a/build/docker/scripts/cmake.sh
+++ b/build/docker/scripts/cmake.sh
@@ -19,4 +19,5 @@ for LIB in $BUILD_LIBS; do
 done
 $MAKEPROG -j3
 cpack
-ctest -VV -E "(concurrency_test|processor_test)"
+ctest -VV 
+# was: -E "(concurrency_test|processor_test)"

http://git-wip-us.apache.org/repos/asf/thrift/blob/df89913b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
index 96cb6d6..a72d38b 100644
--- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
@@ -126,54 +126,19 @@ void* BoostThread::threadMain(void* arg) {
   return (void*)0;
 }
 
-/**
- * POSIX Thread factory implementation
- */
-class BoostThreadFactory::Impl {
-
-private:
-  bool detached_;
-
-public:
-  Impl(bool detached) : detached_(detached) {}
-
-  /**
-   * Creates a new POSIX thread to run the runnable object
-   *
-   * @param runnable A runnable object
-   */
-  shared_ptr newThread(shared_ptr runnable) const {
-shared_ptr result = shared_ptr(new 
BoostThread(detached_, runnable));
-result->weakRef(result);
-runnable->thread(result);
-return result;
-  }
-
-  bool isDetached() const { return detached_; }
-
-  void setDetached(bool value) { detached_ = value; }
-
-  Thread::id_t getCurrentThreadId() const { return 

thrift git commit: THRIFT-3947 use sockaddr_storage with getsockname for future transport compatibility (ipv6) Client: Lua

2016-11-12 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master fd832242b -> ea5ea8b4c


THRIFT-3947 use sockaddr_storage with getsockname for future transport 
compatibility (ipv6)
Client: Lua

This closes #1127


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ea5ea8b4
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ea5ea8b4
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ea5ea8b4

Branch: refs/heads/master
Commit: ea5ea8b4c85ffced36a88b93b35a4671478921ab
Parents: fd83224
Author: James E. King, III 
Authored: Sat Nov 12 15:12:33 2016 -0500
Committer: James E. King, III 
Committed: Sat Nov 12 15:12:33 2016 -0500

--
 lib/lua/src/usocket.c | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/ea5ea8b4/lib/lua/src/usocket.c
--
diff --git a/lib/lua/src/usocket.c b/lib/lua/src/usocket.c
index d97112c..864fa36 100644
--- a/lib/lua/src/usocket.c
+++ b/lib/lua/src/usocket.c
@@ -131,20 +131,27 @@ T_ERRCODE socket_bind(p_socket sock, p_sa addr, int 
addr_len) {
 }
 
 T_ERRCODE socket_get_info(p_socket sock, short *port, char *buf, size_t len) {
-  struct sockaddr_in sa;
+  struct sockaddr_storage sa;
   memset(, 0, sizeof(sa));
   socklen_t addrlen = sizeof(sa);
   int rc = getsockname(*sock, (struct sockaddr*), );
   if (!rc) {
-char *addr = inet_ntoa(sa.sin_addr);
-*port = ntohs(sa.sin_port);
-if (strlen(addr) < len) {
-  len = strlen(addr);
+if (sa.ss_family == AF_INET6) {
+  struct sockaddr_in6* sin = (struct sockaddr_in6*)();
+  if (!inet_ntop(AF_INET6, >sin6_addr, buf, len)) {
+return errno;
+  }
+  *port = ntohs(sin->sin6_port);
+} else {
+  struct sockaddr_in* sin = (struct sockaddr_in*)();
+  if (!inet_ntop(AF_INET, >sin_addr, buf, len)) {
+return errno;
+  }
+  *port = ntohs(sin->sin_port);
 }
-memcpy(buf, addr, len);
 return SUCCESS;
   }
-  return rc;
+  return errno;
 }
 
 




thrift git commit: THRIFT-3961 terminate the connection to the client if an exception occurs while processing a message Client: C++ Patch: Claudius Heine <c...@denx.de>

2016-11-14 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master c9877fb3b -> 7656793d0


THRIFT-3961 terminate the connection to the client if an exception occurs while 
processing a message
Client: C++
Patch: Claudius Heine 

This closes #1125


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7656793d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7656793d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7656793d

Branch: refs/heads/master
Commit: 7656793d0de87bded5e4d8c91173b066f3f5daa8
Parents: c9877fb
Author: James E. King, III 
Authored: Mon Nov 14 10:30:05 2016 -0500
Committer: James E. King, III 
Committed: Mon Nov 14 10:30:05 2016 -0500

--
 lib/cpp/src/thrift/server/TConnectedClient.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/7656793d/lib/cpp/src/thrift/server/TConnectedClient.cpp
--
diff --git a/lib/cpp/src/thrift/server/TConnectedClient.cpp 
b/lib/cpp/src/thrift/server/TConnectedClient.cpp
index 9583284..889c885 100644
--- a/lib/cpp/src/thrift/server/TConnectedClient.cpp
+++ b/lib/cpp/src/thrift/server/TConnectedClient.cpp
@@ -84,7 +84,8 @@ void TConnectedClient::run() {
 } catch (const TException& tex) {
   string errStr = string("TConnectedClient processing exception: ") + 
tex.what();
   GlobalOutput(errStr.c_str());
-  // Continue processing
+  // Disconnect from client, because we could not process the message.
+  done = true;
 }
   }
 



thrift git commit: THRIFT-3953 TSSLSocket::close should handle exceptions from waitForEvent because it is called by the destructor Client: C++ Patch: ted.w...@ni.com

2016-11-14 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 7656793d0 -> 220d5f842


THRIFT-3953 TSSLSocket::close should handle exceptions from waitForEvent 
because it is called by the destructor
Client: C++
Patch: ted.w...@ni.com

This closes #1118


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/220d5f84
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/220d5f84
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/220d5f84

Branch: refs/heads/master
Commit: 220d5f8422ffeecf94f4b46a9dc3c004fd251766
Parents: 7656793
Author: James E. King, III 
Authored: Mon Nov 14 11:19:56 2016 -0500
Committer: James E. King, III 
Committed: Mon Nov 14 11:19:56 2016 -0500

--
 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 56 ++--
 1 file changed, 32 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/220d5f84/lib/cpp/src/thrift/transport/TSSLSocket.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp 
b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 1a37716..0af20cb 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -293,33 +293,41 @@ void TSSLSocket::open() {
 
 void TSSLSocket::close() {
   if (ssl_ != NULL) {
-int rc;
+try {
+  int rc;
+
+  do {
+rc = SSL_shutdown(ssl_);
+if (rc <= 0) {
+  int errno_copy = THRIFT_GET_SOCKET_ERROR;
+  int error = SSL_get_error(ssl_, rc);
+  switch (error) {
+case SSL_ERROR_SYSCALL:
+  if ((errno_copy != THRIFT_EINTR)
+  && (errno_copy != THRIFT_EAGAIN)) {
+break;
+  }
+case SSL_ERROR_WANT_READ:
+case SSL_ERROR_WANT_WRITE:
+  waitForEvent(error == SSL_ERROR_WANT_READ);
+  rc = 2;
+default:;// do nothing
+  }
+}
+  } while (rc == 2);
 
-do {
-  rc = SSL_shutdown(ssl_);
-  if (rc <= 0) {
+  if (rc < 0) {
 int errno_copy = THRIFT_GET_SOCKET_ERROR;
-int error = SSL_get_error(ssl_, rc);
-switch (error) {
-  case SSL_ERROR_SYSCALL:
-if ((errno_copy != THRIFT_EINTR)
-&& (errno_copy != THRIFT_EAGAIN)) {
-  break;
-}
-  case SSL_ERROR_WANT_READ:
-  case SSL_ERROR_WANT_WRITE:
-waitForEvent(error == SSL_ERROR_WANT_READ);
-rc = 2;
-  default:;// do nothing
-}
+string errors;
+buildErrors(errors, errno_copy);
+GlobalOutput(("SSL_shutdown: " + errors).c_str());
   }
-} while (rc == 2);
-
-if (rc < 0) {
-  int errno_copy = THRIFT_GET_SOCKET_ERROR;
-  string errors;
-  buildErrors(errors, errno_copy);
-  GlobalOutput(("SSL_shutdown: " + errors).c_str());
+} catch (TTransportException& te) {
+  // Don't emit an exception because this method is called by the
+  // destructor. There's also not much that a user can do to recover, so
+  // just clean up as much as possible without throwing, similar to the rc
+  // < 0 case above.
+  GlobalOutput.printf("SSL_shutdown: %s", te.what());
 }
 SSL_free(ssl_);
 ssl_ = NULL;



thrift git commit: THRIFT-3937 if the compiler is too old (gcc before 4.8) disable new compiler plugin during configuration Client: C++

2016-11-14 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master c544975d9 -> c9877fb3b


THRIFT-3937 if the compiler is too old (gcc before 4.8) disable new compiler 
plugin during configuration
Client: C++

This closes #1101


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/c9877fb3
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c9877fb3
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c9877fb3

Branch: refs/heads/master
Commit: c9877fb3b40b99c47ab634f15bc7d1cb0acb1053
Parents: c544975
Author: James E. King, III 
Authored: Mon Nov 14 10:20:52 2016 -0500
Committer: James E. King, III 
Committed: Mon Nov 14 10:20:52 2016 -0500

--
 build/cmake/DefineOptions.cmake | 11 ++-
 build/cmake/DefinePlatformSpecifc.cmake |  9 +
 2 files changed, 15 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/c9877fb3/build/cmake/DefineOptions.cmake
--
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 171c9fe..0c853b1 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -164,6 +164,7 @@ message(STATUS "Thrift package version: 
  ${PACKAGE_VERSION}
 message(STATUS "Build configuration Summary")
 message(STATUS "  Build Thrift compiler:  
${BUILD_COMPILER}")
 message(STATUS "  Build compiler plugin support:  ${WITH_PLUGIN}")
+MESSAGE_DEP(PLUGIN_COMPILER_NOT_TOO_OLD "Disabled due to older compiler")
 message(STATUS "  Build with unit tests:  
${BUILD_TESTING}")
 MESSAGE_DEP(HAVE_COMPILER "Disabled because BUILD_THRIFT=OFF and no valid 
THRIFT_COMPILER is given")
 message(STATUS "  Build examples: 
${BUILD_EXAMPLES}")
@@ -171,13 +172,13 @@ MESSAGE_DEP(HAVE_COMPILER "Disabled because 
BUILD_THRIFT=OFF and no valid THRIFT
 message(STATUS "  Build Thrift libraries: 
${BUILD_LIBRARIES}")
 message(STATUS " Language libraries:")
 message(STATUS "  Build C++ library:  ${BUILD_CPP}")
-MESSAGE_DEP(WITH_CPP "Disabled by via WITH_CPP=OFF")
+MESSAGE_DEP(WITH_CPP "Disabled by WITH_CPP=OFF")
 MESSAGE_DEP(Boost_FOUND "Boost headers missing")
 message(STATUS "  Build C (GLib) library: ${BUILD_C_GLIB}")
-MESSAGE_DEP(WITH_C_GLIB "Disabled by via WITH_C_GLIB=OFF")
+MESSAGE_DEP(WITH_C_GLIB "Disabled by WITH_C_GLIB=OFF")
 MESSAGE_DEP(GLIB_FOUND "GLib missing")
 message(STATUS "  Build Java library: ${BUILD_JAVA}")
-MESSAGE_DEP(WITH_JAVA "Disabled by via WITH_JAVA=OFF")
+MESSAGE_DEP(WITH_JAVA "Disabled by WITH_JAVA=OFF")
 if(ANDROID)
 MESSAGE_DEP(GRADLE_FOUND "Gradle missing")
 else()
@@ -185,10 +186,10 @@ else()
 MESSAGE_DEP(ANT_FOUND "Ant missing")
 endif()
 message(STATUS "  Build Python library:   ${BUILD_PYTHON}")
-MESSAGE_DEP(WITH_PYTHON "Disabled by via WITH_PYTHON=OFF")
+MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
 MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
 message(STATUS "  Build Haskell library:  
${BUILD_HASKELL}")
-MESSAGE_DEP(WITH_HASKELL "Disabled by via WITH_HASKELL=OFF")
+MESSAGE_DEP(WITH_HASKELL "Disabled by WITH_HASKELL=OFF")
 MESSAGE_DEP(GHC_FOUND "GHC missing")
 MESSAGE_DEP(CABAL_FOUND "Cabal missing")
 message(STATUS " Library features:")

http://git-wip-us.apache.org/repos/asf/thrift/blob/c9877fb3/build/cmake/DefinePlatformSpecifc.cmake
--
diff --git a/build/cmake/DefinePlatformSpecifc.cmake 
b/build/cmake/DefinePlatformSpecifc.cmake
index 01fcd37..e57ecc2 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -95,3 +95,12 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR 
CMAKE_CXX_COMPILER_ID
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
   endif()
 endif()
+
+# If gcc older than 4.8 is detected, disable new compiler plug-in support (see 
THRIFT-3937)
+set(PLUGIN_COMPILER_NOT_TOO_OLD ON) # simplifies messaging in DefineOptions 
summary
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION 
VERSION_LESS "4.8" AND WITH_PLUGIN)
+  message(STATUS "Disabling compiler plug-in support to work with older gcc 
compiler")
+  set(WITH_PLUGIN OFF)
+  set(PLUGIN_COMPILER_NOT_TOO_OLD OFF)
+endif()
+



thrift git commit: THRIFT-3038 clean up remaining volatile issues Client: C++

2016-11-13 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master df89913b8 -> c544975d9


THRIFT-3038 clean up remaining volatile issues
Client: C++

This closes #1129


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/c544975d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c544975d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c544975d

Branch: refs/heads/master
Commit: c544975d910534b753dc1c4480c09042f8ba07af
Parents: df89913
Author: James E. King, III 
Authored: Sun Nov 13 12:00:37 2016 -0500
Committer: James E. King, III 
Committed: Sun Nov 13 12:00:37 2016 -0500

--
 lib/cpp/src/thrift/concurrency/Mutex.cpp  | 5 ++---
 lib/cpp/src/thrift/transport/TFileTransport.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/c544975d/lib/cpp/src/thrift/concurrency/Mutex.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/Mutex.cpp 
b/lib/cpp/src/thrift/concurrency/Mutex.cpp
index d9921aa..e5e50f7 100644
--- a/lib/cpp/src/thrift/concurrency/Mutex.cpp
+++ b/lib/cpp/src/thrift/concurrency/Mutex.cpp
@@ -37,11 +37,10 @@ namespace concurrency {
 
 #ifndef THRIFT_NO_CONTENTION_PROFILING
 
-static sig_atomic_t mutexProfilingSampleRate = 0;
+static int32_t mutexProfilingCounter = 0;
+static int32_t mutexProfilingSampleRate = 0;
 static MutexWaitCallback mutexProfilingCallback = 0;
 
-volatile static sig_atomic_t mutexProfilingCounter = 0;
-
 void enableMutexProfiling(int32_t profilingSampleRate, MutexWaitCallback 
callback) {
   mutexProfilingSampleRate = profilingSampleRate;
   mutexProfilingCallback = callback;

http://git-wip-us.apache.org/repos/asf/thrift/blob/c544975d/lib/cpp/src/thrift/transport/TFileTransport.h
--
diff --git a/lib/cpp/src/thrift/transport/TFileTransport.h 
b/lib/cpp/src/thrift/transport/TFileTransport.h
index d7fa556..c926c7c 100644
--- a/lib/cpp/src/thrift/transport/TFileTransport.h
+++ b/lib/cpp/src/thrift/transport/TFileTransport.h
@@ -349,7 +349,7 @@ private:
 
   // conditions used to block when the buffer is full or empty
   Monitor notFull_, notEmpty_;
-  volatile bool closing_;
+  bool closing_;
 
   // To keep track of whether the buffer has been flushed
   Monitor flushed_;



svn commit: r1001058 - /websites/production/thrift/content/

2016-11-13 Thread jking
Author: jking
Date: Sun Nov 13 17:51:13 2016
New Revision: 1001058

Log:
THRIFT-3937 added note about gcc-4.8 requirement for compiler plugins.

Added:
websites/production/thrift/content/
  - copied from r1001057, websites/staging/thrift/trunk/content/



svn commit: r1769527 - /thrift/cms-site/trunk/content/docs/install/index.html

2016-11-13 Thread jking
Author: jking
Date: Sun Nov 13 17:50:10 2016
New Revision: 1769527

URL: http://svn.apache.org/viewvc?rev=1769527=rev
Log:
Per THRIFT-3937 added a note about gcc 4.8 for thrift compiler plugins.

Modified:
thrift/cms-site/trunk/content/docs/install/index.html

Modified: thrift/cms-site/trunk/content/docs/install/index.html
URL: 
http://svn.apache.org/viewvc/thrift/cms-site/trunk/content/docs/install/index.html?rev=1769527=1769526=1769527=diff
==
--- thrift/cms-site/trunk/content/docs/install/index.html (original)
+++ thrift/cms-site/trunk/content/docs/install/index.html Sun Nov 13 17:50:10 
2016
@@ -11,7 +11,7 @@ Apache Thrift's compiler is written in C
 ## Basic requirements
 * A relatively POSIX-compliant *NIX system
 * Cygwin or MinGW can be used on Windows (but there are better options, 
see below)
-* g++ 4.2
+* g++ 4.2 (4.8 or later required for thrift compiler plug-in support)
 * boost 1.53.0
 * Runtime libraries for lex and yacc might be needed for the compiler.
 




thrift git commit: fix appveyor builds - ant version changed to 1.9.8

2017-01-04 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b587a12a1 -> fac3f6972


fix appveyor builds - ant version changed to 1.9.8


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/fac3f697
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/fac3f697
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/fac3f697

Branch: refs/heads/master
Commit: fac3f69725f507872e6d68afea5debd020ce2580
Parents: b587a12
Author: James E. King, III 
Authored: Wed Jan 4 21:46:23 2017 -0500
Committer: James E. King, III 
Committed: Wed Jan 4 23:38:53 2017 -0500

--
 appveyor.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/fac3f697/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index 03ee295..e7ab87d 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -30,7 +30,7 @@ environment:
   BOOST_ROOT: C:\Libraries\boost_1_59_0
   BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
   # Unfurtunately, this version needs manual update because old versions are 
quickly deleted.
-  ANT_VERSION: 1.9.7
+  ANT_VERSION: 1.9.8
 
 install:
 - '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64'



thrift git commit: THRIFT-4141: fix haxe installation in docker build for debian, ubuntu

2017-03-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 9f71e00b0 -> 9a8d576c8


THRIFT-4141: fix haxe installation in docker build for debian, ubuntu

This closes #1225


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9a8d576c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9a8d576c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9a8d576c

Branch: refs/heads/master
Commit: 9a8d576c8828d25fc6fb2d5797402590b7edc737
Parents: 9f71e00
Author: James E. King, III 
Authored: Mon Mar 27 15:39:00 2017 -0400
Committer: James E. King, III 
Committed: Mon Mar 27 15:39:00 2017 -0400

--
 build/docker/debian/Dockerfile | 2 +-
 build/docker/ubuntu/Dockerfile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/9a8d576c/build/docker/debian/Dockerfile
--
diff --git a/build/docker/debian/Dockerfile b/build/docker/debian/Dockerfile
index 9a16951..155e0af 100644
--- a/build/docker/debian/Dockerfile
+++ b/build/docker/debian/Dockerfile
@@ -157,7 +157,7 @@ ENV PATH /usr/local/go/bin:$PATH
 
 # Haxe
 RUN mkdir -p /usr/lib/haxe && \
-curl 
http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz
 | \
+wget -O - 
https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz
 | \
 tar -C /usr/lib/haxe --strip-components=1 -xz && \
 ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
 ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \

http://git-wip-us.apache.org/repos/asf/thrift/blob/9a8d576c/build/docker/ubuntu/Dockerfile
--
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index b6cebb3..451087f 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -174,7 +174,7 @@ ENV PATH /usr/local/go/bin:$PATH
 
 # Haxe
 RUN mkdir -p /usr/lib/haxe && \
-curl 
http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz
 | \
+wget -O - 
https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-linux64.tar.gz
 | \
 tar -C /usr/lib/haxe --strip-components=1 -xz && \
 ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
 ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \



thrift git commit: THRIFT-2026: Eliminate some undefined behavior in C/C++ Clients: glib, C++ Patch: Jim Apple <jbapple-imp...@apache.org>

2017-03-25 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 6c08ac72c -> 147c2849a


THRIFT-2026: Eliminate some undefined behavior in C/C++
Clients: glib, C++
Patch: Jim Apple 

This closes #1214

This patch fixes some undefined behavior were found using Clang's
UndefinedBehaviorSanitizer (UBSan). To check for undefined behavior,
run /build/docker/scripts/ubsan.sh. This is run during CI builds, as
well.

The examples of the types of undefined behavior fixed in this commit
are:

1. Enumerations exhibit undefined behavior when they have values
   outside of a range dependent on the values of their enumerators, as
   specified in C++14's chapter 7.2 ("Enumeration declarations"),
   paragraph 8.

2. Left shift of negative values, used in zigzag encoding, is
   undefined behavior. See 5.8 ("Shift operators"), paragraph 2 for
   C++ and 6.5.7 ("Bitwise shift operators"), paragraph 4 for C99 and
   C11.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/147c2849
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/147c2849
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/147c2849

Branch: refs/heads/master
Commit: 147c2849af9c28f2ce347b4005e022ac13db9dd8
Parents: 6c08ac7
Author: Jim Apple 
Authored: Sat Mar 18 12:56:50 2017 -0700
Committer: James E. King, III 
Committed: Sat Mar 25 08:16:18 2017 -0400

--
 .travis.yml |  6 
 build/docker/scripts/ubsan.sh   | 35 
 .../src/thrift/generate/t_c_glib_generator.cc   |  4 +--
 .../cpp/src/thrift/generate/t_d_generator.cc|  2 +-
 compiler/cpp/src/thrift/parse/t_base_type.h |  6 ++--
 .../c_glib/protocol/thrift_compact_protocol.c   |  4 +--
 .../src/thrift/protocol/TCompactProtocol.tcc|  4 +--
 7 files changed, 51 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/147c2849/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 70293ed..10c6fd0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -152,6 +152,12 @@ env:
   BUILD_ENV="-e CC=gcc -e CXX=g++"
   DISTRO=debian
 
+# C and C++ undefined behavior. This wraps autotools.sh, but each binary 
crashes if
+# undefined behavior occurs. Skips the known flaky tests.
+- TEST_NAME="UBSan"
+  SCRIPT="ubsan.sh"
+  BUILD_ARG="--without-haskell --without-nodejs --without-perl 
--without-python"
+
 matrix:
   include:
 # QA jobs for code analytics and metrics

http://git-wip-us.apache.org/repos/asf/thrift/blob/147c2849/build/docker/scripts/ubsan.sh
--
diff --git a/build/docker/scripts/ubsan.sh b/build/docker/scripts/ubsan.sh
new file mode 100755
index 000..6db10f3
--- /dev/null
+++ b/build/docker/scripts/ubsan.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -ex
+
+# Wraps autotools.sh, but each binary crashes if it exhibits undefined 
behavior. See
+# 
http://releases.llvm.org/3.8.0/tools/clang/docs/UndefinedBehaviorSanitizer.html
+
+# Install a more recent clang than default:
+sudo apt-get update
+sudo apt-get install -y --no-install-recommends clang-3.8 llvm-3.8-dev
+export CC=clang-3.8
+export CXX=clang++-3.8
+
+# Set the undefined behavior flags. This crashes on all undefined behavior 
except for
+# undefined casting, aka "vptr".
+#
+# TODO: fix undefined vptr behavior and turn this option back on.
+export CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined 
-fno-sanitize=vptr"
+# Builds without optimization and with debugging symbols for making crash 
reports more
+# readable.
+export CFLAGS="${CFLAGS} -O0 -ggdb3"
+export CXXFLAGS="${CFLAGS}"
+export UBSAN_OPTIONS=print_stacktrace=1
+
+# llvm-symbolizer must be on PATH, but the above installation instals a binary 
called
+# "llvm-symbolizer-3.8", not "llvm-symbolizer". This fixes that with a 
softlink in a new
+# directory.
+CLANG_PATH="$(mktemp -d)"
+trap "rm -rf ${CLANG_PATH}" EXIT
+ln -s "$(whereis llvm-symbolizer-3.8  | rev | cut -d ' ' -f 1 | rev)" \
+  "${CLANG_PATH}/llvm-symbolizer"
+export PATH="${CLANG_PATH}:${PATH}"
+llvm-symbolizer -version
+
+build/docker/scripts/autotools.sh $*

http://git-wip-us.apache.org/repos/asf/thrift/blob/147c2849/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc 
b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
index 7d4e4f0..7d4818e 100644
--- a/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_c_glib_generator.cc
@@ -4061,9 +4061,9 @@ void 

thrift git commit: THRIFT-4126: implement required fields validation in php extension when validate compiler option is enabled Client: php

2017-03-30 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 7470995ce -> 1360270eb


THRIFT-4126: implement required fields validation in php extension when 
validate compiler option is enabled
Client: php

This closes #1215


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/1360270e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/1360270e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/1360270e

Branch: refs/heads/master
Commit: 1360270eb8e03402d48322514eaa58342e5b25d0
Parents: 7470995
Author: kufd 
Authored: Sun Mar 19 19:48:50 2017 +0200
Committer: James E. King, III 
Committed: Thu Mar 30 16:42:11 2017 -0400

--
 .../cpp/src/thrift/generate/t_php_generator.cc  | 16 +++
 .../ext/thrift_protocol/php_thrift_protocol.cpp | 44 +++-
 .../thrift_protocol/php_thrift_protocol7.cpp| 42 +++
 3 files changed, 91 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/1360270e/compiler/cpp/src/thrift/generate/t_php_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_php_generator.cc 
b/compiler/cpp/src/thrift/generate/t_php_generator.cc
index 515e165..9b5062c 100644
--- a/compiler/cpp/src/thrift/generate/t_php_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_php_generator.cc
@@ -760,10 +760,7 @@ void t_php_generator::generate_php_type_spec(ofstream& 
out, t_type* t) {
  * type information to generalize serialization routines.
  */
 void t_php_generator::generate_php_struct_spec(ofstream& out, t_struct* 
tstruct) {
-  indent(out) << "if (!isset(self::$_TSPEC)) {" << endl;
-  indent_up();
-
-  indent(out) << "self::$_TSPEC = array(" << endl;
+  indent(out) << "static $_TSPEC = array(" << endl;
   indent_up();
 
   const vector& members = tstruct->get_members();
@@ -773,15 +770,14 @@ void t_php_generator::generate_php_struct_spec(ofstream& 
out, t_struct* tstruct)
 indent(out) << (*m_iter)->get_key() << " => array(" << endl;
 indent_up();
 out << indent() << "'var' => '" << (*m_iter)->get_name() << "'," << endl;
+out << indent() << "'isRequired' => " << ((*m_iter)->get_req() == 
t_field::T_REQUIRED ? "true" : "false") << "," << endl;
 generate_php_type_spec(out, t);
 indent(out) << ")," << endl;
 indent_down();
   }
 
   indent_down();
-  indent(out) << "  );" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
+  indent(out) << "  );" << endl << endl;
 }
 
 /**
@@ -813,7 +809,9 @@ void 
t_php_generator::generate_php_struct_definition(ofstream& out,
   out << " {" << endl;
   indent_up();
 
-  indent(out) << "static $_TSPEC;" << endl << endl;
+  out << indent() << "static $isValidate = " << (validate_ ? "true" : "false") 
<< ";" << endl << endl;
+
+  generate_php_struct_spec(out, tstruct);
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
 string dval = "null";
@@ -832,8 +830,6 @@ void 
t_php_generator::generate_php_struct_definition(ofstream& out,
   out << indent() << "public function __construct(" << param << ") {" << endl;
   indent_up();
 
-  generate_php_struct_spec(out, tstruct);
-
   if (members.size() > 0) {
 for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
   t_type* t = get_true_type((*m_iter)->get_type());

http://git-wip-us.apache.org/repos/asf/thrift/blob/1360270e/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
--
diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp 
b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
index f9b3ad7..4c9062e 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
@@ -728,6 +728,42 @@ inline bool ttypes_are_compatible(int8_t t1, int8_t t2) {
   return ((t1 == t2) || (ttype_is_int(t1) && ttype_is_int(t2)));
 }
 
+//is used to validate objects before serialization and after deserialization. 
For now, only required fields are validated.
+static
+void validate_thrift_object(zval* object) {
+
+  HashPosition key_ptr;
+  zval** val_ptr;
+
+  TSRMLS_FETCH();
+  zend_class_entry* object_class_entry = zend_get_class_entry(object 
TSRMLS_CC);
+  HashTable* spec = Z_ARRVAL_P(zend_read_static_property(object_class_entry, 
"_TSPEC", 6, false TSRMLS_CC));
+
+  for (zend_hash_internal_pointer_reset_ex(spec, _ptr); 
zend_hash_get_current_data_ex(spec, (void**)_ptr, _ptr) == SUCCESS; 
zend_hash_move_forward_ex(spec, _ptr)) {
+ulong fieldno;
+if (zend_hash_get_current_key_ex(spec, NULL, NULL, , 0, _ptr) 
!= HASH_KEY_IS_LONG) {
+  throw_tprotocolexception("Bad keytype in TSPEC (expected 'long')", 

thrift git commit: THRIFT-4113: export thrift::mem::TBufferTransport Client: rs

2017-03-30 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 177c37ce8 -> 118706018


THRIFT-4113: export thrift::mem::TBufferTransport
Client: rs

This closes #1218


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/11870601
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/11870601
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/11870601

Branch: refs/heads/master
Commit: 1187060183b1f1a17b34b6f14734649b4299745d
Parents: 177c37c
Author: Flier Lu 
Authored: Mon Mar 20 17:31:34 2017 +0800
Committer: James E. King, III 
Committed: Thu Mar 30 17:25:10 2017 -0400

--
 lib/rs/src/transport/mod.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/11870601/lib/rs/src/transport/mod.rs
--
diff --git a/lib/rs/src/transport/mod.rs b/lib/rs/src/transport/mod.rs
index bbabd66..1c39f50 100644
--- a/lib/rs/src/transport/mod.rs
+++ b/lib/rs/src/transport/mod.rs
@@ -30,9 +30,9 @@ mod framed;
 mod passthru;
 mod socket;
 
-#[cfg(test)]
 pub mod mem;
 
+pub use self::mem::TBufferTransport;
 pub use self::buffered::{TBufferedTransport, TBufferedTransportFactory};
 pub use self::framed::{TFramedTransport, TFramedTransportFactory};
 pub use self::passthru::TPassThruTransport;



thrift git commit: THRIFT-4069: perl library cleanup - namespaces, versioning, exception fixes Client: perl

2017-03-30 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 1360270eb -> 177c37ce8


THRIFT-4069: perl library cleanup - namespaces, versioning, exception fixes
Client: perl

This closes #1220


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/177c37ce
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/177c37ce
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/177c37ce

Branch: refs/heads/master
Commit: 177c37ce8516e21b8093fbd7c8047037f794a5f8
Parents: 1360270
Author: James E. King, III 
Authored: Thu Mar 30 17:09:04 2017 -0400
Committer: James E. King, III 
Committed: Thu Mar 30 17:09:04 2017 -0400

--
 .../cpp/src/thrift/generate/t_perl_generator.cc |  52 +++---
 lib/perl/Makefile.PL|  19 +-
 lib/perl/README.md  | 104 ---
 lib/perl/lib/Thrift.pm  | 173 +--
 lib/perl/lib/Thrift/BinaryProtocol.pm   |  25 +--
 lib/perl/lib/Thrift/BufferedTransport.pm|   5 +-
 lib/perl/lib/Thrift/Exception.pm| 160 +
 lib/perl/lib/Thrift/FramedTransport.pm  |   5 +-
 lib/perl/lib/Thrift/HttpClient.pm   |  57 +++---
 lib/perl/lib/Thrift/MemoryBuffer.pm |   6 +-
 lib/perl/lib/Thrift/MessageType.pm  |  19 +-
 lib/perl/lib/Thrift/MultiplexedProcessor.pm |  40 ++---
 lib/perl/lib/Thrift/MultiplexedProtocol.pm  |  21 +--
 lib/perl/lib/Thrift/Protocol.pm |  83 -
 lib/perl/lib/Thrift/ProtocolDecorator.pm|  35 ++--
 lib/perl/lib/Thrift/SSLServerSocket.pm  |   6 +-
 lib/perl/lib/Thrift/SSLSocket.pm|   7 +-
 lib/perl/lib/Thrift/Server.pm   |  29 ++--
 lib/perl/lib/Thrift/ServerSocket.pm |  13 +-
 lib/perl/lib/Thrift/Socket.pm   |  27 +--
 lib/perl/lib/Thrift/Transport.pm|  15 +-
 lib/perl/lib/Thrift/Type.pm |  50 ++
 lib/perl/lib/Thrift/UnixServerSocket.pm |  10 +-
 lib/perl/lib/Thrift/UnixSocket.pm   |  11 +-
 lib/perl/test/multiplex.t   |  16 +-
 lib/perl/test/processor.t   |   4 +-
 test/perl/TestClient.pl |   2 +-
 test/perl/TestServer.pl |   2 +-
 28 files changed, 565 insertions(+), 431 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/177c37ce/compiler/cpp/src/thrift/generate/t_perl_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_perl_generator.cc 
b/compiler/cpp/src/thrift/generate/t_perl_generator.cc
index 5e2a9e9..12b8bfc 100644
--- a/compiler/cpp/src/thrift/generate/t_perl_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_perl_generator.cc
@@ -255,10 +255,12 @@ void t_perl_generator::init_generator() {
 string t_perl_generator::perl_includes() {
   string inc;
 
-  inc = "require 5.6.0;\n";
+  inc  = "use 5.10.0;\n";
   inc += "use strict;\n";
   inc += "use warnings;\n";
-  inc += "use Thrift;\n\n";
+  inc += "use Thrift::Exception;\n";
+  inc += "use Thrift::MessageType;\n";
+  inc += "use Thrift::Type;\n\n";
 
   return inc;
 }
@@ -546,7 +548,7 @@ void 
t_perl_generator::generate_perl_struct_reader(ofstream& out, t_struct* tstr
   indent(out) << "$xfer += $input->readFieldBegin(\\$fname, \\$ftype, 
\\$fid);" << endl;
 
   // Check for field STOP marker and break
-  indent(out) << "if ($ftype == TType::STOP) {" << endl;
+  indent(out) << "if ($ftype == Thrift::TType::STOP) {" << endl;
   indent_up();
   indent(out) << "last;" << endl;
   indent_down();
@@ -749,11 +751,11 @@ void 
t_perl_generator::generate_service_processor(t_service* tservice) {
  << "if (!$self->can($methodname)) {" << endl;
   indent_up();
 
-  f_service_ << indent() << "$input->skip(TType::STRUCT);" << endl << indent()
+  f_service_ << indent() << "$input->skip(Thrift::TType::STRUCT);" << endl << 
indent()
  << "$input->readMessageEnd();" << endl << indent()
- << "my $x = new TApplicationException('Function '.$fname.' not 
implemented.', "
-"TApplicationException::UNKNOWN_METHOD);" << endl << indent()
- << "$output->writeMessageBegin($fname, TMessageType::EXCEPTION, 
$rseqid);" << endl
+ << "my $x = new Thrift::TApplicationException('Function 
'.$fname.' not implemented.', "
+"Thrift::TApplicationException::UNKNOWN_METHOD);" << endl << 
indent()
+ << "$output->writeMessageBegin($fname, 
Thrift::TMessageType::EXCEPTION, $rseqid);" << endl
  << indent() << "$x->write($output);" << endl << indent()
  << "$output->writeMessageEnd();" 

thrift git commit: THRIFT-4147: Rust: protocol should accept transports with non-static lifetime Client: rs

2017-03-30 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 118706018 -> c063b30ec


THRIFT-4147: Rust: protocol should accept transports with non-static lifetime
Client: rs

This closes #1226


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/c063b30e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c063b30e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c063b30e

Branch: refs/heads/master
Commit: c063b30ecd56e920aa136e789a968068996e74ec
Parents: 1187060
Author: Chao Sun 
Authored: Sun Mar 12 12:21:05 2017 -0700
Committer: James E. King, III 
Committed: Thu Mar 30 17:28:58 2017 -0400

--
 lib/rs/src/protocol/binary.rs  | 31 +--
 lib/rs/src/protocol/compact.rs | 28 ++--
 lib/rs/src/protocol/multiplexed.rs | 12 ++--
 3 files changed, 37 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/c063b30e/lib/rs/src/protocol/binary.rs
--
diff --git a/lib/rs/src/protocol/binary.rs b/lib/rs/src/protocol/binary.rs
index f3c9ea2..54613a5 100644
--- a/lib/rs/src/protocol/binary.rs
+++ b/lib/rs/src/protocol/binary.rs
@@ -55,17 +55,18 @@ const BINARY_PROTOCOL_VERSION_1: u32 = 0x8001;
 /// let recvd_bool = i_prot.read_bool().unwrap();
 /// let recvd_string = i_prot.read_string().unwrap();
 /// ```
-pub struct TBinaryInputProtocol {
+pub struct TBinaryInputProtocol<'a> {
 strict: bool,
-transport: Rc>,
+transport: Rc>,
 }
 
-impl TBinaryInputProtocol {
+impl<'a> TBinaryInputProtocol<'a> {
 /// Create a `TBinaryInputProtocol` that reads bytes from `transport`.
 ///
 /// Set `strict` to `true` if all incoming messages contain the protocol
 /// version number in the protocol header.
-pub fn new(transport: Rc>, strict: bool) -> 
TBinaryInputProtocol {
+pub fn new(transport: Rc>,
+   strict: bool) -> TBinaryInputProtocol<'a> {
 TBinaryInputProtocol {
 strict: strict,
 transport: transport,
@@ -73,7 +74,7 @@ impl TBinaryInputProtocol {
 }
 }
 
-impl TInputProtocol for TBinaryInputProtocol {
+impl<'a> TInputProtocol for TBinaryInputProtocol<'a> {
 #[cfg_attr(feature = "cargo-clippy", allow(collapsible_if))]
 fn read_message_begin( self) -> ::Result {
 let mut first_bytes = vec![0; 4];
@@ -239,8 +240,8 @@ impl TBinaryInputProtocolFactory {
 }
 
 impl TInputProtocolFactory for TBinaryInputProtocolFactory {
-fn create( self, transport: Rc>) -> 
Box {
-Box::new(TBinaryInputProtocol::new(transport, true)) as 
Box
+fn create<'a>( self, transport: Rc>) -> 
Box {
+Box::new(TBinaryInputProtocol::new(transport, true)) as 
Box
 }
 }
 
@@ -269,17 +270,18 @@ impl TInputProtocolFactory for 
TBinaryInputProtocolFactory {
 /// o_prot.write_bool(true).unwrap();
 /// o_prot.write_string("test_string").unwrap();
 /// ```
-pub struct TBinaryOutputProtocol {
+pub struct TBinaryOutputProtocol<'a> {
 strict: bool,
-transport: Rc>,
+transport: Rc>,
 }
 
-impl TBinaryOutputProtocol {
+impl<'a> TBinaryOutputProtocol<'a> {
 /// Create a `TBinaryOutputProtocol` that writes bytes to `transport`.
 ///
 /// Set `strict` to `true` if all outgoing messages should contain the
 /// protocol version number in the protocol header.
-pub fn new(transport: Rc>, strict: bool) -> 
TBinaryOutputProtocol {
+pub fn new(transport: Rc>,
+   strict: bool) -> TBinaryOutputProtocol<'a> {
 TBinaryOutputProtocol {
 strict: strict,
 transport: transport,
@@ -291,7 +293,7 @@ impl TBinaryOutputProtocol {
 }
 }
 
-impl TOutputProtocol for TBinaryOutputProtocol {
+impl<'a> TOutputProtocol for TBinaryOutputProtocol<'a> {
 fn write_message_begin( self, identifier: ) -> 
::Result<()> {
 if self.strict {
 let message_type: u8 = identifier.message_type.into();
@@ -794,10 +796,11 @@ mod tests {
 assert_eq!(_bytes, );
 }
 
-fn test_objects
+fn test_objects<'a>
 ()
--> (Rc>, TBinaryInputProtocol, 
TBinaryOutputProtocol)
+-> (Rc>, TBinaryInputProtocol<'a>, 
TBinaryOutputProtocol<'a>)
 {
+
 let mem = 
Rc::new(RefCell::new(Box::new(TBufferTransport::with_capacity(40, 40;
 
 let inner: Box = Box::new(TPassThruTransport { inner: 
mem.clone() });

http://git-wip-us.apache.org/repos/asf/thrift/blob/c063b30e/lib/rs/src/protocol/compact.rs
--
diff --git 

thrift git commit: THRIFT-3959: document that the go simple server is not simple Client: go Patch: JodeZer <jeffery1...@hotmail.com>

2017-03-22 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master bf9b6970b -> 847fae938


THRIFT-3959: document that the go simple server is not simple
Client: go
Patch: JodeZer 

This closes #1213


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/847fae93
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/847fae93
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/847fae93

Branch: refs/heads/master
Commit: 847fae9388048aa9e09d5ed042e34f5452638248
Parents: bf9b697
Author: James E. King, III 
Authored: Wed Mar 22 15:17:30 2017 -0400
Committer: James E. King, III 
Committed: Wed Mar 22 15:17:30 2017 -0400

--
 lib/go/thrift/simple_server.go | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/847fae93/lib/go/thrift/simple_server.go
--
diff --git a/lib/go/thrift/simple_server.go b/lib/go/thrift/simple_server.go
index 4097c4a..5d05c5b 100644
--- a/lib/go/thrift/simple_server.go
+++ b/lib/go/thrift/simple_server.go
@@ -25,7 +25,11 @@ import (
"sync"
 )
 
-// Simple, non-concurrent server for testing.
+/*
+ * This is not a typical TSimpleServer as it is not blocked after accept a 
socket.
+ * It is more like a TThreadedServer that can handle different connections in 
different goroutines.
+ * This will work if golang user implements a conn-pool like thing in client 
side.
+ */
 type TSimpleServer struct {
quit chan struct{}
 



[2/2] thrift git commit: THRIFT-4081 broke compiling with gcc 4.6.x

2017-03-22 Thread jking
THRIFT-4081 broke compiling with gcc 4.6.x


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bf9b6970
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bf9b6970
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bf9b6970

Branch: refs/heads/master
Commit: bf9b6970ba3e30d0a13eca358335508b3f788e33
Parents: 75386db
Author: James E. King, III 
Authored: Wed Mar 22 15:07:23 2017 -0400
Committer: James E. King, III 
Committed: Wed Mar 22 15:07:23 2017 -0400

--
 build/cmake/DefinePlatformSpecifc.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bf9b6970/build/cmake/DefinePlatformSpecifc.cmake
--
diff --git a/build/cmake/DefinePlatformSpecifc.cmake 
b/build/cmake/DefinePlatformSpecifc.cmake
index 28cc5c2..e8479bc 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -100,7 +100,7 @@ endif()
 
 # GCC and Clang: use C++11
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR 
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.6")
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.6.4")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   endif()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -Wextra -pedantic")



[1/2] thrift git commit: THRIFT-4129: Fix fd leak when failing to dispatch new connections Client: C++

2017-03-22 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master e576b26e3 -> bf9b6970b


THRIFT-4129: Fix fd leak when failing to dispatch new connections
Client: C++

This closes #1210


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/75386db8
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/75386db8
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/75386db8

Branch: refs/heads/master
Commit: 75386db8c0eaba39ec5ad374cba27e039d2493e2
Parents: e576b26
Author: Changli Gao 
Authored: Fri Mar 10 13:15:37 2017 +0800
Committer: James E. King, III 
Committed: Wed Mar 22 15:03:37 2017 -0400

--
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/75386db8/lib/cpp/src/thrift/server/TNonblockingServer.cpp
--
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index d4418bd..2cf64f8 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -1004,7 +1004,7 @@ void TNonblockingServer::handleEvent(THRIFT_SOCKET fd, 
short which) {
 } else {
   if (!clientConnection->notifyIOThread()) {
 GlobalOutput.perror("[ERROR] notifyIOThread failed on fresh 
connection, closing", errno);
-returnConnection(clientConnection);
+clientConnection->close();
   }
 }
 



thrift git commit: THRIFT-4130: Release connection back to managed pool. Client: C++

2017-03-22 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 847fae938 -> 6c08ac72c


THRIFT-4130: Release connection back to managed pool.
Client: C++

This closes #1212


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/6c08ac72
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/6c08ac72
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/6c08ac72

Branch: refs/heads/master
Commit: 6c08ac72c6ce9faf66bf28ee75cbb87413daa6aa
Parents: 847fae9
Author: Jonathan Pearlin 
Authored: Sat Mar 11 09:46:03 2017 -0800
Committer: James E. King, III 
Committed: Wed Mar 22 20:33:20 2017 -0400

--
 lib/java/src/org/apache/thrift/transport/THttpClient.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/6c08ac72/lib/java/src/org/apache/thrift/transport/THttpClient.java
--
diff --git a/lib/java/src/org/apache/thrift/transport/THttpClient.java 
b/lib/java/src/org/apache/thrift/transport/THttpClient.java
index 5a5b37c..c3063fe 100644
--- a/lib/java/src/org/apache/thrift/transport/THttpClient.java
+++ b/lib/java/src/org/apache/thrift/transport/THttpClient.java
@@ -304,6 +304,9 @@ public class THttpClient extends TTransport {
   throw new TTransportException(ioe);
 }
   }
+  if (post != null) {
+post.releaseConnection();
+  }
 }
   }
 



thrift git commit: THRIFT-4114: Space after '///' in doc comments Client: rs

2017-03-27 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 971d07780 -> 9f71e00b0


THRIFT-4114: Space after '///' in doc comments
Client: rs

This closes #1224


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9f71e00b
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9f71e00b
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9f71e00b

Branch: refs/heads/master
Commit: 9f71e00b0068d8d5ab571d41c11f087a6e8167e1
Parents: 971d077
Author: Chao Sun 
Authored: Sun Mar 26 23:24:56 2017 -0700
Committer: James E. King, III 
Committed: Mon Mar 27 08:52:12 2017 -0400

--
 compiler/cpp/src/thrift/generate/t_rs_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/9f71e00b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc 
b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
index 5cd304b..78794a5 100644
--- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
@@ -2831,7 +2831,7 @@ void t_rs_generator::render_rustdoc(t_doc* tdoc) {
 return;
   }
 
-  generate_docstring_comment(f_gen_, "", "///", tdoc->get_doc(), "");
+  generate_docstring_comment(f_gen_, "", "/// ", tdoc->get_doc(), "");
 }
 
 void t_rs_generator::render_rift_error(



thrift git commit: THRIFT-3978: tighten up pthread mutex implementation, removing asserts and replacing them with exceptions Client: cpp

2017-04-04 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 7e7a1a7c1 -> 00d425239


THRIFT-3978: tighten up pthread mutex implementation, removing asserts and 
replacing them with exceptions
Client: cpp

This closes #1228


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/00d42523
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/00d42523
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/00d42523

Branch: refs/heads/master
Commit: 00d4252392d9159202cd6ffc4b3294f85265310f
Parents: 7e7a1a7
Author: James E. King, III 
Authored: Tue Apr 4 09:32:45 2017 -0400
Committer: James E. King, III 
Committed: Tue Apr 4 09:32:45 2017 -0400

--
 build/cmake/ConfigureChecks.cmake   |   1 +
 lib/cpp/src/thrift/concurrency/BoostMutex.cpp   |   4 +-
 lib/cpp/src/thrift/concurrency/Mutex.cpp|  86 +-
 lib/cpp/src/thrift/concurrency/Mutex.h  |  11 +-
 lib/cpp/src/thrift/concurrency/StdMutex.cpp |   2 +
 .../src/thrift/concurrency/ThreadManager.cpp|   4 -
 lib/cpp/test/CMakeLists.txt |   3 +-
 lib/cpp/test/Makefile.am|   3 +-
 lib/cpp/test/RWMutexStarveTest.cpp  | 159 ---
 lib/cpp/test/concurrency/MutexTest.cpp  | 123 ++
 lib/cpp/test/concurrency/RWMutexStarveTest.cpp  | 158 ++
 11 files changed, 347 insertions(+), 207 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/00d42523/build/cmake/ConfigureChecks.cmake
--
diff --git a/build/cmake/ConfigureChecks.cmake 
b/build/cmake/ConfigureChecks.cmake
index 81223d8..12a50df 100644
--- a/build/cmake/ConfigureChecks.cmake
+++ b/build/cmake/ConfigureChecks.cmake
@@ -46,6 +46,7 @@ check_include_file(sys/un.h HAVE_SYS_UN_H)
 check_include_file(sys/poll.h HAVE_SYS_POLL_H)
 check_include_file(sys/select.h HAVE_SYS_SELECT_H)
 check_include_file(sched.h HAVE_SCHED_H)
+check_include_file(string.h HAVE_STRING_H)
 check_include_file(strings.h HAVE_STRINGS_H)
 
 check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)

http://git-wip-us.apache.org/repos/asf/thrift/blob/00d42523/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/BoostMutex.cpp 
b/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
index f7cadab..4e556df 100644
--- a/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
+++ b/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
@@ -33,7 +33,9 @@ namespace thrift {
 namespace concurrency {
 
 /**
- * Implementation of Mutex class using boost interprocess mutex
+ * Implementation of Mutex class using boost::timed_mutex
+ *
+ * Methods throw boost::lock_error on error.
  *
  * @version $Id:$
  */

http://git-wip-us.apache.org/repos/asf/thrift/blob/00d42523/lib/cpp/src/thrift/concurrency/Mutex.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/Mutex.cpp 
b/lib/cpp/src/thrift/concurrency/Mutex.cpp
index b6b915d..bcab05e 100644
--- a/lib/cpp/src/thrift/concurrency/Mutex.cpp
+++ b/lib/cpp/src/thrift/concurrency/Mutex.cpp
@@ -17,18 +17,24 @@
  * under the License.
  */
 
+// needed to test for pthread implementation capabilities:
+#define __USE_GNU
+
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
 #include 
-#ifdef HAVE_PTHREAD_H
+#include 
 #include 
-#endif
 #include 
+#include 
 
+#include 
+#include 
 using boost::shared_ptr;
 
 namespace apache {
@@ -110,9 +116,17 @@ static inline int64_t maybeGetProfilingStartTime() {
 #define PROFILE_MUTEX_UNLOCKED()
 #endif // THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
 
+#define EINTR_LOOP(_CALL)  int ret; do { ret = _CALL; } while (ret == 
EINTR)
+#define ABORT_ONFAIL(_CALL)  { EINTR_LOOP(_CALL); if (ret) { abort(); } }
+#define THROW_SRE(_CALLSTR, RET) { throw 
SystemResourceException(boost::str(boost::format("%1% returned %2% (%3%)") % 
_CALLSTR % RET % ::strerror(RET))); }
+#define THROW_SRE_ONFAIL(_CALL)  { EINTR_LOOP(_CALL); if (ret) { 
THROW_SRE(#_CALL, ret); } }
+#define THROW_SRE_TRYFAIL(_CALL) { EINTR_LOOP(_CALL); if (ret == 0) { return 
true; } else if (ret == EBUSY) { return false; } THROW_SRE(#_CALL, ret); }
+
 /**
  * Implementation of Mutex class using POSIX mutex
  *
+ * Throws apache::thrift::concurrency::SystemResourceException on error.
+ *
  * @version $Id:$
  */
 class Mutex::impl {
@@ -128,19 +142,19 @@ public:
   ~impl() {
 if (initialized_) {
   initialized_ = false;
-  int ret = pthread_mutex_destroy(_mutex_);
-  THRIFT_UNUSED_VARIABLE(ret);
-  assert(ret == 0);
+  ABORT_ONFAIL(pthread_mutex_destroy(_mutex_));
 }
   }
 
   void lock() 

thrift git commit: THRIFT-4154: properly close socket whether it is persistent or not on close() Client: php

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master d5536d1ea -> c6ded922c


THRIFT-4154: properly close socket whether it is persistent or not on close()
Client: php

This closes #1011
This closes #1233


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/c6ded922
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/c6ded922
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/c6ded922

Branch: refs/heads/master
Commit: c6ded922c586cad7f66b57a123fec520e5c36a5e
Parents: d5536d1
Author: James E. King, III 
Authored: Sat Apr 1 23:26:54 2017 -0400
Committer: James E. King, III 
Committed: Sat Apr 1 23:26:54 2017 -0400

--
 lib/php/lib/Thrift/Transport/TSocket.php | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/c6ded922/lib/php/lib/Thrift/Transport/TSocket.php
--
diff --git a/lib/php/lib/Thrift/Transport/TSocket.php 
b/lib/php/lib/Thrift/Transport/TSocket.php
index 10d5115..1495047 100644
--- a/lib/php/lib/Thrift/Transport/TSocket.php
+++ b/lib/php/lib/Thrift/Transport/TSocket.php
@@ -248,10 +248,8 @@ class TSocket extends TTransport
*/
   public function close()
   {
-if (!$this->persist_) {
-  @fclose($this->handle_);
-  $this->handle_ = null;
-}
+@fclose($this->handle_);
+$this->handle_ = null;
   }
 
   /**



thrift git commit: THRIFT-4151: disable pthread concurrency analysis code in standard builds Client: C++

2017-03-31 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master c063b30ec -> 7bc943196


THRIFT-4151: disable pthread concurrency analysis code in standard builds
Client: C++

This closes #1229


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7bc94319
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7bc94319
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7bc94319

Branch: refs/heads/master
Commit: 7bc943196d90a1480d1631c330b03ae6ee479ce8
Parents: c063b30
Author: James E. King, III 
Authored: Fri Mar 31 21:25:20 2017 -0400
Committer: James E. King, III 
Committed: Fri Mar 31 21:25:20 2017 -0400

--
 lib/cpp/README.md|  7 +++
 lib/cpp/src/thrift/concurrency/Mutex.cpp | 15 +--
 2 files changed, 16 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/7bc94319/lib/cpp/README.md
--
diff --git a/lib/cpp/README.md b/lib/cpp/README.md
index 2bee2ec..05aef95 100755
--- a/lib/cpp/README.md
+++ b/lib/cpp/README.md
@@ -272,3 +272,10 @@ OpenSSL's RAND_poll() when OpenSSL library is first 
initialized.
 
 The PRNG seed is key to the application security. This method should be
 overridden if it's not strong enough for you.
+
+# Breaking Changes
+
+## 0.11.0
+
+In the pthread mutex implementation, the contention profiling code was enabled
+by default in all builds.  This changed to be disabled by default.  
(THRIFT-4151)

http://git-wip-us.apache.org/repos/asf/thrift/blob/7bc94319/lib/cpp/src/thrift/concurrency/Mutex.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/Mutex.cpp 
b/lib/cpp/src/thrift/concurrency/Mutex.cpp
index e5e50f7..b6b915d 100644
--- a/lib/cpp/src/thrift/concurrency/Mutex.cpp
+++ b/lib/cpp/src/thrift/concurrency/Mutex.cpp
@@ -35,7 +35,10 @@ namespace apache {
 namespace thrift {
 namespace concurrency {
 
-#ifndef THRIFT_NO_CONTENTION_PROFILING
+// Enable this to turn on mutex contention profiling support
+// #define THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
+
+#ifdef THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
 
 static int32_t mutexProfilingCounter = 0;
 static int32_t mutexProfilingSampleRate = 0;
@@ -105,7 +108,7 @@ static inline int64_t maybeGetProfilingStartTime() {
 #define PROFILE_MUTEX_LOCKED()
 #define PROFILE_MUTEX_START_UNLOCK()
 #define PROFILE_MUTEX_UNLOCKED()
-#endif // THRIFT_NO_CONTENTION_PROFILING
+#endif // THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
 
 /**
  * Implementation of Mutex class using POSIX mutex
@@ -115,7 +118,7 @@ static inline int64_t maybeGetProfilingStartTime() {
 class Mutex::impl {
 public:
   impl(Initializer init) : initialized_(false) {
-#ifndef THRIFT_NO_CONTENTION_PROFILING
+#ifdef THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
 profileTime_ = 0;
 #endif
 init(_mutex_);
@@ -186,7 +189,7 @@ public:
 private:
   mutable pthread_mutex_t pthread_mutex_;
   mutable bool initialized_;
-#ifndef THRIFT_NO_CONTENTION_PROFILING
+#ifdef THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
   mutable int64_t profileTime_;
 #endif
 };
@@ -269,7 +272,7 @@ void Mutex::RECURSIVE_INITIALIZER(void* arg) {
 class ReadWriteMutex::impl {
 public:
   impl() : initialized_(false) {
-#ifndef THRIFT_NO_CONTENTION_PROFILING
+#ifdef THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
 profileTime_ = 0;
 #endif
 int ret = pthread_rwlock_init(_lock_, NULL);
@@ -312,7 +315,7 @@ public:
 private:
   mutable pthread_rwlock_t rw_lock_;
   mutable bool initialized_;
-#ifndef THRIFT_NO_CONTENTION_PROFILING
+#ifdef THRIFT_PTHREAD_MUTEX_CONTENTION_PROFILING
   mutable int64_t profileTime_;
 #endif
 };



thrift git commit: THRIFT-3823: Use 'pre' HTML tag when generating non escaped documentation Patch: Maxime Mouial <maxime.mou...@scmfrance.fr>

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master bede86a03 -> 2c0badd66


THRIFT-3823: Use 'pre' HTML tag when generating non escaped documentation
Patch: Maxime Mouial 

This closes #1009


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2c0badd6
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2c0badd6
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2c0badd6

Branch: refs/heads/master
Commit: 2c0badd660501d8b9059b0a8ae97f41f0dc37e92
Parents: bede86a
Author: James E. King, III 
Authored: Sat Apr 1 10:38:13 2017 -0400
Committer: James E. King, III 
Committed: Sat Apr 1 10:38:13 2017 -0400

--
 compiler/cpp/src/thrift/generate/t_html_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/2c0badd6/compiler/cpp/src/thrift/generate/t_html_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_html_generator.cc 
b/compiler/cpp/src/thrift/generate/t_html_generator.cc
index a7fa13c..5d7ff16 100644
--- a/compiler/cpp/src/thrift/generate/t_html_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_html_generator.cc
@@ -405,7 +405,7 @@ void t_html_generator::print_doc(t_doc* tdoc) {
 if (unsafe_) {
   f_out_ << tdoc->get_doc() << "";
 } else {
-  f_out_ << escape_html(tdoc->get_doc()) << "";
+  f_out_ << "" << escape_html(tdoc->get_doc()) << "";
 }
   }
 }



thrift git commit: THRIFT-4140: fix unsafe call to gmtime Client: C++ Patch: Adriaan Schmidt <adriaan.schm...@siemens.com>

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 2c0badd66 -> 5c3de6d3d


THRIFT-4140: fix unsafe call to gmtime
Client: C++
Patch: Adriaan Schmidt 

This closes #1231


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/5c3de6d3
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/5c3de6d3
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/5c3de6d3

Branch: refs/heads/master
Commit: 5c3de6d3d28b94650486d8ae337af56c94e9e442
Parents: 2c0badd
Author: James E. King, III 
Authored: Sat Apr 1 10:46:25 2017 -0400
Committer: James E. King, III 
Committed: Sat Apr 1 10:46:25 2017 -0400

--
 lib/cpp/src/thrift/transport/THttpServer.cpp | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/5c3de6d3/lib/cpp/src/thrift/transport/THttpServer.cpp
--
diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp 
b/lib/cpp/src/thrift/transport/THttpServer.cpp
index 3bf3053..ae3a171 100644
--- a/lib/cpp/src/thrift/transport/THttpServer.cpp
+++ b/lib/cpp/src/thrift/transport/THttpServer.cpp
@@ -41,9 +41,11 @@ THttpServer::~THttpServer() {
 }
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
+  #define THRIFT_GMTIME(TM, TIME) gmtime_s(, )
   #define THRIFT_strncasecmp(str1, str2, len) _strnicmp(str1, str2, len)
   #define THRIFT_strcasestr(haystack, needle) StrStrIA(haystack, needle)
 #else
+  #define THRIFT_GMTIME(TM, TIME) gmtime_r(, )
   #define THRIFT_strncasecmp(str1, str2, len) strncasecmp(str1, str2, len)
   #define THRIFT_strcasestr(haystack, needle) strcasestr(haystack, needle)
 #endif
@@ -146,18 +148,20 @@ std::string THttpServer::getTimeRFC1123() {
   static const char* Months[]
   = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", 
"Nov", "Dec"};
   char buff[128];
+
   time_t t = time(NULL);
-  tm* broken_t = gmtime();
+  struct tm tmb;
+  THRIFT_GMTIME(tmb, t);
 
   sprintf(buff,
   "%s, %d %s %d %d:%d:%d GMT",
-  Days[broken_t->tm_wday],
-  broken_t->tm_mday,
-  Months[broken_t->tm_mon],
-  broken_t->tm_year + 1900,
-  broken_t->tm_hour,
-  broken_t->tm_min,
-  broken_t->tm_sec);
+  Days[tmb.tm_wday],
+  tmb.tm_mday,
+  Months[tmb.tm_mon],
+  tmb.tm_year + 1900,
+  tmb.tm_hour,
+  tmb.tm_min,
+  tmb.tm_sec);
   return std::string(buff);
 }
 }



thrift git commit: THRIFT-4138: Remove undefined behavior imported from Boost Client: C++

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 5c3de6d3d -> 117a5cca7


THRIFT-4138: Remove undefined behavior imported from Boost
Client: C++

There is undefined behavior in boost::lexical_cast that was fixed in
https://github.com/boostorg/lexical_cast/issues/21, but that fix is
only available in recent Boost releases. This patch removes all uses
of lexical_cast instead.

That removes the last undefined behavior, so this patch also makes
ubsan.sh unconditionally fail on undefined behavior.

This closes #1232


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/117a5cca
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/117a5cca
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/117a5cca

Branch: refs/heads/master
Commit: 117a5cca77c3994a62e0287f703232af44a48d9f
Parents: 5c3de6d
Author: Jim Apple 
Authored: Wed Mar 29 20:39:36 2017 -0700
Committer: James E. King, III 
Committed: Sat Apr 1 10:51:48 2017 -0400

--
 build/docker/scripts/ubsan.sh   |  2 +-
 lib/cpp/src/thrift/TOutput.cpp  |  6 +--
 lib/cpp/src/thrift/TToString.h  | 35 +---
 lib/cpp/src/thrift/protocol/TDebugProtocol.cpp  | 22 +-
 lib/cpp/src/thrift/protocol/TJSONProtocol.cpp   | 42 ++--
 lib/cpp/src/thrift/protocol/TJSONProtocol.h |  9 +++--
 lib/cpp/src/thrift/transport/TSSLSocket.cpp |  6 +--
 .../thrift/transport/TTransportException.cpp|  2 -
 lib/cpp/src/thrift/transport/TZlibTransport.h   |  6 +--
 lib/rb/lib/thrift/protocol/json_protocol.rb |  2 +-
 10 files changed, 79 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/117a5cca/build/docker/scripts/ubsan.sh
--
diff --git a/build/docker/scripts/ubsan.sh b/build/docker/scripts/ubsan.sh
index 6db10f3..d39cc83 100755
--- a/build/docker/scripts/ubsan.sh
+++ b/build/docker/scripts/ubsan.sh
@@ -15,7 +15,7 @@ export CXX=clang++-3.8
 # undefined casting, aka "vptr".
 #
 # TODO: fix undefined vptr behavior and turn this option back on.
-export CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined 
-fno-sanitize=vptr"
+export CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined"
 # Builds without optimization and with debugging symbols for making crash 
reports more
 # readable.
 export CFLAGS="${CFLAGS} -O0 -ggdb3"

http://git-wip-us.apache.org/repos/asf/thrift/blob/117a5cca/lib/cpp/src/thrift/TOutput.cpp
--
diff --git a/lib/cpp/src/thrift/TOutput.cpp b/lib/cpp/src/thrift/TOutput.cpp
index 5739d0f..bb46263 100644
--- a/lib/cpp/src/thrift/TOutput.cpp
+++ b/lib/cpp/src/thrift/TOutput.cpp
@@ -18,9 +18,9 @@
  */
 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -100,7 +100,7 @@ void TOutput::perror(const char* message, int errno_copy) {
 
 std::string TOutput::strerror_s(int errno_copy) {
 #ifndef HAVE_STRERROR_R
-  return "errno = " + boost::lexical_cast(errno_copy);
+  return "errno = " + to_string(errno_copy);
 #else // HAVE_STRERROR_R
 
   char b_errbuf[1024] = {'\0'};
@@ -112,7 +112,7 @@ std::string TOutput::strerror_s(int errno_copy) {
   if (rv == -1) {
 // strerror_r failed.  omgwtfbbq.
 return "XSI-compliant strerror_r() failed with errno = "
-   + boost::lexical_cast(errno_copy);
+   + to_string(errno_copy);
   }
 #endif
   // Can anyone prove that explicit cast is probably not necessary

http://git-wip-us.apache.org/repos/asf/thrift/blob/117a5cca/lib/cpp/src/thrift/TToString.h
--
diff --git a/lib/cpp/src/thrift/TToString.h b/lib/cpp/src/thrift/TToString.h
index 5023869..fdf191e 100644
--- a/lib/cpp/src/thrift/TToString.h
+++ b/lib/cpp/src/thrift/TToString.h
@@ -20,20 +20,45 @@
 #ifndef _THRIFT_TOSTRING_H_
 #define _THRIFT_TOSTRING_H_ 1
 
-#include 
-
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
 
 namespace apache {
 namespace thrift {
 
 template 
 std::string to_string(const T& t) {
-  return boost::lexical_cast(t);
+  std::ostringstream o;
+  o << t;
+  return o.str();
+}
+
+// TODO: replace the computations below with std::numeric_limits::max_digits10 
once C++11
+// is enabled.
+inline std::string to_string(const float& t) {
+  std::ostringstream o;
+  o.precision(std::ceil(std::numeric_limits::digits * std::log10(2) + 
1));
+  o << t;
+  return o.str();
+}
+
+inline std::string to_string(const double& t) {
+  std::ostringstream o;
+  o.precision(std::ceil(std::numeric_limits::digits * std::log10(2) + 
1));
+  o << t;
+  return o.str();
+}
+
+inline 

thrift git commit: THRIFT-4152: Make a patch to fix #4152 at least for structs Documentation

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 117a5cca7 -> fcf447679


THRIFT-4152: Make a patch to fix #4152 at least for structs
Documentation

This closes #1230


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/fcf44767
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/fcf44767
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/fcf44767

Branch: refs/heads/master
Commit: fcf44767929dca4c3b722e1fc3303e7ce51a28e4
Parents: 117a5cc
Author: Gonzalo Aguilar Delgado 
Authored: Fri Mar 31 11:13:04 2017 +0200
Committer: James E. King, III 
Committed: Sat Apr 1 10:56:21 2017 -0400

--
 compiler/cpp/src/thrift/generate/t_html_generator.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/fcf44767/compiler/cpp/src/thrift/generate/t_html_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_html_generator.cc 
b/compiler/cpp/src/thrift/generate/t_html_generator.cc
index 5d7ff16..dfd5df3 100644
--- a/compiler/cpp/src/thrift/generate/t_html_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_html_generator.cc
@@ -698,7 +698,7 @@ int t_html_generator::print_type(t_type* ttype) {
 string type_name = ttype->get_name();
 f_out_ << "is_typedef()) {
-  f_out_ << "Typedef_";
+  f_out_ << "Struct_";
 } else if (ttype->is_struct() || ttype->is_xception()) {
   f_out_ << "Struct_";
 } else if (ttype->is_enum()) {



thrift git commit: THRIFT-3784: thrift-maven-plugin generates invalid include directories for IDL in dependency JARs Client: thrift-maven (contrib)

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master fcf447679 -> f65db706b


THRIFT-3784: thrift-maven-plugin generates invalid include directories for IDL 
in dependency JARs
Client: thrift-maven (contrib)

This closes #984


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f65db706
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f65db706
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f65db706

Branch: refs/heads/master
Commit: f65db706b39ceb4898d6c78fe8a7a37501e02c13
Parents: fcf4476
Author: Chris Osborn 
Authored: Thu Apr 7 12:20:02 2016 -0400
Committer: James E. King, III 
Committed: Sat Apr 1 11:15:54 2017 -0400

--
 contrib/thrift-maven-plugin/pom.xml |   6 ++
 .../apache/thrift/maven/AbstractThriftMojo.java |  33 +++---
 .../thrift/maven/ThriftTestCompileMojo.java |  19 
 .../thrift/maven/TestAbstractThriftMojo.java| 102 +++
 4 files changed, 145 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/f65db706/contrib/thrift-maven-plugin/pom.xml
--
diff --git a/contrib/thrift-maven-plugin/pom.xml 
b/contrib/thrift-maven-plugin/pom.xml
index 5bc1004..0af5957 100644
--- a/contrib/thrift-maven-plugin/pom.xml
+++ b/contrib/thrift-maven-plugin/pom.xml
@@ -77,6 +77,12 @@
   plexus-utils
   3.0.14
 
+
+  org.mockito
+  mockito-all
+  1.10.19
+  test
+   
   
   
 ${basedir}/../..

http://git-wip-us.apache.org/repos/asf/thrift/blob/f65db706/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
--
diff --git 
a/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
 
b/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
index 0913c77..869be95 100644
--- 
a/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
+++ 
b/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
@@ -117,7 +117,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
  * @parameter default-value="${localRepository}"
  * @required
  */
-private ArtifactRepository localRepository;
+protected ArtifactRepository localRepository;
 
 /**
  * Set this to {@code false} to disable hashing of dependent jar paths.
@@ -129,7 +129,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
  * @parameter default-value="true"
  * @required
  */
-private boolean hashDependentPaths;
+protected boolean hashDependentPaths;
 
 /**
  * @parameter
@@ -229,7 +229,7 @@ abstract class AbstractThriftMojo extends AbstractMojo {
 checkNotNull(generator, "generator");
 final File thriftSourceRoot = getThriftSourceRoot();
 checkNotNull(thriftSourceRoot);
-checkArgument(!thriftSourceRoot.isFile(), "thriftSourceRoot is a file, 
not a diretory");
+checkArgument(!thriftSourceRoot.isFile(), "thriftSourceRoot is a file, 
not a directory");
 checkNotNull(temporaryThriftFileDirectory, 
"temporaryThriftFileDirectory");
 checkState(!temporaryThriftFileDirectory.isFile(), 
"temporaryThriftFileDirectory is a file, not a directory");
 final File outputDirectory = getOutputDirectory();
@@ -268,7 +268,9 @@ abstract class AbstractThriftMojo extends AbstractMojo {
 if (temporaryThriftFileDirectory.exists()) {
 cleanDirectory(temporaryThriftFileDirectory);
 }
+
 Set thriftDirectories = newHashSet();
+
 for (File classpathElementFile : classpathElementFiles) {
 // for some reason under IAM, we receive poms as dependent files
 // I am excluding .xml rather than including .jar as there may be 
other extensions in use (sar, har, zip)
@@ -283,18 +285,27 @@ abstract class AbstractThriftMojo extends AbstractMojo {
 throw new IllegalArgumentException(format(
 "%s was not a readable artifact", 
classpathElementFile));
 }
+
+/**
+ * Copy each .thrift file found in the JAR into a temporary 
directory, preserving the
+ * directory path it had relative to its containing JAR. Add 
the resulting root directory
+ * (unique for each JAR processed) to the set of thrift 
include directories to use when
+ * compiling.
+ */
 for (JarEntry jarEntry : list(classpathJar.entries())) {
 final String jarEntryName = jarEntry.getName();
  

thrift git commit: THRIFT-3730: go server errors are logged twice Client: go Patch: zhujun2006

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master f65db706b -> d5536d1ea


THRIFT-3730: go server errors are logged twice
Client: go
Patch: zhujun2006 

This closes #940


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d5536d1e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d5536d1e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d5536d1e

Branch: refs/heads/master
Commit: d5536d1ea0300d5643600608492ae51b35538cbf
Parents: f65db70
Author: James E. King, III 
Authored: Sat Apr 1 11:18:45 2017 -0400
Committer: James E. King, III 
Committed: Sat Apr 1 11:21:12 2017 -0400

--
 lib/go/thrift/simple_server.go | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/d5536d1e/lib/go/thrift/simple_server.go
--
diff --git a/lib/go/thrift/simple_server.go b/lib/go/thrift/simple_server.go
index 5d05c5b..e207bd9 100644
--- a/lib/go/thrift/simple_server.go
+++ b/lib/go/thrift/simple_server.go
@@ -186,7 +186,6 @@ func (p *TSimpleServer) processRequests(client TTransport) 
error {
if err, ok := err.(TTransportException); ok && err.TypeId() == 
END_OF_FILE {
return nil
} else if err != nil {
-   log.Printf("error processing request: %s", err)
return err
}
if err, ok := err.(TApplicationException); ok && err.TypeId() 
== UNKNOWN_METHOD {



thrift git commit: THRIFT-3944 TSSLSocket has dead code in checkHandshake Client: C++

2017-04-01 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 7bc943196 -> bede86a03


THRIFT-3944 TSSLSocket has dead code in checkHandshake
Client: C++

This closes #1110


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bede86a0
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bede86a0
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bede86a0

Branch: refs/heads/master
Commit: bede86a032789ea9d8ed7a7d9c684d3fc86ade5c
Parents: 7bc9431
Author: tpcwang 
Authored: Thu Oct 6 10:41:44 2016 -0700
Committer: James E. King, III 
Committed: Sat Apr 1 10:14:16 2017 -0400

--
 lib/cpp/src/thrift/transport/TSSLSocket.cpp | 15 ---
 1 file changed, 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bede86a0/lib/cpp/src/thrift/transport/TSSLSocket.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp 
b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index 4c7be6d..edcfb9d 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -446,21 +446,6 @@ void TSSLSocket::checkHandshake() {
 
   ssl_ = ctx_->createSSL();
 
-  //set read and write bios to non-blocking
-  BIO* wbio =  BIO_new(BIO_s_mem());
-  if (wbio == NULL) {
-throw TSSLException("SSL_get_wbio returns NULL");
-  }
-  BIO_set_nbio(wbio, 1);
-
-  BIO* rbio = BIO_new(BIO_s_mem());
-  if (rbio == NULL) {
-throw TSSLException("SSL_get_rbio returns NULL");
-  }
-  BIO_set_nbio(rbio, 1);
-
-  SSL_set_bio(ssl_, rbio, wbio);
-
   SSL_set_fd(ssl_, static_cast(socket_));
   int rc;
   if (server()) {



thrift git commit: THRIFT-4166: fix recent VC2010 build regression and prevent it in the future Client: cpp

2017-04-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 4eb23472b -> 33df4eb77


THRIFT-4166: fix recent VC2010 build regression and prevent it in the future
Client: cpp

This closes #1237


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/33df4eb7
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/33df4eb7
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/33df4eb7

Branch: refs/heads/master
Commit: 33df4eb77a70a25a37060efd5e5aad049ed39062
Parents: 4eb2347
Author: James E. King, III 
Authored: Thu Apr 6 08:45:17 2017 -0400
Committer: James E. King, III 
Committed: Thu Apr 6 08:45:17 2017 -0400

--
 appveyor.yml | 54 ++-
 build/appveyor/MSVC-appveyor-build.bat   |  1 +
 build/appveyor/MSVC-appveyor-install.bat | 12 ++
 build/appveyor/MSVC-appveyor-test.bat|  6 +--
 build/appveyor/cl_setenv.bat | 18 +++--
 lib/cpp/src/thrift/TToString.h   |  6 +--
 6 files changed, 60 insertions(+), 37 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/33df4eb7/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index b25e7d2..42c2911 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -31,44 +31,33 @@ cache:
   - C:\ProgramData\chocolatey\lib -> build\appveyor\MSVC-appveyor-install.bat
   - C:\msys64\var\cache\pacman-> build\appveyor\MSYS-appveyor-install.bat
 
-configuration:
-# - Debug
-  - Release
-
-platform:
-# - x86
-  - x64
-
 environment:
   matrix:
+   - PROFILE: MSVC2010
+ PLATFORM: x86
+ CONFIGURATION: Debug
+ BOOST_VERSION: 1.54.0
+ LIBEVENT_VERSION: 2.0.22
+ QT_VERSION: 5.6
+ ZLIB_VERSION: 1.2.8
+ DISABLED_TESTS: StressTestNonBlocking|concurrency_test
+
- PROFILE: MSVC2015
+ PLATFORM: x64
+ CONFIGURATION: Release
  BOOST_VERSION: 1.63.0
  LIBEVENT_VERSION: 2.0.22
  PYTHON_VERSION: 3.6
  QT_VERSION: 5.8
  ZLIB_VERSION: 1.2.11
+ DISABLED_TESTS: StressTestNonBlocking
 
- PROFILE: MINGW
-
-#   - PROFILE: MSVC2010
-# BOOST_VERSION: 1.59.0
-# LIBEVENT_VERSION: 2.0.22
-# PYTHON_VERSION: 3.3
-# ZLIB_VERSION: 1.2.8
-
-#   - PROFILE: MSYS
+ PLATFORM: x64
+ CONFIGURATION: Release
 
 matrix:
-  allow_failures:
-# MSVC2010 appears to be 32-bit only in appveyor
-- platform: x64
-  PROFILE: MSVC2010
-
-# Only have 64-bit MinGW working so far (inside MSYS2)
-- platform: x86
-  PROFILE: MINGW
-- platform: x86
-  PROFILE: MSYS
+  fast_finish: true
 
 install:
   - cd %APPVEYOR_BUILD_FOLDER%
@@ -83,6 +72,7 @@ test_script:
   - cd %APPVEYOR_BUILD_FOLDER%
   - call build\appveyor\%PROFILE:~0,4%-appveyor-test.bat
 
+
 # artifact capture disabled as it might increase service cost for little gain:
 #
 # artifacts:
@@ -93,3 +83,15 @@ test_script:
 #  - path: local-thrift-build\Testing
 #name: ctest output
 #type: zip
+
+# RDP support: use one or the other...
+#
+# enables RDP for each build job so you can inspect the environment at the 
beginning of the job:
+# init:
+#  - ps: iex ((new-object 
net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+#
+# enables RDP at the end of the build job so you can login and re-run
+# commands to see why something failed...
+# on_finish:
+#  - ps: $blockRdp = $true; iex ((new-object 
net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+

http://git-wip-us.apache.org/repos/asf/thrift/blob/33df4eb7/build/appveyor/MSVC-appveyor-build.bat
--
diff --git a/build/appveyor/MSVC-appveyor-build.bat 
b/build/appveyor/MSVC-appveyor-build.bat
index ee022cb..054a8b4 100644
--- a/build/appveyor/MSVC-appveyor-build.bat
+++ b/build/appveyor/MSVC-appveyor-build.bat
@@ -35,6 +35,7 @@ CD "%BUILDDIR%" || EXIT /B
 -DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^
 -DZLIB_ROOT="%WIN3P%\zlib-inst" ^
 -DWITH_PYTHON=%WITH_PYTHON% ^
+-DWITH_%THREADMODEL%THREADS=ON ^
 -DWITH_SHARED_LIB=OFF ^
 -DWITH_STATIC_LIB=ON|| EXIT /B
 @ECHO OFF

http://git-wip-us.apache.org/repos/asf/thrift/blob/33df4eb7/build/appveyor/MSVC-appveyor-install.bat
--
diff --git a/build/appveyor/MSVC-appveyor-install.bat 
b/build/appveyor/MSVC-appveyor-install.bat
index 5343d85..573700e 100644
--- a/build/appveyor/MSVC-appveyor-install.bat
+++ b/build/appveyor/MSVC-appveyor-install.bat
@@ -56,5 +56,17 @@ IF "%COMPILER%" == "vc100" (
   7z x "msinttypes-r26.zip" 

thrift git commit: Pull CHANGES file from 0.10.0 release to master

2017-04-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 33df4eb77 -> d6de19925


Pull CHANGES file from 0.10.0 release to master


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d6de1992
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d6de1992
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d6de1992

Branch: refs/heads/master
Commit: d6de19925913ac3b7e5a38167e2362cd2a91a506
Parents: 33df4eb
Author: James E. King, III 
Authored: Thu Apr 6 09:22:22 2017 -0400
Committer: James E. King, III 
Committed: Thu Apr 6 09:22:22 2017 -0400

--
 CHANGES | 587 +++
 1 file changed, 587 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/d6de1992/CHANGES
--
diff --git a/CHANGES b/CHANGES
index 1cf8b34..7b674d6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,592 @@
 Apache Thrift Changelog
 
+Thrift 0.10.0
+
+## Bug
+* [THRIFT-1840] - Thrift Generated Code Causes Global Variable Leaks
+* [THRIFT-1828] - moc_TQTcpServer.cpp was removed from source tree but is 
in thrift-0.9.0.tar.gz
+* [THRIFT-1790] - cocoa: Duplicate interface definition error
+* [THRIFT-1776] - TPipeServer should implement "listen", so that 
TServerEventHandler preServe will work right
+* [THRIFT-1351] - Compiler does not care about binary strings
+* [THRIFT-1229] - Python fastbinary.c can not handle unicode as generated 
python code
+* [THRIFT-749] - C++ TBufferedTransports do not flush their buffers on 
delete
+* [THRIFT-747] - C++ TSocket->close calls shutdown breaking forked parent 
process
+* [THRIFT-732] - server exits abnormally when client calls send_xxx 
function without calling recv_xxx function
+* [THRIFT-3942] - TSSLSocket does not honor send and receive timeouts
+* [THRIFT-3941] - WinXP version of thrift_poll() relies on undefined 
behavior by passing a destructed variable to select()
+* [THRIFT-3940] - Visual Studio project file for compiler is broken
+* [THRIFT-3943] - Coverity Scan identified some high severity defects
+* [THRIFT-3929] - PHP "nsglobal" Option Results in Syntax Error in 
Generated Code (Trailing Backslash)
+* [THRIFT-3936] - Cannot compile 0.10.0 development tip with VS2013 and 
earlier (snprintf, uint32_t)
+* [THRIFT-3935] - Incorrect skipping of map and set
+* [THRIFT-3920] - Ruby: Ensuring that HTTP failures will clear the http 
transport outbuf var
+* [THRIFT-3919] - C# TTLSServerSocket does not use clientTimeout
+* [THRIFT-3917] - Check backports.ssl_match_hostname module version
+* [THRIFT-3909] - Fix c_glib static lib CMake build
+* [THRIFT-3904] - Typo in node tutorial leads to wrong transport being used
+* [THRIFT-3848] - As an implementer of a perl socket server, I do not want 
to have to remember to ignore SIGCHLD for it to work properly
+* [THRIFT-3844] - thrift_protocol cannot compile in 7.0.7
+* [THRIFT-3843] - integer issues with Haxe PHP targets cause ZigZag 
encoding to fail
+* [THRIFT-3842] - Dart generates incorrect code for a const struct
+* [THRIFT-3841] - dart compact protocol incorrectly 
serializes/deserialized doubles
+* [THRIFT-3708] - NameError: global name 'TProtocol' is not defined
+* [THRIFT-3704] - "TConnectedClient died: Could not refill buffer" message 
shown when using HTTP Server
+* [THRIFT-3678] - Fix javadoc errors on JDK 8
+* [THRIFT-3014] - AppVeyor support
+* [THRIFT-2994] - Node.js TJSONProtocol cannot be used for object 
serialization.
+* [THRIFT-2974] - writeToParcel throws NPE for optional enum fields
+* [THRIFT-2948] - Python TJSONProtocol doesn't handle structs with binary 
fields containing invalid unicode.
+* [THRIFT-2845] - ChildService.Plo: No such file or directory
+* [THRIFT-3276] - Binary data does not decode correctly using the 
TJSONProtocol when the base64 encoded data is padded.
+* [THRIFT-3253] - Using latest version of D gives deprecation notices
+* [THRIFT-2883] - TTwisted.py, during ConnectionLost processing: 
exceptions.RuntimeError: dictionary changed size during iteration
+* [THRIFT-2019] - Writing on a disconnected socket on Mac causes SIG PIPE
+* [THRIFT-2020] - Thrift library has some empty files that haven't really 
been deleted
+* [THRIFT-2049] - Go compiler doesn't build on native Windows
+* [THRIFT-2024] - TServer.cpp warns on 64-bit platforms about truncating 
an rlim_t into an int
+* [THRIFT-2023] - gettimeofday implementation on Windows errors when no 
time zone is passed in.
+* [THRIFT-2022] - CoB and 

thrift git commit: THRIFT-4170: fix lua backwards compatibility Client: lua Patch: wlgys8 <147668...@qq.com>

2017-04-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master d6de19925 -> 3641b5435


THRIFT-4170: fix lua backwards compatibility
Client: lua
Patch: wlgys8 <147668...@qq.com>

This closes #669
This closes #1241


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3641b543
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3641b543
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3641b543

Branch: refs/heads/master
Commit: 3641b54352f1c810ba3f60176d51472bfafdc6e0
Parents: d6de199
Author: James E. King, III 
Authored: Thu Apr 6 17:48:23 2017 -0400
Committer: James E. King, III 
Committed: Thu Apr 6 17:49:05 2017 -0400

--
 lib/lua/src/luabpack.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/3641b543/lib/lua/src/luabpack.c
--
diff --git a/lib/lua/src/luabpack.c b/lib/lua/src/luabpack.c
index a86fc3e..077b6aa 100644
--- a/lib/lua/src/luabpack.c
+++ b/lib/lua/src/luabpack.c
@@ -104,10 +104,10 @@ static int l_bunpack(lua_State *L) {
   const char *code = luaL_checkstring(L, 1);
   luaL_argcheck(L, code[1] == '\0', 0, "Format code must be one character.");
   const char *data = luaL_checkstring(L, 2);
-#ifdef _LUA51_
-  size_t len = lua_objlen(L, 2);
-#else
+#if LUA_VERSION_NUM >= 502
   size_t len = lua_rawlen(L, 2);
+#else
+  size_t len = lua_objlen(L, 2);
 #endif
 
   switch (code[0]) {



thrift git commit: THRIFT-4099: Derive Hash trait for Rust structs Client: rs

2017-04-07 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master ee17ff95e -> 92e1c409c


THRIFT-4099: Derive Hash trait for Rust structs
Client: rs

This closes #1246


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/92e1c409
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/92e1c409
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/92e1c409

Branch: refs/heads/master
Commit: 92e1c409c74632ea302eea48b1507e1121769a46
Parents: ee17ff9
Author: Allen George 
Authored: Thu Apr 6 08:28:22 2017 -0400
Committer: James E. King, III 
Committed: Fri Apr 7 09:24:41 2017 -0400

--
 .../cpp/src/thrift/generate/t_rs_generator.cc   | 58 
 lib/rs/src/transport/mem.rs |  2 +-
 lib/rs/test/thrifts/Base_One.thrift | 19 +++
 3 files changed, 67 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/92e1c409/compiler/cpp/src/thrift/generate/t_rs_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_rs_generator.cc 
b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
index 78794a5..c34ed17 100644
--- a/compiler/cpp/src/thrift/generate/t_rs_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_rs_generator.cc
@@ -245,6 +245,13 @@ private:
   // rendered code is calling such a function it has to dereference `v`.
   bool needs_deref_on_container_write(t_type* ttype);
 
+  // Return the variable (including all dereferences) required to write values 
from a rust container
+  // to the output protocol. For example, if you were iterating through a 
container and using the temp
+  // variable `v` to represent each element, then `ttype` is the type stored 
in the container and
+  // `base_var` is "v". The return value is the actual string you will have to 
use to properly reference
+  // the temp variable for writing to the output protocol.
+  string string_container_write_variable(t_type* ttype, const string& 
base_var);
+
   // Write the code to read bytes from the wire into the given `t_struct`. 
`struct_name` is the
   // actual Rust name of the `t_struct`. If `struct_type` is `T_ARGS` then all 
struct fields are
   // necessary. Otherwise, the field's default optionality is used.
@@ -377,6 +384,9 @@ private:
   // Write the documentation for a struct, service-call or other 
documentation-annotated element.
   void render_rustdoc(t_doc* tdoc);
 
+  // Return `true` if the true type of `ttype` is a thrift double, `false` 
otherwise.
+  bool is_double(t_type* ttype);
+
   // Return a string representing the rust type given a `t_type`.
   string to_rust_type(t_type* ttype, bool ordered_float = true);
 
@@ -655,10 +665,7 @@ void t_rs_generator::render_const_value(t_type* ttype, 
t_const_value* tvalue) {
   f_gen_ << tvalue->get_integer();
   break;
 case t_base_type::TYPE_DOUBLE:
-  f_gen_
-<< indent()
-<< "OrderedFloat::from(" << tvalue->get_double() << ")"
-<< endl;
+  f_gen_ << "OrderedFloat::from(" << tvalue->get_double() << " as f64)";
   break;
 default:
   throw "cannot generate const value for " + 
t_base_type::t_base_name(tbase_type->get_base());
@@ -826,7 +833,7 @@ void t_rs_generator::generate_enum(t_enum* tenum) {
 
 void t_rs_generator::render_enum_definition(t_enum* tenum, const string& 
enum_name) {
   render_rustdoc((t_doc*) tenum);
-  f_gen_ << "#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]" << 
endl;
+  f_gen_ << "#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, 
PartialOrd)]" << endl;
   f_gen_ << "pub enum " << enum_name << " {" << endl;
   indent_up();
 
@@ -965,7 +972,7 @@ void t_rs_generator::render_struct_definition(
   t_rs_generator::e_struct_type struct_type
 ) {
   render_rustdoc((t_doc*) tstruct);
-  f_gen_ << "#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]" << endl;
+  f_gen_ << "#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << 
endl;
   f_gen_ << visibility_qualifier(struct_type) << "struct " << struct_name << " 
{" << endl;
 
   // render the members
@@ -1311,7 +1318,7 @@ void t_rs_generator::render_union_definition(const 
string& union_name, t_struct*
 throw "cannot generate rust enum with 0 members"; // may be valid thrift, 
but it's invalid rust
   }
 
-  f_gen_ << "#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]" << endl;
+  f_gen_ << "#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]" << 
endl;
   f_gen_ << "pub enum " << union_name << " {" << endl;
   indent_up();
 
@@ -1543,7 +1550,7 @@ void t_rs_generator::render_list_sync_write(const string 
_var, bool list_va
   string ref(list_var_is_ref ? "" : "&");
   f_gen_ << indent() << "for e in " << ref << 

thrift git commit: THRIFT-3832: fix lnk 200 error on windows when compile as lib

2017-04-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 3db41faf4 -> 2d65c2365


THRIFT-3832: fix lnk 200 error on windows when compile as lib

This closes #1250


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/2d65c236
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/2d65c236
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/2d65c236

Branch: refs/heads/master
Commit: 2d65c2365f19f637bc73e71d78727bf0b709
Parents: 3db41fa
Author: 771545...@qq.com <771545...@qq.com>
Authored: Mon Apr 10 17:09:32 2017 +0800
Committer: James E. King, III 
Committed: Mon Apr 10 08:55:19 2017 -0400

--
 lib/cpp/libthrift.vcxproj | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/2d65c236/lib/cpp/libthrift.vcxproj
--
diff --git a/lib/cpp/libthrift.vcxproj b/lib/cpp/libthrift.vcxproj
index db0e5d9..307b121 100644
--- a/lib/cpp/libthrift.vcxproj
+++ b/lib/cpp/libthrift.vcxproj
@@ -53,6 +53,12 @@
 
 
 
+   
+   
+   
+   
+   
+   
 
 
 



thrift git commit: THRIFT-4158: MSYS-appveyor-install.bat: use mingw-w64-xxx variants of openssl and zlib Client: C++

2017-04-18 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 2d65c2365 -> a105450fd


THRIFT-4158: MSYS-appveyor-install.bat: use mingw-w64-xxx variants of openssl 
and zlib
Client: C++

This closes #1247


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/a105450f
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/a105450f
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/a105450f

Branch: refs/heads/master
Commit: a105450fd1f85ca40423b7f81e9c49386444d429
Parents: 2d65c23
Author: Mario Emmenlauer 
Authored: Fri Apr 7 21:26:52 2017 +0200
Committer: James E. King, III 
Committed: Tue Apr 18 09:11:06 2017 -0400

--
 build/appveyor/MSYS-appveyor-install.bat | 4 ++--
 build/cmake/README-MSYS2.md  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/a105450f/build/appveyor/MSYS-appveyor-install.bat
--
diff --git a/build/appveyor/MSYS-appveyor-install.bat 
b/build/appveyor/MSYS-appveyor-install.bat
index 252f47d..ff43cd3 100644
--- a/build/appveyor/MSYS-appveyor-install.bat
+++ b/build/appveyor/MSYS-appveyor-install.bat
@@ -28,11 +28,11 @@ CALL cl_showenv.bat|| EXIT /B
 SET PACKAGES=^
   --needed -S bison flex ^
   make ^
-  openssl openssl-devel ^
   mingw-w64-x86_64-boost ^
   mingw-w64-x86_64-cmake ^
+  mingw-w64-x86_64-openssl ^
   mingw-w64-x86_64-toolchain ^
-  zlib zlib-devel
+  mingw-w64-x86_64-zlib
 
 :: omitting libevent-devel for now it is version 2.1.4 and doesn't play nice 
with MinGW
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/a105450f/build/cmake/README-MSYS2.md
--
diff --git a/build/cmake/README-MSYS2.md b/build/cmake/README-MSYS2.md
index 06c0205..02679e6 100644
--- a/build/cmake/README-MSYS2.md
+++ b/build/cmake/README-MSYS2.md
@@ -26,9 +26,9 @@ Download and fully upgrade msys2 following the instructions 
at:
 
 Install the necessary toolchain items for C++:
 
-$ pacman -S bison flex openssl openssl-devel \
+$ pacman --needed -S bison flex make mingw-w64-x86_64-openssl \
 mingw-w64-x86_64-boost mingw-w64-x86_64-cmake \
-mingw-w64-x86_64-toolchain zlib zlib-devel
+mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib
 
 Update your msys2 bash path to include /mingw64/bin by adding a line to your 
~/.bash_profiles using this command:
 
@@ -60,4 +60,4 @@ Run the tests (inside thrift-build):
 
 ## Tested With
 
-msys2 64-bit 2016-10-26 distribution
\ No newline at end of file
+msys2 64-bit 2016-10-26 distribution



thrift git commit: THRIFT-4177 fix java deep copy Client: Java

2017-04-19 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master a105450fd -> 3311a9b23


THRIFT-4177 fix java deep copy
Client: Java

Java compiler produces deep copy constructor that could make shallow copy 
accidentally.

This closes #1254


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3311a9b2
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3311a9b2
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3311a9b2

Branch: refs/heads/master
Commit: 3311a9b2375276441234218f4351c6a8f66a6bc2
Parents: a105450
Author: Deniss Afonin 
Authored: Tue Apr 18 19:27:49 2017 +0300
Committer: James E. King, III 
Committed: Wed Apr 19 12:38:14 2017 -0400

--
 .../cpp/src/thrift/generate/t_java_generator.cc |  1 +
 lib/java/build.xml  |  3 ++
 .../test/org/apache/thrift/TestDeepCopy.java| 34 
 test/JavaDeepCopyTest.thrift| 19 +++
 test/Makefile.am|  1 +
 5 files changed, 58 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/3311a9b2/compiler/cpp/src/thrift/generate/t_java_generator.cc
--
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc 
b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index 80b8eef..3408bf6 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -4657,6 +4657,7 @@ void 
t_java_generator::generate_deep_copy_non_container(ofstream& out,
 std::string dest_name,
 t_type* type) {
   (void)dest_name;
+  type = get_true_type(type);
   if (type->is_base_type() || type->is_enum() || type->is_typedef()) {
 if (type->is_binary()) {
   out << "org.apache.thrift.TBaseHelper.copyBinary(" << source_name << ")";

http://git-wip-us.apache.org/repos/asf/thrift/blob/3311a9b2/lib/java/build.xml
--
diff --git a/lib/java/build.xml b/lib/java/build.xml
index 6af9f27..e40eafa 100644
--- a/lib/java/build.xml
+++ b/lib/java/build.xml
@@ -287,6 +287,9 @@
 
   
 
+
+  
+
   
 
   

http://git-wip-us.apache.org/repos/asf/thrift/blob/3311a9b2/lib/java/test/org/apache/thrift/TestDeepCopy.java
--
diff --git a/lib/java/test/org/apache/thrift/TestDeepCopy.java 
b/lib/java/test/org/apache/thrift/TestDeepCopy.java
new file mode 100644
index 000..acafaef
--- /dev/null
+++ b/lib/java/test/org/apache/thrift/TestDeepCopy.java
@@ -0,0 +1,34 @@
+package org.apache.thrift;
+
+import junit.framework.TestCase;
+import thrift.test.DeepCopyBar;
+import thrift.test.DeepCopyFoo;
+
+public class TestDeepCopy extends TestCase {
+
+  public void testDeepCopy() throws Exception {
+final DeepCopyFoo foo = new DeepCopyFoo();
+
+foo.addToL(new DeepCopyBar());
+foo.addToS(new DeepCopyBar());
+foo.putToM("test 3", new DeepCopyBar());
+
+foo.addToLi(new thrift.test.Object());
+foo.addToSi(new thrift.test.Object());
+foo.putToMi("test 3", new thrift.test.Object());
+
+foo.setBar(new DeepCopyBar());
+
+final DeepCopyFoo deepCopyFoo = foo.deepCopy();
+
+assertNotSame(foo.getBar(), deepCopyFoo.getBar());
+
+assertNotSame(foo.getL().get(0),  
deepCopyFoo.getL().get(0));
+assertNotSame(foo.getS().toArray(new DeepCopyBar[0])[0],  
deepCopyFoo.getS().toArray(new DeepCopyBar[0])[0]);
+assertNotSame(foo.getM().get("test 3"),   
deepCopyFoo.getM().get("test 3"));
+
+assertNotSame(foo.getLi().get(0), 
deepCopyFoo.getLi().get(0));
+assertNotSame(foo.getSi().toArray(new thrift.test.Object[0])[0],  
deepCopyFoo.getSi().toArray(new thrift.test.Object[0])[0]);
+assertNotSame(foo.getMi().get("test 3"),  
deepCopyFoo.getMi().get("test 3"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/thrift/blob/3311a9b2/test/JavaDeepCopyTest.thrift
--
diff --git a/test/JavaDeepCopyTest.thrift b/test/JavaDeepCopyTest.thrift
new file mode 100644
index 000..fc974ae
--- /dev/null
+++ b/test/JavaDeepCopyTest.thrift
@@ -0,0 +1,19 @@
+include "JavaTypes.thrift"
+
+namespace java thrift.test
+
+struct DeepCopyFoo {
+  1: optional list l,
+  2: optional set s,
+  3: optional map m,
+  4: optional list li,
+  5: optional set si,
+  6: optional map mi,
+  7: optional DeepCopyBar bar,
+}
+
+struct 

thrift git commit: THRIFT-4110: add libthrift0-dbg debug symbols package to debian build process for symbolic debugging

2017-03-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b79396f79 -> 9b1544dc2


THRIFT-4110: add libthrift0-dbg debug symbols package to debian build process 
for symbolic debugging

This closes #1209


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/9b1544dc
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/9b1544dc
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/9b1544dc

Branch: refs/heads/master
Commit: 9b1544dc21f2d952b91c44e4636e1b9da937002c
Parents: b79396f
Author: James E. King, III 
Authored: Fri Mar 10 06:14:18 2017 -0500
Committer: James E. King, III 
Committed: Fri Mar 10 06:14:18 2017 -0500

--
 debian/control | 11 +++
 debian/rules   |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/9b1544dc/debian/control
--
diff --git a/debian/control b/debian/control
index 43e7a0f..218d217 100644
--- a/debian/control
+++ b/debian/control
@@ -166,6 +166,17 @@ Description: Thrift C++ library
  This package contains the runtime libraries needed for C++ applications
  using Thrift.
 
+Package: libthrift0-dbg
+Architecture: any
+Section: debug
+Depends: ${shlibs:Depends}, ${misc:Depends}, libthrift0 (= ${binary:Version})
+Description: Thrift C++ library debug symbols
+ Thrift is a software framework for scalable cross-language services
+ development. It combines a software stack with a code generation engine to
+ build services that work efficiently and seamlessly.
+ .
+ This package contains the debug symbols for the Thrift C++ runtime libraries.
+
 Package: libthrift-dev
 Architecture: any
 Section: libdevel

http://git-wip-us.apache.org/repos/asf/thrift/blob/9b1544dc/debian/rules
--
diff --git a/debian/rules b/debian/rules
index 53aec3c..f370325 100755
--- a/debian/rules
+++ b/debian/rules
@@ -202,9 +202,10 @@ binary-common:
dh_installexamples
dh_installman
dh_link
+   dh_strip -plibthrift0 --dbg-package=libthrift0-dbg
dh_strip -ppython-thrift --dbg-package=python-thrift-dbg
dh_strip -ppython3-thrift --dbg-package=python3-thrift-dbg
-   dh_strip -pthrift-compiler -plibthrift0
+   dh_strip -pthrift-compiler
dh_compress
dh_fixperms
dh_makeshlibs



thrift git commit: THRIFT-4081: appveyor retooling - added mingw64 build as a second job to the CI build process

2017-03-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 9b1544dc2 -> 07f59971b


THRIFT-4081: appveyor retooling - added mingw64 build as a second job to the CI 
build process

This closes #1205


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/07f59971
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/07f59971
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/07f59971

Branch: refs/heads/master
Commit: 07f59971bd11df619709444275298061ee69f707
Parents: 9b1544d
Author: James E. King, III 
Authored: Fri Mar 10 06:18:33 2017 -0500
Committer: James E. King, III 
Committed: Fri Mar 10 06:18:33 2017 -0500

--
 appveyor.yml| 127 ++-
 build/appveyor/MING-appveyor-build.bat  |  36 ++
 build/appveyor/MING-appveyor-install.bat|  21 +++
 build/appveyor/MING-appveyor-test.bat   |  16 +++
 build/appveyor/MSVC-appveyor-build.bat  |  44 +++
 build/appveyor/MSVC-appveyor-install.bat|  60 +
 build/appveyor/MSVC-appveyor-test.bat   |  29 +
 build/appveyor/MSYS-appveyor-build.bat  |  47 +++
 build/appveyor/MSYS-appveyor-install.bat|  41 ++
 build/appveyor/MSYS-appveyor-test.bat   |  26 
 build/appveyor/README.md|  34 +
 build/appveyor/build-libevent.bat   |  30 +
 build/appveyor/build-zlib.bat   |  49 +++
 build/appveyor/cl_banner_apache_thrift.bat  |  24 
 build/appveyor/cl_banner_build.bat  |  23 
 build/appveyor/cl_banner_install.bat|  23 
 build/appveyor/cl_banner_test.bat   |  23 
 build/appveyor/cl_setcompiler.bat   |  63 +
 build/appveyor/cl_setenv.bat|  79 
 build/appveyor/cl_setgenerator.bat  |  74 +++
 build/appveyor/cl_showenv.bat   |  67 ++
 build/appveyor/download_openssl.py  |  41 --
 build/appveyor/simulate-appveyor.bat|  35 +
 build/cmake/DefineOptions.cmake |  15 +--
 build/cmake/DefinePlatformSpecifc.cmake |  14 +-
 build/cmake/NewPlatformDebug.cmake  |  43 +++
 .../cpp/src/thrift/generate/t_cpp_generator.cc  |   4 +-
 lib/cpp/CMakeLists.txt  |   2 +-
 lib/cpp/src/thrift/concurrency/StdMutex.cpp |   2 +
 lib/cpp/src/thrift/protocol/TProtocol.h |   4 +-
 lib/cpp/src/thrift/transport/TPipe.cpp  |   2 +-
 lib/cpp/src/thrift/transport/TPipeServer.cpp|   4 +-
 lib/cpp/src/thrift/transport/TServerSocket.cpp  |   2 +-
 lib/cpp/src/thrift/transport/TSocket.cpp|   2 +-
 lib/cpp/src/thrift/windows/config.h |  19 ++-
 lib/cpp/test/Base64Test.cpp |   4 +
 lib/cpp/test/CMakeLists.txt |   6 +-
 lib/cpp/test/TFileTransportTest.cpp |  11 +-
 lib/cpp/test/TSSLSocketInterruptTest.cpp|   2 +-
 lib/cpp/test/ZlibTest.cpp   |   2 +-
 lib/java/CMakeLists.txt |   2 +-
 lib/py/src/ext/module.cpp   |   7 +-
 42 files changed, 1006 insertions(+), 153 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/07f59971/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index a4df229..b25e7d2 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,3 +1,4 @@
+#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements. See the NOTICE file
 # distributed with this work for additional information
@@ -18,73 +19,77 @@
 
 # build Apache Thrift on AppVeyor - https://ci.appveyor.com
 
+version: '1.0.0-dev.{build}'
+
 shallow_clone: true
-clone_depth: 10
 
-version: '{build}'
 os:
-# - Windows Server 2012 R2
-- Visual Studio 2015
+  - Visual Studio 2015
+
+cache:
+  - C:\projects\thrift\buildcache -> build\appveyor\MSVC-appveyor-install.bat
+  - C:\ProgramData\chocolatey\lib -> build\appveyor\MSVC-appveyor-install.bat
+  - C:\msys64\var\cache\pacman-> build\appveyor\MSYS-appveyor-install.bat
+
+configuration:
+# - Debug
+  - Release
+
+platform:
+# - x86
+  - x64
 
 environment:
-  BOOST_ROOT: C:\Libraries\boost_1_59_0
-  BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
+  matrix:
+   - PROFILE: MSVC2015
+ BOOST_VERSION: 1.63.0
+ LIBEVENT_VERSION: 2.0.22
+ PYTHON_VERSION: 3.6
+ QT_VERSION: 5.8
+ ZLIB_VERSION: 1.2.11
 
-install:
-- '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64'
-- cd \
-  # Zlib
-- appveyor DownloadFile https://github.com/madler/zlib/archive/v1.2.8.tar.gz
-- 7z x 

thrift git commit: THRIFT-4029: add MANIFEST.in to include the extension files Client: py

2017-03-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 07f59971b -> 658275775


THRIFT-4029: add MANIFEST.in to include the extension files
Client: py

This closes #1206


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/65827577
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/65827577
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/65827577

Branch: refs/heads/master
Commit: 6582757752e62efea3f9786dddf0260efaa1f450
Parents: 07f5997
Author: Yao Jin 
Authored: Thu Mar 2 13:31:11 2017 +0800
Committer: James E. King, III 
Committed: Fri Mar 10 06:24:31 2017 -0500

--
 lib/py/MANIFEST.in | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/65827577/lib/py/MANIFEST.in
--
diff --git a/lib/py/MANIFEST.in b/lib/py/MANIFEST.in
new file mode 100644
index 000..af54e29
--- /dev/null
+++ b/lib/py/MANIFEST.in
@@ -0,0 +1 @@
+include src/ext/*



thrift git commit: THRIFT-4108: c_glib ssl implementation fixes - remove global ssl context and more Client: glib

2017-03-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 431732d39 -> b79396f79


THRIFT-4108: c_glib ssl implementation fixes - remove global ssl context and 
more
Client: glib

This closes #1208


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/b79396f7
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/b79396f7
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/b79396f7

Branch: refs/heads/master
Commit: b79396f799fe88d2dae48573f61257aac5b2c09b
Parents: 431732d
Author: Gonzalo Aguilar Delgado 
Authored: Mon Mar 6 18:55:44 2017 +0100
Committer: James E. King, III 
Committed: Mon Mar 6 19:09:06 2017 -0500

--
 .../thrift/c_glib/transport/thrift_ssl_socket.c | 360 +--
 .../thrift/c_glib/transport/thrift_ssl_socket.h |  50 +++
 2 files changed, 214 insertions(+), 196 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/b79396f7/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
--
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c 
b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
index f7c42cc..1de4a43 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
@@ -27,11 +27,15 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
+
 #if defined(WIN32)
 #define MUTEX_TYPEHANDLE
 #define MUTEX_SETUP(x)(x) = CreateMutex(NULL, FALSE, NULL)
@@ -58,8 +62,6 @@ enum _ThriftSSLSocketProperties
 
 /* To hold a global state management of openssl for all instances */
 static gboolean thrift_ssl_socket_openssl_initialized=FALSE;
-/* Should this be keept at class level? */
-static SSL_CTX* thrift_ssl_socket_global_context=NULL;
 /* This array will store all of the mutexes available to OpenSSL. */
 static MUTEX_TYPE *thrift_ssl_socket_global_mutex_buf=NULL;
 
@@ -152,21 +154,21 @@ thrift_ssl_socket_peek (ThriftTransport *transport, 
GError **error)
   gboolean retval = FALSE;
   ThriftSSLSocket *ssl_socket = THRIFT_SSL_SOCKET (transport);
   if (thrift_ssl_socket_is_open (transport))
-  {
-int rc;
-gchar byte;
-rc = SSL_peek(ssl_socket->ssl, , 1);
-if (rc < 0) {
-g_set_error (error,
- THRIFT_TRANSPORT_ERROR,
- THRIFT_SSL_SOCKET_ERROR_SSL,
- "failed to peek at socket - id?");
-}
-if (rc == 0) {
-ERR_clear_error();
+{
+  int rc;
+  gchar byte;
+  rc = SSL_peek(ssl_socket->ssl, , 1);
+  if (rc < 0) {
+ g_set_error (error,
+  THRIFT_TRANSPORT_ERROR,
+  THRIFT_SSL_SOCKET_ERROR_SSL,
+  "failed to peek at socket - id?");
+  }
+  if (rc == 0) {
+ ERR_clear_error();
+  }
+  retval = (rc > 0);
 }
-retval = (rc > 0);
-  }
   return retval;
 }
 
@@ -175,13 +177,13 @@ gboolean
 thrift_ssl_socket_open (ThriftTransport *transport, GError **error)
 {
   if (!thrift_socket_open(transport, error)) {
-return FALSE;
+  return FALSE;
   }
 
   if (!THRIFT_SSL_SOCKET_GET_CLASS(transport)->handle_handshake(transport, 
error)) {
-GError *tmperr;
-thrift_socket_close(transport, );
-return FALSE;
+  GError *tmperr;
+  thrift_socket_close(transport, );
+  return FALSE;
   }
 
   return TRUE;
@@ -195,7 +197,7 @@ thrift_ssl_socket_close (ThriftTransport *transport, GError 
**error)
   if(THRIFT_SSL_SOCKET(transport)->ssl) {
   int rc = SSL_shutdown(THRIFT_SSL_SOCKET(transport)->ssl);
   if (rc < 0) {
-int errno_copy = THRIFT_SSL_SOCKET_ERROR_SSL;
+ int errno_copy = THRIFT_SSL_SOCKET_ERROR_SSL;
   }
   SSL_free(THRIFT_SSL_SOCKET(transport)->ssl);
   THRIFT_SSL_SOCKET(transport)->ssl = NULL;
@@ -207,26 +209,26 @@ thrift_ssl_socket_close (ThriftTransport *transport, 
GError **error)
 /* implements thrift_transport_read */
 gint32
 thrift_ssl_socket_read (ThriftTransport *transport, gpointer buf,
-  guint32 len, GError **error)
+   guint32 len, GError **error)
 {
   guint maxRecvRetries_ = 10;
   ThriftSSLSocket *ssl_socket = THRIFT_SSL_SOCKET (transport);
   guint bytes = 0;
   guint retries = 0;
   for (retries=0; retries < maxRecvRetries_; retries++) {
-bytes = SSL_read(ssl_socket->ssl, buf, len);
-if (bytes >= 0)
-  break;
-int errno_copy = THRIFT_GET_SOCKET_ERROR;
-if (SSL_get_error(ssl_socket->ssl, bytes) == SSL_ERROR_SYSCALL) {
-if (ERR_get_error() == 0 && errno_copy == THRIFT_EINTR) {
-  continue;
-}
-}
-g_set_error (error, THRIFT_TRANSPORT_ERROR,
-   THRIFT_TRANSPORT_ERROR_RECEIVE,
-  

thrift git commit: THRIFT-4160: Fix use closed(freed) connections in non-blocking server Client: cpp

2017-04-02 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master df3223c85 -> d4fa706dc


THRIFT-4160: Fix use closed(freed) connections in non-blocking server
Client: cpp

When failing to add tasks into the thread manager, we close the
corresponding connections, then set the flags of these connections,
which have been already freed.

We should decrease the number of active processors.

This closes #1211


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/d4fa706d
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/d4fa706d
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/d4fa706d

Branch: refs/heads/master
Commit: d4fa706dcab91f85153f4243eaa28eb604df1290
Parents: df3223c
Author: Changli Gao 
Authored: Fri Mar 10 13:25:43 2017 +0800
Committer: James E. King, III 
Committed: Sun Apr 2 23:24:54 2017 -0400

--
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/d4fa706d/lib/cpp/src/thrift/server/TNonblockingServer.cpp
--
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index 2cf64f8..c03327d 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -591,21 +591,24 @@ void TNonblockingServer::TConnection::transition() {
   // The application is now waiting on the task to finish
   appState_ = APP_WAIT_TASK;
 
+  // Set this connection idle so that libevent doesn't process more
+  // data on it while we're still waiting for the threadmanager to
+  // finish this task
+  setIdle();
+
   try {
 server_->addTask(task);
   } catch (IllegalStateException& ise) {
 // The ThreadManager is not ready to handle any more tasks (it's 
probably shutting down).
 GlobalOutput.printf("IllegalStateException: Server::process() %s", 
ise.what());
+server_->decrementActiveProcessors();
 close();
   } catch (TimedOutException& to) {
 GlobalOutput.printf("[ERROR] TimedOutException: Server::process() %s", 
to.what());
+server_->decrementActiveProcessors();
 close();
   }
 
-  // Set this connection idle so that libevent doesn't process more
-  // data on it while we're still waiting for the threadmanager to
-  // finish this task
-  setIdle();
   return;
 } else {
   try {



thrift git commit: THRIFT-3859: Add support for Unix Domain Sockets to TSocketServer and TSocketTransport. Client: cocoa

2017-04-02 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 90b630490 -> df3223c85


THRIFT-3859: Add support for Unix Domain Sockets to TSocketServer and 
TSocketTransport.
Client: cocoa

TSocketServer and TSocketTransport have been refactored to support sockets 
created using either a port or a path.
Existing behavior for port-based socket transport is unchanged by this commit.

This closes #1031


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/df3223c8
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/df3223c8
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/df3223c8

Branch: refs/heads/master
Commit: df3223c85db910e55bc1d5237c145ddcde93e664
Parents: 90b6304
Author: Chris Vasselli 
Authored: Tue Jun 21 16:45:39 2016 -0700
Committer: James E. King, III 
Committed: Sun Apr 2 23:14:29 2017 -0400

--
 lib/cocoa/src/server/TSocketServer.h   |   4 +
 lib/cocoa/src/server/TSocketServer.m   | 117 +++-
 lib/cocoa/src/transport/TSocketTransport.h |   2 +
 lib/cocoa/src/transport/TSocketTransport.m |  68 +-
 4 files changed, 165 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/df3223c8/lib/cocoa/src/server/TSocketServer.h
--
diff --git a/lib/cocoa/src/server/TSocketServer.h 
b/lib/cocoa/src/server/TSocketServer.h
index fe657ea..95b0d3c 100644
--- a/lib/cocoa/src/server/TSocketServer.h
+++ b/lib/cocoa/src/server/TSocketServer.h
@@ -41,6 +41,10 @@ extern NSString *const TSockerServerTransportKey;
  protocolFactory:(id )protocolFactory
 processorFactory:(id )processorFactory;
 
+- (instancetype) initWithPath: (NSString *) path
+  protocolFactory: (id ) protocolFactory
+ processorFactory: (id ) processorFactory;
+
 @end
 
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/df3223c8/lib/cocoa/src/server/TSocketServer.m
--
diff --git a/lib/cocoa/src/server/TSocketServer.m 
b/lib/cocoa/src/server/TSocketServer.m
index ccbbba1..09b603c 100644
--- a/lib/cocoa/src/server/TSocketServer.m
+++ b/lib/cocoa/src/server/TSocketServer.m
@@ -25,7 +25,7 @@
 
 #import 
 #include 
-
+#include 
 
 
 NSString *const TSocketServerClientConnectionFinished = 
@"TSocketServerClientConnectionFinished";
@@ -40,13 +40,14 @@ NSString *const TSockerServerTransportKey = 
@"TSockerServerTransport";
 @property(strong, nonatomic) id processorFactory;
 @property(strong, nonatomic) NSFileHandle *socketFileHandle;
 @property(strong, nonatomic) dispatch_queue_t processingQueue;
+@property(strong, nonatomic) NSString *domainSocketPath;
 
 @end
 
 
 @implementation TSocketServer
 
--(instancetype) initWithPort:(int)port
+-(instancetype) initWithSocket:(CFSocketRef)socket
  protocolFactory:(id )protocolFactory
 processorFactory:(id )processorFactory;
 {
@@ -62,11 +63,50 @@ NSString *const TSockerServerTransportKey = 
@"TSockerServerTransport";
   _processingQueue = dispatch_queue_create("TSocketServer.processing", 
processingQueueAttr);
 
   // create a socket.
-  int fd = -1;
+  int fd = CFSocketGetNative(socket);
+
+  // wrap it in a file handle so we can get messages from it
+  _socketFileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fd
+closeOnDealloc:YES];
+
+  // throw away our socket
+  CFSocketInvalidate(socket);
+  CFRelease(socket);
+
+  // register for notifications of accepted incoming connections
+  [[NSNotificationCenter defaultCenter] addObserver:self
+   
selector:@selector(connectionAccepted:)
+   
name:NSFileHandleConnectionAcceptedNotification
+ object:_socketFileHandle];
+
+  // tell socket to listen
+  [_socketFileHandle acceptConnectionInBackgroundAndNotify];
+
+  return self;
+}
+
+- (id) initWithPort: (int) port
+protocolFactory: (id ) protocolFactory
+   processorFactory: (id ) processorFactory
+{
+  CFSocketRef socket = [[self class] createSocketWithPort:port];
+  if (socket == NULL) {
+return nil;
+  }
+
+  if (self = [self initWithSocket:socket protocolFactory:protocolFactory 
processorFactory:processorFactory]) {
+NSLog(@"TSocketServer: Listening on TCP port %d", port);
+  }
+  return self;
+}
+
+
++(CFSocketRef) createSocketWithPort:(int)port
+{
   CFSocketRef socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, 
SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL);
   if (socket) {
 CFSocketSetSocketFlags(socket, CFSocketGetSocketFlags(socket) & 
~kCFSocketCloseOnInvalidate);
-fd = 

thrift git commit: THRIFT-4161: TNonblockingServer: Fix using uninitialized event_ Client: cpp

2017-04-02 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master d4fa706dc -> bf42d5518


THRIFT-4161: TNonblockingServer: Fix using uninitialized event_
Client: cpp

When there are more than one IO threads, and we have failed to notify
one IO threads, then we have to close the connection. But the event_
in that connection isn't initialized. We should use setIdle() instead.

This closes #1216


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bf42d551
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bf42d551
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bf42d551

Branch: refs/heads/master
Commit: bf42d55189d9d8160a061cc3a7020324111942bb
Parents: d4fa706
Author: Changli Gao 
Authored: Mon Mar 20 14:29:07 2017 +0800
Committer: James E. King, III 
Committed: Sun Apr 2 23:30:04 2017 -0400

--
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/bf42d551/lib/cpp/src/thrift/server/TNonblockingServer.cpp
--
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index c03327d..905c5d2 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -821,10 +821,7 @@ void TNonblockingServer::TConnection::setFlags(short 
eventFlags) {
  * Closes a connection
  */
 void TNonblockingServer::TConnection::close() {
-  if (eventFlags_ && event_del(_) == -1) {
-GlobalOutput.perror("TConnection::close() event_del", 
THRIFT_GET_SOCKET_ERROR);
-return;
-  }
+  setIdle();
 
   if (serverEventHandler_) {
 serverEventHandler_->deleteContext(connectionContext_, inputProtocol_, 
outputProtocol_);



thrift git commit: TSocket: Don't close connections when failing to read/write Client: cpp

2017-04-02 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master bf42d5518 -> 7e7a1a7c1


TSocket: Don't close connections when failing to read/write
Client: cpp

Sockets maybe registered to a event base of libevent, so the
following epoll_ctl(2) may fail due to EBADF, or may
delete other sockets. Chaos occurs.

This closes #1217


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7e7a1a7c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7e7a1a7c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7e7a1a7c

Branch: refs/heads/master
Commit: 7e7a1a7c1027d30294da24e5d3f299ff90313c34
Parents: bf42d55
Author: Changli Gao 
Authored: Mon Mar 20 14:36:57 2017 +0800
Committer: James E. King, III 
Committed: Sun Apr 2 23:37:14 2017 -0400

--
 lib/cpp/src/thrift/transport/TSocket.cpp | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/7e7a1a7c/lib/cpp/src/thrift/transport/TSocket.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp 
b/lib/cpp/src/thrift/transport/TSocket.cpp
index 21a9aca..8f0f06c 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -217,7 +217,6 @@ bool TSocket::peek() {
  * the other side
  */
 if (errno_copy == THRIFT_ECONNRESET) {
-  close();
   return false;
 }
 #endif
@@ -653,7 +652,6 @@ uint32_t TSocket::write_partial(const uint8_t* buf, 
uint32_t len) {
 
 if (errno_copy == THRIFT_EPIPE || errno_copy == THRIFT_ECONNRESET
 || errno_copy == THRIFT_ENOTCONN) {
-  close();
   throw TTransportException(TTransportException::NOT_OPEN, "write() 
send()", errno_copy);
 }
 



thrift git commit: THRIFT-4159: enable some Windows sources also on MSYS2

2017-04-07 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 92e1c409c -> 3db41faf4


THRIFT-4159: enable some Windows sources also on MSYS2

This closes #1248


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/3db41faf
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/3db41faf
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/3db41faf

Branch: refs/heads/master
Commit: 3db41faf4e607e52960c6265161ac8808a24c113
Parents: 92e1c40
Author: Mario Emmenlauer 
Authored: Fri Apr 7 23:24:07 2017 +0200
Committer: James E. King, III 
Committed: Sat Apr 8 00:31:35 2017 -0400

--
 lib/cpp/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/3db41faf/lib/cpp/CMakeLists.txt
--
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index 9a1ef10..59da346 100755
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -57,7 +57,7 @@ set( thriftcpp_SOURCES
src/thrift/server/TThreadedServer.cpp
 )
 
-# This files don't work on Windows CE as there is no pipe support
+# These files don't work on Windows CE as there is no pipe support
 # TODO: These files won't work with UNICODE support on windows. If fixed this 
can be re-added.
 if (NOT WINCE)
 list(APPEND thriftcpp_SOURCES
@@ -68,7 +68,7 @@ if (NOT WINCE)
 endif()
 
 
-if (WIN32 AND NOT MSYS)
+if (WIN32)
 list(APPEND thriftcpp_SOURCES
 src/thrift/windows/TWinsockSingleton.cpp
 src/thrift/windows/SocketPair.cpp



thrift git commit: THRIFT-4160 (pt. 2): Fix wrong numActiveProcessors_ when failing to notify any IO thread Client: cpp

2017-04-05 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 43e959bc5 -> 257dceff5


THRIFT-4160 (pt. 2): Fix wrong numActiveProcessors_ when failing to notify any 
IO thread
Client: cpp

This closes #1239
We should decrease numActiveProcessors_ when failing to notify any
IO thread.


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/257dceff
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/257dceff
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/257dceff

Branch: refs/heads/master
Commit: 257dceff5ebeb083ecf5527d80e37aa9706e2d75
Parents: 43e959b
Author: Changli Gao 
Authored: Thu Apr 6 00:42:01 2017 +0800
Committer: James E. King, III 
Committed: Wed Apr 5 19:29:24 2017 -0400

--
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/257dceff/lib/cpp/src/thrift/server/TNonblockingServer.cpp
--
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index 905c5d2..97c4cd9 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -288,6 +288,7 @@ public:
   void forceClose() {
 appState_ = APP_CLOSE_CONNECTION;
 if (!notifyIOThread()) {
+  server_->decrementActiveProcessors();
   close();
   throw TException("TConnection::forceClose: failed write on notify pipe");
 }
@@ -349,6 +350,7 @@ public:
 // Signal completion back to the libevent thread via a pipe
 if (!connection_->notifyIOThread()) {
   GlobalOutput.printf("TNonblockingServer: failed to notifyIOThread, 
closing.");
+  connection_->server_->decrementActiveProcessors();
   connection_->close();
   throw TException("TNonblockingServer::Task::run: failed write on notify 
pipe");
 }



thrift git commit: THRIFT-4071: collapse and remove unnecessary build jobs in Travis CI; ensure WITH_PLUGIN is tested somewhere

2017-04-05 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 257dceff5 -> 4eb23472b


THRIFT-4071: collapse and remove unnecessary build jobs in Travis CI; ensure 
WITH_PLUGIN is tested somewhere

This closes #1238


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/4eb23472
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/4eb23472
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/4eb23472

Branch: refs/heads/master
Commit: 4eb23472b76759843b802bb222d308d408475ab0
Parents: 257dcef
Author: James E. King, III 
Authored: Wed Apr 5 19:32:27 2017 -0400
Committer: James E. King, III 
Committed: Wed Apr 5 19:32:27 2017 -0400

--
 .travis.yml | 42 +++---
 1 file changed, 7 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/4eb23472/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 10c6fd0..a664263 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,46 +47,27 @@ env:
   BUILD_ARG="-'(binary|header|multiplexed)'"
   BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
 
-- TEST_NAME="Cross Language Tests (Debian) (Binary, Header, Multiplexed 
Protocols)"
-  SCRIPT="cross-test.sh"
-  BUILD_ARG="-'(binary|header|multiplexed)'"
-  BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
-  DISTRO=debian
-
 - TEST_NAME="Cross Language Tests (Compact and JSON Protocols)"
   SCRIPT="cross-test.sh"
   BUILD_ARG="-'(compact|json)'"
   BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
 
-- TEST_NAME="Cross Language Tests (Debian) (Compact and JSON Protocols)"
-  SCRIPT="cross-test.sh"
-  BUILD_ARG="-'(compact|json)'"
-  BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
-  DISTRO=debian
-
 # TODO: Remove them once migrated to CMake
 # Autotools builds
 - TEST_NAME="C C++ C# D Erlang Haxe Go (automake)"
   SCRIPT="autotools.sh"
   BUILD_ARG="--without-dart --without-haskell --without-java --without-lua 
--without-nodejs --without-perl --without-php --without-php_extension 
--without-python --without-ruby"
 
-- TEST_NAME="C C++ - GCC (automake)"
+- TEST_NAME="C C++ Plugin - GCC (automake)"
   SCRIPT="autotools.sh"
-  BUILD_ARG="--without-csharp --without-java --without-erlang 
--without-nodejs --without-lua --without-python --without-perl --without-php 
--without-php_extension --without-dart --without-ruby --without-haskell 
--without-go --without-haxe --without-d"
+  BUILD_ARG="--enable-plugin --without-csharp --without-java 
--without-erlang --without-nodejs --without-lua --without-python --without-perl 
--without-php --without-php_extension --without-dart --without-ruby 
--without-haskell --without-go --without-haxe --without-d"
   BUILD_ENV="-e CC=gcc -e CXX=g++"
 
-- TEST_NAME="Java Lua PHP Ruby Dart (automake)"
+- TEST_NAME="Java Lua PHP Ruby Dart Haskell Node.js Python Perl (automake)"
   SCRIPT="autotools.sh"
-  BUILD_ARG="--without-cpp --without-haskell --without-c_glib 
--without-csharp --without-d --without-erlang --without-go --without-haxe 
--without-nodejs --without-python --without-perl"
-
-# These are flaky (due to cabal and npm network/server failures) and also 
have lengthy output
-- TEST_NAME="Haskell Node.js Python Perl (automake)"
-  SCRIPT="autotools.sh"
-  BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d 
--without-dart --without-erlang --without-go --without-haxe --without-java 
--without-lua --without-php --without-php_extension --without-ruby"
-
-# CMake build
-- TEST_NAME="All"
+  BUILD_ARG="--without-cpp --without-c_glib --without-csharp --without-d 
--without-erlang --without-go --without-haxe"
 
+# CMake builds
 - TEST_NAME="All (Debian)"
   DISTRO=debian
 
@@ -95,23 +76,14 @@ env:
   BUILD_ARG="-DWITH_PYTHON=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
   BUILD_ENV="-e CC=gcc -e CXX=g++"
 
-- TEST_NAME="C++ (Boost Thread)"
-  BUILD_LIBS="CPP TESTING TUTORIALS"
-  BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF 
-DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
-
 - TEST_NAME="C++ (Boost Thread - GCC)"
   BUILD_LIBS="CPP TESTING TUTORIALS"
   BUILD_ARG="-DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF 
-DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
   BUILD_ENV="-e CC=gcc -e CXX=g++"
 
-- TEST_NAME="C++ (Std Thread)"
-  BUILD_LIBS="CPP TESTING TUTORIALS"
-  BUILD_ARG="-DWITH_STDTHREADS=ON -DCMAKE_CXX_FLAGS='-std=c++11' 
-DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"

thrift git commit: THRIFT-4172: fix node.js tutorial when connection fails Client: node.js Patch: Eden Hochbaum <eden.hochb...@gmail.com>

2017-04-06 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master b909a3897 -> f74943cf6


THRIFT-4172: fix node.js tutorial when connection fails
Client: node.js
Patch: Eden Hochbaum 

This closes #1037
This closes #1244


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/f74943cf
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/f74943cf
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/f74943cf

Branch: refs/heads/master
Commit: f74943cf6e9384e91a1085daf80c78b148f8ebe5
Parents: b909a38
Author: James E. King, III 
Authored: Thu Apr 6 21:04:56 2017 -0400
Committer: James E. King, III 
Committed: Thu Apr 6 21:04:56 2017 -0400

--
 tutorial/nodejs/NodeClient.js| 2 +-
 tutorial/nodejs/NodeClientPromise.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/thrift/blob/f74943cf/tutorial/nodejs/NodeClient.js
--
diff --git a/tutorial/nodejs/NodeClient.js b/tutorial/nodejs/NodeClient.js
index 130ba57..b4886e8 100644
--- a/tutorial/nodejs/NodeClient.js
+++ b/tutorial/nodejs/NodeClient.js
@@ -20,7 +20,7 @@
 var thrift = require('thrift');
 var Calculator = require('./gen-nodejs/Calculator');
 var ttypes = require('./gen-nodejs/tutorial_types');
-
+const assert = require('assert');
 
 var transport = thrift.TBufferedTransport;
 var protocol = thrift.TBinaryProtocol;

http://git-wip-us.apache.org/repos/asf/thrift/blob/f74943cf/tutorial/nodejs/NodeClientPromise.js
--
diff --git a/tutorial/nodejs/NodeClientPromise.js 
b/tutorial/nodejs/NodeClientPromise.js
index fac12ba..2cdc184 100644
--- a/tutorial/nodejs/NodeClientPromise.js
+++ b/tutorial/nodejs/NodeClientPromise.js
@@ -20,7 +20,7 @@
 var thrift = require('thrift');
 var Calculator = require('./gen-nodejs/Calculator');
 var ttypes = require('./gen-nodejs/tutorial_types');
-
+const assert = require('assert');
 
 var transport = thrift.TBufferedTransport;
 var protocol = thrift.TBinaryProtocol;



[2/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/test/TServerIntegrationTest.cpp
--
diff --git a/lib/cpp/test/TServerIntegrationTest.cpp 
b/lib/cpp/test/TServerIntegrationTest.cpp
index fd7bae2..a6e02f1 100644
--- a/lib/cpp/test/TServerIntegrationTest.cpp
+++ b/lib/cpp/test/TServerIntegrationTest.cpp
@@ -20,16 +20,14 @@
 #define BOOST_TEST_MODULE TServerIntegrationTest
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,6 +55,9 @@ using apache::thrift::server::TServerEventHandler;
 using apache::thrift::server::TSimpleServer;
 using apache::thrift::server::TThreadPoolServer;
 using apache::thrift::server::TThreadedServer;
+using apache::thrift::stdcxx::dynamic_pointer_cast;
+using apache::thrift::stdcxx::make_shared;
+using apache::thrift::stdcxx::shared_ptr;
 using apache::thrift::test::ParentServiceClient;
 using apache::thrift::test::ParentServiceIf;
 using apache::thrift::test::ParentServiceIfFactory;
@@ -79,8 +80,8 @@ public:
 isListening_ = true;
 notify();
   }
-  virtual void* createContext(boost::shared_ptr input,
-  boost::shared_ptr output) {
+  virtual void* createContext(shared_ptr input,
+  shared_ptr output) {
 Synchronized sync(*this);
 ++accepted_;
 notify();
@@ -149,26 +150,26 @@ void autoSocketCloser(TSocket* pSock) {
 template 
 class TServerIntegrationTestFixture {
 public:
-  TServerIntegrationTestFixture(const boost::shared_ptr& 
_processorFactory)
+  TServerIntegrationTestFixture(const shared_ptr& 
_processorFactory)
 : pServer(new TServerType(_processorFactory,
-  boost::shared_ptr(
+  shared_ptr(
   new TServerSocket("localhost", 0)),
-  boost::shared_ptr(new 
TTransportFactory),
-  boost::shared_ptr(new 
TBinaryProtocolFactory))),
-  pEventHandler(boost::shared_ptr(new 
TServerReadyEventHandler)),
+  shared_ptr(new 
TTransportFactory),
+  shared_ptr(new 
TBinaryProtocolFactory))),
+  pEventHandler(shared_ptr(new 
TServerReadyEventHandler)),
 bStressDone(false),
 bStressConnectionCount(0),
 bStressRequestCount(0) {
 pServer->setServerEventHandler(pEventHandler);
   }
 
-  TServerIntegrationTestFixture(const boost::shared_ptr& 
_processor)
+  TServerIntegrationTestFixture(const shared_ptr& _processor)
 : pServer(
   new TServerType(_processor,
-  boost::shared_ptr(new 
TServerSocket("localhost", 0)),
-  boost::shared_ptr(new 
TTransportFactory),
-  boost::shared_ptr(new 
TBinaryProtocolFactory))),
-  pEventHandler(boost::shared_ptr(new 
TServerReadyEventHandler)),
+  shared_ptr(new 
TServerSocket("localhost", 0)),
+  shared_ptr(new TTransportFactory),
+  shared_ptr(new 
TBinaryProtocolFactory))),
+  pEventHandler(shared_ptr(new 
TServerReadyEventHandler)),
   bStressDone(false),
 bStressConnectionCount(0),
 bStressRequestCount(0) {
@@ -176,7 +177,7 @@ public:
   }
 
   void startServer() {
-pServerThread.reset(new boost::thread(boost::bind(::serve, 
pServer.get(;
+pServerThread.reset(new 
boost::thread(apache::thrift::stdcxx::bind(::serve, 
pServer.get(;
 
 // block until listen() completes so clients will be able to connect
 Synchronized sync(*(pEventHandler.get()));
@@ -222,19 +223,19 @@ public:
 
 startServer();
 
-std::vector holdSockets;
-std::vector holdThreads;
+std::vector holdSockets;
+std::vector holdThreads;
 
 for (int64_t i = 0; i < numToMake; ++i) {
-  boost::shared_ptr pClientSock(new TSocket("localhost", 
getServerPort()),
+  shared_ptr pClientSock(new TSocket("localhost", 
getServerPort()),
  autoSocketCloser);
   holdSockets.push_back(pClientSock);
-  boost::shared_ptr pClientProtocol(new 
TBinaryProtocol(pClientSock));
+  shared_ptr pClientProtocol(new TBinaryProtocol(pClientSock));
   ParentServiceClient client(pClientProtocol);
   pClientSock->open();
   client.incrementGeneration();
-  holdThreads.push_back(boost::shared_ptr(
-  new 
boost::thread(boost::bind(::delayClose,
+  holdThreads.push_back(shared_ptr(
+  new 
boost::thread(apache::thrift::stdcxx::bind(::delayClose,
 this,
 pClientSock,
 milliseconds(10 * numToMake);
@@ -242,7 +243,7 @@ 

[6/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
THRIFT-2221: detect C++11 and use std namespace for memory operations 
(smart_ptr)
Client: C++

This closes #1328


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/82ae9575
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/82ae9575
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/82ae9575

Branch: refs/heads/master
Commit: 82ae9575cdc112088771fc7b876f75e1e4d85ebb
Parents: 0a8c34c
Author: James E. King, III 
Authored: Sat Aug 5 12:23:54 2017 -0400
Committer: James E. King, III 
Committed: Thu Aug 10 13:27:21 2017 -0400

--
 appveyor.yml|   8 +-
 build/appveyor/MSVC-appveyor-build.bat  |   2 +
 build/cmake/DefineCMakeDefaults.cmake   |  12 +-
 build/cmake/DefineOptions.cmake |  12 ++
 build/cmake/DefinePlatformSpecifc.cmake |  15 +-
 build/cmake/NewPlatformDebug.cmake  |   1 +
 .../cpp/src/thrift/generate/t_cpp_generator.cc  | 118 ++--
 compiler/cpp/src/thrift/plugin/plugin.cc|  30 ++--
 compiler/cpp/src/thrift/plugin/plugin_output.cc |   8 +-
 lib/c_glib/test/testthrifttestclient.cpp|  37 ++--
 lib/cpp/Makefile.am |   4 +-
 lib/cpp/README.md   |  31 ++--
 lib/cpp/src/thrift/TDispatchProcessor.h |   8 +-
 lib/cpp/src/thrift/TProcessor.h |  34 ++--
 .../src/thrift/async/TAsyncBufferProcessor.h|  10 +-
 lib/cpp/src/thrift/async/TAsyncChannel.cpp  |   2 +-
 lib/cpp/src/thrift/async/TAsyncChannel.h|   2 +-
 .../src/thrift/async/TAsyncDispatchProcessor.h  |   8 +-
 lib/cpp/src/thrift/async/TAsyncProcessor.h  |  24 ++-
 .../thrift/async/TAsyncProtocolProcessor.cpp|  10 +-
 .../src/thrift/async/TAsyncProtocolProcessor.h  |  14 +-
 .../thrift/async/TConcurrentClientSyncInfo.h|   4 +-
 lib/cpp/src/thrift/async/TEvhttpClientChannel.h |   2 +-
 lib/cpp/src/thrift/async/TEvhttpServer.cpp  |  14 +-
 lib/cpp/src/thrift/async/TEvhttpServer.h|   8 +-
 lib/cpp/src/thrift/concurrency/BoostMonitor.cpp |   6 +-
 .../thrift/concurrency/BoostThreadFactory.cpp   |  17 +-
 .../src/thrift/concurrency/BoostThreadFactory.h |   9 +-
 lib/cpp/src/thrift/concurrency/FunctionRunner.h |  16 +-
 lib/cpp/src/thrift/concurrency/Monitor.cpp  |   9 +-
 lib/cpp/src/thrift/concurrency/Mutex.cpp|   2 -
 lib/cpp/src/thrift/concurrency/Mutex.h  |   6 +-
 .../thrift/concurrency/PosixThreadFactory.cpp   |  29 ++-
 .../src/thrift/concurrency/PosixThreadFactory.h |  10 +-
 .../src/thrift/concurrency/StdThreadFactory.cpp |  22 ++-
 .../src/thrift/concurrency/StdThreadFactory.h   |   8 +-
 lib/cpp/src/thrift/concurrency/Thread.h |  17 +-
 .../src/thrift/concurrency/ThreadManager.cpp|  10 +-
 lib/cpp/src/thrift/concurrency/ThreadManager.h  |  19 +-
 lib/cpp/src/thrift/concurrency/TimerManager.cpp |   2 +-
 lib/cpp/src/thrift/concurrency/TimerManager.h   |  24 +--
 lib/cpp/src/thrift/cxxfunctional.h  | 132 --
 lib/cpp/src/thrift/processor/PeekProcessor.cpp  |  26 +--
 lib/cpp/src/thrift/processor/PeekProcessor.h|  30 ++--
 lib/cpp/src/thrift/processor/StatsProcessor.h   |   8 +-
 .../thrift/processor/TMultiplexedProcessor.h|   2 +-
 lib/cpp/src/thrift/protocol/TBinaryProtocol.h   |  12 +-
 lib/cpp/src/thrift/protocol/TCompactProtocol.h  |  12 +-
 lib/cpp/src/thrift/protocol/TDebugProtocol.h|  12 +-
 lib/cpp/src/thrift/protocol/THeaderProtocol.cpp |   6 +-
 lib/cpp/src/thrift/protocol/THeaderProtocol.h   |  34 ++--
 lib/cpp/src/thrift/protocol/TJSONProtocol.cpp   |  12 +-
 lib/cpp/src/thrift/protocol/TJSONProtocol.h |  14 +-
 .../src/thrift/protocol/TMultiplexedProtocol.h  |   2 +-
 lib/cpp/src/thrift/protocol/TProtocol.h |  18 +-
 .../src/thrift/protocol/TProtocolDecorator.h|   4 +-
 lib/cpp/src/thrift/protocol/TProtocolTap.h  |   6 +-
 lib/cpp/src/thrift/protocol/TVirtualProtocol.h  |   4 +-
 lib/cpp/src/thrift/qt/TQIODeviceTransport.cpp   |   6 +-
 lib/cpp/src/thrift/qt/TQIODeviceTransport.h |   6 +-
 lib/cpp/src/thrift/qt/TQTcpServer.cpp   |   9 +-
 lib/cpp/src/thrift/qt/TQTcpServer.h |  18 +-
 lib/cpp/src/thrift/server/TConnectedClient.cpp  |   2 +-
 lib/cpp/src/thrift/server/TConnectedClient.h|  22 +--
 .../src/thrift/server/TNonblockingServer.cpp|  64 +++
 lib/cpp/src/thrift/server/TNonblockingServer.h  |  94 +-
 lib/cpp/src/thrift/server/TServer.h | 140 +++
 lib/cpp/src/thrift/server/TServerFramework.cpp  |  13 +-
 lib/cpp/src/thrift/server/TServerFramework.h|  46 ++---
 lib/cpp/src/thrift/server/TSimpleServer.cpp |   2 +-
 lib/cpp/src/thrift/server/TSimpleServer.h   |  42 ++---
 lib/cpp/src/thrift/server/TThreadPoolServer.cpp |   4 +-
 

[5/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
index 6a0b47c..6bf043b 100644
--- a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
@@ -31,15 +31,12 @@
 
 #include 
 
-#include 
+#include 
 
 namespace apache {
 namespace thrift {
 namespace concurrency {
 
-using boost::shared_ptr;
-using boost::weak_ptr;
-
 /**
  * The POSIX thread class.
  *
@@ -59,7 +56,7 @@ private:
   int policy_;
   int priority_;
   int stackSize_;
-  weak_ptr self_;
+  stdcxx::weak_ptr self_;
   bool detached_;
 
 public:
@@ -67,7 +64,7 @@ public:
 int priority,
 int stackSize,
 bool detached,
-shared_ptr runnable)
+stdcxx::shared_ptr runnable)
 :
 
 #ifndef _WIN32
@@ -139,7 +136,7 @@ public:
 }
 
 // Create reference
-shared_ptr* selfRef = new shared_ptr();
+stdcxx::shared_ptr* selfRef = new 
stdcxx::shared_ptr();
 *selfRef = self_.lock();
 
 state_ = starting;
@@ -178,19 +175,19 @@ public:
 #endif // _WIN32
   }
 
-  shared_ptr runnable() const { return Thread::runnable(); }
+  stdcxx::shared_ptr runnable() const { return Thread::runnable(); }
 
-  void runnable(shared_ptr value) { Thread::runnable(value); }
+  void runnable(stdcxx::shared_ptr value) { Thread::runnable(value); 
}
 
-  void weakRef(shared_ptr self) {
+  void weakRef(stdcxx::shared_ptr self) {
 assert(self.get() == this);
-self_ = weak_ptr(self);
+self_ = stdcxx::weak_ptr(self);
   }
 };
 
 void* PthreadThread::threadMain(void* arg) {
-  shared_ptr thread = *(shared_ptr*)arg;
-  delete reinterpret_cast(arg);
+  stdcxx::shared_ptr thread = 
*(stdcxx::shared_ptr*)arg;
+  delete reinterpret_cast(arg);
 
   if (thread == NULL) {
 return (void*)0;
@@ -276,9 +273,9 @@ PosixThreadFactory::PosixThreadFactory(bool detached)
 stackSize_(1) {
 }
 
-shared_ptr PosixThreadFactory::newThread(shared_ptr 
runnable) const {
-  shared_ptr result
-  = shared_ptr(new PthreadThread(toPthreadPolicy(policy_),
+stdcxx::shared_ptr 
PosixThreadFactory::newThread(stdcxx::shared_ptr runnable) const {
+  stdcxx::shared_ptr result
+  = stdcxx::shared_ptr(new 
PthreadThread(toPthreadPolicy(policy_),
 toPthreadPriority(policy_, 
priority_),
 stackSize_,
 isDetached(),

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
--
diff --git a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h 
b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
index c1bbe5c..5e04d01 100644
--- a/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
+++ b/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
@@ -22,7 +22,7 @@
 
 #include 
 
-#include 
+#include 
 
 namespace apache {
 namespace thrift {
@@ -63,9 +63,9 @@ public:
 
   /**
* Posix thread (pthread) factory.  All threads created by a factory are 
reference-counted
-   * via boost::shared_ptr and boost::weak_ptr.  The factory guarantees that 
threads and
-   * the Runnable tasks they host will be properly cleaned up once the last 
strong reference
-   * to both is given up.
+   * via stdcxx::shared_ptr.  The factory guarantees that threads and the 
Runnable tasks 
+   * they host will be properly cleaned up once the last strong reference to 
both is
+   * given up.
*
* Threads are created with the specified policy, priority, stack-size and 
detachable-mode
* detached means the thread is free-running and will release all system 
resources the
@@ -88,7 +88,7 @@ public:
   PosixThreadFactory(bool detached);
 
   // From ThreadFactory;
-  boost::shared_ptr newThread(boost::shared_ptr runnable) 
const;
+  stdcxx::shared_ptr newThread(stdcxx::shared_ptr runnable) 
const;
 
   // From ThreadFactory;
   Thread::id_t getCurrentThreadId() const;

http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
--
diff --git a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp 
b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
index 4fca8da..4067f24 100644
--- a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
+++ b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
@@ -23,11 +23,9 @@
 
 #include 
 #include 
+#include 
 
 #include 
-
-#include 
-#include 
 #include 
 
 namespace apache {
@@ -43,11 +41,11 @@ namespace concurrency {
  *
  * @version $Id:$
  */
-class 

[3/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/src/thrift/transport/TSSLSocket.cpp
--
diff --git a/lib/cpp/src/thrift/transport/TSSLSocket.cpp 
b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
index e8f38dd..d8b16e1 100644
--- a/lib/cpp/src/thrift/transport/TSSLSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSSLSocket.cpp
@@ -52,8 +52,8 @@
 #include 
 #include 
 
-using namespace std;
 using namespace apache::thrift::concurrency;
+using std::string;
 
 struct CRYPTO_dynlock_value {
   Mutex mutex;
@@ -212,33 +212,33 @@ SSL* SSLContext::createSSL() {
 }
 
 // TSSLSocket implementation
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx)
   : TSocket(), server_(false), ssl_(NULL), ctx_(ctx) {
   init();
 }
 
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx, 
boost::shared_ptr interruptListener)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx, 
stdcxx::shared_ptr interruptListener)
 : TSocket(), server_(false), ssl_(NULL), ctx_(ctx) {
   init();
   interruptListener_ = interruptListener;
 }
 
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx, THRIFT_SOCKET socket)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx, THRIFT_SOCKET 
socket)
   : TSocket(socket), server_(false), ssl_(NULL), ctx_(ctx) {
   init();
 }
 
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx, THRIFT_SOCKET 
socket, boost::shared_ptr interruptListener)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx, THRIFT_SOCKET 
socket, stdcxx::shared_ptr interruptListener)
 : TSocket(socket, interruptListener), server_(false), ssl_(NULL), 
ctx_(ctx) {
   init();
 }
 
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx, string host, int 
port)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx, string host, int 
port)
   : TSocket(host, port), server_(false), ssl_(NULL), ctx_(ctx) {
   init();
 }
 
-TSSLSocket::TSSLSocket(boost::shared_ptr ctx, string host, int 
port, boost::shared_ptr interruptListener)
+TSSLSocket::TSSLSocket(stdcxx::shared_ptr ctx, string host, int 
port, stdcxx::shared_ptr interruptListener)
 : TSocket(host, port), server_(false), ssl_(NULL), ctx_(ctx) {
   init();
   interruptListener_ = interruptListener;
@@ -807,7 +807,7 @@ TSSLSocketFactory::TSSLSocketFactory(SSLProtocol protocol) 
: server_(false) {
 randomize();
   }
   count_++;
-  ctx_ = boost::shared_ptr(new SSLContext(protocol));
+  ctx_ = stdcxx::shared_ptr(new SSLContext(protocol));
 }
 
 TSSLSocketFactory::~TSSLSocketFactory() {
@@ -819,47 +819,47 @@ TSSLSocketFactory::~TSSLSocketFactory() {
   }
 }
 
-boost::shared_ptr TSSLSocketFactory::createSocket() {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_));
+stdcxx::shared_ptr TSSLSocketFactory::createSocket() {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_));
   setup(ssl);
   return ssl;
 }
 
-boost::shared_ptr 
TSSLSocketFactory::createSocket(boost::shared_ptr 
interruptListener) {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_, interruptListener));
+stdcxx::shared_ptr 
TSSLSocketFactory::createSocket(stdcxx::shared_ptr 
interruptListener) {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_, interruptListener));
   setup(ssl);
   return ssl;
 }
 
-boost::shared_ptr TSSLSocketFactory::createSocket(THRIFT_SOCKET 
socket) {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_, socket));
+stdcxx::shared_ptr TSSLSocketFactory::createSocket(THRIFT_SOCKET 
socket) {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_, socket));
   setup(ssl);
   return ssl;
 }
 
-boost::shared_ptr TSSLSocketFactory::createSocket(THRIFT_SOCKET 
socket, boost::shared_ptr interruptListener) {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_, socket, 
interruptListener));
+stdcxx::shared_ptr TSSLSocketFactory::createSocket(THRIFT_SOCKET 
socket, stdcxx::shared_ptr interruptListener) {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_, socket, 
interruptListener));
   setup(ssl);
   return ssl;
 }
 
-boost::shared_ptr TSSLSocketFactory::createSocket(const string& 
host, int port) {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_, host, port));
+stdcxx::shared_ptr TSSLSocketFactory::createSocket(const string& 
host, int port) {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_, host, port));
   setup(ssl);
   return ssl;
 }
 
-boost::shared_ptr TSSLSocketFactory::createSocket(const string& 
host, int port, boost::shared_ptr interruptListener) {
-  boost::shared_ptr ssl(new TSSLSocket(ctx_, host, port, 
interruptListener));
+stdcxx::shared_ptr TSSLSocketFactory::createSocket(const string& 
host, int port, stdcxx::shared_ptr interruptListener) {
+  stdcxx::shared_ptr ssl(new TSSLSocket(ctx_, host, port, 
interruptListener));
   setup(ssl);
   return ssl;
 }
 
 
-void TSSLSocketFactory::setup(boost::shared_ptr ssl) {
+void TSSLSocketFactory::setup(stdcxx::shared_ptr ssl) {
   ssl->server(server());
   if (access_ == NULL && !server()) {
-access_ = boost::shared_ptr(new DefaultClientAccessManager);
+access_ = stdcxx::shared_ptr(new 

[4/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/lib/cpp/src/thrift/server/TServer.h
--
diff --git a/lib/cpp/src/thrift/server/TServer.h 
b/lib/cpp/src/thrift/server/TServer.h
index 47e0d40..f4cd7bc 100644
--- a/lib/cpp/src/thrift/server/TServer.h
+++ b/lib/cpp/src/thrift/server/TServer.h
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 namespace apache {
 namespace thrift {
@@ -58,8 +58,8 @@ public:
   /**
* Called when a new client has connected and is about to being processing.
*/
-  virtual void* createContext(boost::shared_ptr input,
-  boost::shared_ptr output) {
+  virtual void* createContext(stdcxx::shared_ptr input,
+  stdcxx::shared_ptr output) {
 (void)input;
 (void)output;
 return NULL;
@@ -70,8 +70,8 @@ public:
* context.
*/
   virtual void deleteContext(void* serverContext,
- boost::shared_ptr input,
- boost::shared_ptr output) {
+ stdcxx::shared_ptr input,
+ stdcxx::shared_ptr output) {
 (void)serverContext;
 (void)input;
 (void)output;
@@ -80,7 +80,7 @@ public:
   /**
* Called when a client is about to call the processor.
*/
-  virtual void processContext(void* serverContext, 
boost::shared_ptr transport) {
+  virtual void processContext(void* serverContext, 
stdcxx::shared_ptr transport) {
 (void)serverContext;
 (void)transport;
   }
@@ -107,62 +107,62 @@ public:
   // Allows running the server as a Runnable thread
   virtual void run() { serve(); }
 
-  boost::shared_ptr getProcessorFactory() { return 
processorFactory_; }
+  stdcxx::shared_ptr getProcessorFactory() { return 
processorFactory_; }
 
-  boost::shared_ptr getServerTransport() { return 
serverTransport_; }
+  stdcxx::shared_ptr getServerTransport() { return 
serverTransport_; }
 
-  boost::shared_ptr getInputTransportFactory() { return 
inputTransportFactory_; }
+  stdcxx::shared_ptr getInputTransportFactory() { return 
inputTransportFactory_; }
 
-  boost::shared_ptr getOutputTransportFactory() {
+  stdcxx::shared_ptr getOutputTransportFactory() {
 return outputTransportFactory_;
   }
 
-  boost::shared_ptr getInputProtocolFactory() { return 
inputProtocolFactory_; }
+  stdcxx::shared_ptr getInputProtocolFactory() { return 
inputProtocolFactory_; }
 
-  boost::shared_ptr getOutputProtocolFactory() { return 
outputProtocolFactory_; }
+  stdcxx::shared_ptr getOutputProtocolFactory() { return 
outputProtocolFactory_; }
 
-  boost::shared_ptr getEventHandler() { return 
eventHandler_; }
+  stdcxx::shared_ptr getEventHandler() { return 
eventHandler_; }
 
 protected:
-  TServer(const boost::shared_ptr& processorFactory)
+  TServer(const stdcxx::shared_ptr& processorFactory)
 : processorFactory_(processorFactory) {
-setInputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setOutputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setInputProtocolFactory(boost::shared_ptr(new 
TBinaryProtocolFactory()));
-setOutputProtocolFactory(boost::shared_ptr(new 
TBinaryProtocolFactory()));
+setInputTransportFactory(stdcxx::shared_ptr(new 
TTransportFactory()));
+setOutputTransportFactory(stdcxx::shared_ptr(new 
TTransportFactory()));
+setInputProtocolFactory(stdcxx::shared_ptr(new 
TBinaryProtocolFactory()));
+setOutputProtocolFactory(stdcxx::shared_ptr(new 
TBinaryProtocolFactory()));
   }
 
-  TServer(const boost::shared_ptr& processor)
+  TServer(const stdcxx::shared_ptr& processor)
 : processorFactory_(new TSingletonProcessorFactory(processor)) {
-setInputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setOutputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setInputProtocolFactory(boost::shared_ptr(new 
TBinaryProtocolFactory()));
-setOutputProtocolFactory(boost::shared_ptr(new 
TBinaryProtocolFactory()));
+setInputTransportFactory(stdcxx::shared_ptr(new 
TTransportFactory()));
+setOutputTransportFactory(stdcxx::shared_ptr(new 
TTransportFactory()));
+setInputProtocolFactory(stdcxx::shared_ptr(new 
TBinaryProtocolFactory()));
+setOutputProtocolFactory(stdcxx::shared_ptr(new 
TBinaryProtocolFactory()));
   }
 
-  TServer(const boost::shared_ptr& processorFactory,
-  const boost::shared_ptr& serverTransport)
+  TServer(const stdcxx::shared_ptr& processorFactory,
+  const stdcxx::shared_ptr& serverTransport)
 : processorFactory_(processorFactory), serverTransport_(serverTransport) {
-setInputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setOutputTransportFactory(boost::shared_ptr(new 
TTransportFactory()));
-setInputProtocolFactory(boost::shared_ptr(new 
TBinaryProtocolFactory()));
-setOutputProtocolFactory(boost::shared_ptr(new 

[1/6] thrift git commit: THRIFT-2221: detect C++11 and use std namespace for memory operations (smart_ptr) Client: C++

2017-08-10 Thread jking
Repository: thrift
Updated Branches:
  refs/heads/master 0a8c34cee -> 82ae9575c


http://git-wip-us.apache.org/repos/asf/thrift/blob/82ae9575/test/cpp/src/StressTestNonBlocking.cpp
--
diff --git a/test/cpp/src/StressTestNonBlocking.cpp 
b/test/cpp/src/StressTestNonBlocking.cpp
index 1ebb9e0..e68988f 100644
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -33,11 +33,10 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "Service.h"
 
-#include 
-
 #include 
 #include 
 #include 
@@ -110,8 +109,8 @@ private:
 
 class ClientThread : public Runnable {
 public:
-  ClientThread(boost::shared_ptr transport,
-   boost::shared_ptr client,
+  ClientThread(stdcxx::shared_ptr transport,
+   stdcxx::shared_ptr client,
Monitor& monitor,
size_t& workerCount,
size_t loopCount,
@@ -222,8 +221,8 @@ public:
 }
   }
 
-  boost::shared_ptr _transport;
-  boost::shared_ptr _client;
+  stdcxx::shared_ptr _transport;
+  stdcxx::shared_ptr _client;
   Monitor& _monitor;
   size_t& _workerCount;
   size_t _loopCount;
@@ -345,24 +344,24 @@ int main(int argc, char** argv) {
 cerr << usage.str();
   }
 
-  boost::shared_ptr threadFactory
-  = boost::shared_ptr(new PlatformThreadFactory());
+  stdcxx::shared_ptr threadFactory
+  = stdcxx::shared_ptr(new PlatformThreadFactory());
 
   // Dispatcher
-  boost::shared_ptr serviceHandler(new Server());
+  stdcxx::shared_ptr serviceHandler(new Server());
 
   if (replayRequests) {
-boost::shared_ptr serviceHandler(new Server());
-boost::shared_ptr serviceProcessor(new 
ServiceProcessor(serviceHandler));
+stdcxx::shared_ptr serviceHandler(new Server());
+stdcxx::shared_ptr serviceProcessor(new 
ServiceProcessor(serviceHandler));
 
 // Transports
-boost::shared_ptr fileTransport(new 
TFileTransport(requestLogPath));
+stdcxx::shared_ptr fileTransport(new 
TFileTransport(requestLogPath));
 fileTransport->setChunkSize(2 * 1024 * 1024);
 fileTransport->setMaxEventSize(1024 * 16);
 fileTransport->seekToEnd();
 
 // Protocol Factory
-boost::shared_ptr protocolFactory(new 
TBinaryProtocolFactory());
+stdcxx::shared_ptr protocolFactory(new 
TBinaryProtocolFactory());
 
 TFileProcessor fileProcessor(serviceProcessor, protocolFactory, 
fileTransport);
 
@@ -372,48 +371,50 @@ int main(int argc, char** argv) {
 
   if (runServer) {
 
-boost::shared_ptr serviceProcessor(new 
ServiceProcessor(serviceHandler));
+stdcxx::shared_ptr serviceProcessor(new 
ServiceProcessor(serviceHandler));
 
 // Protocol Factory
-boost::shared_ptr protocolFactory(new 
TBinaryProtocolFactory());
+stdcxx::shared_ptr protocolFactory(new 
TBinaryProtocolFactory());
 
 // Transport Factory
-boost::shared_ptr transportFactory;
+stdcxx::shared_ptr transportFactory;
 
 if (logRequests) {
   // initialize the log file
-  boost::shared_ptr fileTransport(new 
TFileTransport(requestLogPath));
+  stdcxx::shared_ptr fileTransport(new 
TFileTransport(requestLogPath));
   fileTransport->setChunkSize(2 * 1024 * 1024);
   fileTransport->setMaxEventSize(1024 * 16);
 
   transportFactory
-  = boost::shared_ptr(new 
TPipedTransportFactory(fileTransport));
+  = stdcxx::shared_ptr(new 
TPipedTransportFactory(fileTransport));
 }
 
-boost::shared_ptr serverThread;
-boost::shared_ptr serverThread2;
-boost::shared_ptr nbSocket1, 
nbSocket2;
+stdcxx::shared_ptr serverThread;
+stdcxx::shared_ptr serverThread2;
+stdcxx::shared_ptr nbSocket1;
+stdcxx::shared_ptr nbSocket2;
 
 if (serverType == "simple") {
+
   nbSocket1.reset(new transport::TNonblockingServerSocket(port));
-  serverThread = threadFactory->newThread(boost::shared_ptr(
+  serverThread = threadFactory->newThread(stdcxx::shared_ptr(
   new TNonblockingServer(serviceProcessor, protocolFactory, 
nbSocket1)));
   nbSocket2.reset(new transport::TNonblockingServerSocket(port + 1));
-  serverThread2 = threadFactory->newThread(boost::shared_ptr(
+  serverThread2 = threadFactory->newThread(stdcxx::shared_ptr(
   new TNonblockingServer(serviceProcessor, protocolFactory, 
nbSocket2)));
 
 } else if (serverType == "thread-pool") {
 
-  boost::shared_ptr threadManager
+  stdcxx::shared_ptr threadManager
   = ThreadManager::newSimpleThreadManager(workerCount);
 
   threadManager->threadFactory(threadFactory);
   threadManager->start();
   nbSocket1.reset(new transport::TNonblockingServerSocket(port));
-  serverThread = threadFactory->newThread(boost::shared_ptr(
+  serverThread = threadFactory->newThread(stdcxx::shared_ptr(
   new TNonblockingServer(serviceProcessor, protocolFactory, nbSocket1, 
threadManager)));
   nbSocket2.reset(new 

  1   2   3   4   5   6   7   >