mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
update comments
This commit is contained in:
parent
193dbef087
commit
1a8bd44841
1 changed files with 4 additions and 1 deletions
|
|
@ -53,12 +53,14 @@ impl Connection {
|
||||||
cancellable: Cancellable,
|
cancellable: Cancellable,
|
||||||
callback: impl Fn(Result<Response, Error>) + 'static,
|
callback: impl Fn(Result<Response, Error>) + 'static,
|
||||||
) {
|
) {
|
||||||
|
// Send request
|
||||||
self.stream().output_stream().write_bytes_async(
|
self.stream().output_stream().write_bytes_async(
|
||||||
&Bytes::from(format!("{query}\r\n").as_bytes()),
|
&Bytes::from(format!("{query}\r\n").as_bytes()),
|
||||||
priority,
|
priority,
|
||||||
Some(&cancellable.clone()),
|
Some(&cancellable.clone()),
|
||||||
move |result| match result {
|
move |result| match result {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
// Read response
|
||||||
Response::from_connection_async(self, priority, cancellable, move |result| {
|
Response::from_connection_async(self, priority, cancellable, move |result| {
|
||||||
callback(match result {
|
callback(match result {
|
||||||
Ok(response) => Ok(response),
|
Ok(response) => Ok(response),
|
||||||
|
|
@ -86,13 +88,14 @@ impl Connection {
|
||||||
|
|
||||||
/// Setup new [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html)
|
/// Setup new [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html)
|
||||||
/// wrapper for [SocketConnection](https://docs.gtk.org/gio/class.SocketConnection.html)
|
/// wrapper for [SocketConnection](https://docs.gtk.org/gio/class.SocketConnection.html)
|
||||||
|
/// using `server_identity` as [SNI](https://geminiprotocol.net/docs/protocol-specification.gmi#server-name-indication)
|
||||||
pub fn new_tls_client_connection(
|
pub fn new_tls_client_connection(
|
||||||
socket_connection: &SocketConnection,
|
socket_connection: &SocketConnection,
|
||||||
server_identity: Option<&NetworkAddress>,
|
server_identity: Option<&NetworkAddress>,
|
||||||
) -> Result<TlsClientConnection, Error> {
|
) -> Result<TlsClientConnection, Error> {
|
||||||
match TlsClientConnection::new(socket_connection, server_identity) {
|
match TlsClientConnection::new(socket_connection, server_identity) {
|
||||||
Ok(tls_client_connection) => {
|
Ok(tls_client_connection) => {
|
||||||
// Prevent session resumption (on certificate change in runtime)
|
// Prevent session resumption (certificate change ability in runtime)
|
||||||
tls_client_connection.set_property("session-resumption-enabled", false);
|
tls_client_connection.set_property("session-resumption-enabled", false);
|
||||||
|
|
||||||
// @TODO handle
|
// @TODO handle
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue