Skip to content

Commit

Permalink
Reset m_pos on clearing parser buffer (#30)
Browse files Browse the repository at this point in the history
On long run this cause parser to work incorrectly after `discardProcessed()` got called
  • Loading branch information
marfer authored and dingmaotu committed Apr 2, 2018
1 parent 9e3b686 commit 7dec5fc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Format/RespStreamParser.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit 7dec5fc

Please sign in to comment.