Be sure to only pop unsupported packet if already pushed
This commit is contained in:
parent
fb10fa075a
commit
e3cbaba33a
|
@ -36,15 +36,19 @@ Packetlist.prototype.read = function (bytes) {
|
||||||
var parsed = packetParser.read(bytes, i, bytes.length - i);
|
var parsed = packetParser.read(bytes, i, bytes.length - i);
|
||||||
i = parsed.offset;
|
i = parsed.offset;
|
||||||
|
|
||||||
|
var pushed = false;
|
||||||
try {
|
try {
|
||||||
var tag = enums.read(enums.packet, parsed.tag);
|
var tag = enums.read(enums.packet, parsed.tag);
|
||||||
var packet = packets.newPacketFromTag(tag);
|
var packet = packets.newPacketFromTag(tag);
|
||||||
this.push(packet);
|
this.push(packet);
|
||||||
|
pushed = true;
|
||||||
packet.read(parsed.packet);
|
packet.read(parsed.packet);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
if (pushed) {
|
||||||
this.pop(); // drop unsupported packet
|
this.pop(); // drop unsupported packet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user