]> git.lyx.org Git - lyx.git/blobdiff - src/Server.cpp
More requires --> required, for C++2a.
[lyx.git] / src / Server.cpp
index 64e2af15d3aab0645a3afd45d43ad6e1825152ff..d4a2120b6ea5e3c0550b5348a59766971259898a 100644 (file)
@@ -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);