anchor.diff:  peek_stanzas(#client{ref=Ref}) ->
       {messages, Msgs} = process_info(self(), messages),
       lists:flatmap(fun ({got_stanza, MRef, Stanza}) when MRef == Ref ->
  -                         [Stanza];
  +                         Stanza;
  +                      ({stream_error, MRef, Reason}) when MRef == Ref ->
  +                         {stream_error, Reason};
                        (_) ->
                            []
                    end, Msgs).
  
positive.code:         #received_packet{raw_packet=Packet} ->
              Master ! {got_stanza, ClientRef, Packet},
              client_loop(ClientRef, Master);
          Other ->
              error_logger:error_msg("bad message: ~p~n", [Other]),
              client_loop(ClientRef, Master)
  
negative.code:     receive
          {got_stanza, Ref, Stanza} ->
              do_wait_for_stanzas(Client, Count - 1, TimeoutMsg, [Stanza|Acc]);
          {stream_error, Ref, Reason} ->
              do_wait_for_stanzas(Client, Count - 1, TimeoutMsg, [{stream_error, Reason}|Acc]);
          TimeoutMsg ->
              do_wait_for_stanzas(Client, 0, TimeoutMsg, Acc)
      end.
  