Added socket lib strict mode spool, used in WebSocket::readFrame

This commit is contained in:
Thulinma 2021-06-17 14:44:24 +02:00
parent 829c8b7948
commit fe6a0777a5
3 changed files with 6 additions and 6 deletions

View file

@ -932,9 +932,9 @@ uint64_t Socket::Connection::dataDown(){
/// Updates the downbuffer internal variable.
/// Returns true if new data was received, false otherwise.
bool Socket::Connection::spool(){
bool Socket::Connection::spool(bool strictMode){
/// \todo Provide better mechanism to prevent overbuffering.
if (downbuffer.size() > 10000){
if (!strictMode && downbuffer.size() > 10000){
return true;
}else{
return iread(downbuffer);