Commit Graph

13 Commits

Author SHA1 Message Date
fbd98a5f9b A significant clean-up of the server authentication phase, with a basic test.
The prior implementation involved some (moderately awkward) layered
`match` expressions; this version skips those in favor of `?`. The cost
is a little less detail about (for example) when serialization errors
happen. On the bright side, it gains us some huge improvements in code
clarity. We might be able to get back the tracing later, with other
library support.

In addition, we know have a couple tests: one to make sure we choose the
authentication method appropriately, and a very basic handshake test for
when we're not actually negotiation a username and password.
2021-10-09 18:40:00 -07:00
3364031c18 Whoops! TCP streams are dual-buffered!
This adjusts the way that TestingStream is implemented to allow for
two, separate buffers for each of the two directions. In the prior
implementation, if you called `write` and then `read`, you would
`read` the data you just wrote. Which is not what you want; you want
to block until you get data back from the other side.
2021-10-09 18:31:48 -07:00
748dc33a36 Rid ourselves of the old Network trait. 2021-10-09 15:24:51 -07:00
0d35f1cdb3 Remove a bunch of (hopefully) unnecessary Pins.
I believe these were introduced previously to solve a problem that we're
no longer dealing with; specifically, if I remember correctly, we
introduced these to deal with how we were going to implement a trait.
However, they don't appear to be necessary any more, so we're going to
get rid of them, so we won't need to deal with them any longer.
2021-10-09 15:22:10 -07:00
a2c57e4c76 Add a prototype testing network stack, that requires no actual network connection. 2021-10-04 15:01:56 -07:00
75d11c1ea6 Address some minor Clippy complaints. 2021-10-04 15:01:26 -07:00
82d36d6fca Clean up formatting. 2021-07-26 20:55:36 -07:00
6bddd878fb Use GenericStream::from once, just to make sure it works. 2021-07-26 20:39:52 -07:00
58cb384afd Add HasLocalAddress for querying a socket's address, and a test. 2021-07-25 17:18:29 -07:00
1436b02323 Switch to a Mutex-based approach in Streamlike. 2021-07-25 17:17:38 -07:00
ca2eddf515 Ditch ToSocksAddress for the standard From/TryFrom.
This induces an added `Send` in the Network trait and its
implementations, but provides us the ability to use standard functions
with obvious extensions. So that's nice. I've also added some additional
testing to sanity check the conversions.
2021-07-05 20:35:56 -07:00
d1143a414c Split out the messages into individual files,, and add negative tests, so we can aspire towards good coverage. 2021-06-27 16:53:57 -07:00
Adam Wick
1bf6f62d4e checkpoint 2021-06-24 19:18:16 -07:00