Closed hwh33 closed 3 years ago
Some of the bug fixes were fairly subtle. The logic is already a bit complex and I think the bug fixes unfortunately added to this complexity, as have bug fixes merged in a number of recent PRs. It's tough because there are a lot of moving parts and tricky edge cases to handle. If anyone reviewing this PR sees potential simplifications I'd be quite appreciative. I think I've been looking at this code too long!
@reflog and @soltzen I've requested reviews from the two of you as I think it'd be beneficial to get more eyes on this codebase. Currently @oxtoacart is the only other member of the team with significant familiarity.
Let me know if you have any questions! This PR is fairly low-impact as it is really just adding tests and fixing a few minor bugs. No big rush here either.
Taking this up. Thanks @hwh33!
Just to manage expectations: I'll post my review before Tuesday the 24th
Thanks @soltzen!
Resolves https://github.com/getlantern/tlsmasq/issues/20 by adding a test utilizing
nettest.TestConn
. Unfortunately, we cannot test the full tlsmasq connection withTestConn
. The connection wraps atls.Conn
which, surprisingly, does not itself pass the tests. However, we are able to test the innerptlshs.Conn
. Most of the complex logic is in this inner package (ptlshs
) anyway, so this is still a win IMO. A few bugs were caught as a result of adding this test - they have been fixed in this PR.