X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=inline;f=src%2FslipBio.cpp;h=6fe1ec19f74b93ef371bd4b06e4bce88bb38e08a;hb=d289583508396f1ae84580febc8faa913fd20935;hp=ced5a6fb4639a6a6dafbcacb96b4055f993e4136;hpb=b96ef8b6ed1da29999800fbfd681b153de75bb72;p=cassiopeia.git diff --git a/src/slipBio.cpp b/src/slipBio.cpp index ced5a6f..6fe1ec1 100644 --- a/src/slipBio.cpp +++ b/src/slipBio.cpp @@ -4,6 +4,8 @@ #include +#define BUFFER_SIZE 8192 + char hexDigit( char c ) { if( c < 0 ) { return 'x'; @@ -33,7 +35,7 @@ std::string toHex( const char* buf, int len ) { } SlipBIO::SlipBIO() { - this->buffer = std::vector( 4096 ); + this->buffer = std::vector( BUFFER_SIZE ); this->decodeTarget = 0; this->decodePos = 0; this->rawPos = 0; @@ -47,7 +49,7 @@ void SlipBIO::setTarget( std::shared_ptr target ) { SlipBIO::SlipBIO( std::shared_ptr target ) { this->target = target; - this->buffer = std::vector( 4096 ); + this->buffer = std::vector( BUFFER_SIZE ); this->decodeTarget = 0; this->decodePos = 0; this->rawPos = 0; @@ -58,6 +60,7 @@ SlipBIO::SlipBIO( std::shared_ptr target ) { SlipBIO::~SlipBIO() {} int SlipBIO::write( const char* buf, int num ) { + std::cout << "Out: " << toHex( buf, num ) << std::endl; int badOnes = 0; for( int i = 0; i < num; i++ ) {