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;
}
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;
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;
}
initMessage();
- auto errn = getErrno();
+ auto errn = errno;
const(char)* file = void;
int line = void;
/**
* 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.
*/
}
prot.readSetEnd();
break;
+ case TType.STOP: goto case;
+ case TType.VOID:
+ assert(false, "Invalid field type passed.");
}
}
return CType.SET;
case TType.LIST:
return CType.LIST;
+ case TType.VOID:
+ assert(false, "Invalid type passed.");
}
}
return "lst";
case TType.SET:
return "set";
+ case TType.STOP: goto case;
+ case TType.VOID:
+ assert(false, "Invalid type passed.");
}
}
// 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);
void setSocketOpts() {
try {
alias SocketOptionLevel.SOCKET lvlSock;
- linger l;
+ Linger l;
l.on = 0;
l.time = 0;
socket_.setOption(lvlSock, SocketOption.LINGER, l);
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__,
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;
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.
void delegate() dg;
auto b = hashSet(dg);
- enforce(b.toString() == "thrift.util.hashset.HashSet!(void delegate()).HashSet");
+ static assert(__traits(compiles, b.toString()));
}