You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2012/08/18 05:31:29 UTC

svn commit: r1374507 - in /thrift/trunk/lib/d/src/thrift: internal/socket.d internal/ssl.d protocol/base.d protocol/compact.d protocol/json.d server/transport/socket.d transport/socket.d transport/ssl.d util/hashset.d

Author: jfarrell
Date: Sat Aug 18 03:31:28 2012
New Revision: 1374507

URL: http://svn.apache.org/viewvc?rev=1374507&view=rev
Log:
Thrift-1674:Update Thrift D library to be compatible with 2.060
Client: d
Patch: David Nadlinger

Updated D lib for 2.060.


Modified:
    thrift/trunk/lib/d/src/thrift/internal/socket.d
    thrift/trunk/lib/d/src/thrift/internal/ssl.d
    thrift/trunk/lib/d/src/thrift/protocol/base.d
    thrift/trunk/lib/d/src/thrift/protocol/compact.d
    thrift/trunk/lib/d/src/thrift/protocol/json.d
    thrift/trunk/lib/d/src/thrift/server/transport/socket.d
    thrift/trunk/lib/d/src/thrift/transport/socket.d
    thrift/trunk/lib/d/src/thrift/transport/ssl.d
    thrift/trunk/lib/d/src/thrift/util/hashset.d

Modified: thrift/trunk/lib/d/src/thrift/internal/socket.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/internal/socket.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/internal/socket.d (original)
+++ thrift/trunk/lib/d/src/thrift/internal/socket.d Sat Aug 18 03:31:28 2012
@@ -44,7 +44,7 @@ version (Win32) {
   enum WSAENOTCONN = 10057;
   enum WSAETIMEDOUT = 10060;
 } else {
-  import core.stdc.errno : getErrno, EAGAIN, ECONNRESET, EINPROGRESS, EINTR,
+  import core.stdc.errno : errno, EAGAIN, ECONNRESET, EINPROGRESS, EINTR,
     ENOTCONN, EPIPE;
   import core.stdc.string : strerror;
 }
@@ -71,7 +71,7 @@ version (Win32) {
     return (errno == WSAECONNRESET || errno == WSAENOTCONN);
   }
 } else {
-  alias getErrno getSocketErrno;
+  alias errno getSocketErrno;
   enum CONNECT_INPROGRESS_ERRNO = EINPROGRESS;
   enum INTERRUPTED_ERRNO = EINTR;
   enum WOULD_BLOCK_ERRNO = EAGAIN;

Modified: thrift/trunk/lib/d/src/thrift/internal/ssl.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/internal/ssl.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/internal/ssl.d (original)
+++ thrift/trunk/lib/d/src/thrift/internal/ssl.d Sat Aug 18 03:31:28 2012
@@ -20,7 +20,7 @@ module thrift.internal.ssl;
 
 import core.memory : GC;
 import core.stdc.config;
-import core.stdc.errno : getErrno;
+import core.stdc.errno : errno;
 import core.stdc.string : strerror;
 import deimos.openssl.err;
 import deimos.openssl.ssl;
@@ -188,7 +188,7 @@ Exception getSSLException(string locatio
   }
   initMessage();
 
-  auto errn = getErrno();
+  auto errn = errno;
 
   const(char)* file = void;
   int line = void;

Modified: thrift/trunk/lib/d/src/thrift/protocol/base.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/protocol/base.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/protocol/base.d (original)
+++ thrift/trunk/lib/d/src/thrift/protocol/base.d Sat Aug 18 03:31:28 2012
@@ -253,7 +253,7 @@ protected:
 /**
  * Skips a field of the given type on the protocol.
  *
- * The main purpose of skip() is to allow treating struct and cotainer types,
+ * The main purpose of skip() is to allow treating struct and container types,
  * (where multiple primitive types have to be skipped) the same as scalar types
  * in generated code.
  */
@@ -322,6 +322,9 @@ void skip(Protocol)(Protocol prot, TType
       }
       prot.readSetEnd();
       break;
+    case TType.STOP: goto case;
+    case TType.VOID:
+      assert(false, "Invalid field type passed.");
   }
 }
 

