*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
1 parent
f21f47005d
commit
26b5e033ff
2257 files changed
+750
-103852
No files matched your search
@@ -4,25 +4,20 @@
|
||||
**/
|
||||
/*
|
||||
Copyright (C) 2004-2007 Anders Hedstrom
|
||||
|
||||
This library is made available under the terms of the GNU GPL.
|
||||
|
||||
If you would like to use this library in a closed-source application,
|
||||
a separate license agreement is available. For information about
|
||||
the closed-source license agreement for the C++ sockets library,
|
||||
please visit http://www.alhem.net/Sockets/license.html and/or
|
||||
email license@alhem.net.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
@@ -42,24 +37,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#include "ISocketHandler.h"
|
||||
#include "Lock.h"
|
||||
#include "Mutex.h"
|
||||
|
||||
#ifdef SOCKETS_NAMESPACE
|
||||
namespace SOCKETS_NAMESPACE {
|
||||
#endif
|
||||
|
||||
//#ifdef _DEBUG
|
||||
//#define DEB(x) x
|
||||
//#else
|
||||
#define DEB(x)
|
||||
//#endif
|
||||
|
||||
|
||||
// static
|
||||
ResolvSocket::cache_t ResolvSocket::m_cache;
|
||||
ResolvSocket::timeout_t ResolvSocket::m_cache_to;
|
||||
Mutex ResolvSocket::m_cache_mutex;
|
||||
|
||||
|
||||
ResolvSocket::ResolvSocket(ISocketHandler& h)
|
||||
:TcpSocket(h)
|
||||
,m_bServer(false)
|
||||
@@ -72,7 +63,6 @@ ResolvSocket::ResolvSocket(ISocketHandler& h)
|
||||
SetLineProtocol();
|
||||
}
|
||||
|
||||
|
||||
ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, const std::string& host, port_t port, bool ipv6)
|
||||
:TcpSocket(h)
|
||||
,m_bServer(false)
|
||||
@@ -87,7 +77,6 @@ ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, const std::string&
|
||||
SetLineProtocol();
|
||||
}
|
||||
|
||||
|
||||
ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, ipaddr_t a)
|
||||
:TcpSocket(h)
|
||||
,m_bServer(false)
|
||||
@@ -102,7 +91,6 @@ ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, ipaddr_t a)
|
||||
SetLineProtocol();
|
||||
}
|
||||
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, in6_addr& a)
|
||||
:TcpSocket(h)
|
||||
@@ -117,12 +105,10 @@ ResolvSocket::ResolvSocket(ISocketHandler& h, Socket *parent, in6_addr& a)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ResolvSocket::~ResolvSocket()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void ResolvSocket::OnLine(const std::string& line)
|
||||
{
|
||||
Parse pa(line, ":");
|
||||
@@ -184,7 +170,6 @@ DEB(fprintf(stderr, " *** Returning cache for [%s][%s] = '%s'\n", m_query.c_str(
|
||||
std::string key = pa.getword();
|
||||
std::string value = pa.getrest();
|
||||
DEB( fprintf(stderr, " *** ResolvSocket response; %s: %s\n", key.c_str(), value.c_str());)
|
||||
|
||||
if (key == "Cached")
|
||||
{
|
||||
m_cached = true;
|
||||
@@ -268,7 +253,6 @@ DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(),
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void ResolvSocket::OnDetached()
|
||||
{
|
||||
DEB( fprintf(stderr, " *** ResolvSocket::OnDetached(); query=%s, data=%s\n", m_query.c_str(), m_data.c_str());)
|
||||
@@ -370,7 +354,6 @@ DEB( fprintf(stderr, " *** ResolvSocket::OnDetached(); query=%s, data=%s\n",
|
||||
SetCloseAndDelete();
|
||||
}
|
||||
|
||||
|
||||
void ResolvSocket::OnConnect()
|
||||
{
|
||||
if (!m_resolv_host.empty())
|
||||
@@ -405,7 +388,6 @@ void ResolvSocket::OnConnect()
|
||||
Send( msg );
|
||||
}
|
||||
|
||||
|
||||
void ResolvSocket::OnDelete()
|
||||
{
|
||||
if (m_parent)
|
||||
@@ -427,11 +409,8 @@ DEB(fprintf(stderr, " *** Update cache for [%s][%s] = '%s'\n", m_query.c_str(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef SOCKETS_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ENABLE_RESOLVER
|
||||
|
||||
|
||||
Reference in new issue
Block a user