diff options
author | Guillaume Zajac <guillaume.zajac@linux.intel.com> | 2011-02-17 18:27:13 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-02-17 11:30:47 -0600 |
commit | 205d40db829724b5b451975a9c5273aac9ab14fa (patch) | |
tree | eb1de95d77cd5bdf26cf473ed0096177ffc4c329 | |
parent | afe16ba22a17946374cf5121c7d08e4bcfbd2942 (diff) | |
download | ofono-205d40db829724b5b451975a9c5273aac9ab14fa.tar.bz2 |
test-server: Fix crash when remote disconnects
If the remote side kills the connection when PPP is established, we
should not try to resume the AT server.
-rw-r--r-- | gatchat/test-server.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gatchat/test-server.c b/gatchat/test-server.c index e574d64c..28bad1d9 100644 --- a/gatchat/test-server.c +++ b/gatchat/test-server.c @@ -137,6 +137,12 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user) g_at_ppp_unref(ppp); ppp = NULL; + if (reason == G_AT_PPP_REASON_LINK_DEAD) { + g_at_server_unref(server); + server = NULL; + return; + } + g_at_server_resume(server); g_at_server_set_debug(server, server_debug, "Server"); |