~oppen/ariane

864cb62eb7a0f2645ad46ac42688238abe15e189 — Jonathan Fisher 1 year, 10 months ago 02c67bd 2.0.9
remove port management
1 files changed, 2 insertions(+), 3 deletions(-)

M app/src/main/java/oppen/ariane/io/gemini/GeminiDatasource.kt
M app/src/main/java/oppen/ariane/io/gemini/GeminiDatasource.kt => app/src/main/java/oppen/ariane/io/gemini/GeminiDatasource.kt +2 -3
@@ 77,7 77,6 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
    }

    private fun geminiRequest(uri: URI, onUpdate: (state: GemState) -> Unit){
        val port = if(uri.port == -1) 1965 else uri.port

        //todo - extract and reuse this ------------------------------------------------------------
        val protocol = prefs.getString("tls_protocol", "TLS")


@@ 97,7 96,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)

        val socket: SSLSocket?
        try {
            socket = factory.createSocket(uri.host, port) as SSLSocket
            socket = factory.createSocket(uri.host, 1965) as SSLSocket

            when (protocol) {
                "TLS" -> {}//Use default enabled protocols


@@ 105,7 104,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
                else -> socket.enabledProtocols = arrayOf(protocol)
            }

            println("Ariane socket handshake with ${uri.host} on port $port")
            println("Ariane socket handshake with ${uri.host}")
            socket.startHandshake()
        }catch (ce: ConnectException){
            println("Ariane socket error: $ce")