anchor.diff:  handle_info(_Info, _StateName, StateData) ->
       lager:debug("info ~p", [_StateName]),
       {stop, error, StateData}.
  +
  +terminate(normal, StateName, #state{publisher=Pub, message=#mqtt_msg{payload=P}}) ->
  +    lager:debug("normal terminaison (state ~p)", [StateName]),
  +    
  +    MsgID = proplists:get_value(msgid, P),
  +    mqtt_session:landed(Pub, MsgID), % message no more in in-flight mode
  +
  +    terminate;
   
   terminate(_Reason, StateName, _StateData) ->
       lager:debug("terminate: ~p ~p ~p", [_Reason, StateName, _StateData]),
  
positive.code:     end.
  
  % qos=2
  provisional({provresp, From, Msg=#mqtt_msg{type='PUBREL', payload=P}}, 
              State=#state{publisher=Pub, message=PubMsg, subscribers=Subscribers}) ->
      lager:debug("provisional state: received provisional response ~p", [Msg]),
  
negative.code: % for QOS 1, they must send back a PUBACK message
  % for QOS 2, they must send back a PUBREC, then latter on a PUBCOMP
  %
  % From = subscriber responding PUBREC to PUBLISH
  %
  waitacks({provreq, From, Msg=#mqtt_msg{payload=P}}, State=#state{inflight=Inflight}) ->
      lager:debug("received provisional response from ~p: ~p", [From, Msg]),
  
  