netty_epoll_linuxsocket_setTcpMd5Sig should throw ChannelException when not able to init sockaddr (#9029)

Motivation:

When netty_epoll_linuxsocket_setTcpMd5Sig fails to init the sockaddr we should throw an exception and not silently return.

Modifications:

Throw exception if init of sockaddr fails.

Result:

Correctly report back error to user.
This commit is contained in:
Norman Maurer 2019-04-11 18:50:16 +02:00 committed by GitHub
parent ee351ef8bc
commit 45b0daf9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,6 +292,7 @@ static void netty_epoll_linuxsocket_setTcpMd5Sig(JNIEnv* env, jclass clazz, jint
struct sockaddr_storage addr;
socklen_t addrSize;
if (netty_unix_socket_initSockaddr(env, address, scopeId, 0, &addr, &addrSize) == -1) {
netty_unix_errors_throwChannelExceptionError(env, "Could not init sockaddr");
return;
}