X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2FslipBio.cpp;h=da1253a6b1aa04695f8a297f6f447a337ff63077;hb=1da0a75827f3b6af11c6a30880984c511cb624c9;hp=725e837a228122da085b14a3f4f88e581d7f34e3;hpb=2e64f805b7d03578897b4d8d2a3d3f270b6288c2;p=cassiopeia.git diff --git a/src/slipBio.cpp b/src/slipBio.cpp index 725e837..da1253a 100644 --- a/src/slipBio.cpp +++ b/src/slipBio.cpp @@ -1,8 +1,10 @@ #include "slipBio.h" +#include + #include -#include +#define BUFFER_SIZE 8192 char hexDigit( char c ) { if( c < 0 ) { @@ -33,10 +35,11 @@ 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; + this->failed = false; } void SlipBIO::setTarget( std::shared_ptr target ) { @@ -45,7 +48,8 @@ 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; @@ -56,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++ ) {