From: <bni...@us...> - 2006-12-04 23:15:57
|
Revision: 413 http://svn.sourceforge.net/omc/?rev=413&view=rev Author: bnicholes Date: 2006-12-04 15:15:57 -0800 (Mon, 04 Dec 2006) Log Message: ----------- On the initial connection, set the clp prompt immediately Modified Paths: -------------- clp/trunk/src/omcclpdsvrconnection.cpp Modified: clp/trunk/src/omcclpdsvrconnection.cpp =================================================================== --- clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-01 18:16:28 UTC (rev 412) +++ clp/trunk/src/omcclpdsvrconnection.cpp 2006-12-04 23:15:57 UTC (rev 413) @@ -122,26 +122,32 @@ try { + bool firstLine = true; + while (sistr.good()) { - String line = String::getLine(sistr); - - OW_LOG_DEBUG(logger, - Format("OMCClpdSvrConnection received line: %1", line)); + if (!firstLine) + { + String line = String::getLine(sistr); + OW_LOG_DEBUG(logger, + Format("OMCClpdSvrConnection received line: %1", line)); - if (!line.empty()) { - clpref->runCommand(line); - sostr.flush(); + if (!line.empty()) { + clpref->runCommand(line); + sostr.flush(); + } + + if (clpref->shouldExit()) + { + line = "Good-bye :-)"; + sostr << line << "\r\n"; + sostr.flush(); + break; + } } - - if (clpref->shouldExit()) - { - line = "Good-bye :-)"; - sostr << line << "\r\n"; - sostr.flush(); - break; - } - + else + firstLine = false; + /* Send the prompt to the client */ sostr << "\r\nCLP-->"; sostr.flush(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <bni...@us...> - 2007-12-07 00:08:49
|
Revision: 505 http://omc.svn.sourceforge.net/omc/?rev=505&view=rev Author: bnicholes Date: 2007-12-06 16:08:48 -0800 (Thu, 06 Dec 2007) Log Message: ----------- Set the configuration file path before initializing the CLP session Modified Paths: -------------- clp/trunk/src/omcclpdsvrconnection.cpp Modified: clp/trunk/src/omcclpdsvrconnection.cpp =================================================================== --- clp/trunk/src/omcclpdsvrconnection.cpp 2007-12-06 01:44:43 UTC (rev 504) +++ clp/trunk/src/omcclpdsvrconnection.cpp 2007-12-07 00:08:48 UTC (rev 505) @@ -149,6 +149,8 @@ Int32 timeout = item.toInt32(); OMCCLPProgramRef clpref(new OMCCLPDaemon(sostr)); + clpref->setConfFilename (m_pServer->getEnv()->getConfigItem( + OMCClpdConfigOpts::CONFIG_FILE_opt, OMCCLPD_DEFAULT_CONFIG_FILE)); clpref->setLogger(logger); if (clpref->initializeCLPSession() && clpref->createCLPSessionInfo(clpref->getCIMClient())) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |