X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FServer.cpp;h=d4a2120b6ea5e3c0550b5348a59766971259898a;hb=4d7f4762a1af2bbe4d2051bd86e45c35361f0cfc;hp=64e2af15d3aab0645a3afd45d43ad6e1825152ff;hpb=6b6fa94c913e9cd5f5460328f833f2c6b19541b1;p=lyx.git diff --git a/src/Server.cpp b/src/Server.cpp index 64e2af15d3..d4a2120b6e 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -199,8 +199,8 @@ bool LyXComm::pipeServer() LYXERR(Debug::LYXSERVER, "LyXComm: Connection established"); ready_ = true; outbuf_.erase(); - DWORD status; - bool success; + DWORD status = 0; + bool success = false; while (!checkStopServer()) { // Indefinitely wait for the completion of an overlapped @@ -356,7 +356,7 @@ bool LyXComm::pipeServer() error = GetLastError(); - if (success && error == ERROR_IO_PENDING) { + if (success && (error == ERROR_IO_PENDING || error == NO_ERROR)) { // The write operation is still pending. // We get here when a reader is started // well before a reply is ready, so delay @@ -1067,10 +1067,7 @@ Server::~Server() string message; for (int i = 0; i != numclients_; ++i) { message = "LYXSRV:" + clients_[i] + ":bye\n"; - // ignore exceptions, we are quitting anyway - try { - pipes_.send(message); - } catch (...) {} + pipes_.send(message); } } @@ -1181,7 +1178,7 @@ void Server::callback(string const & msg) // connect to the lyxfunc in the single GuiView we // support currently. (Lgb) - FuncRequest fr(lyxaction.lookupFunc(cmd), from_ascii(arg)); + FuncRequest fr(lyxaction.lookupFunc(cmd), from_utf8(arg)); fr.setOrigin(FuncRequest::LYXSERVER); DispatchResult dr; theApp()->dispatch(fr, dr);