mirror of https://git.sr.ht/~oppen/ariane
remove port management
This commit is contained in:
parent
02c67bda89
commit
864cb62eb7
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue