X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fio%2FrecordHandler.cpp;h=2d58be0b7d1e195e62350ebaadd4cc9191074b4f;hb=eac5817fe5ed5052599bbfb1ab3f6ade426010d0;hp=b2fe82c2973783a73f863370df590ad3b6ee0878;hpb=e8abb7ca28c05c91fef58d23c40d3f2b1d5322ff;p=cassiopeia.git diff --git a/src/io/recordHandler.cpp b/src/io/recordHandler.cpp index b2fe82c..2d58be0 100644 --- a/src/io/recordHandler.cpp +++ b/src/io/recordHandler.cpp @@ -72,16 +72,7 @@ public: } void work() { - std::vector buffer( 2048 ); - int res = io->read( buffer.data(), buffer.size() ); - - if( res <= 0 ) { - logger::error( "Stream error, resetting SSL" ); - parent->reset(); - return; - } - - std::string content( buffer.data(), res ); + std::string content = io->readLine(); try { RecordHeader head; @@ -242,6 +233,9 @@ void DefaultRecordHandler::handle() { logger::note( "New session allocated." ); currentSession = std::make_shared( this, signer, ctx, bio ); } - - currentSession->work(); + try { + currentSession->work(); + } catch( EOFException e ){ + reset(); + } }