You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2015/03/06 02:13:15 UTC

[1/3] thrift git commit: THRIFT-3024 User-Agent "BattleNet" used in some Thrift library files Client: AS3, Haxe Patch: Jens Geyer

Repository: thrift
Updated Branches:
  refs/heads/master 426ab8680 -> 624781c1c


THRIFT-3024 User-Agent "BattleNet" used in some Thrift library files
Client: AS3, Haxe
Patch: Jens Geyer

This closes #390


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

Branch: refs/heads/master
Commit: 8cc78c101a86e9d200a09996e75f3cabec18bad4
Parents: 426ab86
Author: Jens Geyer <je...@apache.org>
Authored: Thu Mar 5 23:59:05 2015 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Mar 6 01:26:13 2015 +0100

----------------------------------------------------------------------
 .../src/org/apache/thrift/transport/TFullDuplexHttpClient.as | 2 +-
 .../src/org/apache/thrift/transport/TFullDuplexHttpClient.hx | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/8cc78c10/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
----------------------------------------------------------------------
diff --git a/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as b/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
index 3374986..863c59b 100644
--- a/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
+++ b/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
@@ -195,7 +195,7 @@ package org.apache.thrift.transport
         {
             this.output = this.socket;
             this.input = this.socket;
-            this.output.writeUTF("CONNECT " + resource + " HTTP/1.1\n" + "Host: " + host + ":" + port + "\r\n" + "User-Agent: BattleNet\r\n" + "Transfer-Encoding: chunked\r\n" + "content-type: application/x-thrift\r\n" + "Accept: */*\r\n\r\n");
+            this.output.writeUTF("CONNECT " + resource + " HTTP/1.1\n" + "Host: " + host + ":" + port + "\r\n" + "User-Agent: Thrift/AS3\r\n" + "Transfer-Encoding: chunked\r\n" + "content-type: application/x-thrift\r\n" + "Accept: */*\r\n\r\n");
             this.eventDispatcher.dispatchEvent(event);
         }
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/8cc78c10/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx b/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
index 3cd2e51..a4dc671 100644
--- a/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
+++ b/lib/haxe/src/org/apache/thrift/transport/TFullDuplexHttpClient.hx
@@ -192,7 +192,13 @@ import flash.events.EventDispatcher;
         {
             this.output = this.socket;
             this.input = this.socket;
-            this.output.writeUTF("CONNECT " + resource + " HTTP/1.1\n" + "Host :  " + host + ":" + port + "\r\n" + "User-Agent :  BattleNet\r\n" + "Transfer-Encoding :  chunked\r\n" + "content-type :  application/x-thrift\r\n" + "Accept :  */*\r\n\r\n");
+            this.output.writeUTF( "CONNECT " + resource + " HTTP/1.1\n" 
+			                    + "Host :  " + host + ":" + port + "\r\n" 
+								+ "User-Agent :  Thrift/Haxe\r\n" 
+								+ "Transfer-Encoding :  chunked\r\n" 
+								+ "content-type :  application/x-thrift\r\n" 
+								+ "Accept :  */*\r\n" 
+								+ "\r\n");
             this.eventDispatcher.dispatchEvent(event);
         }
 


[3/3] thrift git commit: THRIFT-3026 TMultiplexedProcessor does not have a constructor Client: Haxe Patch: Jens Geyer

Posted by je...@apache.org.
THRIFT-3026 TMultiplexedProcessor does not have a constructor
Client: Haxe
Patch: Jens Geyer

This closes #392


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

Branch: refs/heads/master
Commit: 624781c1c4b89dce9f48fa80b841b5cd3d93aebb
Parents: 65ee983
Author: Jens Geyer <je...@apache.org>
Authored: Fri Mar 6 02:00:48 2015 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Mar 6 02:12:29 2015 +0100

----------------------------------------------------------------------
 lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/624781c1/lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx b/lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx
index a4d8237..9e25fcf 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TMultiplexedProcessor.hx
@@ -51,6 +51,9 @@ class TMultiplexedProcessor implements TProcessor
     private var serviceProcessorMap : StringMap<TProcessor> = new StringMap<TProcessor>();
     private var defaultProcessor : TProcessor = null;
 
