Closed reynir closed 3 years ago
The "fail if other ends wants version 1" looks fine to me; but I'm not a big fan of the conditionally print a debug message -- and would either use a warning there, or keep the old code (an info message printing the remote version).
It's not really a warning - there's nothing wrong with the other end offering a newer version.
How about an info
message that always shows the version offered and the version chosen?
The old code was wrong in its log message, though, in the case of the other end wanting to use protocol version 3. Then it would log us using protocol version 3 even though we send protocol version 2 thereby forcing the protocol version to 2.
The new commit unconditionally logs the protocol version negotiation in both places.
that looks good - though I'd condense the two Log
in connect
into a single on the Info level -- and also use the Info level in with_flow
Yes, I'll fix it up. The log message still says "newer" even though that's not necessarily true.
Continuation of #56.
Adds debug message the other place where protocol version is negotiated. In the case of version > 2 it would work without this patch. It fails if the other end wants to use version 1 for good measure.