aboutsummaryrefslogtreecommitdiff
path: root/src/stable/protocoltelnet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/protocoltelnet.cpp')
-rw-r--r--src/stable/protocoltelnet.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/stable/protocoltelnet.cpp b/src/stable/protocoltelnet.cpp
index 4259fc7..f8a3906 100644
--- a/src/stable/protocoltelnet.cpp
+++ b/src/stable/protocoltelnet.cpp
@@ -70,6 +70,7 @@ Bu::ProtocolTelnet::ProtocolTelnet() :
70 oNAWS( *this, OPT_NAWS ), 70 oNAWS( *this, OPT_NAWS ),
71 oSuppressGA(*this, OPT_SUPGA ), 71 oSuppressGA(*this, OPT_SUPGA ),
72 bCanonical( true ), 72 bCanonical( true ),
73 bEcho( true ),
73 bSubOpt( false ) 74 bSubOpt( false )
74{ 75{
75} 76}
@@ -230,7 +231,7 @@ void Bu::ProtocolTelnet::onNewData( Bu::Client *pClient )
230 else 231 else
231 { 232 {
232 sDataBuf += bc; 233 sDataBuf += bc;
233 if( oEcho.isLocalSet() ) 234 if( oEcho.isLocalSet() && bEcho )
234 { 235 {
235 pClient->write( &bc, 1 ); 236 pClient->write( &bc, 1 );
236#ifdef __TELNET_DEBUG 237#ifdef __TELNET_DEBUG
@@ -243,7 +244,7 @@ void Bu::ProtocolTelnet::onNewData( Bu::Client *pClient )
243 else 244 else
244 { 245 {
245 sDataBuf += bc; 246 sDataBuf += bc;
246 if( oEcho.isLocalSet() ) 247 if( oEcho.isLocalSet() && bEcho )
247 { 248 {
248 pClient->write( &bc, 1 ); 249 pClient->write( &bc, 1 );
249 } 250 }
@@ -273,6 +274,16 @@ bool Bu::ProtocolTelnet::isCanonical()
273 return bCanonical; 274 return bCanonical;
274} 275}
275 276
277void Bu::ProtocolTelnet::setEcho( bool bOpt )
278{
279 bEcho = bOpt;
280}
281
282bool Bu::ProtocolTelnet::isEchoEnabled()
283{
284 return bEcho;
285}
286
276void Bu::ProtocolTelnet::write( const Bu::String &sData ) 287void Bu::ProtocolTelnet::write( const Bu::String &sData )
277{ 288{
278 write( sData.getStr(), sData.getSize() ); 289 write( sData.getStr(), sData.getSize() );