diff --git a/src/invidious/helpers/crystal_class_overrides.cr b/src/invidious/helpers/crystal_class_overrides.cr index d5952537..db89fb17 100644 --- a/src/invidious/helpers/crystal_class_overrides.cr +++ b/src/invidious/helpers/crystal_class_overrides.cr @@ -1,3 +1,7 @@ +# Override of the TCPSocket and HTTP::Client classes in oder to allow an +# IP family to be selected for domains that resolve to both IPv4 and +# IPv6 addresses. +# class TCPSocket def initialize(host, port, dns_timeout = nil, connect_timeout = nil, family = Socket::Family::UNSPEC) Addrinfo.tcp(host, port, timeout: dns_timeout, family: family) do |addrinfo| @@ -10,6 +14,7 @@ class TCPSocket end end +# :ditto: class HTTP::Client property family : Socket::Family = Socket::Family::UNSPEC @@ -32,6 +37,9 @@ class HTTP::Client end end +# Mute the ClientError exception raised when a connection is flushed. +# This happends when the connection is unexpectedly closed by the client. +# class HTTP::Server::Response class Output private def unbuffered_flush @@ -42,6 +50,8 @@ class HTTP::Server::Response end end +# TODO: Document this override +# class PG::ResultSet def field(index = @column_index) @fields.not_nil![index]