packet can contain multiple datasets of same type

This commit is contained in:
j3d1 2015-11-02 02:20:50 +01:00
parent ed87648312
commit 73df3e0528
5 changed files with 15 additions and 13 deletions

View file

@ -33,7 +33,7 @@ void Packet::printHeader() {
bytes Packet::getBytes() {
int i = 0;
for (auto d : payload)
push(body, i, d.second);
push(body, i, d);
push(body, i, (int) PACKET_END);
i = 0;
push(head, i, version);
@ -79,7 +79,7 @@ void Packet::parse(bytes data) {
pull(body, i, d.type);
pull(body, i, d.len);
pull(body, i, d.value, d.len);
payload = d;
payload.push_back(d);
}
}