Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Try to use all discovered addresses instead of only the first one #14

Merged

Conversation

l-jonas
Copy link

@l-jonas l-jonas commented Sep 16, 2018

This "fixes" exceptions like the below when the route does not work because other connections are tried after it.

    javax.net.ssl.SSLHandshakeException: Connection closed by peer
        at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
        at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:357)
        at com.android.org.conscrypt.OpenSSLSocketImpl.waitForHandshake(OpenSSLSocketImpl.java:682)
        at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:644)
        at net.syncthing.java.bep.ConnectionHandler.connect(ConnectionHandler.kt:109)
        at net.syncthing.java.client.SyncthingClient.openConnection(SyncthingClient.kt:85)
        at net.syncthing.java.client.SyncthingClient.getPeerConnections(SyncthingClient.kt:105)
        at net.syncthing.java.client.SyncthingClient.updateIndexFromPeers(SyncthingClient.kt:117)
        at net.syncthing.java.client.SyncthingClient.access$updateIndexFromPeers(SyncthingClient.kt:38)
        at net.syncthing.java.client.SyncthingClient$1.invoke(SyncthingClient.kt:51)
        at net.syncthing.java.client.SyncthingClient$1.invoke(SyncthingClient.kt:38)
        at net.syncthing.java.client.SyncthingClientKt$sam$Runnable$9543d2f5.run(SyncthingClient.kt)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:278)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:273)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

It's eventually equal to syncthing/syncthing-lite#6

@AudriusButkevicius AudriusButkevicius merged commit cdfcc7e into syncthing:master Sep 16, 2018
l-jonas added a commit to l-jonas/syncthing-java that referenced this pull request Sep 17, 2018
The problem was that connections which failed to connect were added to the active connections.
This caused issues with syncthing#14 as often one of the failed connections was used.

Now, connecting over the internet/ relays works "reliable" if the Syncthing Server thinks
that Syncthing Lite is not connected (shows "not connected" in the Web UI). To get
this situation, one has to restart the server.
l-jonas added a commit to l-jonas/syncthing-java that referenced this pull request Sep 17, 2018
The problem was that connections which failed to connect were added to the active connections.
This caused issues with syncthing#14 as often one of the failed connections was used.

Now, connecting over the internet/ relays works "reliable" if the Syncthing Server thinks
that Syncthing Lite is not connected (shows "not connected" in the Web UI). To get
this situation, one has to restart the server.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants