master moved from f15671372498 to c4ddf0244319

2 new revisions:

Revision: 31ee10af1c33
Author:   Jean Deruelle <[email protected]>
Date:     Thu Jan 30 10:15:20 2014 UTC
Log:      Update Issue 5...
http://code.google.com/p/commscale/source/detail?r=31ee10af1c33&repo=load-balancer

Revision: c4ddf0244319
Author:   Jean Deruelle <[email protected]>
Date:     Thu Jan 30 10:16:53 2014 UTC
Log:      Update Issue 5...
http://code.google.com/p/commscale/source/detail?r=c4ddf0244319&repo=load-balancer

==============================================================================
Revision: 31ee10af1c33
Author:   Jean Deruelle <[email protected]>
Date:     Thu Jan 30 10:15:20 2014 UTC
Log:      Update Issue 5

 making the maxContentLength configurable

(cherry picked from commit 5d825ee17a0177027b1ca3f27fc2a969173cfad4)

Conflicts:
jar/src/main/java/org/mobicents/tools/http/balancer/HttpClientPipelineFactory.java

http://code.google.com/p/commscale/source/detail?r=31ee10af1c33&repo=load-balancer

Modified:
/jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java /jar/src/main/java/org/mobicents/tools/http/balancer/HttpClientPipelineFactory.java
 /jar/src/main/java/org/mobicents/tools/sip/balancer/NodeRegisterImpl.java

=======================================
--- /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Mon Apr 8 11:52:20 2013 UTC +++ /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Thu Jan 30 10:15:20 2014 UTC
@@ -1,23 +1,20 @@
 /*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+ * TeleStax, Open Source Cloud Communications
+ * Copyright 2011-2013, Telestax Inc and individual contributors
+ * by the @authors tag.
  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
+ * This program is free software: you can redistribute it and/or modify
+ * under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation; either version 3 of
  * the License, or (at your option) any later version.
  *
- * This software is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>
  */

 package org.mobicents.tools.http.balancer;
@@ -39,6 +36,10 @@
 import org.mobicents.tools.sip.balancer.BalancerContext;
 import org.mobicents.tools.sip.balancer.BalancerRunner;

+/**
+ * @author Vladimir Ralev ([email protected])
+ * @author Jean Deruelle ([email protected])
+ */
 public class HttpBalancerForwarder {
private static final Logger logger = Logger.getLogger(HttpBalancerForwarder.class.getCanonicalName());
        ExecutorService executor;
@@ -61,10 +62,17 @@
String httpPortString = balancerRunner.balancerContext.properties.getProperty("httpPort", "2080");
                        httpPort = Integer.parseInt(httpPortString);
                }
+               // Defaulting to 1 MB
+               int maxContentLength = 1048576;
+               if(balancerRunner.balancerContext.properties != null) {
+ String maxContentLengthString = balancerRunner.balancerContext.properties.getProperty("maxContentLength", "1048576");
+                       maxContentLength = 
Integer.parseInt(maxContentLengthString);
+               }
                logger.info("HTTP LB listening on port " + httpPort);
