You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ns...@apache.org on 2016/03/29 19:48:35 UTC

[1/9] thrift git commit: THRIFT-3755 TDebugProtocol::writeString hits assert in isprint on Windows with debug CRT

Repository: thrift
Updated Branches:
  refs/heads/master 06340a466 -> 3bf5bf993


THRIFT-3755 TDebugProtocol::writeString hits assert in isprint on Windows with debug CRT

This closes #960


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

Branch: refs/heads/master
Commit: 3bf5bf99334c2da212e5e3d14145a1783657877c
Parents: 6657b83
Author: tpcwang <tp...@gmail.com>
Authored: Wed Mar 23 15:22:33 2016 -0700
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/cpp/src/thrift/protocol/TDebugProtocol.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/3bf5bf99/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
index 4687e82..09b978c 100644
--- a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp
@@ -347,7 +347,9 @@ uint32_t TDebugProtocol::writeString(const string& str) {
       output += "\\\\";
     } else if (*it == '"') {
       output += "\\\"";
-    } else if (std::isprint(*it)) {
+      // passing characters <0 to std::isprint causes asserts. isprint takes an
+      // int, so we need to be careful of sign extension
+    } else if (std::isprint((unsigned char)*it)) {
       output += *it;
     } else {
       switch (*it) {


[2/9] thrift git commit: THRIFT-3764: Ensure PHP TSimpleJSONProtocol and TMultiplexedProtocol files included during "make install"

Posted by ns...@apache.org.
THRIFT-3764: Ensure PHP TSimpleJSONProtocol and TMultiplexedProtocol files included during "make install"

This closes #969


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

Branch: refs/heads/master
Commit: 4ab9a88496413087df1ee3256472b19c5b4be500
Parents: f98d59f
Author: Mark Goldfinch <ma...@modicagroup.com>
Authored: Fri Mar 25 23:28:43 2016 +1300
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/php/Makefile.am | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/4ab9a884/lib/php/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/php/Makefile.am b/lib/php/Makefile.am
index 866e053..8e62960 100755
--- a/lib/php/Makefile.am
+++ b/lib/php/Makefile.am
@@ -38,6 +38,8 @@ distclean-local:
 endif
 
 phpdir = $(PHP_PREFIX)/Thrift
+php_DATA = \
+  lib/Thrift/TMultiplexedProcessor.php
 
 phpbasedir = $(phpdir)/Base
 phpbase_DATA = \
@@ -69,7 +71,10 @@ phpprotocol_DATA = \
   lib/Thrift/Protocol/TBinaryProtocol.php \
   lib/Thrift/Protocol/TCompactProtocol.php \
   lib/Thrift/Protocol/TJSONProtocol.php \
-  lib/Thrift/Protocol/TProtocol.php
+  lib/Thrift/Protocol/TMultiplexedProtocol.php \
+  lib/Thrift/Protocol/TProtocol.php \
+  lib/Thrift/Protocol/TProtocolDecorator.php \
+  lib/Thrift/Protocol/TSimpleJSONProtocol.php
 
 phpprotocoljsondir = $(phpprotocoldir)/JSON
 phpprotocoljson_DATA = \
@@ -78,6 +83,14 @@ phpprotocoljson_DATA = \
   lib/Thrift/Protocol/JSON/LookaheadReader.php \
   lib/Thrift/Protocol/JSON/PairContext.php
 
+phpprotocolsimplejsondir = $(phpprotocoldir)/SimpleJSON
+phpprotocolsimplejson_DATA = \
+  lib/Thrift/Protocol/SimpleJSON/CollectionMapKeyException.php \
+  lib/Thrift/Protocol/SimpleJSON/Context.php \
+  lib/Thrift/Protocol/SimpleJSON/ListContext.php \
+  lib/Thrift/Protocol/SimpleJSON/MapContext.php \
+  lib/Thrift/Protocol/SimpleJSON/StructContext.php
+
 phpserializerdir = $(phpdir)/Serializer
 phpserializer_DATA = \
   lib/Thrift/Serializer/TBinarySerializer.php


[5/9] thrift git commit: THRIFT-3763 Fix serialization of i64 larger than 2^53 for browserify

Posted by ns...@apache.org.
THRIFT-3763 Fix serialization of i64 larger than 2^53 for browserify

This closes #968


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

Branch: refs/heads/master
Commit: abbc8d0ec19850f7ce1125a7f8b1fc9878aac052
Parents: eb344a8
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 25 09:49:39 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/int64_util.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/abbc8d0e/lib/nodejs/lib/thrift/int64_util.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/int64_util.js b/lib/nodejs/lib/thrift/int64_util.js
index ecba439..e8d707d 100644
--- a/lib/nodejs/lib/thrift/int64_util.js
+++ b/lib/nodejs/lib/thrift/int64_util.js
@@ -40,7 +40,7 @@ Int64Util.toDecimalString = function(i64) {
       var incremented = false;
       var buffer = new Buffer(8);
       for (var i = 7; i >= 0; --i) {
-        buffer[i] = ~b[o + i] + (incremented ? 0 : 1);
+        buffer[i] = (~b[o + i] + (incremented ? 0 : 1)) & 0xff;
         incremented |= b[o + i];
       }
       b = buffer;


[6/9] thrift git commit: THRIFT-3761 Add debian package for Python3

Posted by ns...@apache.org.
THRIFT-3761 Add debian package for Python3

This closes #966


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

Branch: refs/heads/master
Commit: f43d0ca6e57c4c30ea742e5f80e086288e999ecb
Parents: 93bbdc8
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 25 09:22:16 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 build/docker/debian/Dockerfile |  6 +++--
 build/docker/ubuntu/Dockerfile |  6 +++--
 debian/control                 | 44 ++++++++++++++++++++++++++++++++++---
 debian/rules                   | 17 ++++++++++----
 4 files changed, 62 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/f43d0ca6/build/docker/debian/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/debian/Dockerfile b/build/docker/debian/Dockerfile
index d8c2411..66a52d7 100644
--- a/build/docker/debian/Dockerfile
+++ b/build/docker/debian/Dockerfile
@@ -66,11 +66,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
       python-all-dev \
       python-all-dbg \
       python-setuptools \
-      python-support \
       python-twisted \
       python-zope.interface \
       python-pip \
-      python3-dev \
+      python3-all \
+      python3-all-dbg \
+      python3-all-dev \
+      python3-setuptools \
       python3-pip
 
 # Ruby dependencies

http://git-wip-us.apache.org/repos/asf/thrift/blob/f43d0ca6/build/docker/ubuntu/Dockerfile
----------------------------------------------------------------------
diff --git a/build/docker/ubuntu/Dockerfile b/build/docker/ubuntu/Dockerfile
index 58a361c..469f026 100644
--- a/build/docker/ubuntu/Dockerfile
+++ b/build/docker/ubuntu/Dockerfile
@@ -72,10 +72,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
       python-all-dev \
       python-pip \
       python-setuptools \
-      python-support \
       python-twisted \
       python-zope.interface \
-      python3-dev \
+      python3-all \
+      python3-all-dbg \
+      python3-all-dev \
+      python3-setuptools \
       python3-pip
 
 # Ruby dependencies

http://git-wip-us.apache.org/repos/asf/thrift/blob/f43d0ca6/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index c1d478f..5d57460 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,10 @@ Section: devel
 Priority: extra
 Build-Depends: debhelper (>= 9), build-essential, mono-gmcs, python-dev, ant,
     mono-devel,  libmono-system-web2.0-cil, erlang-base, ruby-dev | ruby1.9.1-dev, autoconf, automake,
-    pkg-config, libtool, bison, flex, libboost-dev | libboost1.53-dev, python-all,
-    python-all-dev, python-all-dbg, openjdk-6-jdk | java-sdk,
+    pkg-config, libtool, bison, flex, libboost-dev | libboost1.53-dev,
+    python-all, python-setuptools, python-all-dev, python-all-dbg,
+    python3-all, python3-setuptools, python3-all-dev, python3-all-dbg,
+    openjdk-6-jdk | java-sdk,
     libboost-test-dev | libboost-test1.53-dev, libevent-dev, libssl-dev, perl (>= 5.8.0-7),
     php5, php5-dev, libglib2.0-dev, qtbase5-dev, qtbase5-dev-tools
 Maintainer: Thrift Developer's <de...@thrift.apache.org>
@@ -13,6 +15,7 @@ Vcs-Git: https://git-wip-us.apache.org/repos/asf/thrift.git
 Vcs-Browser: https://git-wip-us.apache.org/repos/asf?p=thrift.git
 Standards-Version: 3.9.5
 X-Python-Version: >= 2.6
+X-Python3-Version: >= 3.3
 
 Package: thrift-compiler
 Architecture: any
@@ -32,7 +35,7 @@ Section: python
 Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-six
 Recommends: python-twisted-web, python-backports.ssl-match-hostname, python-ipaddress
 Provides: ${python:Provides}
-Description: Python bindings for Thrift
+Description: Python bindings for Thrift (Python 2)
  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.
@@ -41,6 +44,8 @@ Description: Python bindings for Thrift
  tool (in the thrift-compiler package) to compile your definition to Python
  classes, and then the modules in this package will allow you to use those
  classes in your programs.
+ .
+ This package installs the library for Python 2.
 
 Package: python-thrift-dbg
 Architecture: any
@@ -57,6 +62,39 @@ Description: Python bindings for Thrift (debug version)
  definition to Python classes, and then the modules in this package will allow
  you to use those classes in your programs.
 
+Package: python3-thrift
+Architecture: any
+Section: python
+Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}, python3-six
+Recommends: python3-twisted-web
+Provides: ${python:Provides}
+Description: Python bindings for Thrift (Python 3)
+ 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 Python bindings for Thrift. You will need the thrift
+ tool (in the thrift-compiler package) to compile your definition to Python
+ classes, and then the modules in this package will allow you to use those
+ classes in your programs.
+ .
+ This package installs the library for Python 3.
+
+Package: python3-thrift-dbg
+Architecture: any
+Section: debug
+Depends: ${shlibs:Depends}, ${misc:Depends}, python3-thrift (= ${binary:Version}), python3-all-dbg
+Provides: ${python:Provides}
+Description: Python bindings for Thrift (debug version)
+ 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 Python bindings for Thrift with debugging symbols.
+ You will need the thrift tool (in the thrift-compiler package) to compile your
+ definition to Python classes, and then the modules in this package will allow
+ you to use those classes in your programs.
+
 Package: ruby-thrift
 Architecture: all
 Section: libs

http://git-wip-us.apache.org/repos/asf/thrift/blob/f43d0ca6/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index dcd2b0b..afbf323 100755
--- a/debian/rules
+++ b/debian/rules
@@ -152,10 +152,10 @@ install-arch:
 
 	# Python
 	cd $(CURDIR)/lib/py && \
-	for py in $(PYVERS); do \
-		$$py setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift; \
-		$$py-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
-	done
+	python2 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift && \
+	python2-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg && \
+	python3 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift && \
+	python3-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift-dbg
 
 	find $(CURDIR)/debian/python-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
 	find $(CURDIR)/debian/python-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
@@ -165,6 +165,14 @@ install-arch:
 	find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
 	find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
 
+	find $(CURDIR)/debian/python3-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python3-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python3-thrift-dbg -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python3-thrift-dbg -name "*.py[co]" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python3-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python3-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
+	find $(CURDIR)/debian/python3-thrift-dbg -depth -type d -empty -exec rmdir {} \;
+
 	# PHP
 	mkdir -p $(CURDIR)/debian/php5-thrift
 	cd $(CURDIR)/lib/php && \
@@ -192,6 +200,7 @@ binary-common:
 	dh_installman
 	dh_link
 	dh_strip -ppython-thrift --dbg=python-thrift-dbg
+	dh_strip -ppython3-thrift --dbg=python3-thrift-dbg
 	dh_strip -pthrift-compiler -plibthrift0
 	dh_compress
 	dh_fixperms


[3/9] thrift git commit: THRIFT-3762 Fix warnings for deprecated Thrift "byte" fields

Posted by ns...@apache.org.
THRIFT-3762 Fix warnings for deprecated Thrift "byte" fields

This closes #967


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

Branch: refs/heads/master
Commit: eb344a81913234183bd5f4ab63a872ca165d308d
Parents: f43d0ca
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 25 09:37:18 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 test/DebugProtoTest.thrift | 52 ++++++++++++++++++++---------------------
 test/DocTest.thrift        |  6 ++---
 test/StressTest.thrift     |  8 +++----
 test/ThriftTest.thrift     | 10 ++++----
 4 files changed, 38 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/eb344a81/test/DebugProtoTest.thrift
----------------------------------------------------------------------
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index df0fb30..b6a7659 100644
--- a/test/DebugProtoTest.thrift
+++ b/test/DebugProtoTest.thrift
@@ -36,7 +36,7 @@ struct Doubles {
 struct OneOfEach {
   1: bool im_true,
   2: bool im_false,
-  3: byte a_bite = 0x7f,
+  3: i8 a_bite = 0x7f,
   4: i16 integer16 = 0x7fff,
   5: i32 integer32,
   6: i64 integer64 = 10000000000,
@@ -45,7 +45,7 @@ struct OneOfEach {
   9: string zomg_unicode,
   10: bool what_who,
   11: binary base64,
-  12: list<byte> byte_list = [1, 2, 3],
+  12: list<i8> byte_list = [1, 2, 3],
   13: list<i16> i16_list = [1,2,3],
   14: list<i64> i64_list = [1,2,3]
 }
@@ -105,7 +105,7 @@ struct Base64 {
 
 struct CompactProtoTestStruct {
   // primitive fields
-  1: byte   a_byte;
+  1: i8     a_byte;
   2: i16    a_i16;
   3: i32    a_i32;
   4: i64    a_i64;
@@ -117,7 +117,7 @@ struct CompactProtoTestStruct {
   10: Empty empty_struct_field;
 
   // primitives in lists
-  11: list<byte>    byte_list;
+  11: list<i8>      byte_list;
   12: list<i16>     i16_list;
   13: list<i32>     i32_list;
   14: list<i64>     i64_list;
@@ -128,7 +128,7 @@ struct CompactProtoTestStruct {
   19: list<Empty>   struct_list;
 
   // primitives in sets
-  20: set<byte>     byte_set;
+  20: set<i8>       byte_set;
   21: set<i16>      i16_set;
   22: set<i32>      i32_set;
   23: set<i64>      i64_set;
@@ -140,30 +140,30 @@ struct CompactProtoTestStruct {
 
   // maps
   // primitives as keys
-  29: map<byte, byte>             byte_byte_map;
-  30: map<i16, byte>              i16_byte_map;
-  31: map<i32, byte>              i32_byte_map;
-  32: map<i64, byte>              i64_byte_map;
-  33: map<double, byte>           double_byte_map;
-  34: map<string, byte>           string_byte_map;
-  35: map<binary, byte>           binary_byte_map;
-  36: map<bool, byte>             boolean_byte_map;
+  29: map<i8, i8>               byte_byte_map;
+  30: map<i16, i8>              i16_byte_map;
+  31: map<i32, i8>              i32_byte_map;
+  32: map<i64, i8>              i64_byte_map;
+  33: map<double, i8>           double_byte_map;
+  34: map<string, i8>           string_byte_map;
+  35: map<binary, i8>           binary_byte_map;
+  36: map<bool, i8>             boolean_byte_map;
   // primitives as values
-  37: map<byte, i16>              byte_i16_map;
-  38: map<byte, i32>              byte_i32_map;
-  39: map<byte, i64>              byte_i64_map;
-  40: map<byte, double>           byte_double_map;
-  41: map<byte, string>           byte_string_map;
-  42: map<byte, binary>           byte_binary_map;
-  43: map<byte, bool>             byte_boolean_map;
+  37: map<i8, i16>              byte_i16_map;
+  38: map<i8, i32>              byte_i32_map;
+  39: map<i8, i64>              byte_i64_map;
+  40: map<i8, double>           byte_double_map;
+  41: map<i8, string>           byte_string_map;
+  42: map<i8, binary>           byte_binary_map;
+  43: map<i8, bool>             byte_boolean_map;
   // collections as keys
-  44: map<list<byte> (python.immutable = ""), byte>       list_byte_map;
-  45: map<set<byte> (python.immutable = ""), byte>        set_byte_map;
-  46: map<map<byte,byte> (python.immutable = ""), byte>   map_byte_map;
+  44: map<list<i8> (python.immutable = ""), i8>       list_byte_map;
+  45: map<set<i8> (python.immutable = ""), i8>        set_byte_map;
+  46: map<map<i8,i8> (python.immutable = ""), i8>     map_byte_map;
   // collections as values
-  47: map<byte, map<byte,byte>>   byte_map_map;
-  48: map<byte, set<byte>>        byte_set_map;
-  49: map<byte, list<byte>>       byte_list_map;
+  47: map<i8, map<i8,i8>>     byte_map_map;
+  48: map<i8, set<i8>>        byte_set_map;
+  49: map<i8, list<i8>>       byte_list_map;
 }
 
 // To be used to test the serialization of an empty map

http://git-wip-us.apache.org/repos/asf/thrift/blob/eb344a81/test/DocTest.thrift
----------------------------------------------------------------------
diff --git a/test/DocTest.thrift b/test/DocTest.thrift
index 70575c1..d702b2c 100644
--- a/test/DocTest.thrift
+++ b/test/DocTest.thrift
@@ -58,7 +58,7 @@ struct Xtruct
   1:  string string_thing
 
   /** doct text goes before a comma */
-  4:  byte   byte_thing,
+  4:  i8     byte_thing,
 
   9:  i32    i32_thing,
   11: i64    i64_thing
@@ -74,7 +74,7 @@ const map<string,string> MAPCONSTANT = {'hello':'world', 'goodnight':'moon'}
 
 struct Xtruct2
 {
-  1: byte   byte_thing,
+  1: i8     byte_thing,
   2: Xtruct struct_thing,
   3: i32    i32_thing
 }
@@ -117,7 +117,7 @@ service ThriftTest
   /** And this is how you would document functions in a service */
   void         testVoid(),
   string       testString(1: string thing),
-  byte         testByte(1: byte thing),
+  i8           testByte(1: byte thing),
   i32          testI32(1: i32 thing),
 
   /** Like this one */

http://git-wip-us.apache.org/repos/asf/thrift/blob/eb344a81/test/StressTest.thrift
----------------------------------------------------------------------
diff --git a/test/StressTest.thrift b/test/StressTest.thrift
index ccf22af..431811b 100644
--- a/test/StressTest.thrift
+++ b/test/StressTest.thrift
@@ -24,12 +24,12 @@ namespace go stress
 service Service {
 
   void echoVoid(),
-  byte echoByte(1: byte arg),
+  i8 echoByte(1: i8 arg),
   i32 echoI32(1: i32 arg),
   i64 echoI64(1: i64 arg),
   string echoString(1: string arg),
-  list<byte>  echoList(1: list<byte> arg),
-  set<byte>  echoSet(1: set<byte> arg),
-  map<byte, byte>  echoMap(1: map<byte, byte> arg),
+  list<i8>  echoList(1: list<i8> arg),
+  set<i8>  echoSet(1: set<i8> arg),
+  map<i8, i8>  echoMap(1: map<i8, i8> arg),
 }
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/eb344a81/test/ThriftTest.thrift
----------------------------------------------------------------------
diff --git a/test/ThriftTest.thrift b/test/ThriftTest.thrift
index 20929d4..56adf39 100644
--- a/test/ThriftTest.thrift
+++ b/test/ThriftTest.thrift
@@ -80,7 +80,7 @@ struct Bools {
 struct Xtruct
 {
   1:  string string_thing,
-  4:  byte   byte_thing,
+  4:  i8     byte_thing,
   9:  i32    i32_thing,
   11: i64    i64_thing
 }
@@ -158,7 +158,7 @@ service ThriftTest
    * @param byte thing - the i8/byte to print
    * @return i8 - returns the i8/byte 'thing'
    */
-  i8         testByte(1: byte thing),
+  i8           testByte(1: i8 thing),
 
   /**
    * Prints 'testI32("%d")' with thing as '%d'
@@ -271,7 +271,7 @@ service ThriftTest
 
   /**
    * Prints 'testMulti()'
-   * @param byte arg0 -
+   * @param i8 arg0 -
    * @param i32 arg1 -
    * @param i64 arg2 -
    * @param map<i16, string> arg3 -
@@ -280,7 +280,7 @@ service ThriftTest
    * @return Xtruct - returns an Xtruct with string_thing = "Hello2, byte_thing = arg0, i32_thing = arg1
    *    and i64_thing = arg2
    */
-  Xtruct testMulti(1: byte arg0, 2: i32 arg1, 3: i64 arg2, 4: map<i16, string> arg3, 5: Numberz arg4, 6: UserId arg5),
+  Xtruct testMulti(1: i8 arg0, 2: i32 arg1, 3: i64 arg2, 4: map<i16, string> arg3, 5: Numberz arg4, 6: UserId arg5),
 
   /**
    * Print 'testException(%s)' with arg as '%s'
@@ -331,7 +331,7 @@ struct VersioningTestV2 {
        1: i32 begin_in_both,
 
        2: i32 newint,
-       3: byte newbyte,
+       3: i8 newbyte,
        4: i16 newshort,
        5: i64 newlong,
        6: double newdouble


[9/9] thrift git commit: THRIFT-3757 Fix various compile warnings with VS2015

Posted by ns...@apache.org.
THRIFT-3757 Fix various compile warnings with VS2015

This closes #962


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

Branch: refs/heads/master
Commit: f98d59fc822dd6d05c6cd48c5b86d716469a48fc
Parents: d42d8be
Author: tpcwang <tp...@gmail.com>
Authored: Wed Mar 23 16:18:52 2016 -0700
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/cpp/src/thrift/concurrency/TimerManager.cpp  | 3 +--
 lib/cpp/src/thrift/protocol/TJSONProtocol.cpp    | 1 -
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 6 +++---
 lib/cpp/src/thrift/server/TServerFramework.cpp   | 2 +-
 lib/cpp/src/thrift/transport/TSocket.cpp         | 2 +-
 lib/cpp/test/TransportTest.cpp                   | 2 +-
 6 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/concurrency/TimerManager.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/concurrency/TimerManager.cpp b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
index 122d26e..f95fcda 100644
--- a/lib/cpp/src/thrift/concurrency/TimerManager.cpp
+++ b/lib/cpp/src/thrift/concurrency/TimerManager.cpp
@@ -162,8 +162,7 @@ TimerManager::~TimerManager() {
     try {
       stop();
     } catch (...) {
-      throw;
-      // uhoh
+      // We're really hosed.
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index dbed8fb..412e927 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -43,7 +43,6 @@ static const uint8_t kJSONObjectStart = '{';
 static const uint8_t kJSONObjectEnd = '}';
 static const uint8_t kJSONArrayStart = '[';
 static const uint8_t kJSONArrayEnd = ']';
-static const uint8_t kJSONNewline = '\n';
 static const uint8_t kJSONPairSeparator = ':';
 static const uint8_t kJSONElemSeparator = ',';
 static const uint8_t kJSONBackslash = '\\';

http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/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 1e35275..7f44c1f 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -1436,8 +1436,8 @@ bool TNonblockingIOThread::notify(TNonblockingServer::TConnection* conn) {
   }
 
   fd_set wfds, efds;
-  int ret = -1;
-  int kSize = sizeof(conn);
+  long ret = -1;
+  long kSize = sizeof(conn);
   const char* pos = (const char*)const_cast_sockopt(&conn);
 
   while (kSize > 0) {
@@ -1445,7 +1445,7 @@ bool TNonblockingIOThread::notify(TNonblockingServer::TConnection* conn) {
     FD_ZERO(&efds);
     FD_SET(fd, &wfds);
     FD_SET(fd, &efds);
-    ret = select(fd + 1, NULL, &wfds, &efds, NULL);
+    ret = select(static_cast<int>(fd + 1), NULL, &wfds, &efds, NULL);
     if (ret < 0) {
       return false;
     } else if (ret == 0) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/src/thrift/server/TServerFramework.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/server/TServerFramework.cpp b/lib/cpp/src/thrift/server/TServerFramework.cpp
index 43d11c5..9fdd694 100644
--- a/lib/cpp/src/thrift/server/TServerFramework.cpp
+++ b/lib/cpp/src/thrift/server/TServerFramework.cpp
@@ -224,7 +224,7 @@ void TServerFramework::newlyConnectedClient(const boost::shared_ptr<TConnectedCl
   // Count a concurrent client added.
   Synchronized sync(mon_);
   ++clients_;
-  hwm_ = std::max(hwm_, clients_);
+  hwm_ = (std::max)(hwm_, clients_);
 }
 
 void TServerFramework::disposeConnectedClient(TConnectedClient* pClient) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/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 6de6d4e..bc1bbdd 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -700,7 +700,7 @@ void TSocket::setLinger(bool on, int linger) {
 #ifndef _WIN32
   struct linger l = {(lingerOn_ ? 1 : 0), lingerVal_};
 #else
-  struct linger l = {(lingerOn_ ? 1 : 0), static_cast<u_short>(lingerVal_)};
+  struct linger l = {static_cast<u_short>(lingerOn_ ? 1 : 0), static_cast<u_short>(lingerVal_)};
 #endif
 
   int ret = setsockopt(socket_, SOL_SOCKET, SO_LINGER, cast_sockopt(&l), sizeof(l));

http://git-wip-us.apache.org/repos/asf/thrift/blob/f98d59fc/lib/cpp/test/TransportTest.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/test/TransportTest.cpp b/lib/cpp/test/TransportTest.cpp
index 6cc2c87..ccef9d5 100644
--- a/lib/cpp/test/TransportTest.cpp
+++ b/lib/cpp/test/TransportTest.cpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "config.h"
+#include <thrift/thrift-config.h>
 
 #include <stdlib.h>
 #include <time.h>


[8/9] thrift git commit: THRIFT-3765 fix memory leak in python compact protocol extension

Posted by ns...@apache.org.
THRIFT-3765 fix memory leak in python compact protocol extension

This closes #970


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

Branch: refs/heads/master
Commit: 6657b8337d1aedfd2aed22a8cdcf4b96965ece26
Parents: 4ab9a88
Author: Chandler May <cj...@gmail.com>
Authored: Sun Mar 27 22:47:06 2016 -0400
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/py/src/ext/protocol.tcc | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/6657b833/lib/py/src/ext/protocol.tcc
----------------------------------------------------------------------
diff --git a/lib/py/src/ext/protocol.tcc b/lib/py/src/ext/protocol.tcc
index 2f0d083..6e978d7 100644
--- a/lib/py/src/ext/protocol.tcc
+++ b/lib/py/src/ext/protocol.tcc
@@ -418,19 +418,24 @@ bool ProtocolBase<Impl>::encodeValue(PyObject* value, TType type, PyObject* type
   }
 
   case T_STRING: {
+    ScopedPyObject nval;
+
     if (PyUnicode_Check(value)) {
-      value = PyUnicode_AsUTF8String(value);
-      if (!value) {
+      nval.reset(PyUnicode_AsUTF8String(value));
+      if (!nval) {
         return false;
       }
+    } else {
+      Py_INCREF(value);
+      nval.reset(value);
     }
 
-    Py_ssize_t len = PyBytes_Size(value);
+    Py_ssize_t len = PyBytes_Size(nval.get());
     if (!detail::check_ssize_t_32(len)) {
       return false;
     }
 
-    impl()->writeString(value, static_cast<int32_t>(len));
+    impl()->writeString(nval.get(), static_cast<int32_t>(len));
     return true;
   }
 


[7/9] thrift git commit: THRIFT-3758 TApplicationException::getType and TProtocolException::getType should be const

Posted by ns...@apache.org.
THRIFT-3758 TApplicationException::getType and TProtocolException::getType should be const

This closes #963


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

Branch: refs/heads/master
Commit: d42d8be78fff22fab9f524d4766b61bb9053fd69
Parents: abbc8d0
Author: tpcwang <tp...@gmail.com>
Authored: Thu Mar 24 09:56:10 2016 -0700
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 lib/cpp/src/thrift/TApplicationException.h       | 2 +-
 lib/cpp/src/thrift/protocol/TProtocolException.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/d42d8be7/lib/cpp/src/thrift/TApplicationException.h
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/TApplicationException.h b/lib/cpp/src/thrift/TApplicationException.h
index 0de5391..81d9424 100644
--- a/lib/cpp/src/thrift/TApplicationException.h
+++ b/lib/cpp/src/thrift/TApplicationException.h
@@ -65,7 +65,7 @@ public:
    *
    * @return Error code
    */
-  TApplicationExceptionType getType() { return type_; }
+  TApplicationExceptionType getType() const { return type_; }
 
   virtual const char* what() const throw() {
     if (message_.empty()) {

http://git-wip-us.apache.org/repos/asf/thrift/blob/d42d8be7/lib/cpp/src/thrift/protocol/TProtocolException.h
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/protocol/TProtocolException.h b/lib/cpp/src/thrift/protocol/TProtocolException.h
index 18a8ed0..6e536b4 100644
--- a/lib/cpp/src/thrift/protocol/TProtocolException.h
+++ b/lib/cpp/src/thrift/protocol/TProtocolException.h
@@ -67,7 +67,7 @@ public:
    *
    * @return Error code
    */
-  TProtocolExceptionType getType() { return type_; }
+  TProtocolExceptionType getType() const { return type_; }
 
   virtual const char* what() const throw() {
     if (message_.empty()) {


[4/9] thrift git commit: THRIFT-3760 Fix install paths etc of debian packages for py and perl

Posted by ns...@apache.org.
THRIFT-3760 Fix install paths etc of debian packages for py and perl

This closes #965


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

Branch: refs/heads/master
Commit: 93bbdc8127cb6ebdd34350fbba1b3a0a4e8e4111
Parents: 06340a4
Author: Nobuaki Sukegawa <ns...@apache.org>
Authored: Fri Mar 25 08:51:09 2016 +0900
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Tue Mar 29 12:03:34 2016 +0900

----------------------------------------------------------------------
 debian/control   |  2 +-
 debian/rules     | 38 +++++++++++++++++++++++---------------
 debian/substvars |  2 +-
 3 files changed, 25 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/control
----------------------------------------------------------------------
diff --git a/debian/control b/debian/control
index be5209c..c1d478f 100644
--- a/debian/control
+++ b/debian/control
@@ -30,7 +30,7 @@ Package: python-thrift
 Architecture: any
 Section: python
 Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-six
-Recommends: python-twisted-web
+Recommends: python-twisted-web, python-backports.ssl-match-hostname, python-ipaddress
 Provides: ${python:Provides}
 Description: Python bindings for Thrift
  Thrift is a software framework for scalable cross-language services

http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/rules
----------------------------------------------------------------------
diff --git a/debian/rules b/debian/rules
index 2441a4c..dcd2b0b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,7 +29,7 @@ configure-stamp:
 
 	# Add here commands to configure the package.
 	if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi
-	$(CURDIR)/configure --prefix=/usr --with-c_glib --without-erlang
+	$(CURDIR)/configure --prefix=/usr
 
 	touch configure-stamp
 
@@ -40,7 +40,7 @@ build: build-arch build-indep
 	# $(MAKE) -C test check
 
 build-arch: build-arch-stamp
-build-arch-stamp: configure-stamp
+$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp
 
 	# Compile compiler
 	$(MAKE) -C $(CURDIR)/compiler/cpp
@@ -61,12 +61,12 @@ build-arch-stamp: configure-stamp
 	# PHP
 	cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \
 		phpize && \
-		./configure && make
+		./configure && $(MAKE)
 
 	touch $@
 
 build-indep: build-indep-stamp
-build-indep-stamp: configure-stamp
+build-indep-stamp: configure-stamp $(CURDIR)/compiler/cpp/thrift
 
 	# Add here commands to compile the indep part of the package.
 	#$(MAKE) doc
@@ -91,6 +91,8 @@ clean:
 	dh_testroot
 	rm -f build-arch-stamp build-indep-stamp configure-stamp
 
+	cd $(CURDIR)/lib/py && python setup.py clean --all
+
 	# Add here commands to clean up after the build process.
 	-$(MAKE) clean
 
@@ -107,12 +109,12 @@ install-indep:
 	# debian/<package>-doc.
 	#INSTALLDOC#
 
-        # Java
+	# Java
 	mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \
 	cp $(CURDIR)/lib/java/build/libthrift*.jar \
 		$(CURDIR)/debian/libthrift-java/usr/share/java/
 
-        # Ruby
+	# Ruby
 	mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \
 	cp $(CURDIR)/lib/rb/lib/thrift.rb \
 		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
@@ -125,7 +127,10 @@ install-indep:
 		$(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/Thrift.dll
 
 	# Perl
-	$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl/usr
+	$(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
+	rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib
+	rmdir $(CURDIR)/debian/libthrift-perl/usr/local
 
 	dh_install -i
 
@@ -148,11 +153,14 @@ install-arch:
 	# Python
 	cd $(CURDIR)/lib/py && \
 	for py in $(PYVERS); do \
-		$$py setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift; \
-		$$py-dbg setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
+		$$py setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift; \
+		$$py-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
 	done
 
-	find $(CURDIR)/debian/python-thrift-dbg -name "*.pyc" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
+	find $(CURDIR)/debian/python-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python-thrift-dbg -name "__pycache__" -print0 | xargs -0 rm -fr
+	find $(CURDIR)/debian/python-thrift-dbg -name "*.py[co]" -print0 | xargs -0 rm -f
 	find $(CURDIR)/debian/python-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
 	find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
 	find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
@@ -165,9 +173,9 @@ install-arch:
 	# C++ and C (glib)
 	mkdir -p $(CURDIR)/debian/tmp; \
 	cd $(CURDIR)/lib/cpp && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
+		$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 	cd $(CURDIR)/lib/c_glib && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
+		$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 
 	dh_install --sourcedir=debian/tmp -s
 
@@ -183,8 +191,8 @@ binary-common:
 	dh_installexamples
 	dh_installman
 	dh_link
-	dh_strip -Npython-thrift-dbg -Nthrift-compiler -Nlibthrift0 --dbg=python-thrift-dbg
-	dh_strip -Npython-thrift-dbg
+	dh_strip -ppython-thrift --dbg=python-thrift-dbg
+	dh_strip -pthrift-compiler -plibthrift0
 	dh_compress
 	dh_fixperms
 	dh_makeshlibs
@@ -200,7 +208,7 @@ binary-indep: build-indep install-indep
 
 # Build architecture dependent packages using the common target.
 binary-arch: build-arch install-arch
-	echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars
+	echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" > $(CURDIR)/debian/substvars
 	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
 
 binary: binary-arch binary-indep

http://git-wip-us.apache.org/repos/asf/thrift/blob/93bbdc81/debian/substvars
----------------------------------------------------------------------
diff --git a/debian/substvars b/debian/substvars
index badf572..9841f2d 100644
--- a/debian/substvars
+++ b/debian/substvars
@@ -1 +1 @@
-php:Depends=phpapi-
+php:Depends=phpapi-20121212