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){
|
private fun geminiRequest(uri: URI, onUpdate: (state: GemState) -> Unit){
|
||||||
val port = if(uri.port == -1) 1965 else uri.port
|
|
||||||
|
|
||||||
//todo - extract and reuse this ------------------------------------------------------------
|
//todo - extract and reuse this ------------------------------------------------------------
|
||||||
val protocol = prefs.getString("tls_protocol", "TLS")
|
val protocol = prefs.getString("tls_protocol", "TLS")
|
||||||
|
@ -97,7 +96,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
|
||||||
|
|
||||||
val socket: SSLSocket?
|
val socket: SSLSocket?
|
||||||
try {
|
try {
|
||||||
socket = factory.createSocket(uri.host, port) as SSLSocket
|
socket = factory.createSocket(uri.host, 1965) as SSLSocket
|
||||||
|
|
||||||
when (protocol) {
|
when (protocol) {
|
||||||
"TLS" -> {}//Use default enabled protocols
|
"TLS" -> {}//Use default enabled protocols
|
||||||
|
@ -105,7 +104,7 @@ class GeminiDatasource(private val context: Context, val history: ArianeHistory)
|
||||||
else -> socket.enabledProtocols = arrayOf(protocol)
|
else -> socket.enabledProtocols = arrayOf(protocol)
|
||||||
}
|
}
|
||||||
|
|
||||||
println("Ariane socket handshake with ${uri.host} on port $port")
|
println("Ariane socket handshake with ${uri.host}")
|
||||||
socket.startHandshake()
|
socket.startHandshake()
|
||||||
}catch (ce: ConnectException){
|
}catch (ce: ConnectException){
|
||||||
println("Ariane socket error: $ce")
|
println("Ariane socket error: $ce")
|
||||||
|
|
Loading…
Reference in New Issue