git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf9c483
)
fix STOP server
author
Niki Roo
<niki@nikiroo.be>
Thu, 14 May 2020 15:21:23 +0000
(17:21 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Thu, 14 May 2020 15:21:23 +0000
(17:21 +0200)
src/be/nikiroo/fanfix/Main.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/Main.java
b/src/be/nikiroo/fanfix/Main.java
index e48f4f53ec7ab7d1951ea4760cacdb64afbccc51..c02abb387c0309ad79a8cba66d79733af22a775a 100644
(file)
--- a/
src/be/nikiroo/fanfix/Main.java
+++ b/
src/be/nikiroo/fanfix/Main.java
@@
-648,6
+648,18
@@
public class Main {
if (port == null)
port = Instance.getInstance().getConfig().getInteger(Config.SERVER_PORT);
if (port == null)
port = Instance.getInstance().getConfig().getInteger(Config.SERVER_PORT);
+ if (host == null) {
+ String mode = Instance.getInstance().getConfig()
+ .getString(Config.SERVER_MODE, "fanfix");
+ if ("http".equals(mode)) {
+ host = "http://localhost";
+ } else if ("https".equals(mode)) {
+ host = "https://localhost";
+ } else if ("fanfix".equals(mode)) {
+ host = "fanfix://localhost";
+ }
+ }
+
if (port == null) {
System.err.println("No port given nor configured in the config file");
exitCode = 15;
if (port == null) {
System.err.println("No port given nor configured in the config file");
exitCode = 15;
@@
-1069,7
+1081,7
@@
public class Main {
* @param key
* the key to contact the Fanfix server
* @param host
* @param key
* the key to contact the Fanfix server
* @param host
- * the host on which it runs
(NULL means localhost)
+ * the host on which it runs
* @param port
* the port on which it runs
*
* @param port
* the port on which it runs
*
@@
-1078,7
+1090,7
@@
public class Main {
* @throws SSLException
* when the key was not accepted
*/
* @throws SSLException
* when the key was not accepted
*/
- private void stopServer(String key, String host,
Integer
port)
+ private void stopServer(String key, String host,
int
port)
throws IOException, SSLException {
if (host.startsWith("http://") || host.startsWith("https://")) {
new WebLibrary(key, host, port).stop();
throws IOException, SSLException {
if (host.startsWith("http://") || host.startsWith("https://")) {
new WebLibrary(key, host, port).stop();