summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2016-09-19 13:40:53 -0700
committerGrant Limberg <grant.limberg@zerotier.com>2016-09-19 13:40:53 -0700
commitd87f0293e3bdbb013ce2b48d5518a22e3ecd8c71 (patch)
tree67c092db1de1c7f6c2db9e12e28306ff60ec8220 /java
parent5fadd8bdd25577cf8fd626a2a2decbedf28c0dd6 (diff)
downloadinfinitytier-d87f0293e3bdbb013ce2b48d5518a22e3ecd8c71.tar.gz
infinitytier-d87f0293e3bdbb013ce2b48d5518a22e3ecd8c71.zip
Don't print a few error messages when they don't matter.

Diffstat (limited to 'java')
-rw-r--r--java/jni/ZT_jniutils.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/java/jni/ZT_jniutils.cpp b/java/jni/ZT_jniutils.cpp
index 411a836a..6faa91a4 100644
--- a/java/jni/ZT_jniutils.cpp
+++ b/java/jni/ZT_jniutils.cpp
@@ -313,11 +313,20 @@ jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
return NULL;
}
- jobject inetAddressObject = newInetAddress(env, addr);
+ jobject inetAddressObject = NULL;
+
+ if(addr.ss_family != 0)
+ {
+ inetAddressObject = newInetAddress(env, addr);
- if(env->ExceptionCheck() || inetAddressObject == NULL)
+ if(env->ExceptionCheck() || inetAddressObject == NULL)
+ {
+ LOGE("Error creating new inet address");
+ return NULL;
+ }
+ }
+ else
{
- LOGE("Error creating new inet address");
return NULL;
}
@@ -350,10 +359,9 @@ jobject newInetSocketAddress(JNIEnv *env, const sockaddr_storage &addr)
break;
default:
{
- LOGE("ERROR: addr.ss_family is not set or unknown");
break;
}
- };
+ }
jobject inetSocketAddressObject = env->NewObject(inetSocketAddressClass, inetSocketAddress_constructor, inetAddressObject, port);