profile
viewpoint

cconroy/curator 0

Mirror of Apache Curator

cconroy/gson 0

A Java serialization library that can convert Java Objects into JSON and back.

cconroy/intellij-plugin-copy-and-open-github-url 0

intellij plugin: copy as github

cconroy/javapoet 0

A Java API for generating .java source files.

cconroy/netty 0

Netty project - an event-driven asynchronous network application framework

cconroy/netty-tcnative 0

A fork of Apache Tomcat Native, based on finagle-native

cconroy/protobuf 0

Protocol Buffers - Google's data interchange format

issue closednetty/netty

io.netty.channel.DefaultFileRegion.transferTo throws EOPNOTSUPP (java.io.IOException: Operation not Supported)

Expected behavior Host A send a file stream to Host B successfully

Actual behavior Got an IOException:Operation not Supported ERROR org.apache.spark.network.server.TransportRequestHandler: Error sending result StreamResponse{streamId=/jars/spark-examples_2.11-2.2.1.jar, byteCount=1992533, body=FileSegmentManagedBuffer{file=/opt/spark/examples/jars/spark-examples_2.11-2.2.1.jar, offset=0, length=1992533}} to /175.117.1.16:42812; closing connection java.io.IOException: Operation not Supported at sun.nio.ch.FileChannelImpl.transferTo0(Native Method) at sun.nio.ch.FileChannelImpl.transferToDirectlyInternal(FileChannelImpl.java:428) at sun.nio.ch.FileChannelImpl.transferToDirectly(FileChannelImpl.java:493) at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:608) at io.netty.channel.DefaultFileRegion.transferTo(DefaultFileRegion.java:139)

Steps to reproduce

  1. Install a spark cluster
  2. Run ’spark-submit --class org.apache.spark.examples.SparkPi --executor-cores 1 --executor-memory 1g --total-executor-cores 3 spark-examples_2.11-2.2.1.jar 100‘
  3. we can find the IOE(Operation not Supported) in console
  4. we catched the Process trace log as follows:
98724 15:32:58.175513 open("/opt/spark/examples/jars/spark-examples_2.11-2.2.1.jar", O_RDONLY) = 421 <0.000027>
98724 15:32:58.175581 fstat(421, {st_mode=S_IFREG|0777, st_size=1992533, ...}) = 0 <0.000016>
98724 15:32:58.175662 fstat(421, {st_mode=S_IFREG|0777, st_size=1992533, ...}) = 0 <0.000015>
98724 15:32:58.175725 sendfile(420, 421, [0], 1992533) = -1 EOPNOTSUPP (Operation not supported) <0.000024>
98724 15:32:58.175892 getsockopt(420, SOL_SOCKET, SO_LINGER, {onoff=0, linger=0}, [8]) = 0 <0.000018>

Minimal yet complete reproducer code (or URL to code)

Netty version 4.0.43

JVM version (e.g. java -version) JDK1.8

OS version (e.g. uname -a) SUSE12 SP5

closed time in an hour

ouyangxiaochen

issue commentnetty/netty

io.netty.channel.DefaultFileRegion.transferTo throws EOPNOTSUPP (java.io.IOException: Operation not Supported)

This exception is thrown from the JDK itself, so there is nothing we can do about it.

ouyangxiaochen

comment created time in an hour

Pull request review commentnetty/netty

Add ConnAck message builder method to handle the creation of related properties

 public MqttConnAckMessage build() {         }     } +    public static class ConnAckPropertiesBuilder {+        private String clientId;+        private Long sessionExpiryInterval;+        private int receiveMaximum;+        private Byte maximumQos;+        private boolean retain;+        private Long maximumPacketSize;+        private int topicAliasMaximum;+        private String reasonString;+        private MqttProperties.UserProperties userProperties = new MqttProperties.UserProperties();+        private Boolean wildcardSubscriptionAvailable;+        private Boolean subscriptionIdentifiersAvailable;+        private Boolean sharedSubscriptionAvailable;+        private Integer serverKeepAlive;+        private String responseInformation;+        private String serverReference;+        private String authenticationMethod;+        private byte[] authenticationData;++        public MqttProperties build() {+            final MqttProperties props = new MqttProperties();+            if (clientId != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.ASSIGNED_CLIENT_IDENTIFIER.value(),+                        clientId));+            }+            if (sessionExpiryInterval != null) {+                props.add(new MqttProperties.IntegerProperty(+                        MqttPropertyType.SESSION_EXPIRY_INTERVAL.value(), sessionExpiryInterval.intValue()));+            }+            if (receiveMaximum > 0) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RECEIVE_MAXIMUM.value(), receiveMaximum));+            }+            if (maximumQos != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_QOS.value(), receiveMaximum));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RETAIN_AVAILABLE.value(), retain ? 1 : 0));+            if (maximumPacketSize != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_PACKET_SIZE.value(),+                        maximumPacketSize.intValue()));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.TOPIC_ALIAS_MAXIMUM.value(),+                    topicAliasMaximum));+            if (reasonString != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.REASON_STRING.value(), reasonString));+            }+            props.add(userProperties);+            if (wildcardSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.WILDCARD_SUBSCRIPTION_AVAILABLE.value(),+                        wildcardSubscriptionAvailable ? 1 : 0));+            }+            if (subscriptionIdentifiersAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SUBSCRIPTION_IDENTIFIER_AVAILABLE.value(),+                        subscriptionIdentifiersAvailable ? 1 : 0));+            }+            if (sharedSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SHARED_SUBSCRIPTION_AVAILABLE.value(),+                        sharedSubscriptionAvailable ? 1 : 0));+            }+            if (serverKeepAlive != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SERVER_KEEP_ALIVE.value(),+                        serverKeepAlive));+            }+            if (responseInformation != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.RESPONSE_INFORMATION.value(),+                        responseInformation));+            }+            if (serverReference != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.SERVER_REFERENCE.value(),+                        serverReference));+            }+            if (authenticationMethod != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.AUTHENTICATION_METHOD.value(),+                        authenticationMethod));+            }+            if (authenticationData != null) {+                props.add(new MqttProperties.BinaryProperty(MqttPropertyType.AUTHENTICATION_DATA.value(),+                        authenticationData));+            }++            return props;+        }++        public void sessionExpiryInterval(long seconds) {+            this.sessionExpiryInterval = seconds;+        }++        public void receiveMaximum(int value) {+            if (value <= 0) {+                throw new IllegalArgumentException("receive maximum property must be > 0");+            }+            this.receiveMaximum = value;+        }++        public void maximumQos(byte value) {

the intent was to have a declarative listing, something like:

properties.apply {
   maximumQos = 1
   assignedClientId = "client1234"
   ....
}

to mimic in Java as:

withProperties(p -> {
    p.maximumQos(1);
    p.assignedClientId("client1234");
   ...
})
andsel

comment created time in 8 hours

issue openednetty/netty

io.netty.channel.DefaultFileRegion.transferTo throws EOPNOTSUPP (java.io.IOException: Operation not Supported)

Expected behavior Host A send a file stream to host B successfully

Actual behavior Got an IOException:Operation not Supported

Steps to reproduce

  1. Install a spark cluster 2.spark-submit --class org.apache.spark.example.SparkPi --executor-cores 1 --executor-memory 1g --total-executor-cores 3 spark-examples_2.11-2.2.1.jar 100
  2. we can find the IOE(Operation not Supported) in console
  3. we catch the Process trace log as follow:
98724 15:32:58.175513 open("/opt/spark/examples/jars/spark-examples_2.11-2.2.1.jar", O_RDONLY) = 421 <0.000027>
98724 15:32:58.175581 fstat(421, {st_mode=S_IFREG|0777, st_size=1992533, ...}) = 0 <0.000016>
98724 15:32:58.175662 fstat(421, {st_mode=S_IFREG|0777, st_size=1992533, ...}) = 0 <0.000015>
98724 15:32:58.175725 sendfile(420, 421, [0], 1992533) = -1 EOPNOTSUPP (Operation not supported) <0.000024>
98724 15:32:58.175892 getsockopt(420, SOL_SOCKET, SO_LINGER, {onoff=0, linger=0}, [8]) = 0 <0.000018>

Minimal yet complete reproducer code (or URL to code)

Netty version 4.0.43

JVM version (e.g. java -version) JDK1.8

OS version (e.g. uname -a) SUSE12 SP5

created time in 14 hours

Pull request review commentnetty/netty

Create bespoke long/long hashmap and long-valued priority queue for PoolChunk

 private void insertAvailRun(int runOffset, int pages, Long handle) {         }     } -    private void insertAvailRun0(int runOffset, Long handle) {-        Long pre = runsAvailMap.put(runOffset, handle);-        assert pre == null;+    private void insertAvailRun0(int runOffset, long handle) {+        long pre = runsAvailMap.put(runOffset, handle);+        assert pre == 0;

what is the reason for returning 0 and not -1 here ? IMHO -1 would be what I expect for a non existing key as handles will always be positive.

chrisvest

comment created time in a day

Pull request review commentnetty/netty

Create bespoke long/long hashmap and long-valued priority queue for PoolChunk

 private void tcacheAllocateNormal(PoolThreadCache cache, PooledByteBuf<T> buf, f         }     } -    // Method must be called inside synchronized(this) { ... } block+    // Method must be called inside synchronized(this) { ... } block

Lets do this as a follow up as its not related to the PR

chrisvest

comment created time in a day

Pull request review commentnetty/netty

Create bespoke long/long hashmap and long-valued priority queue for PoolChunk

 private void tcacheAllocateNormal(PoolThreadCache cache, PooledByteBuf<T> buf, f         }     } -    // Method must be called inside synchronized(this) { ... } block+    // Method must be called inside synchronized(this) { ... } block

