From 42680bc02124ad679329a4763ec422dce3a1888e Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 12 Apr 2019 15:15:27 +0200 Subject: [PATCH] Throw IOException (not ChannelException) if netty_epoll_linuxsocket_setTcpMd5Sig fails (#9039) Motivation: At the moment we throw a ChannelException if netty_epoll_linuxsocket_setTcpMd5Sig fails. This is inconsistent with other methods which throw a IOException. Modifications: Throw IOException Result: More correct and consistent exception usage in epoll transport --- transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c b/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c index 2ad2cbf8b5..95d7a67c4e 100644 --- a/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c +++ b/transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c @@ -292,7 +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"); + netty_unix_errors_throwIOException(env, "Could not init sockaddr"); return; } @@ -323,7 +323,7 @@ static void netty_epoll_linuxsocket_setTcpMd5Sig(JNIEnv* env, jclass clazz, jint } if (setsockopt(fd, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof(md5sig)) < 0) { - netty_unix_errors_throwChannelExceptionErrorNo(env, "setsockopt() failed: ", errno); + netty_unix_errors_throwIOExceptionErrorNo(env, "setsockopt() failed: ", errno); } }