mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-06 15:42:12 +01:00
fix open webserver port < 1024 as non privileged user
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user