From 0c5df9afd846a0a17ed2600fec3e744b86384743 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 27 Sep 2011 10:41:52 +0200 Subject: Catch connection lost --- src/message.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/message.c b/src/message.c index 8acf83b..c29b8d8 100644 --- a/src/message.c +++ b/src/message.c @@ -90,7 +90,15 @@ cmumble_recv_msg(struct cmumble_context *ctx) if (ret <= 0) { if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) return 0; - g_printerr("read failed: %ld\n", ret); + + if (g_error_matches(error, G_TLS_ERROR, G_TLS_ERROR_EOF)) { + g_print("%s\n", error->message); + g_main_loop_quit(ctx->loop); + return 0; + } + + g_printerr("read failed: %ld: %d %s\n", ret, error->code, error->message); + return 0; } -- cgit