add custom port number support

This commit is contained in:
yggverse 2024-11-25 19:51:11 +02:00
parent 591032e349
commit 935c6ad75e

View File

@ -523,7 +523,14 @@ impl Page {
// Implement shared [SocketConnectable](https://docs.gtk.org/gio/iface.SocketConnectable.html) interface // Implement shared [SocketConnectable](https://docs.gtk.org/gio/iface.SocketConnectable.html) interface
// * required also on `auth` step ([SNI](https://geminiprotocol.net/docs/protocol-specification.gmi#server-name-indication)) // * required also on `auth` step ([SNI](https://geminiprotocol.net/docs/protocol-specification.gmi#server-name-indication))
let connectable = NetworkAddress::new(&uri.host().unwrap(), 1965); let connectable = NetworkAddress::new(
&uri.host().unwrap(),
if uri.port().is_positive() {
uri.port() as u16
} else {
1965
},
);
// Create connection // Create connection
client.connect_async( client.connect_async(