From 03b8c56b67d92a781357297f2f6fbdca4fa05044 Mon Sep 17 00:00:00 2001 From: lotodore Date: Sat, 19 Apr 2008 11:56:27 +0000 Subject: [PATCH] Fixed linefeeds. --- src/net/common/clientstate.cpp | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 0880d0dc..ec5a09bd 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -253,7 +253,7 @@ ClientStateStartServerListDownload::Process(ClientThread &client) { int retVal = MSG_SOCK_INTERNAL_PENDING; - const ClientContext &context = client.GetContext(); + const ClientContext &context = client.GetContext(); path tmpServerListPath(context.GetCacheDir()); tmpServerListPath /= "serverlist.xml.z"; @@ -302,41 +302,41 @@ ClientStateDownloadingServerList::Process(ClientThread &client) if (m_downloadHelper->Process()) { - ClientContext &context = client.GetContext(); + ClientContext &context = client.GetContext(); path zippedServerListPath(context.GetCacheDir()); zippedServerListPath /= "serverlist.xml.z"; path xmlServerListPath = change_extension(zippedServerListPath, ""); // Unzip the file. { - ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary); - ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out); - boost::iostreams::filtering_streambuf in; - in.push(boost::iostreams::zlib_decompressor()); - in.push(inFile); - boost::iostreams::copy(in, outFile); - } - // Parse the server address. + ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary); + ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out); + boost::iostreams::filtering_streambuf in; + in.push(boost::iostreams::zlib_decompressor()); + in.push(inFile); + boost::iostreams::copy(in, outFile); + } + // Parse the server address. TiXmlDocument doc(xmlServerListPath.directory_string()); if (doc.LoadFile()) { - TiXmlHandle docHandle(&doc); - const TiXmlElement *firstServer = docHandle.FirstChild("ServerList" ).FirstChild("Server").ToElement(); - if (firstServer) - { - ClientContext &context = client.GetContext(); - const TiXmlNode *addrNode = firstServer->FirstChild("IPv4Address"); - if (addrNode && addrNode->ToElement()) - context.SetServerAddr(addrNode->ToElement()->Attribute("value")); - const TiXmlNode *portNode = firstServer->FirstChild("Port"); - if (portNode && portNode->ToElement()) - { - int tmpPort = 0; - portNode->ToElement()->QueryIntAttribute("value", &tmpPort); - context.SetServerPort((unsigned)tmpPort); - } - } - } + TiXmlHandle docHandle(&doc); + const TiXmlElement *firstServer = docHandle.FirstChild("ServerList" ).FirstChild("Server").ToElement(); + if (firstServer) + { + ClientContext &context = client.GetContext(); + const TiXmlNode *addrNode = firstServer->FirstChild("IPv4Address"); + if (addrNode && addrNode->ToElement()) + context.SetServerAddr(addrNode->ToElement()->Attribute("value")); + const TiXmlNode *portNode = firstServer->FirstChild("Port"); + if (portNode && portNode->ToElement()) + { + int tmpPort = 0; + portNode->ToElement()->QueryIntAttribute("value", &tmpPort); + context.SetServerPort((unsigned)tmpPort); + } + } + } client.SetState(ClientStateStartResolve::Instance()); }