diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-27 10:41:52 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-27 10:41:52 +0200 |
commit | 0c5df9afd846a0a17ed2600fec3e744b86384743 (patch) | |
tree | 01ecdaf01069c489bec79e97cf24baee4eb65752 /src/message.c | |
parent | 7856a20be8065cadae1fce0c7b33a95a8df8e98e (diff) | |
download | cmumble-0c5df9afd846a0a17ed2600fec3e744b86384743.tar.gz cmumble-0c5df9afd846a0a17ed2600fec3e744b86384743.tar.bz2 cmumble-0c5df9afd846a0a17ed2600fec3e744b86384743.zip |
Catch connection lost
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; } |