fix open webserver port < 1024 as non privileged user

This commit is contained in:
Sebastian Sdorra
2014-05-16 13:14:26 +02:00
parent a5355cfefb
commit e71477e301
2 changed files with 37 additions and 2 deletions

View File

@@ -92,12 +92,23 @@ public class ScmServer extends Thread
{
try
{
if (!initialized)
{
server.join();
}
server.start();
server.join();
}
catch (Exception ex)
{
throw new RuntimeException(ex);
if (ex instanceof ScmServerException)
{
throw(ScmServerException) ex;
}
else
{
throw new ScmServerException("could not start scm-server", ex);
}
}
}
@@ -110,6 +121,7 @@ public class ScmServer extends Thread
try
{
server.setStopAtShutdown(true);
initialized = false;
}
catch (Exception ex)
{
@@ -117,8 +129,28 @@ public class ScmServer extends Thread
}
}
/**
* Method description
*
*/
void init()
{
try
{
server.start();
initialized = true;
}
catch (Exception ex)
{
throw new ScmServerException("could not initialize server", ex);
}
}
//~--- fields ---------------------------------------------------------------
/** Field description */
private boolean initialized = false;
/** Field description */
private Server server = new Server();
}