Thrift-1674:Update Thrift D library to be compatible with 2.060

Client: d
Patch: David Nadlinger

Updated D lib for 2.060.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1374507 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jake Farrell 2012-08-18 03:31:28 +00:00
parent ffd7685c09
commit c02efe21c1
9 changed files with 19 additions and 11 deletions

View File

@ -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;

View File

@ -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 location = null, string clientFile = __FILE__,
}
initMessage();
auto errn = getErrno();
auto errn = errno;
const(char)* file = void;
int line = void;

View File

@ -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 type) if (is(Protocol : TProtocol)) {
}
prot.readSetEnd();
break;
case TType.STOP: goto case;
case TType.VOID:
assert(false, "Invalid field type passed.");
}
}

View File

@ -475,6 +475,8 @@ private:
return CType.SET;
case TType.LIST:
return CType.LIST;
case TType.VOID:
assert(false, "Invalid type passed.");
}
}

View File

@ -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.");
}
}

View File

@ -284,7 +284,7 @@ Socket makeSocketAndListen(ushort port, int backlog, ushort retryLimit,
// 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);

View File

@ -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__,

View File

@ -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.

View File

@ -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()));
}