diff options
-rw-r--r-- | Sluift/SluiftClient.cpp | 1 | ||||
-rw-r--r-- | Sluift/client.cpp | 9 |
2 files changed, 3 insertions, 7 deletions
diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp index 184fbd6..257eec1 100644 --- a/Sluift/SluiftClient.cpp +++ b/Sluift/SluiftClient.cpp @@ -57,4 +57,5 @@ void SluiftClient::connect(const std::string& host, int port) { options.manualHostname = host; options.manualPort = port; + disconnectedError = boost::optional<ClientError>(); if (globals->debug) { tracer = new ClientXMLTracer(client, options.boshURL.isEmpty()? false: true); diff --git a/Sluift/client.cpp b/Sluift/client.cpp index 2ca62d6..cd675fa 100644 --- a/Sluift/client.cpp +++ b/Sluift/client.cpp @@ -48,6 +48,6 @@ SLUIFT_LUA_FUNCTION(Client, async_connect) { SluiftClient* client = getClient(L); - std::string host; - int port = -1; + std::string host = client->getOptions().manualHostname; + int port = client->getOptions().manualPort; if (lua_istable(L, 2)) { if (boost::optional<std::string> hostString = Lua::getStringField(L, 2, "host")) { @@ -58,10 +58,5 @@ SLUIFT_LUA_FUNCTION(Client, async_connect) { } } - if (host.empty() && port == -1) { - client->connect(); - } - else { client->connect(host, port); - } return 0; } |