+    public function new() {        
+    }
+	
     /**
      * 'Register' a service with this TMultiplexedProcessor. This allows us to broker
      * requests to individual services by using the service name to select them at request time.


[2/3] thrift git commit: THRIFT-3025 Change pure Ints into @enums Client: Haxe Patch: Jens Geyer

Posted by je...@apache.org.
THRIFT-3025 Change pure Ints into @enums
Client: Haxe
Patch: Jens Geyer

This closes #391


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

Branch: refs/heads/master
Commit: 65ee9838bcfe1da945647b27f8db98ea573e5def
Parents: 8cc78c1
Author: Jens Geyer <je...@apache.org>
Authored: Thu Mar 5 23:11:45 2015 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Fri Mar 6 01:27:48 2015 +0100

----------------------------------------------------------------------
 .../org/apache/thrift/TApplicationException.hx  |  2 +
 .../org/apache/thrift/TFieldRequirementType.hx  |  8 ++--
 .../apache/thrift/protocol/TCompactProtocol.hx  | 21 +---------
 .../org/apache/thrift/protocol/TCompactTypes.hx | 41 ++++++++++++++++++++
 .../src/org/apache/thrift/protocol/TMessage.hx  |  2 +-
 .../org/apache/thrift/protocol/TMessageType.hx  |  5 ++-
 .../thrift/protocol/TProtocolException.hx       |  2 +
 .../src/org/apache/thrift/protocol/TType.hx     |  5 +--
 .../thrift/transport/TTransportException.hx     |  2 +
 9 files changed, 58 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/TApplicationException.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/TApplicationException.hx b/lib/haxe/src/org/apache/thrift/TApplicationException.hx
index 4287a85..4fe571d 100644
--- a/lib/haxe/src/org/apache/thrift/TApplicationException.hx
+++ b/lib/haxe/src/org/apache/thrift/TApplicationException.hx
@@ -34,6 +34,8 @@ class TApplicationException extends TException {
     private static var MESSAGE_FIELD = { new TField("message", TType.STRING, 1); };
     private static var TYPE_FIELD = { new TField("type", TType.I32, 2); };
 
+    // WARNING: These are subject to be extended in the future, so we can't use enums 
+    // with Haxe 3.1.3 because of https://github.com/HaxeFoundation/haxe/issues/3649
     public static inline var UNKNOWN : Int = 0;
     public static inline var UNKNOWN_METHOD : Int = 1;
     public static inline var INVALID_MESSAGE_TYPE : Int = 2;

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx b/lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx
index 7c22030..039a2cf 100644
--- a/lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx
+++ b/lib/haxe/src/org/apache/thrift/TFieldRequirementType.hx
@@ -23,9 +23,9 @@ package org.apache.thrift;
    * Requirement type constants.
    *
    */
