From 0a2f8547fc7620ada30a63ad84106984aa877288 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 9 Jun 2002 23:08:18 +0000 Subject: [PATCH] no longer camps if the server sends an error message. --- client/CClient.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/CClient.cpp b/client/CClient.cpp index af8855f9..3d0e4d89 100644 --- a/client/CClient.cpp +++ b/client/CClient.cpp @@ -282,6 +282,7 @@ void CClient::runSession(void*) CThread::exit(NULL); } + bool fail = false; try { // handle messages from server for (;;) { @@ -353,18 +354,22 @@ void CClient::runSession(void*) } else if (memcmp(code, kMsgEIncompatible, 4) == 0) { onErrorIncompatible(); + fail = true; break; } else if (memcmp(code, kMsgEBusy, 4) == 0) { onErrorBusy(); + fail = true; break; } else if (memcmp(code, kMsgEUnknown, 4) == 0) { onErrorUnknown(); + fail = true; break; } else if (memcmp(code, kMsgEBad, 4) == 0) { onErrorBad(); + fail = true; break; } else { @@ -387,7 +392,7 @@ void CClient::runSession(void*) // exit event loop m_screen->stop(); - CThread::exit(reinterpret_cast(1)); + CThread::exit(fail ? NULL : reinterpret_cast(1)); } // FIXME -- use factory to create screen