diff --git a/README.md b/README.md index 658a83201..95a0a0d54 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # *EMQ* - Erlang MQTT Broker [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) -*EMQ (Erlang MQTT Broker)* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. +*EMQ* (Erlang MQTT Broker) is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. *EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index f53f363a4..b6add0581 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -332,10 +332,16 @@ handle_cast({unsubscribe, TopicTable}, Session = #session{client_id = Client end, Subscriptions, TopicTable), hibernate(Session#session{subscriptions = Subscriptions1}); -handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId}) -> +handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = undefined}) -> ?LOG(warning, "destroyed", [], Session), shutdown(destroy, Session); +%% +handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = OldClientPid}) -> + ?LOG(warning, "kickedout~p", [OldClientPid], Session), + shutdown(conflict, Session); + + handle_cast({resume, ClientId, ClientPid}, Session = #session{client_id = ClientId, client_pid = OldClientPid, clean_sess = CleanSess,