-class TFieldRequirementType {
-    public static inline var REQUIRED : Int  = 1;
+@:enum
+abstract TFieldRequirementType(Int)  from Int to Int  {
+    public static inline var REQUIRED : Int = 1;
     public static inline var OPTIONAL : Int = 2;
-    public static inline var DEFAULT : Int = 3;
-
+    public static inline var DEFAULT  : Int = 3;
 }

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TCompactProtocol.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TCompactProtocol.hx b/lib/haxe/src/org/apache/thrift/protocol/TCompactProtocol.hx
index d08a6d0..0781114 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TCompactProtocol.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TCompactProtocol.hx
@@ -35,26 +35,7 @@ import org.apache.thrift.helper.BitConverter;
 
 
 /**
- * All of the on-wire type codes.
- */
-class TCompactTypes {
-    public static inline var STOP          = 0x00;
-    public static inline var BOOLEAN_TRUE  = 0x01;
-    public static inline var BOOLEAN_FALSE = 0x02;
-    public static inline var BYTE          = 0x03;
-    public static inline var I16           = 0x04;
-    public static inline var I32           = 0x05;
-    public static inline var I64           = 0x06;
-    public static inline var DOUBLE        = 0x07;
-    public static inline var BINARY        = 0x08;
-    public static inline var LIST          = 0x09;
-    public static inline var SET           = 0x0A;
-    public static inline var MAP           = 0x0B;
-    public static inline var STRUCT        = 0x0C;
-}
-
-/**
-* Binary protocol implementation for thrift.
+* Compact protocol implementation for thrift.
 */
 class TCompactProtocol implements TProtocol {
 

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TCompactTypes.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TCompactTypes.hx b/lib/haxe/src/org/apache/thrift/protocol/TCompactTypes.hx
new file mode 100644
index 0000000..cdd3d87
--- /dev/null
+++ b/lib/haxe/src/org/apache/thrift/protocol/TCompactTypes.hx
@@ -0,0 +1,41 @@
+/**
+ * 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.
+ */
+
+package org.apache.thrift.protocol;
+
+/**
+ * All of the on-wire type codes.
+ */
+@:enum
+abstract TCompactTypes(Int)  from Int to Int  {
+    public static inline var STOP          = 0x00;
+    public static inline var BOOLEAN_TRUE  = 0x01;
+    public static inline var BOOLEAN_FALSE = 0x02;
+    public static inline var BYTE          = 0x03;
+    public static inline var I16           = 0x04;
+    public static inline var I32           = 0x05;
+    public static inline var I64           = 0x06;
+    public static inline var DOUBLE        = 0x07;
+    public static inline var BINARY        = 0x08;
+    public static inline var LIST          = 0x09;
+    public static inline var SET           = 0x0A;
+    public static inline var MAP           = 0x0B;
+    public static inline var STRUCT        = 0x0C;
+}
+

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TMessage.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TMessage.hx b/lib/haxe/src/org/apache/thrift/protocol/TMessage.hx
index 58d71a9..d99264a 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TMessage.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TMessage.hx
@@ -38,4 +38,4 @@ class TMessage {
     public function equals(other:TMessage) : Bool {
       return name == other.name && type == other.type && seqid == other.seqid;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TMessageType.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TMessageType.hx b/lib/haxe/src/org/apache/thrift/protocol/TMessageType.hx
index 7cb38b3..706d329 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TMessageType.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TMessageType.hx
@@ -19,9 +19,10 @@
 
 package org.apache.thrift.protocol;
 
-class TMessageType {
+@:enum
+abstract TMessageType(Int)  from Int to Int  {
     public static inline var CALL      : Int = 1;
-    public static inline var REPLY        : Int = 2;
+    public static inline var REPLY     : Int = 2;
     public static inline var EXCEPTION : Int = 3;
     public static inline var ONEWAY    : Int = 4;
 }

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TProtocolException.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TProtocolException.hx b/lib/haxe/src/org/apache/thrift/protocol/TProtocolException.hx
index 6e528cb..2e0f9f5 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TProtocolException.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TProtocolException.hx
@@ -23,6 +23,8 @@ import org.apache.thrift.TException;
 
 class TProtocolException extends TException {
 
+    // WARNING: These are subject to be extended in the future, so we can't use enums 
+    // with Haxe 3.1.3 because of https://github.com/HaxeFoundation/haxe/issues/3649
     public static inline var UNKNOWN : Int = 0;
     public static inline var INVALID_DATA : Int = 1;
     public static inline var NEGATIVE_SIZE : Int = 2;

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/protocol/TType.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/protocol/TType.hx b/lib/haxe/src/org/apache/thrift/protocol/TType.hx
index 1e093c2..6abbc96 100644
--- a/lib/haxe/src/org/apache/thrift/protocol/TType.hx
+++ b/lib/haxe/src/org/apache/thrift/protocol/TType.hx
@@ -19,8 +19,8 @@
 
 package org.apache.thrift.protocol;
 
-class TType {
-
+@:enum
+abstract TType(Int)  from Int to Int  {
     public static inline var STOP : Int   = 0;
     public static inline var VOID : Int   = 1;
     public static inline var BOOL : Int   = 2;
@@ -34,5 +34,4 @@ class TType {
     public static inline var MAP : Int    = 13;
     public static inline var SET : Int    = 14;
     public static inline var LIST : Int   = 15;
-
 }

http://git-wip-us.apache.org/repos/asf/thrift/blob/65ee9838/lib/haxe/src/org/apache/thrift/transport/TTransportException.hx
----------------------------------------------------------------------
diff --git a/lib/haxe/src/org/apache/thrift/transport/TTransportException.hx b/lib/haxe/src/org/apache/thrift/transport/TTransportException.hx
index f930c52..036b9f5 100644
--- a/lib/haxe/src/org/apache/thrift/transport/TTransportException.hx
+++ b/lib/haxe/src/org/apache/thrift/transport/TTransportException.hx
@@ -23,6 +23,8 @@ import org.apache.thrift.TException;
 
 class TTransportException extends TException {
 
+    // WARNING: These are subject to be extended in the future, so we can't use enums 
+    // with Haxe 3.1.3 because of https://github.com/HaxeFoundation/haxe/issues/3649
     public static inline var UNKNOWN : Int = 0;
     public static inline var NOT_OPEN : Int = 1;
     public static inline var ALREADY_OPEN : Int = 2;