anchor.diff:                  Msg ->
                       consumer_loop_have_msg(Child, Callback, Acc, ConsumedSoFar,
                                              SnapshotStart, SnapshotEnd, LastSeenSeqno,
  -                                           PrevData, Msg)
  +                                           Data, Len, NeedLen, Msg)
               after ?FORCED_ACK_TIMEOUT ->
                       Child ! ConsumedSoFar,
                       consumer_loop_recv(Child, Callback, Acc, 0,
                                          SnapshotStart, SnapshotEnd, LastSeenSeqno,
  -                                       PrevData)
  +                                       Data, Len, NeedLen)
               end;
  -        _ ->
  +        false ->
               receive
                   Msg ->
                       consumer_loop_have_msg(Child, Callback, Acc, ConsumedSoFar,
                                              SnapshotStart, SnapshotEnd, LastSeenSeqno,
  -                                           PrevData, Msg)
  +                                           Data, Len, NeedLen, Msg)
               end
       end.
   
   consumer_loop_have_msg(Child, Callback, Acc, ConsumedSoFar,
                          SnapshotStart, SnapshotEnd, LastSeenSeqno,
  -                       PrevData, Msg) ->
  +                       Data, Len, NeedLen, Msg) ->
       case Msg of
           MoreData when is_binary(MoreData) ->
  -            NewData = case PrevData of
  -                          <<>> -> MoreData;
  -                          _ -> <<PrevData/binary, MoreData/binary>>
  +            NewData = case Data of
  +                          <<>> ->
  +                              MoreData;
  +                          _ ->
  +                              <<Data/binary, MoreData/binary>>
                         end,
  +            NewLen = Len + byte_size(MoreData),
               consume_stuff_loop(Child, Callback, Acc, ConsumedSoFar,
                                  SnapshotStart, SnapshotEnd, LastSeenSeqno,
  -                               NewData);
  +                               NewData, NewLen, NeedLen);
           {'EXIT', _From, Reason} = ExitMsg ->
               ?log_debug("Got exit signal: ~p", [ExitMsg]),
               exit(Reason);
  
positive.code: 
  -export([test/0]).
  
  -export([encode_req/1, encode_res/1, decode_packet/1, read_message_loop/2]).
  
  encode_req(#dcp_packet{opcode = Opcode,
                         datatype = DT,
  
negative.code:             case Callback(OtherMsg, Acc) of
                  {ok, Acc2} ->
                      consumer_loop_recv(Child, Callback, Acc2, ConsumedSoFar,
                                         SnapshotStart, SnapshotEnd, LastSeenSeqno,
                                         Data, Len, NeedLen);
                  {stop, RV} ->
                      consumer_loop_exit(Child, stop, <<>>),
                      RV
              end
      end.
  