changeset 791:ca81307adf7c

set thread name in LuanHandler
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Sep 2016 21:26:17 -0600
parents 4cddfc06a34f
children 87c63df214e9
files src/luan/modules/http/LuanHandler.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/modules/http/LuanHandler.java	Sun Sep 04 20:47:19 2016 -0600
+++ b/src/luan/modules/http/LuanHandler.java	Sun Sep 04 21:26:17 2016 -0600
@@ -56,6 +56,9 @@
 	{
 		if( target.endsWith("/") )
 			target += welcomeFile;
+		Thread thread = Thread.currentThread();
+		String oldName = thread.getName();
+		thread.setName(request.getHeader("host")+request.getRequestURI());
 		lock.readLock().lock();
 		try {
 			if( !HttpServicer.service(luan,request,response,"site:"+target+".luan") )
@@ -67,6 +70,7 @@
 			response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,err);
 		} finally {
 			lock.readLock().unlock();
+			thread.setName(oldName);
 		}
 		baseRequest.setHandled(true);
 	}