]> arthur.barton.de Git - bup.git/commit
bup: make demux errors clearer
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 1 Feb 2021 23:01:47 +0000 (00:01 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sun, 13 Jun 2021 16:32:17 +0000 (11:32 -0500)
commit3175e48204ff274d488104085f6d44282f4ddc87
tree4677c360c433d3710772bec8c4a225d34874ff2f
parent242f693bdf3a2e1c3ab1bbae1eb50a8da0506f44
bup: make demux errors clearer

If we hit the

    assert(n <= MAX_PACKET)

in the demux code then quite likely we've been reading
something that shouldn't even be demuxed, but got some
error message from ssh instead of a muxed connection
record.

Clarify this case a bit by printing out the data that
we got (under the assumption it's an error message) and
raising Exception("Connection broken") instead of just
asserting.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py