* SSU: Fix 100% CPU after socket failure

* UPnP: Catch reported error on FreeBSD
This commit is contained in:
zzz
2014-09-22 13:22:35 +00:00
parent 98062f830a
commit 0e48557b48
4 changed files with 20 additions and 12 deletions

View File

@@ -1,3 +1,7 @@
2014-09-22 zzz
* SSU: Fix 100% CPU after socket failure
* UPnP: Catch reported error on FreeBSD
* 2014-09-20 0.9.15 released
2014-09-17 kytv

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 0;
public final static long BUILD = 1;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -281,6 +281,8 @@ class UDPReceiver {
_log.warn("Error receiving", ioe);
//}
packet.release();
// TODO count consecutive errors, give up after too many?
try { Thread.sleep(100); } catch (InterruptedException ie) {}
}
}
if (_log.shouldLog(Log.DEBUG))

View File

@@ -124,6 +124,7 @@ public class JaxpParser extends Parser
factory.setValidating(false);
factory.setNamespaceAware(true);
factory.setExpandEntityReferences(false);
try {
try {
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (ParserConfigurationException pce) {}
@@ -136,6 +137,7 @@ public class JaxpParser extends Parser
try {
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException pce) {}
} catch (AbstractMethodError ame) {} // FreeBSD
DocumentBuilder builder = factory.newDocumentBuilder();
builder.setEntityResolver(new BlankingResolver());
InputSource inSrc = new InputSource(new NullFilterInputStream(inStream));