Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4B9010D42 for ; Mon, 17 Feb 2014 17:12:37 +0000 (UTC) Received: (qmail 8723 invoked by uid 500); 17 Feb 2014 17:12:25 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 7985 invoked by uid 500); 17 Feb 2014 17:12:22 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 7906 invoked by uid 99); 17 Feb 2014 17:12:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Feb 2014 17:12:20 +0000 Date: Mon, 17 Feb 2014 17:12:20 +0000 (UTC) From: "Dhiraj Bokde (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-5058) Broker MUST respond with CONNACK with return code 0x02 for zero length client id and 0 cleansession MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Dhiraj Bokde created AMQ-5058: --------------------------------- Summary: Broker MUST respond with CONNACK with return code 0x02 for zero length client id and 0 cleansession Key: AMQ-5058 URL: https://issues.apache.org/jira/browse/AMQ-5058 Project: ActiveMQ Issue Type: Bug Components: MQTT Affects Versions: 5.9.0 Reporter: Dhiraj Bokde Fix For: 5.10.0 Attachments: AMQ-5058.patch The CONNECT.decode() method from mqtt-client had an issue which has been fixed in https://github.com/fusesource/mqtt-client/pull/31 Wit this fix MQTTProtocolConverter.onConnect() can now check for the condition outlined below and return a CONNACK with return code 0x02. >From MQTT 3.1.1 draft specification [MQTT-3.1.3-6] A Server MAY allow a Client to supply a ClientId that has a length of zero bytes. However if it does so the Server MUST treat this as a special case and assign a unique ClientId to that Client. It MUST then process the CONNECT packet as if the Client had provided that unique ClientId. [MQTT-3.1.3-7] If the Client supplies a zero-byte ClientId, the Client MUST also set Clean Session to 1. [MQTT-3.1.3-8] If the Client supplies a zero-byte ClientId with Clean Session set to 0, the Server MUST respond to the CONNECT Packet with a CONNACK return code 0x02 (Identifier rejected) and then close the Network Connection. [MQTT-3.1.3-9] If the Server rejects the ClientId it MUST respond to the CONNECT Packet with a CONNACK return code 0x02 (Identifier rejected) and then close the Network Connection. -- This message was sent by Atlassian JIRA (v6.1.5#6160)