Mercurial Hosting > luan
diff src/luan/modules/http/LuanHandler.java @ 1767:9157e0d5936e
minor fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 06 Jun 2023 20:31:19 -0600 |
parents | 8df0b80e715e |
children |
line wrap: on
line diff
--- a/src/luan/modules/http/LuanHandler.java Tue Jun 06 14:33:24 2023 -0600 +++ b/src/luan/modules/http/LuanHandler.java Tue Jun 06 20:31:19 2023 -0600 @@ -35,7 +35,7 @@ private static final Logger logger = LoggerFactory.getLogger(LuanHandler.class); private final Luan luanInit; - private final String domain; + public final String domain; private final ReadWriteLock rwLock = new ReentrantReadWriteLock(); private volatile Luan currentLuan; private volatile boolean isDisabled = false; @@ -144,7 +144,7 @@ } @Override public void close() { - synchronized(currentLuan) { + synchronized(closeables) { for( Closeable c : closeables ) { try { c.close(); @@ -152,6 +152,7 @@ logger.error(c.toString(),e); } } + closeables.clear(); } } @@ -234,7 +235,10 @@ } @Override public void addCloseable(Closeable c) throws LuanException { - lh().closeables.add(c); + List<Closeable> closeables = lh().closeables; + synchronized(closeables) { + closeables.add(c); + } } public void reset_luan() throws LuanException {