From: <bni...@us...> - 2006-12-12 17:24:01
|
Revision: 421 http://svn.sourceforge.net/omc/?rev=421&view=rev Author: bnicholes Date: 2006-12-12 09:23:19 -0800 (Tue, 12 Dec 2006) Log Message: ----------- Fix the CLP prompt to conform to the spec. The prompt should be -><space> Modified Paths: -------------- clp/trunk/src/omcclpc.cpp clp/trunk/src/omcclpc.h clp/trunk/src/omcclpcommon.h clp/trunk/src/omcclpdsvrconnection.cpp Modified: clp/trunk/src/omcclpc.cpp =================================================================== --- clp/trunk/src/omcclpc.cpp 2006-12-11 23:33:10 UTC (rev 420) +++ clp/trunk/src/omcclpc.cpp 2006-12-12 17:23:19 UTC (rev 421) @@ -309,7 +309,7 @@ int count = 0; /* Wait for the prompt from the server */ - while (!prompt.endsWith("-->") && (count < 10)) + while (!prompt.endsWith(PROMPT) && (count < 10)) { if (m_socket.waitForInput(1)) { @@ -351,8 +351,8 @@ { String UFiP(0); - /* We need to get the session UFiP from the CLP server. - Send the command to get the session UFiP */ + /* We need to make sure that the 'session' reserved target + exists so that we can use it when needed */ String cmd = "show -o format=keyword session"; m_socket.write(cmd.c_str(), cmd.length()); m_socket.write("\r\n", 2); Modified: clp/trunk/src/omcclpc.h =================================================================== --- clp/trunk/src/omcclpc.h 2006-12-11 23:33:10 UTC (rev 420) +++ clp/trunk/src/omcclpc.h 2006-12-12 17:23:19 UTC (rev 421) @@ -77,7 +77,7 @@ void doExit(); void shutdown(); String getServerPrompt(); - bool isValidPrompt (String prompt) {prompt.endsWith("-->");} + bool isValidPrompt (String prompt) {prompt.endsWith(PROMPT);} bool socketConnect(); void createLogger(); Modified: clp/trunk/src/omcclpcommon.h =================================================================== --- clp/trunk/src/omcclpcommon.h 2006-12-11 23:33:10 UTC (rev 420) +++ clp/trunk/src/omcclpcommon.h 2006-12-12 17:23:19 UTC (rev 421) @@ -61,6 +61,8 @@ s = s.substring(0,s.length()-1); } #define CLPENDL "\r\n" +#define PROMPT "-> " +#define CLPPROMPT "CLP"PROMPT namespace OMCCLP { Modified: clp/trunk/src/omcclpdsvrconnection.cpp =================================================================== --- clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-11 23:33:10 UTC (rev 420) +++ clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-12 17:23:19 UTC (rev 421) @@ -187,7 +187,7 @@ firstLine = false; /* Send the prompt to the client */ - sostr << "\r\nCLP-->"; + sostr << "\r\n"CLPPROMPT; sostr.flush(); // only select if the buffer is empty This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |