adamvr/MQTT.js — pull request #10 by oribrost (2012-03-28 15:01:17+00:00)
Title: Fix bug when packet recv() is cut at the length field

We encountered this bug in the following case:
The server sends a CONNACK packet - 0x20, 0x02, 0x00, 0x00
The packet is received as two data events, the first is for 0x20, the second is for 0x02,0x00,0x00. In this case, the length field is not handled correctly.

The attached commit fixes this issue.
@nivertech