Author: fmeschbe
Date: Sun Jan  9 18:14:35 2011
New Revision: 1056994

URL: http://svn.apache.org/viewvc?rev=1056994&view=rev
Log:
FELIX-2772 Do not use HTTP or HTTPS if configured port number is less than or 
equal to zero even though the FELIX_HTTP[S]_ENABLE flag is true

Modified:
    
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java

Modified: 
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java?rev=1056994&r1=1056993&r2=1056994&view=diff
==============================================================================
--- 
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
 (original)
+++ 
felix/trunk/http/jetty/src/main/java/org/apache/felix/http/jetty/internal/JettyConfig.java
 Sun Jan  9 18:14:35 2011
@@ -93,9 +93,14 @@ public final class JettyConfig
         return this.debug;
     }
 
+    /**
+     * Returns <code>true</code> if HTTP is configured to be used (
+     * {...@link #FELIX_HTTP_ENABLE}) and
+     * the configured HTTP port ({...@link #HTTP_PORT}) is higher than zero.
+     */
     public boolean isUseHttp()
     {
-        return this.useHttp;
+        return this.useHttp && getHttpPort() > 0;
     }
 
     public boolean isUseHttpNio()
@@ -103,9 +108,14 @@ public final class JettyConfig
         return this.useHttpNio;
     }
 
+    /**
+     * Returns <code>true</code> if HTTPS is configured to be used (
+     * {...@link #FELIX_HTTPS_ENABLE}) and
+     * the configured HTTP port ({...@link #HTTPS_PORT}) is higher than zero.
+     */
     public boolean isUseHttps()
     {
-        return this.useHttps;
+        return this.useHttps && getHttpsPort() > 0;
     }
 
     public boolean isUseHttpsNio()


Reply via email to