forked from I2P_Developers/i2p.i2p
imagegen: Catch render error (ticket #2507)
This commit is contained in:
@ -17,8 +17,10 @@ import com.docuverse.identicon.IdenticonRenderer;
|
||||
import com.docuverse.identicon.IdenticonUtil;
|
||||
import com.docuverse.identicon.NineBlockIdenticonRenderer2;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.util.ConvertToHash;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
|
||||
/**
|
||||
@ -146,12 +148,22 @@ public class IdenticonServlet extends HttpServlet {
|
||||
if (cache == null
|
||||
|| (imageBytes = cache.get(identiconETag)) == null) {
|
||||
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
|
||||
RenderedImage image = renderer.render(code, size);
|
||||
RenderedImage image;
|
||||
try {
|
||||
image = renderer.render(code, size);
|
||||
} catch (Throwable t) {
|
||||
// java.lang.NoClassDefFoundError: Could not initialize class java.awt.GraphicsEnvironment$LocalGE
|
||||
Log log = I2PAppContext.getGlobalContext().logManager().getLog(IdenticonServlet.class);
|
||||
log.logAlways(Log.WARN, "Identicon render failure: " + t);
|
||||
response.setStatus(403);
|
||||
return;
|
||||
}
|
||||
ImageIO.write(image, IDENTICON_IMAGE_FORMAT, byteOut);
|
||||
imageBytes = byteOut.toByteArray();
|
||||
if (cache != null)
|
||||
cache.add(identiconETag, imageBytes);
|
||||
} else {
|
||||
// FIXME this sends 403 if cached
|
||||
response.setStatus(403);
|
||||
return;
|
||||
}
|
||||
|
@ -1,3 +1,11 @@
|
||||
2019-06-25 zzz
|
||||
* I2CP: Prevent sending message to a local meta destination
|
||||
* imagegen: Catch render error (ticket #2507)
|
||||
* Router: Disable MessageHistory job on Android
|
||||
* Streaming:
|
||||
- Check that destinations match in signatures
|
||||
- Increase size of recently-closed cache
|
||||
|
||||
2019-06-22 zzz
|
||||
* Console: New logo
|
||||
* I2CP: Ensure that callbacks are called on abnormal close
|
||||
|
@ -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 = 12;
|
||||
public final static long BUILD = 13;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
Reference in New Issue
Block a user