Author: tschoening
Date: Mon Feb 10 06:02:52 2014
New Revision: 1566514
URL: http://svn.apache.org/r1566514
Log:
LOGCXX-353: When a client disconnects the SocketHubAppender crashes on the next
log message
Modified:
incubator/log4cxx/trunk/src/changes/changes.xml
incubator/log4cxx/trunk/src/main/cpp/sockethubappender.cpp
Modified: incubator/log4cxx/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/changes/changes.xml?rev=1566514&r1=1566513&r2=1566514&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/changes/changes.xml (original)
+++ incubator/log4cxx/trunk/src/changes/changes.xml Mon Feb 10 06:02:52 2014
@@ -58,6 +58,7 @@
<action issue="LOGCXX-336" type="fix">Test compilation
fails: Overloading ambiguity</action>
<action issue="LOGCXX-340"
type="fix">Transcoder::encodeCharsetName bungles encoding</action>
<action issue="LOGCXX-351" type="fix">Download page
does not have link to KEYS file</action>
+ <action issue="LOGCXX-353" type="fix">When a client
disconnects the SocketHubAppender crashes on the next log message</action>
<action issue="LOGCXX-358" type="fix">SMTPAppender
generating Emails with an empty body</action>
<action issue="LOGCXX-365" type="fix">Unit tests fail
on system dates later than 2009-12-31.</action>
<action issue="LOGCXX-366" type="fix">Errors when
compile log4cxx 0.10.0 under Win7 x64 with Visual Studio 2010 (due to Christian
Boos and Feng Nan)</action>
Modified: incubator/log4cxx/trunk/src/main/cpp/sockethubappender.cpp
URL:
http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/sockethubappender.cpp?rev=1566514&r1=1566513&r2=1566514&view=diff
==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/sockethubappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/sockethubappender.cpp Mon Feb 10
06:02:52 2014
@@ -127,13 +127,13 @@ void SocketHubAppender::append(const spi
{
return;
}
-
+
LogString ndcVal;
event->getNDC(ndcVal);
event->getThreadName();
// Get a copy of this thread's MDC.
event->getMDCCopy();
-
+
// loop through the current set of open connections, appending the
event to each
std::vector<ObjectOutputStreamPtr>::iterator it = streams.begin();
@@ -156,6 +156,7 @@ void SocketHubAppender::append(const spi
{
// there was an io exception so just drop the
connection
it = streams.erase(it);
+ itEnd = streams.end();
LogLog::debug(LOG4CXX_STR("dropped connection"), e);
}
}