Commit graph

9 commits

Author SHA1 Message Date
Nico Weber
ef1b21004f Everywhere: Fix typos
Mostly in comments, but sprintf() now prints "August" instead of
"Auguest" so that's something.
2020-10-02 16:03:17 +02:00
AnotherTest
4065182811 LibTLS: Reschedule the timeout if we're too slow
Previously, we would not care if the handshake timer timed out because
the server was too slow, or because we were too slow, this caused
connections to fail when the system was under heavy load.
This patch fixes this behaviour (and closes #2843) by checking if the
timeout delay was within margin of error of the max timeout.
2020-07-21 13:01:35 +02:00
AnotherTest
d54d2892a9 LibTLS: Avoid busy-wait between ClientHello and ServerHello
This commit also adds a timeout timer to cancel the connection if the
server does not respond to the hello request in 10 seconds.
2020-05-30 18:26:13 +02:00
Andreas Kling
5049e41223 LibTLS: Put lots of debug spam behind TLS_DEBUG 2020-05-26 23:46:28 +02:00
AnotherTest
7d76299ca9 LibTLS: Do not call on_tls_finished until the client has read app data 2020-05-21 01:21:39 +02:00
AnotherTest
379cb061d7 LibTLS: Only try to flush data when needed
This patchset drops the write notifier, and schedules writes only when
necessary.
As a result, the CPU utilisation no longer spikes to the skies :^)
2020-05-19 20:00:43 +02:00
Andreas Kling
4b202a3c79 LibCore+LibTLS: Don't keep a "ready to write" notifier on all Sockets
The "ready to write" notifier we set up in generic socket connection is
really only meant to detect a successful connection. Once we have a TCP
connection, for example, it will fire on every event loop iteration.

This was causing IRC Client to max out the CPU by getting this no-op
notifier callback over and over.

Since this was only used by TLSv12, I changed that code to create its
own notifier instead. It might be possible to improve TLS performance
by only processing writes when actually needed, but I didn't look very
closely at that for this patch. :^)
2020-05-18 20:16:52 +02:00
AnotherTest
b028a123b8 LibTLS: "Properly" handle the server dropping the connection
Contrary to popular belief, not every implementation of TLS follows the
specs.
Some of them just drop the connection without sending a proper
close_notify, and we should handle that gracefully.
2020-05-03 19:08:40 +02:00
AnotherTest
dace14e70d LibTLS: Split TLSv12 to sensible categorical files
This commit splits the TLSv12 file into multiple files, and also removes
some magic values, to make the code less horrible. :^)
2020-05-02 12:24:10 +02:00