netty_epoll_linuxsocket_setTcpMd5Sig should throw ChannelException when not able to init sockaddr

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 14:06:44 +02:00
parent 81244e1ae1
commit e00e06c037

View File

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