File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {CrtError} from "./error";
2121import * as ws from "./ws" ;
2222import * as mqtt_shared from "../common/mqtt_shared" ;
2323import * as auth from "./auth" ;
24+ import * as validate from "./mqtt_internal/validate" ;
2425
2526export * from "../common/mqtt5" ;
2627export * from '../common/mqtt5_packet' ;
@@ -373,6 +374,12 @@ export class Mqtt5Client extends BufferedEventEmitter implements mqtt5.IMqtt5Cli
373374 * @param disconnectPacket (optional) properties of a DISCONNECT packet to send as part of the shutdown process
374375 */
375376 stop ( disconnectPacket ?: mqtt5_packet . DisconnectPacket ) {
377+ // maintain backwards comaptibility with previous implementation which let validation errors
378+ // trump the stop request
379+ if ( disconnectPacket ) {
380+ validate . validateInitialOutboundPacket ( disconnectPacket , internal_mqtt_client . ProtocolMode . Mqtt5 ) ;
381+ }
382+
376383 this . internalClient . stop ( disconnectPacket ) ;
377384 }
378385
You can’t perform that action at this time.
0 commit comments