summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorÉmilien Devos <contact@emiliendevos.be>2021-07-14 17:59:33 +0200
committerGitHub <noreply@github.com>2021-07-14 17:59:33 +0200
commit0d57a887ea59b6111d9a19b1ea1cea619ad9f129 (patch)
tree4e06a4d5cc99c349a72038ab4f3436efd065544f /src
parentb5fdd29cd54f12eb9cbadb5ba531632b91c86550 (diff)
downloadinvidious-0d57a887ea59b6111d9a19b1ea1cea619ad9f129.tar.gz
invidious-0d57a887ea59b6111d9a19b1ea1cea619ad9f129.tar.bz2
invidious-0d57a887ea59b6111d9a19b1ea1cea619ad9f129.zip
Mute unbuffered_flush IOError exception (#2235)
Related to #1416, it doesn't really fix the real error, but instead mutes the exception message. Like explained in #1416, this "exception Error" while flushing the client data doesn't harm the client-server connection. However, this exception message continuously spams the logs and makes debugging and error finding really difficult.
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/helpers.cr10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr
index 072bdf95..d332ad37 100644
--- a/src/invidious/helpers/helpers.cr
+++ b/src/invidious/helpers/helpers.cr
@@ -700,6 +700,16 @@ def proxy_file(response, env)
end
end
+class HTTP::Server::Response
+ class Output
+ private def unbuffered_flush
+ @io.flush
+ rescue ex : IO::Error
+ unbuffered_close
+ end
+ end
+end
+
class HTTP::Client::Response
def pipe(io)
HTTP.serialize_body(io, headers, @body, @body_io, @version)