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]),