anchor.diff:  handle(<<"AMQP", 1, 1, 9, 1>>, State) ->
       connect({8, 0, 0}, rabbit_framing_amqp_0_8, State);
   handle(<<Type:8, _:16, Len:32>>, State) ->
  -    handshake(State#state{next = ?PAYLOAD(Len), payload = {Type, Len}});
  +    handshake(State#state{stage = ?PAYLOAD(Len), payload = {Type, Len}});
   handle(Data, State = #state{protocol = Protocol, payload = {Type, Len}}) ->
       <<Payload:Len/binary, ?FRAME_END>> = Data,
       Login = decode(Type, Payload, Protocol),
  
positive.code: 
  -include("include/amqpoxy.hrl").
  
  -record(state, {listener    :: pid(),
                  client      :: inet:socket(),
                  backend     :: undefined | inet:socket(),
                  proxy = ""  :: string(),
                  protocol    :: module(),
                  next        :: pos_integer(),
                  payload     :: undefined | {integer(), pos_integer()},
                  replay = [] :: [binary()]}).
  
  %% AMQP frame sizes
  -define(HANDSHAKE, 8).
  -define(HEADER, 7).
  
negative.code: 
  %% TCP connection timeout
  -define(TIMEOUT, 6000).
  
  -record(state, {client      :: inet:socket(),
                  backend     :: inet:socket() | undefined,
                  proxy  = "" :: string(),
                  protocol    :: module() | undefined,
                  stage       :: pos_integer(),
                  payload     :: {integer(), pos_integer()} | undefined,
                  replay = [] :: [binary()]}).
  
  %% AMQP protocol version
  -type version() :: {0 | 8,0 | 9,0 | 1}.
  