Fix bug in c extension causing it to only send 1 packet