From 1822deba4ad820faa6bbfeb7760383ccc0cf31d1 Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Sat, 12 Jun 2010 13:50:41 +0800 Subject: [PATCH] gatserver: Check for disconnection when resuming If the internal GAtIO is no longer valid, treat it as if our channel was disconnected. --- gatchat/gatserver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gatchat/gatserver.c b/gatchat/gatserver.c index 6bb92443..3fa26a0e 100644 --- a/gatchat/gatserver.c +++ b/gatchat/gatserver.c @@ -1164,6 +1164,11 @@ void g_at_server_resume(GAtServer *server) server->suspended = FALSE; + if (g_at_io_get_channel(server->io) == NULL) { + io_disconnect(server); + return; + } + g_at_io_set_debug(server->io, server->debugf, server->debug_data); g_at_io_set_read_handler(server->io, new_bytes, server);