aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/core/stanza_reader.vala
diff options
context:
space:
mode:
authorfrosty <frostinator33@airmail.cc>2026-10-26 10:21:57 -0400
committerfrosty <frostinator33@airmail.cc>2026-10-26 10:21:57 -0400
commit74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch)
tree560e6434f183eb54cd779936f3a4c9575146a066 /xmpp-vala/src/core/stanza_reader.vala
parent3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff)
parent4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff)
Merge 'upstream/master'
Diffstat (limited to 'xmpp-vala/src/core/stanza_reader.vala')
-rw-r--r--xmpp-vala/src/core/stanza_reader.vala11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmpp-vala/src/core/stanza_reader.vala b/xmpp-vala/src/core/stanza_reader.vala
index ff512497..4828600d 100644
--- a/xmpp-vala/src/core/stanza_reader.vala
+++ b/xmpp-vala/src/core/stanza_reader.vala
@@ -38,8 +38,15 @@ public class StanzaReader {
if (cancellable != null && cancellable.is_cancelled()) throw new IOError.CANCELLED("Input stream is canceled.");
try {
buffer_fill = (int) yield ((!)input).read_async(buffer, GLib.Priority.DEFAULT, cancellable);
- } catch (TlsError.EOF e) {
- throw new IOError.CLOSED("End of TLS stream reached");
+ } catch (Error e) {
+ if (e is IOError) {
+ throw (IOError) e;
+ } else if (e is TlsError.EOF) {
+ // The error can be TlsError.EOF instead of IOError.CLOSED, fixing that
+ throw new IOError.CLOSED("End of TLS stream reached");
+ } else {
+ throw new IOError.FAILED("Unknown error: %s", e.message);
+ }
}
if (buffer_fill == 0) throw new IOError.CLOSED("End of input stream reached.");
buffer_pos = 0;