mirror of https://github.com/adamdruppe/arsd.git
x64 fixes
This commit is contained in:
parent
239a5b5651
commit
cfb136120d
|
@ -36,9 +36,7 @@ interface Database {
|
||||||
} else if (arg == typeid(long) || arg == typeid(const(long)) || arg == typeid(immutable(long))) {
|
} else if (arg == typeid(long) || arg == typeid(const(long)) || arg == typeid(immutable(long))) {
|
||||||
long e = va_arg!long(_argptr);
|
long e = va_arg!long(_argptr);
|
||||||
a = to!string(e);
|
a = to!string(e);
|
||||||
} else if (arg == typeid(void*)) {
|
} else if (arg == typeid(null)) {
|
||||||
void* e = va_arg!(void*)(_argptr);
|
|
||||||
assert(e is null, "can only pass null pointer");
|
|
||||||
a = null;
|
a = null;
|
||||||
} else assert(0, "invalid type " ~ arg.toString );
|
} else assert(0, "invalid type " ~ arg.toString );
|
||||||
|
|
||||||
|
@ -463,8 +461,6 @@ class DataObject {
|
||||||
auto e = va_arg!(long)(_argptr);
|
auto e = va_arg!(long)(_argptr);
|
||||||
a = to!string(e);
|
a = to!string(e);
|
||||||
} else if (arg == typeid(null)) {
|
} else if (arg == typeid(null)) {
|
||||||
auto e = va_arg!(void*)(_argptr);
|
|
||||||
assert(e is null, "can only pass null pointer");
|
|
||||||
a = null;
|
a = null;
|
||||||
} else assert(0, "invalid type " ~ arg.toString );
|
} else assert(0, "invalid type " ~ arg.toString );
|
||||||
|
|
||||||
|
|
14
netman.d
14
netman.d
|
@ -87,7 +87,7 @@ class NetworkManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int numActiveConnections(){
|
size_t numActiveConnections(){
|
||||||
return connections.length;
|
return connections.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,8 +220,8 @@ setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, on.sizeof);
|
||||||
if(connection.writeBufferLength > 0)
|
if(connection.writeBufferLength > 0)
|
||||||
if(FD_ISSET(connection.socket, &writefs)){
|
if(FD_ISSET(connection.socket, &writefs)){
|
||||||
auto b = connection.writeBuffer[connection.writeBufferPosition..(connection.writeBufferPosition+connection.writeBufferLength)];
|
auto b = connection.writeBuffer[connection.writeBufferPosition..(connection.writeBufferPosition+connection.writeBufferLength)];
|
||||||
//int num = send(connection.socket, b.ptr, b.length, 0);
|
//auto num = send(connection.socket, b.ptr, b.length, 0);
|
||||||
int num = write(connection.socket, b.ptr, b.length);
|
auto num = write(connection.socket, b.ptr, b.length);
|
||||||
if(num < 0)
|
if(num < 0)
|
||||||
throw new ConnectionException("send", connection);
|
throw new ConnectionException("send", connection);
|
||||||
|
|
||||||
|
@ -234,13 +234,13 @@ setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, on.sizeof);
|
||||||
connection.timeOfLastActivity = now;
|
connection.timeOfLastActivity = now;
|
||||||
}
|
}
|
||||||
if(FD_ISSET(connection.socket, &rdfs)){
|
if(FD_ISSET(connection.socket, &rdfs)){
|
||||||
int s = connection.readBufferPosition + connection.readBufferLength;
|
size_t s = connection.readBufferPosition + connection.readBufferLength;
|
||||||
s += 1024;
|
s += 1024;
|
||||||
if(connection.readBuffer.length < s)
|
if(connection.readBuffer.length < s)
|
||||||
connection.readBuffer.length = s;
|
connection.readBuffer.length = s;
|
||||||
//int size = recv(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024, 0);
|
//auto size = recv(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024, 0);
|
||||||
//std.stdio.writefln("read buffer length: %s", connection.readBufferLength);
|
//std.stdio.writefln("read buffer length: %s", connection.readBufferLength);
|
||||||
int size = read(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024);
|
auto size = read(connection.socket, connection.readBuffer.ptr + connection.readBufferPosition + connection.readBufferLength, 1024);
|
||||||
if(size == 0){
|
if(size == 0){
|
||||||
connection.disconnectQueued = true;
|
connection.disconnectQueued = true;
|
||||||
connection.reason = "size == 0";
|
connection.reason = "size == 0";
|
||||||
|
@ -372,7 +372,7 @@ class Connection {
|
||||||
if(socket < 0)
|
if(socket < 0)
|
||||||
throw new ConnectionException("cannot write to a closed connection", this);
|
throw new ConnectionException("cannot write to a closed connection", this);
|
||||||
|
|
||||||
int newEnd = writeBufferPosition + writeBufferLength + data.length;
|
size_t newEnd = writeBufferPosition + writeBufferLength + data.length;
|
||||||
|
|
||||||
if(newEnd >= writeBuffer.length)
|
if(newEnd >= writeBuffer.length)
|
||||||
writeBuffer.length = newEnd;
|
writeBuffer.length = newEnd;
|
||||||
|
|
2
web.d
2
web.d
|
@ -1084,7 +1084,7 @@ void run(Provider)(Cgi cgi, Provider instantiation, size_t pathInfoStartingPoint
|
||||||
|
|
||||||
form = doc.requireSelector!Form("form");
|
form = doc.requireSelector!Form("form");
|
||||||
} else {
|
} else {
|
||||||
Parameter[] params = cast(Parameter[]) (cast() *fun).parameters.dup;
|
Parameter[] params = (cast(Parameter[])fun.parameters).dup;
|
||||||
foreach(i, p; fun.parameters) {
|
foreach(i, p; fun.parameters) {
|
||||||
string value = "";
|
string value = "";
|
||||||
if(p.name in cgi.get)
|
if(p.name in cgi.get)
|
||||||
|
|
Loading…
Reference in New Issue