libpurple/protocols/jabber/jabber.c

changeset 40346
a4de01fc9a6b
parent 40345
351db01b452d
child 40358
e6fe6fc1f516
--- a/libpurple/protocols/jabber/jabber.c	Sun Apr 26 18:51:58 2020 -0400
+++ b/libpurple/protocols/jabber/jabber.c	Sun Apr 26 18:57:48 2020 -0400
@@ -610,7 +610,12 @@
 		len = g_pollable_input_stream_read_nonblocking(
 		        G_POLLABLE_INPUT_STREAM(stream), buf, sizeof(buf) - 1,
 		        js->cancellable, &error);
-		if (len < 0) {
+		if (len == 0) {
+			purple_connection_error(js->gc,
+			                        PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+			                        _("Server closed the connection"));
+			return G_SOURCE_REMOVE;
+		} else if (len < 0) {
 			if (error->code == G_IO_ERROR_WOULD_BLOCK) {
 				g_error_free(error);
 				return G_SOURCE_CONTINUE;
@@ -623,6 +628,7 @@
 			}
 			return G_SOURCE_REMOVE;
 		}
+
 		purple_connection_update_last_received(gc);
 #ifdef HAVE_CYRUS_SASL
 		if (js->sasl_maxbuf > 0) {

mercurial