let's put a proper assert with monitor check

chrisvest

comment created time in a day

issue closednetty/netty

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (build-native-lib) on project netty-transport-native-unix-common: An Ant BuildException has occured: exec returned: 2

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (build-native-lib) on project netty-transport-native-unix-common: An Ant BuildException has occured: exec returned: 2 [ERROR] around Ant part ...<exec resolveexecutable="true" failonerror="true" executable="make">... @ 4:71 in /Users/wangxiaoliang/github/netty/transport-native-unix-common/target/antrun/build-main.xml [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :netty-transport-native-unix-common

closed time in a day

xiaoliang-wang

push eventnetty/netty

Norman Maurer

commit sha 23c0bbb9045fda365e906504b559a11bad717faa

Don't use the cname cache when using DnsRecordResolveContext (#10808) Motivation: The DnsNameResolver internally follows CNAME indirects for all records types, and supports caching for CNAME resolution and A* records. For DNS record types that are not cached (e.g. SRV records) the caching of CNAME records may result in failures at incorrect times. For example if a CNAME record has a larger TTL than the entries it resolves this may result in failures which don't occur if the CNAME cache is disabled. Modifications: - Don't cache CNAME and also dont use the cache for CNAME when using DnsRecordResolveContext - Add unit test Result: More correct resolving and also not possible to have failures due CNAME still be in the cache while the queried record experied

view details

push time in a day

push eventnetty/netty

Norman Maurer

commit sha 567b46fa0182e5b613ae1c975972a3cfa35c06a4

Don't use the cname cache when using DnsRecordResolveContext (#10808) Motivation: The DnsNameResolver internally follows CNAME indirects for all records types, and supports caching for CNAME resolution and A* records. For DNS record types that are not cached (e.g. SRV records) the caching of CNAME records may result in failures at incorrect times. For example if a CNAME record has a larger TTL than the entries it resolves this may result in failures which don't occur if the CNAME cache is disabled. Modifications: - Don't cache CNAME and also dont use the cache for CNAME when using DnsRecordResolveContext - Add unit test Result: More correct resolving and also not possible to have failures due CNAME still be in the cache while the queried record experied

view details

push time in a day

delete branch netty/netty

delete branch : no_cname_cache

delete time in a day

PR merged netty/netty

Reviewers
Don't use the cname cache when using DnsRecordResolveContext

Motivation:

When we resolve other records then AAAA / AAAA we will use the resolve(...) overloads that take a DnsQuestion. This will then end up creating a DnsRecordResolveContext, in this case we should not use the CnameCache at all as we also not the result.

Modifications:

Don't cache CNAME and also dont use the cache for CNAME when using DnsRecordResolveContext

Result:

More correct resolving and also not possible to have failures due CNAME still be in the cache while the queried record experied

+94 -0

2 comments

2 changed files

normanmaurer

pr closed time in a day

issue commentnetty/netty

Websocket checkStartsWith doesn't work as expected

Apologies for the delay. Please give me a chance to verify on Monday, after the US holiday.

travishaagen

comment created time in a day

pull request commentnetty/netty

Add NetBSD support

I was told to check surefire tests and they trigger an openjdk11 error on NetBSD, related to kqueue (EINVAL). I need to dig into it.

krytarowski

comment created time in a day

push eventnetty/netty

Norman Maurer

commit sha 7ebdc9cf4bab99f0e02acfa3495116c908e3df69

Don't use the cname cache when using DnsRecordResolveContext Motivation: The DnsNameResolver internally follows CNAME indirects for all records types, and supports caching for CNAME resolution and A* records. For DNS record types that are not cached (e.g. SRV records) the caching of CNAME records may result in failures at incorrect times. For example if a CNAME record has a larger TTL than the entries it resolves this may result in failures which don't occur if the CNAME cache is disabled. Modifications: - Don't cache CNAME and also dont use the cache for CNAME when using DnsRecordResolveContext - Add unit test Result: More correct resolving and also not possible to have failures due CNAME still be in the cache while the queried record experied

view details

push time in a day

pull request commentnetty/netty

Don't use the cname cache when using DnsRecordResolveContext

@Scottmitch adjusted commit message and added test. Will pull in once the CI passed.

normanmaurer

comment created time in a day

push eventnetty/netty

Norman Maurer

commit sha a6d57c779b4d8107f4d4f00d29eef8d410ded973

Don't use the cname cache when using DnsRecordResolveContext Motivation: The DnsNameResolver internally follows CNAME indirects for all records types, and supports caching for CNAME resolution and A* records. For DNS record types that are not cached (e.g. SRV records) the caching of CNAME records may result in failures at incorrect times. For example if a CNAME record has a larger TTL than the entries it resolves this may result in failures which don't occur if the CNAME cache is disabled. Modifications: - Don't cache CNAME and also dont use the cache for CNAME when using DnsRecordResolveContext - Add unit test Result: More correct resolving and also not possible to have failures due CNAME still be in the cache while the queried record experied

view details

push time in a day

pull request commentnetty/netty

Add PushPromise and Priority Frame support in Http2FrameCodec

@normanmaurer Done. :)

