no longer camps if the server sends an error message.

This commit is contained in:
crs 2002-06-09 23:08:18 +00:00
parent 28afcddf62
commit 0a2f8547fc
1 changed files with 6 additions and 1 deletions

View File

@ -282,6 +282,7 @@ void CClient::runSession(void*)
CThread::exit(NULL); CThread::exit(NULL);
} }
bool fail = false;
try { try {
// handle messages from server // handle messages from server
for (;;) { for (;;) {
@ -353,18 +354,22 @@ void CClient::runSession(void*)
} }
else if (memcmp(code, kMsgEIncompatible, 4) == 0) { else if (memcmp(code, kMsgEIncompatible, 4) == 0) {
onErrorIncompatible(); onErrorIncompatible();
fail = true;
break; break;
} }
else if (memcmp(code, kMsgEBusy, 4) == 0) { else if (memcmp(code, kMsgEBusy, 4) == 0) {
onErrorBusy(); onErrorBusy();
fail = true;
break; break;
} }
else if (memcmp(code, kMsgEUnknown, 4) == 0) { else if (memcmp(code, kMsgEUnknown, 4) == 0) {
onErrorUnknown(); onErrorUnknown();
fail = true;
break; break;
} }
else if (memcmp(code, kMsgEBad, 4) == 0) { else if (memcmp(code, kMsgEBad, 4) == 0) {
onErrorBad(); onErrorBad();
fail = true;
break; break;
} }
else { else {
@ -387,7 +392,7 @@ void CClient::runSession(void*)
// exit event loop // exit event loop
m_screen->stop(); m_screen->stop();
CThread::exit(reinterpret_cast<void*>(1)); CThread::exit(fail ? NULL : reinterpret_cast<void*>(1));
} }
// FIXME -- use factory to create screen // FIXME -- use factory to create screen