anchor.diff:              case Callback(OtherMsg, Acc) of
                   {ok, Acc2} ->
                       consumer_loop_recv(Child, Callback, Acc2, ConsumedSoFar,
  -                                       SnapshotStart, SnapshotEnd, LastSeenSeqno, PrevData);
  +                                       SnapshotStart, SnapshotEnd, LastSeenSeqno,
  +                                       Data, Len, NeedLen);
                   {stop, RV} ->
  -                    consumer_loop_exit(Child, stop, []),
  +                    consumer_loop_exit(Child, stop, <<>>),
                       RV
               end
       end.
  
positive.code: encode_res(Packet) ->
      encode_req(Packet#dcp_packet{vbucket = Packet#dcp_packet.status}).
  
  decode_packet(<<Magic:8, Opcode:8, KeyLen:16,
                  ExtLen:8, DT:8, VB:16,
                  BodyLen:32,
                  Opaque:32,
                  Cas:64, Rest/binary>> = FullBinary) ->
      case Rest of
          <<Body:BodyLen/binary, RestRest/binary>> ->
              <<Ext:ExtLen/binary, KB/binary>> = Body,
              <<Key0:KeyLen/binary, TrueBody0/binary>> = KB,
              Key = binary:copy(Key0),
              TrueBody = binary:copy(TrueBody0),
              case Magic of
                  ?REQ_MAGIC ->
                      {req,
                       #dcp_packet{opcode = Opcode,
                                   datatype = DT,
                                   vbucket = VB,
                                   opaque = Opaque,
                                   cas = Cas,
                                   ext = Ext,
                                   key = Key,
                                   body = TrueBody},
                       RestRest,
                       ?HEADER_LEN + BodyLen};
                  ?RES_MAGIC ->
                      {res,
                       #dcp_packet{opcode = Opcode,
                                   datatype = DT,
                                   status = VB,
                                   opaque = Opaque,
                                   cas = Cas,
                                   ext = Ext,
                                   key = Key,
                                   body = TrueBody},
                       RestRest,
                       ?HEADER_LEN + BodyLen}
              end;
          _ ->
              FullBinary
      end;
  decode_packet(FullBinary) ->
      FullBinary.
  
  build_stream_request_packet(Vb, Opaque,
                              StartSeqno, EndSeqno, VBUUID,
  
negative.code:         {failover_id, _FailoverUUID, StartSeqno, _, SnapshotStart, SnapshotEnd} = Evt ->
              {ok, Acc2} = Callback(Evt, Acc),
              consumer_loop_recv(Child, Callback, Acc2, 0,
                                 SnapshotStart, SnapshotEnd, StartSeqno,
                                 <<>>, 0, 0)
      end.
  
  consumer_loop_recv(Child, Callback, Acc, ConsumedSoFar0,
                     SnapshotStart, SnapshotEnd, LastSeenSeqno,
                     Data, Len, NeedLen) ->
      ConsumedSoFar =
          case ConsumedSoFar0 >= ?XDCR_DCP_BUFFER_SIZE div 3 of
              true ->
  