From 8eb9cc9700058d73d0b9e0771eb5c88b92fdcb61 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Wed, 14 Oct 2015 14:26:46 +0900 Subject: [PATCH] Fix "HEY, machi_pb_translate:852 got {error,bad_csum}" errors s/bad_csum/bad_checksum/ as needed in in machi_file_proxy.erl --- src/machi_file_proxy.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/machi_file_proxy.erl b/src/machi_file_proxy.erl index 7f97a48..dccebbb 100644 --- a/src/machi_file_proxy.erl +++ b/src/machi_file_proxy.erl @@ -347,7 +347,7 @@ handle_call({append, ClientMeta, Extra, Data}, _From, {error, {bad_csum, Bad}} -> lager:error("Bad checksum; client sent ~p, we computed ~p", [ClientCsum, Bad]), - {{error, bad_csum}, Err + 1, U}; + {{error, bad_checksum}, Err + 1, U}; TaggedCsum -> case handle_write(FHd, FHc, F, TaggedCsum, EofP, Data, U) of {ok, NewU1} -> @@ -495,7 +495,7 @@ check_or_make_tagged_csum(Tag, InCsum, Data) when Tag == ?CSUM_TAG_CLIENT_SHA; end; check_or_make_tagged_csum(OtherTag, _ClientCsum, _Data) -> lager:warning("Unknown checksum tag ~p", [OtherTag]), - {error, bad_csum}. + {error, bad_checksum}. encode_csum_file_entry(Offset, Size, TaggedCSum) -> Len = 8 + 4 + byte_size(TaggedCSum), @@ -535,7 +535,7 @@ parse_csum_file(Filename) -> Unwritten :: [byte_sequence()] ) -> {ok, Bytes :: binary(), Csum :: binary()} | eof | - {error, bad_csum} | + {error, bad_checksum} | {error, partial_read} | {error, not_written} | {error, Other :: term() }. @@ -544,7 +544,7 @@ parse_csum_file(Filename) -> % % +% `{error, bad_checksum}' is returned. % % @@ -574,7 +574,7 @@ do_read(FHd, Filename, TaggedCsum, Offset, Size) -> {error, Bad} -> lager:error("Bad checksum; got ~p, expected ~p", [Bad, Ck]), - {error, bad_csum}; + {error, bad_checksum}; TaggedCsum -> {ok, Bytes, TaggedCsum}; %% XXX FIXME: Should we return something other than