anchor.diff:  %%
   %% Validation
   %%
  +
  +%% @private
  +ensure_headers(Headers, Frame) -> ensure_headers(Headers, Frame, []).
  +
  +%% @private
  +ensure_headers([], _Frame, Acc) ->
  +    {ok, lists:reverse(Acc)};
  +ensure_headers([H|T], Frame, Acc) ->
  +    case restomp:header(Frame, H) of
  +        {ok, Value} -> ensure_headers(T, Frame, [Value|Acc]);
  +        not_found   -> {error, missing_header, "Missing header: " ++ H}
  +    end.
   
   %% @private
   split_destination(Dest) ->
  
positive.code: 
  %% @private
  ack(Frame, State) ->
      Fun = fun(H) -> restomp:header(Frame, H) end,
      case {Fun("message-id"), Fun("subscription")} of
          {{ok, _Id}, {ok, _Sub}} ->
              {noreply, State};
          {not_found, _Sub} ->
              send_error(no_message_id, State);
          {_Id, not_found} ->
              send_error(no_subscription, State)
      end.
  
  %% @private
  nack(Frame, State) ->
      Fun = fun(H) -> restomp:header(Frame, H) end,
      case {Fun("message-id"), Fun("subscription")} of
          {{ok, _Id}, {ok, _Sub}} ->
              {noreply, State};
          {not_found, _Sub} ->
              send_error(no_message_id, State);
          {_Id, not_found} ->
              send_error(no_subscription, State)
      end.
  
  %% @private
  
negative.code: %%
  
  %% @private
  send_error(Msg, State) -> send_error(Msg, [], State).
  
  %% @private
  send_error(Msg, Details, State) ->
      Headers = [{"message", atom_to_list(Msg)},
                 ?CONTENT_TEXT,
                 ?VERSION_HEADER],
      case send_frame("ERROR", Headers, Details, State) of
          {noreply, NewState} -> {stop, Msg, NewState};
          Error               -> Error
      end.
  
  %% @private
  send_frame(Cmd, Headers, Body, State) ->
      send_frame(#stomp_frame{command = Cmd, headers = Headers, body = Body}, State).
  
  -spec send_frame(restomp:frame(), inet:socket()) -> #s{}.
  %% @private
  