activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbertram <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1534: ARTEMIS-1420 limit non-ssl connection h...
Date Thu, 19 Oct 2017 14:07:53 GMT
Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1534#discussion_r145710480
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ProtocolHandler.java
---
    @@ -99,9 +101,28 @@ public ProtocolManager getProtocol(String name) {
     
           private final boolean httpEnabled;
     
    +      private ScheduledFuture timeoutFuture;
    +
    +      private int handshakeTimeout;
    +
    +
           ProtocolDecoder(boolean http, boolean httpEnabled) {
              this.http = http;
              this.httpEnabled = httpEnabled;
    +         this.handshakeTimeout = ConfigurationHelper.getIntProperty(TransportConstants.NETTY_HANDSHAKE_TIMEOUT,
TransportConstants.DEFAULT_NETTY_HANDSHAKE_TIMEOUT, nettyAcceptor.getConfiguration());
    +      }
    +
    +      @Override
    +      public void channelActive(ChannelHandlerContext ctx) throws Exception {
    +         if (handshakeTimeout > 0) {
    +            timeoutFuture = scheduledThreadPool.schedule(new Runnable() {
    +               @Override
    --- End diff --
    
    This could be a bit more readable using a lambda. Just a thought.


---

Mime
View raw message