Fix segfault

Message len was not updated when iterating in on_read_bytes