file traversal corrected, with easier ordering to follow, and better clarity and safer timeouts on file sending