Add support for RESOLVE and RESOLVE_PTR
Work in progress to support RESOLVE and RESOLVE_PTR as mentioned in issue #33 (closed)
Merge request reports
Activity
- Resolved by yuan
requested review from @nickm
added 24 commits
-
2c98dc0a...50691f2a - 23 commits from branch
tpo/core:main
- 58ed1b33 - Add support for RESOLVE and RESOLVE_PTR
-
2c98dc0a...50691f2a - 23 commits from branch
mentioned in issue torspec#58
- Resolved by yuan
595 ResolvedVal::NontransientError => { 596 return Err(Error::InternalError("Received not retriable error.".into())) 597 } 598 ResolvedVal::Unrecognized(_, _) => { 599 return Err(Error::InternalError("Unrecognized resolved value.".into())) 600 } 601 // Ignoring ResolvedVal::Hostname 602 _ => (), 603 }; 604 } 605 606 Ok(addrs) 607 } 608 609 /// Start a reverse DNS lookup by using a RESOLVE cell 610 pub async fn resolve_ptr(self: Arc<Self>, addr: IpAddr) -> Result<Vec<String>> { I moved these code around and couldn't come up with a cleaner way than creating a helper function to send the message and read from resolve stream.
If I combine the two dispatching
match
block and make the function return aVec<ResolvedVal>
instead, I will need to check again whether it is a hostname or an IP address at the client level. Please let me know if you have better idea to refactor this, I'd like to make the change. Thanks!Edited by yuan
- Resolved by yuan
- Resolved by yuan
Great patch!
One question I have here is about testing strategy. I know that some of the stream/circuit code in
tor-proto
is hard to test right now, but maybe we can refactor some of the message parsing/handling code so that we could test that correctly.I've also had a look at the code and left a few comments in various parts. Please feel free to fix anything you want to, and I'll take on the rest once you're done. Thanks so much for the code!
added Needs Revision label
added 15 commits
-
58ed1b33...888296cc - 14 commits from branch
tpo/core:main
- dc983182 - Add support for RESOLVE and RESOLVE_PTR
-
58ed1b33...888296cc - 14 commits from branch
added 11 commits
-
dc983182...d160c88c - 10 commits from branch
tpo/core:main
- 2dfe4b69 - Add support for RESOLVE and RESOLVE_PTR
-
dc983182...d160c88c - 10 commits from branch
removed Needs Revision label