Modified: thrift/trunk/lib/d/src/thrift/protocol/compact.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/protocol/compact.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/protocol/compact.d (original)
+++ thrift/trunk/lib/d/src/thrift/protocol/compact.d Sat Aug 18 03:31:28 2012
@@ -475,6 +475,8 @@ private:
         return CType.SET;
       case TType.LIST:
         return CType.LIST;
+      case TType.VOID:
+        assert(false, "Invalid type passed.");
     }
   }
 

Modified: thrift/trunk/lib/d/src/thrift/protocol/json.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/protocol/json.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/protocol/json.d (original)
+++ thrift/trunk/lib/d/src/thrift/protocol/json.d Sat Aug 18 03:31:28 2012
@@ -847,6 +847,9 @@ private {
         return "lst";
       case TType.SET:
         return "set";
+      case TType.STOP: goto case;
+      case TType.VOID:
+        assert(false, "Invalid type passed.");
     }
   }
 

Modified: thrift/trunk/lib/d/src/thrift/server/transport/socket.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/server/transport/socket.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/server/transport/socket.d (original)
+++ thrift/trunk/lib/d/src/thrift/server/transport/socket.d Sat Aug 18 03:31:28 2012
@@ -284,7 +284,7 @@ Socket makeSocketAndListen(ushort port, 
 
   // Turn linger off to avoid blocking on socket close.
   try {
-    linger l;
+    Linger l;
     l.on = 0;
     l.time = 0;
     socket.setOption(lvlSock, SocketOption.LINGER, l);

Modified: thrift/trunk/lib/d/src/thrift/transport/socket.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/transport/socket.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/transport/socket.d (original)
+++ thrift/trunk/lib/d/src/thrift/transport/socket.d Sat Aug 18 03:31:28 2012
@@ -158,7 +158,7 @@ protected:
   void setSocketOpts() {
     try {
       alias SocketOptionLevel.SOCKET lvlSock;
-      linger l;
+      Linger l;
       l.on = 0;
       l.time = 0;
       socket_.setOption(lvlSock, SocketOption.LINGER, l);
@@ -438,7 +438,7 @@ protected:
         socket_.setOption(SocketOptionLevel.SOCKET, type, value);
       } catch (SocketException e) {
         throw new TTransportException(
-          "Could not set send timeout: " ~ socketErrnoString(e.errorCode),
+          "Could not set timeout.",
           TTransportException.Type.UNKNOWN,
           __FILE__,
           __LINE__,

Modified: thrift/trunk/lib/d/src/thrift/transport/ssl.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/transport/ssl.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/transport/ssl.d (original)
+++ thrift/trunk/lib/d/src/thrift/transport/ssl.d Sat Aug 18 03:31:28 2012
@@ -23,7 +23,7 @@
 module thrift.transport.ssl;
 
 import core.exception : onOutOfMemoryError;
-import core.stdc.errno : getErrno, EINTR;
+import core.stdc.errno : errno, EINTR;
 import core.sync.mutex : Mutex;
 import core.memory : GC;
 import core.stdc.config;
@@ -149,7 +149,7 @@ final class TSSLSocket : TSocket {
       bytes = SSL_read(ssl_, buf.ptr, cast(int)buf.length);
       if (bytes >= 0) break;
 
-      auto errnoCopy = getErrno();
+      auto errnoCopy = errno;
       if (SSL_get_error(ssl_, bytes) == SSL_ERROR_SYSCALL) {
         if (ERR_get_error() == 0 && errnoCopy == EINTR) {
           // FIXME: Windows.

Modified: thrift/trunk/lib/d/src/thrift/util/hashset.d
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/d/src/thrift/util/hashset.d?rev=1374507&r1=1374506&r2=1374507&view=diff
==============================================================================
--- thrift/trunk/lib/d/src/thrift/util/hashset.d (original)
+++ thrift/trunk/lib/d/src/thrift/util/hashset.d Sat Aug 18 03:31:28 2012
@@ -141,5 +141,5 @@ unittest {
 
   void delegate() dg;
   auto b = hashSet(dg);
-  enforce(b.toString() == "thrift.util.hashset.HashSet!(void delegate()).HashSet");
+  static assert(__traits(compiles, b.toString()));
 }