uint32_t size = ntohl(hdr->size);
uint32_t flags = ntohl(hdr->flags);
+ if (size > 65535) {
+ log(WARNING, "[%s] Metacube block of %x bytes (flags=%x); corrupted header?",
+ url.c_str(), size, flags);
+ }
+
// See if we have the entire block. If not, wait for more data.
if (pending_data.size() < sizeof(metacube_block_header) + size) {
return;
}
log(WARNING, "[%s] Dropping %lld junk bytes from stream, maybe it is not a Metacube stream?",
url.c_str(), (long long)num_bytes);
+ assert(pending_data.size() >= num_bytes);
pending_data.erase(pending_data.begin(), pending_data.begin() + num_bytes);
}