|
From: <bni...@us...> - 2006-12-13 00:50:37
|
Revision: 424
http://svn.sourceforge.net/omc/?rev=424&view=rev
Author: bnicholes
Date: 2006-12-12 16:50:35 -0800 (Tue, 12 Dec 2006)
Log Message:
-----------
Since the prompt is really the handshaking mechanism between the client and the server, make sure that we only send the prompt after a response. Sending prompts out of order confuses the client
Modified Paths:
--------------
clp/trunk/src/omcclpdsvrconnection.cpp
Modified: clp/trunk/src/omcclpdsvrconnection.cpp
===================================================================
--- clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-12 21:35:53 UTC (rev 423)
+++ clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-13 00:50:35 UTC (rev 424)
@@ -158,14 +158,20 @@
try
{
String line;
+ String prompt = "\r\n"CLPPROMPT;
while (sistr.good())
{
line.erase();
- /* Send the prompt to the client */
- sostr << "\r\n"CLPPROMPT;
- sostr.flush();
+ /* Only send a prompt if we have handled a request */
+ if (prompt.length())
+ {
+ /* Send the prompt to the client */
+ sostr << "\r\n"CLPPROMPT;
+ sostr.flush();
+ prompt.erase();
+ }
int selType = Select::SELECT_INTERRUPTED;
while(selType == Select::SELECT_INTERRUPTED)
@@ -197,6 +203,7 @@
Format("OMCClpdSvrConnection received line: %1", line));
clpref->runCommand(line);
sostr.flush();
+ prompt = "\r\n"CLPPROMPT;
}
if (clpref->shouldExit())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|