diff options
author | Linus Nordberg <linus@nordberg.se> | 2015-04-15 17:19:49 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2015-04-15 17:21:20 +0200 |
commit | 40b01777dd64941daffbe22fc25cb3a25eee0998 (patch) | |
tree | 6227d0d9543d6bfd4b06f07a0812af26a18239e0 /src | |
parent | 507f2014aab5c2c687406e9d3e6a6058bf68cff0 (diff) |
Be less strict when writing entryhash files.
Closes CATLFISH-44.
Diffstat (limited to 'src')
-rw-r--r-- | src/db.erl | 5 | ||||
-rw-r--r-- | src/frontend.erl | 2 | ||||
-rw-r--r-- | src/storage.erl | 2 |
3 files changed, 4 insertions, 5 deletions
@@ -57,10 +57,9 @@ add(LeafHash, Data) -> lager:debug("leafhash ~s added", [mochihex:to_hex(LeafHash)]), ok. --spec add_entryhash(binary(), binary()) -> ok. +-spec add_entryhash(binary(), binary()) -> ok | differ. add_entryhash(LeafHash, EntryHash) -> - ok = perm:ensurefile_nosync(entryhash_root_path(), EntryHash, LeafHash), - ok. + perm:ensurefile_nosync(entryhash_root_path(), EntryHash, LeafHash). -spec add_index_nosync(binary(), non_neg_integer()) -> ok. add_index_nosync(LeafHash, Index) -> diff --git a/src/frontend.erl b/src/frontend.erl index 208b4c7..2689956 100644 --- a/src/frontend.erl +++ b/src/frontend.erl @@ -128,7 +128,7 @@ check_entry(LeafHash, Index) -> {Index, LeafHash, Entry} -> {ok, {Module, Function}} = application:get_env(plop, entryhash_from_entry), EntryHash = Module:Function(Entry), - ok = db:add_entryhash(LeafHash, EntryHash), + db:add_entryhash(LeafHash, EntryHash), ok end. diff --git a/src/storage.erl b/src/storage.erl index 9f4bb5a..e208d9b 100644 --- a/src/storage.erl +++ b/src/storage.erl @@ -26,7 +26,7 @@ request(post, "ct/storage/entrycommitted", Input) -> {struct, PropList} -> EntryHash = base64:decode(proplists:get_value(<<"entryhash">>, PropList)), LeafHash = base64:decode(proplists:get_value(<<"treeleafhash">>, PropList)), - ok = db:add_entryhash(LeafHash, EntryHash), + db:add_entryhash(LeafHash, EntryHash), success({[{result, <<"ok">>}]}) end; request(get, "ct/storage/fetchnewentries", _Input) -> |