Skip to content

Commit b7c315f

Browse files
committed
enhancement(activity.c): prevent flooding logcat with Connection refused messages
1 parent 500779a commit b7c315f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/src/main/cpp/lorie/activity.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ static jboolean requestConnection(__unused JNIEnv *env, __unused jclass clazz) {
8989
check(r < 0, "poll failed: %s", strerror(errno));
9090
socklen_t len = sizeof(so_error);
9191
check(getsockopt(sock, SOL_SOCKET, SO_ERROR, &so_error, &len) < 0, "getsockopt failed: %s", strerror(errno));
92+
if (so_error == ECONNREFUSED) goto end; // Regular situation which happens often if server is not started. No need to spam logcat with this.
9293
check(so_error != 0, "Connection failed: %s", strerror(so_error));
9394

9495
check(write(sock, MAGIC, sizeof(MAGIC)) < 0, "failed to send message: %s", strerror(errno));

0 commit comments

Comments
 (0)