aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-09 19:39:01 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-09 19:39:01 +0000
commit34ea3c0a672760b93d5263f6e5bc9011dce2b186 (patch)
tree74ced66c2f846fee3098fac2a14abad1b0e1d468
parentb4da565534b3826037576a6c44e40716b024f89a (diff)
downloadlibbu++-34ea3c0a672760b93d5263f6e5bc9011dce2b186.tar.gz
libbu++-34ea3c0a672760b93d5263f6e5bc9011dce2b186.tar.bz2
libbu++-34ea3c0a672760b93d5263f6e5bc9011dce2b186.tar.xz
libbu++-34ea3c0a672760b93d5263f6e5bc9011dce2b186.zip
Updates, the client now tells protocols about new connections, and the hexDump
is less ugly.
-rw-r--r--src/client.cpp1
-rw-r--r--src/logger.cpp4
2 files changed, 2 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 8077b3d..9f0eb21 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -71,6 +71,7 @@ void Bu::Client::processOutput()
71void Bu::Client::setProtocol( Protocol *pProto ) 71void Bu::Client::setProtocol( Protocol *pProto )
72{ 72{
73 this->pProto = pProto; 73 this->pProto = pProto;
74 this->pProto->onNewConnection( this );
74} 75}
75 76
76Bu::Protocol *Bu::Client::getProtocol() 77Bu::Protocol *Bu::Client::getProtocol()
diff --git a/src/logger.cpp b/src/logger.cpp
index 1e0313b..aedfe0f 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -133,12 +133,11 @@ void Bu::Logger::hexDump( int nLevel, const char *sFile, const char *sFunction,
133 int nLine, const void *pDataV, long nDataLen, 133 int nLine, const void *pDataV, long nDataLen,
134 const char *lpName ) 134 const char *lpName )
135{ 135{
136 log( nLevel, sFile, sFunction, nLine, "Displaying %ld bytes of %s.\n", nDataLen, lpName ); 136 log( nLevel, sFile, sFunction, nLine, "Displaying %ld bytes of %s.", nDataLen, lpName );
137 const unsigned char *pData = (const unsigned char *)pDataV; 137 const unsigned char *pData = (const unsigned char *)pDataV;
138 int j = 0; 138 int j = 0;
139 Bu::FString sBorder; 139 Bu::FString sBorder;
140 for( int l = 0; l < 8*3+2*8+2; l++ ) sBorder += ((l!=8*3)?("-"):("+")); 140 for( int l = 0; l < 8*3+2*8+2; l++ ) sBorder += ((l!=8*3)?("-"):("+"));
141 sBorder += '\n';
142 log( nLevel, sFile, sFunction, nLine, sBorder.getStr() ); 141 log( nLevel, sFile, sFunction, nLine, sBorder.getStr() );
143 Bu::FString sLine; 142 Bu::FString sLine;
144 for(;;) 143 for(;;)
@@ -165,7 +164,6 @@ void Bu::Logger::hexDump( int nLevel, const char *sFile, const char *sFunction,
165 sprintf( buf, "%c ", (pData[j+k]>32 && pData[j+k]<=128)?(pData[j+k]):('.') ); 164 sprintf( buf, "%c ", (pData[j+k]>32 && pData[j+k]<=128)?(pData[j+k]):('.') );
166 sLine += buf; 165 sLine += buf;
167 } 166 }
168 sLine += '\n';
169 log( nLevel, sFile, sFunction, nLine, sLine.getStr() ); 167 log( nLevel, sFile, sFunction, nLine, sLine.getStr() );
170 sLine = ""; 168 sLine = "";
171 j += kmax; 169 j += kmax;