Handle zero-length messages in server gracefully