+ logger.debug("HTTP maxContentLength Chunking set to " + maxContentLength); HttpChannelAssociations.serverBootstrap.setPipelineFactory(new HttpServerPipelineFactory(balancerRunner)); serverChannel = HttpChannelAssociations.serverBootstrap.bind(new InetSocketAddress(httpPort)); - HttpChannelAssociations.inboundBootstrap.setPipelineFactory(new HttpClientPipelineFactory()); + HttpChannelAssociations.inboundBootstrap.setPipelineFactory(new HttpClientPipelineFactory(maxContentLength));
        }

        public void stop() {
=======================================
--- /jar/src/main/java/org/mobicents/tools/http/balancer/HttpClientPipelineFactory.java Fri Feb 15 22:00:00 2013 UTC +++ /jar/src/main/java/org/mobicents/tools/http/balancer/HttpClientPipelineFactory.java Thu Jan 30 10:15:20 2014 UTC
@@ -1,23 +1,20 @@
 /*
- * JBoss, Home of Professional Open Source
- * Copyright 2011, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
+ * TeleStax, Open Source Cloud Communications
+ * Copyright 2011-2013, Telestax Inc and individual contributors
+ * by the @authors tag.
  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
+ * This program is free software: you can redistribute it and/or modify
+ * under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation; either version 3 of
  * the License, or (at your option) any later version.
  *
- * This software is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>
  */

 package org.mobicents.tools.http.balancer;
@@ -35,9 +32,16 @@
  * @author Andy Taylor ([email protected])
  * @author Trustin Lee ([email protected])
  * @author Vladimir Ralev ([email protected])
+ * @author Jean Deruelle ([email protected])
  *
  */
 public class HttpClientPipelineFactory implements ChannelPipelineFactory {
+    int maxContentLength = 1048576;
+
+    public HttpClientPipelineFactory(int maxContentLength) {
+       this.maxContentLength = maxContentLength;
+    }
+
     public ChannelPipeline getPipeline() throws Exception {
         // Create a default pipeline implementation.
         ChannelPipeline pipeline = pipeline();
@@ -45,9 +49,14 @@
// Remove the following line if you don't want automatic content decompression.
         //pipeline.addLast("inflater", new HttpContentDecompressor());
         pipeline.addLast("encoder", new HttpRequestEncoder());
- // http://code.google.com/p/commscale/issues/detail?id=5 support for HttpChunks
-        pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
+ // http://code.google.com/p/commscale/issues/detail?id=5 support for HttpChunks, + // https://telestax.atlassian.net/browse/LB-8 if commented accessing the RestComm Management console fails, so making the maxContentLength Configurable + pipeline.addLast("aggregator", new HttpChunkAggregator(maxContentLength));
         pipeline.addLast("handler", new HttpResponseHandler());
         return pipeline;
     }
+
+    public void setMaxContentLength(int maxContentLength) {
+       this.maxContentLength = maxContentLength;
+    }
 }
=======================================
--- /jar/src/main/java/org/mobicents/tools/sip/balancer/NodeRegisterImpl.java Tue May 22 13:40:28 2012 UTC +++ /jar/src/main/java/org/mobicents/tools/sip/balancer/NodeRegisterImpl.java Thu Jan 30 10:15:20 2014 UTC
@@ -292,8 +292,8 @@
        class NodeExpirationTimerTask extends TimerTask {

                public void run() {
-                       if(logger.isDebugEnabled()) {
-                               logger.debug("NodeExpirationTimerTask Running");
+                       if(logger.isTraceEnabled()) {
+                               logger.trace("NodeExpirationTimerTask Running");
                        }
                        for (SIPNode node : 
balancerRunner.balancerContext.aliveNodes) {
                                long expirationTime = node.getTimeStamp() + 
nodeExpiration;
@@ -312,14 +312,14 @@
                                                         "ms and tolerance=" + 
nodeExpiration + " ms");
                                        }
                                } else {
-                                       if(logger.isDebugEnabled()) {
- logger.debug("node time stamp : " + expirationTime + " , current time : "
+                                       if(logger.isTraceEnabled()) {
+ logger.trace("node time stamp : " + expirationTime + " , current time : "
                                                        + 
System.currentTimeMillis());
                                        }
                                }
                        }
-                       if(logger.isDebugEnabled()) {
-                               logger.debug("NodeExpirationTimerTask Done");
+                       if(logger.isTraceEnabled()) {
+                               logger.trace("NodeExpirationTimerTask Done");
                        }
                }


==============================================================================
Revision: c4ddf0244319
Author:   Jean Deruelle <[email protected]>
Date:     Thu Jan 30 10:16:53 2014 UTC
Log:      Update Issue 5

fixing the default port so the http port is always set

(cherry picked from commit a075e9ab8c2b7ebccd2a85b815f6aef581f98150)

http://code.google.com/p/commscale/source/detail?r=c4ddf0244319&repo=load-balancer

Modified:
/jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java

=======================================
--- /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Thu Jan 30 10:15:20 2014 UTC +++ /jar/src/main/java/org/mobicents/tools/http/balancer/HttpBalancerForwarder.java Thu Jan 30 10:16:53 2014 UTC
@@ -56,8 +56,8 @@
HttpChannelAssociations.inboundBootstrap = new ClientBootstrap(nioClientSocketChannelFactory); HttpChannelAssociations.channels = new ConcurrentHashMap<Channel, Channel>();

-
-               Integer httpPort = 2222;
+ // https://telestax.atlassian.net/browse/LB-7 making the default port the same
+               Integer httpPort = 2080;
                if(balancerRunner.balancerContext.properties != null) {
String httpPortString = balancerRunner.balancerContext.properties.getProperty("httpPort", "2080");
                        httpPort = Integer.parseInt(httpPortString);

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to