From 7dec5fc8c6a716852a28a3f1176361a74fc6e0a3 Mon Sep 17 00:00:00 2001 From: marfer Date: Mon, 2 Apr 2018 18:53:20 +0300 Subject: [PATCH] Reset m_pos on clearing parser buffer (#30) 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 |