diff --git a/simgear/io/sg_netChannel.cxx b/simgear/io/sg_netChannel.cxx index e62e120a..1561e8de 100644 --- a/simgear/io/sg_netChannel.cxx +++ b/simgear/io/sg_netChannel.cxx @@ -251,6 +251,11 @@ NetChannelPoller::removeChannel(NetChannel* channel) assert(channel->poller == this); channel->poller = NULL; + // portability: MSVC throws assertion failure when empty + if (channels.empty()) { + return; + } + ChannelList::iterator it = channels.begin(); for (; it != channels.end(); ++it) { if (*it == channel) { diff --git a/simgear/io/test_HTTP.cxx b/simgear/io/test_HTTP.cxx index 1849434d..ea57837b 100644 --- a/simgear/io/test_HTTP.cxx +++ b/simgear/io/test_HTTP.cxx @@ -379,6 +379,8 @@ class TestServer : public NetChannel public: TestServer() { + Socket::initSockets(); + open(); bind(NULL, 2000); // localhost, any port listen(5); @@ -414,14 +416,14 @@ TestServer testServer; void waitForComplete(HTTP::Client* cl, TestRequest* tr) { SGTimeStamp start(SGTimeStamp::now()); - while (start.elapsedMSec() < 1000) { + while (start.elapsedMSec() < 10000) { cl->update(); testServer.poll(); if (tr->complete) { return; } - SGTimeStamp::sleepForMSec(1); + SGTimeStamp::sleepForMSec(15); } cerr << "timed out" << endl; @@ -430,14 +432,14 @@ void waitForComplete(HTTP::Client* cl, TestRequest* tr) void waitForFailed(HTTP::Client* cl, TestRequest* tr) { SGTimeStamp start(SGTimeStamp::now()); - while (start.elapsedMSec() < 1000) { + while (start.elapsedMSec() < 10000) { cl->update(); testServer.poll(); if (tr->failed) { return; } - SGTimeStamp::sleepForMSec(1); + SGTimeStamp::sleepForMSec(15); } cerr << "timed out waiting for failure" << endl;