This patch seems incorrect. Using "raise e" creates an an entirely new exception stack, as opposed to the bare raise, which re-raises the original intact.
The adjustments to anonymous retries are really not the right place to address the Unexpected EOF issue.
Certainly it would be good to be smarter about the expected eof case, but this is not the right fix. nak.