From 24f8cb21a29c671bb925edcf5d2ab4c8f1e775f3 Mon Sep 17 00:00:00 2001 From: Scott Lystig Fritchie Date: Mon, 28 Mar 2016 21:04:23 +0900 Subject: [PATCH] Fix eunit test failures related to min file position --- include/machi.hrl | 2 +- src/machi_file_proxy.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/machi.hrl b/include/machi.hrl index 5fbd525..7974fd2 100644 --- a/include/machi.hrl +++ b/include/machi.hrl @@ -21,7 +21,7 @@ %% @doc Now 4GiBytes, could be up to 64bit due to PB message limit of %% chunk size -define(DEFAULT_MAX_FILE_SIZE, ((1 bsl 32) - 1)). --define(MINIMUM_OFFSET, 0). +-define(MINIMUM_OFFSET, 1024). %% 0th draft of checksum typing with 1st byte. -define(CSUM_TAG_NONE, 0). % No csum provided by client diff --git a/src/machi_file_proxy.erl b/src/machi_file_proxy.erl index bc9a539..60ebe84 100644 --- a/src/machi_file_proxy.erl +++ b/src/machi_file_proxy.erl @@ -239,7 +239,7 @@ init({FluName, Filename, DataDir}) -> data_filehandle = FHd, csum_table = CsumTable, tref = Tref, - eof_position = Eof, + eof_position = erlang:max(Eof, ?MINIMUM_OFFSET), max_file_size = machi_config:max_file_size()}, lager:debug("Starting file proxy ~p for filename ~p, state = ~p, Eof = ~p", [self(), Filename, St, Eof]),