From d5b2ff184df94e0fcd7bba35587e1de556975d46 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sun, 19 Apr 2009 17:25:07 +0200 Subject: [PATCH] Upstream tarball 9573 --- .svn-revision | 2 +- src/MuleUDPSocket.cpp | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.svn-revision b/.svn-revision index 76c21196..0fd7b9f8 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -9572 +9573 diff --git a/src/MuleUDPSocket.cpp b/src/MuleUDPSocket.cpp index b86fcf7f..85475b4c 100644 --- a/src/MuleUDPSocket.cpp +++ b/src/MuleUDPSocket.cpp @@ -170,11 +170,10 @@ void CMuleUDPSocket::OnReceive(int errorCode) AddDebugLogLineM(false, logMuleUDP, m_name + wxT(": Invalid Packet received")); } else if (!ip) { // wxFAIL; - printf("Unknown ip receiving on UDP packet! Ignoring: '%s'\n", - (const char*)unicode2char(addr.IPAddress())); + AddLogLineNS(wxT("Unknown ip receiving an UDP packet! Ignoring: '") + addr.IPAddress() + wxT("'")); } else if (!port) { // wxFAIL; - printf("Unknown port receiving an UDP packet! Ignoring\n"); + AddLogLineNS(wxT("Unknown port receiving an UDP packet! Ignoring")); } else if (theApp->clientlist->IsBannedClient(ip)) { AddDebugLogLineM(false, logMuleUDP, m_name + wxT(": Dropped packet from banned IP ") + addr.IPAddress()); } else { @@ -220,17 +219,15 @@ void CMuleUDPSocket::SendPacket(CPacket* packet, uint32 IP, uint16 port, bool bE } if (!Ok()) { - AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet discarded (socket not Ok): ")) - << Uint32toStringIP(IP) << wxT(":") << port << wxT(" ") << packet->GetPacketSize() - << wxT("b")); + AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet discarded, socket not Ok (")) + << Uint32_16toStringIP_Port(IP, port) << wxT("): ") << packet->GetPacketSize() << wxT("b")); delete packet; return; } - AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet queued: ")) - << Uint32toStringIP(IP) << wxT(":") << port << wxT(" ") - << packet->GetPacketSize() << wxT("b")); + AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet queued (")) + << Uint32_16toStringIP_Port(IP, port) << wxT("): ") << packet->GetPacketSize() << wxT("b")); UDPPack newpending; newpending.IP = IP; @@ -331,13 +328,14 @@ bool CMuleUDPSocket::SendTo(uint8_t *buffer, uint32_t length, uint32_t ip, uint1 } else { // An error which we can't handle happended, so we drop // the packet rather than risk entering an infinite loop. - printf("WARNING! %s discarded packet due to errors (%i) while sending.\n", - (const char*)unicode2char(m_name), error); + AddLogLineNS((wxT("WARNING! ") + m_name + wxT(": Packet to ")) + << Uint32_16toStringIP_Port(ip, port) + << wxT(" discarded due to error (") << error << wxT(") while sending.")); sent = true; } } else { - AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet sent to ")) - << ip << wxT(":") << port << wxT(": ") + AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet sent (")) + << Uint32_16toStringIP_Port(ip, port) << wxT("): ") << length << wxT("b")); sent = true; } -- 2.11.4.GIT