PTAL and lemme know. :D

hyperxpro

comment created time in a day

PR closed netty/netty

Remove the Unpooled.wrappedBuffer method that wraps a raw pointer

Motiviation: This method is inherently unsafe, and also appears to have no usage within Netty itself.

Modification: Removed the Unpooled.wrappedBuffer method that takes a raw pointer, and also remove the WrappedUnpooledUnsafeDirectByteBuf that only existed to support this method.

Result: Less unsafe code.

+8 -193

5 comments

3 changed files

chrisvest

pr closed time in a day

Pull request review commentnetty/netty

Remove the Unpooled.wrappedBuffer method that wraps a raw pointer

 public static ByteBuf wrappedBuffer(ByteBuffer buffer) {     /**      * Creates a new buffer which wraps the specified memory address. If {@code doFree} is true the      * memoryAddress will automatically be freed once the reference count of the {@link ByteBuf} reaches {@code 0}.+     * <p>+     * <strong>Note:</strong> This method is inherently unsafe, and may not be supported on all platforms.      */     public static ByteBuf wrappedBuffer(long memoryAddress, int size, boolean doFree) {-        return new WrappedUnpooledUnsafeDirectByteBuf(ALLOC, memoryAddress, size, doFree);+        ByteBuffer buffer = PlatformDependent.directBuffer(memoryAddress, size);

Yes, that seems to be correct.

chrisvest

comment created time in a day

Pull request review commentnetty/netty

Add ConnAck message builder method to handle the creation of related properties

 public MqttConnAckMessage build() {         }     } +    public static class ConnAckPropertiesBuilder {+        private String clientId;+        private Long sessionExpiryInterval;+        private int receiveMaximum;+        private Byte maximumQos;+        private boolean retain;+        private Long maximumPacketSize;+        private int topicAliasMaximum;+        private String reasonString;+        private MqttProperties.UserProperties userProperties = new MqttProperties.UserProperties();+        private Boolean wildcardSubscriptionAvailable;+        private Boolean subscriptionIdentifiersAvailable;+        private Boolean sharedSubscriptionAvailable;+        private Integer serverKeepAlive;+        private String responseInformation;+        private String serverReference;+        private String authenticationMethod;+        private byte[] authenticationData;++        public MqttProperties build() {+            final MqttProperties props = new MqttProperties();+            if (clientId != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.ASSIGNED_CLIENT_IDENTIFIER.value(),+                        clientId));+            }+            if (sessionExpiryInterval != null) {+                props.add(new MqttProperties.IntegerProperty(+                        MqttPropertyType.SESSION_EXPIRY_INTERVAL.value(), sessionExpiryInterval.intValue()));+            }+            if (receiveMaximum > 0) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RECEIVE_MAXIMUM.value(), receiveMaximum));+            }+            if (maximumQos != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_QOS.value(), receiveMaximum));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RETAIN_AVAILABLE.value(), retain ? 1 : 0));+            if (maximumPacketSize != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_PACKET_SIZE.value(),+                        maximumPacketSize.intValue()));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.TOPIC_ALIAS_MAXIMUM.value(),+                    topicAliasMaximum));+            if (reasonString != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.REASON_STRING.value(), reasonString));+            }+            props.add(userProperties);+            if (wildcardSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.WILDCARD_SUBSCRIPTION_AVAILABLE.value(),+                        wildcardSubscriptionAvailable ? 1 : 0));+            }+            if (subscriptionIdentifiersAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SUBSCRIPTION_IDENTIFIER_AVAILABLE.value(),+                        subscriptionIdentifiersAvailable ? 1 : 0));+            }+            if (sharedSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SHARED_SUBSCRIPTION_AVAILABLE.value(),+                        sharedSubscriptionAvailable ? 1 : 0));+            }+            if (serverKeepAlive != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SERVER_KEEP_ALIVE.value(),+                        serverKeepAlive));+            }+            if (responseInformation != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.RESPONSE_INFORMATION.value(),+                        responseInformation));+            }+            if (serverReference != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.SERVER_REFERENCE.value(),+                        serverReference));+            }+            if (authenticationMethod != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.AUTHENTICATION_METHOD.value(),+                        authenticationMethod));+            }+            if (authenticationData != null) {+                props.add(new MqttProperties.BinaryProperty(MqttPropertyType.AUTHENTICATION_DATA.value(),+                        authenticationData));+            }++            return props;+        }++        public void sessionExpiryInterval(long seconds) {+            this.sessionExpiryInterval = seconds;+        }++        public void receiveMaximum(int value) {+            if (value <= 0) {+                throw new IllegalArgumentException("receive maximum property must be > 0");+            }+            this.receiveMaximum = value;+        }++        public void maximumQos(byte value) {+            if (value != 0 && value != 1) {+                throw new IllegalArgumentException("maximum QoS property could be 0 or 1");+            }+            this.maximumQos = value;+        }++        public void retainAvailable(boolean retain) {+            this.retain = retain;+        }++        public void maximumPacketSize(long size) {+            if (size <= 0) {+                throw new IllegalArgumentException("maximum packet size property must be > 0");+            }+            this.maximumPacketSize = size;+        }++        public void assignedClientId(String clientId) {+            this.clientId = clientId;+        }++        public void topicAliasMaximum(int value) {+            this.topicAliasMaximum = value;+        }++        public void reasonString(String reason) {+            this.reasonString = reason;+        }++        public void userProperty(String name, String value) {+            userProperties.add(name, value);+        }++        public void wildcardSubscriptionAvailable(boolean value) {+            this.wildcardSubscriptionAvailable = value;+        }++        public void subscriptionIdentifiersAvailable(boolean value) {+            this.subscriptionIdentifiersAvailable = value;+        }++        public void sharedSubscriptionAvailable(boolean value) {+            this.sharedSubscriptionAvailable = value;+        }++        public void serverKeepAlive(int seconds) {+            this.serverKeepAlive = seconds;+        }++        public void responseInformation(String value) {+            this.responseInformation = value;+        }++        public void serverReference(String host) {+            this.serverReference = host;+        }++        public void authenticationMethod(String methodName) {+            this.authenticationMethod = methodName;+        }++        public void authenticationData(byte[] rawData) {+            this.authenticationData = rawData;

rawData.clone()

andsel

comment created time in a day

Pull request review commentnetty/netty

Add ConnAck message builder method to handle the creation of related properties

 public MqttConnAckMessage build() {         }     } +    public static class ConnAckPropertiesBuilder {+        private String clientId;+        private Long sessionExpiryInterval;+        private int receiveMaximum;+        private Byte maximumQos;+        private boolean retain;+        private Long maximumPacketSize;+        private int topicAliasMaximum;+        private String reasonString;+        private MqttProperties.UserProperties userProperties = new MqttProperties.UserProperties();+        private Boolean wildcardSubscriptionAvailable;+        private Boolean subscriptionIdentifiersAvailable;+        private Boolean sharedSubscriptionAvailable;+        private Integer serverKeepAlive;+        private String responseInformation;+        private String serverReference;+        private String authenticationMethod;+        private byte[] authenticationData;++        public MqttProperties build() {+            final MqttProperties props = new MqttProperties();+            if (clientId != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.ASSIGNED_CLIENT_IDENTIFIER.value(),+                        clientId));+            }+            if (sessionExpiryInterval != null) {+                props.add(new MqttProperties.IntegerProperty(+                        MqttPropertyType.SESSION_EXPIRY_INTERVAL.value(), sessionExpiryInterval.intValue()));+            }+            if (receiveMaximum > 0) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RECEIVE_MAXIMUM.value(), receiveMaximum));+            }+            if (maximumQos != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_QOS.value(), receiveMaximum));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.RETAIN_AVAILABLE.value(), retain ? 1 : 0));+            if (maximumPacketSize != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.MAXIMUM_PACKET_SIZE.value(),+                        maximumPacketSize.intValue()));+            }+            props.add(new MqttProperties.IntegerProperty(MqttPropertyType.TOPIC_ALIAS_MAXIMUM.value(),+                    topicAliasMaximum));+            if (reasonString != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.REASON_STRING.value(), reasonString));+            }+            props.add(userProperties);+            if (wildcardSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.WILDCARD_SUBSCRIPTION_AVAILABLE.value(),+                        wildcardSubscriptionAvailable ? 1 : 0));+            }+            if (subscriptionIdentifiersAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SUBSCRIPTION_IDENTIFIER_AVAILABLE.value(),+                        subscriptionIdentifiersAvailable ? 1 : 0));+            }+            if (sharedSubscriptionAvailable != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SHARED_SUBSCRIPTION_AVAILABLE.value(),+                        sharedSubscriptionAvailable ? 1 : 0));+            }+            if (serverKeepAlive != null) {+                props.add(new MqttProperties.IntegerProperty(MqttPropertyType.SERVER_KEEP_ALIVE.value(),+                        serverKeepAlive));+            }+            if (responseInformation != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.RESPONSE_INFORMATION.value(),+                        responseInformation));+            }+            if (serverReference != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.SERVER_REFERENCE.value(),+                        serverReference));+            }+            if (authenticationMethod != null) {+                props.add(new MqttProperties.StringProperty(MqttPropertyType.AUTHENTICATION_METHOD.value(),+                        authenticationMethod));+            }+            if (authenticationData != null) {+                props.add(new MqttProperties.BinaryProperty(MqttPropertyType.AUTHENTICATION_DATA.value(),+                        authenticationData));+            }++            return props;+        }++        public void sessionExpiryInterval(long seconds) {+            this.sessionExpiryInterval = seconds;+        }++        public void receiveMaximum(int value) {+            if (value <= 0) {+                throw new IllegalArgumentException("receive maximum property must be > 0");+            }+            this.receiveMaximum = value;+        }++        public void maximumQos(byte value) {

usually builders should return itself so you can use method chaining

andsel

comment created time in a day

Pull request review commentnetty/netty

Add ConnAck message builder method to handle the creation of related properties

 public MqttConnAckMessage build() {         }     } +    public static class ConnAckPropertiesBuilder {

final ?

andsel

comment created time in a day

push eventnetty/netty

Chris Vest

commit sha db4f85a479931dd9a701b04f163b7842e61b2218

Remove use of PlatformDependent.throwsException in SingleThreadEventExecutor (#10827) Motivation: We should avoid lying with throws declarations whenever possible. Modification: Changed the code to instead directly throw Error, which seems to have been the intent. Also, while we're here, convert its associated test to JUnit 5 and clean it up a bit. Result: Cleaner code.

view details

push time in a day

pull request commentnetty/netty

Remove use of PlatformDependent.throwsException in SingleThreadEventExecutor

@chrisvest thanks a lot

chrisvest

comment created time in a day

PR merged netty/netty

Remove use of PlatformDependent.throwsException in SingleThreadEventExecutor

Motivation: We should avoid lying with throws declarations whenever possible.

Modification: Changed the code to instead directly throw Error, which seems to have been the intent. Also, while we're here, convert its associated test to JUnit 5 and clean it up a bit.

Result: Cleaner code.

+84 -95

0 comment

2 changed files

chrisvest

pr closed time in a day

pull request commentnetty/netty

Add PushPromise and Priority Frame support in Http2FrameCodec

@hyperxpro there is a suppression file for that. That said most sites should support https these days. Please fix :)

hyperxpro

comment created time in a day

issue commentnetty/netty

Websocket checkStartsWith doesn't work as expected

So I am correct that we can close this one ?

travishaagen

comment created time in a day

issue commentnetty/netty

[Netty 5] Transport/Protocol Multiplexing

See https://github.com/netty/netty-incubator-codec-quic for the quic work

normanmaurer

comment created time in a day

more