]> git.lyx.org Git - lyx.git/commitdiff
Fix LyX server on Windows
authorEnrico Forestieri <forenr@lyx.org>
Tue, 7 Aug 2018 15:56:07 +0000 (17:56 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 8 Aug 2018 11:15:56 +0000 (13:15 +0200)
On some recent Windows versions, GetLastError() may also return
NO_ERROR instead of ERROR_IO_PENDING during an overlapped write
operation to a pipe. This was confusing the state machine in
Server.cpp so that replies to commands were scheduled but were
never actually output.

(cherry picked from commit cf5f2661dc0a902e541704172ab369ba3e5a54d6)

src/Server.cpp
status.23x

index d883850263dd2e8a499ee873bd702fa537fa5553..566f8f334400b6594cf587f71f5de43016ff7326 100644 (file)
@@ -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
index b7383bc111abe0939298139e8aeb058ab59af12d..f84c674866013ac3281bd5f9b0064bd78eb0f396 100644 (file)
@@ -299,6 +299,8 @@ What's new
 - When reconfiguring LyX, correctly detect commands specified with a
   full path with spaces (bug 11214).
 
+- Fix the LyX server on Windows so that replies are actually output.
+
 
 * DOCUMENTATION AND LOCALIZATION