From 43dbfd4211c563ee1ba1887a8f4290aae0c8f040 Mon Sep 17 00:00:00 2001 From: marfer Date: Thu, 22 Mar 2018 17:14:18 +0200 Subject: [PATCH] Reset m_pos on clearing parser buffer On long run this cause parser to work incorrectly after `discardProcessed()` got called --- Format/RespStreamParser.mqh | 1 + 1 file changed, 1 insertion(+) diff --git a/Format/RespStreamParser.mqh b/Format/RespStreamParser.mqh index b525966..978dab1 100644 --- a/Format/RespStreamParser.mqh +++ b/Format/RespStreamParser.mqh @@ -369,6 +369,7 @@ void RespStreamParser::discardProcessed() m_buf[i]=m_buf[j]; ArrayResize(m_buf,m_size-m_pos,RESERVE_SIZE); m_size=ArraySize(m_buf); + m_pos=0; } //+------------------------------------------------------------------+ //| a giant state machine that do parsing based on current task |