You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/09/08 14:41:01 UTC

[couchdb] 03/04: ss - couch_file bug fixes

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch compactor-optimize-emsort
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 3a5c77e50cf260b5209e5dbeaf8631c6b8fd0b48
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Fri Sep 8 09:40:26 2017 -0500

    ss - couch_file bug fixes
---
 src/couch/src/couch_file.erl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index e96e5c3..a8fcc6c 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -198,7 +198,7 @@ pread_binaries(Fd, PosList) ->
 pread_iolists(Fd, PosList) ->
     case ioq:call(Fd, {pread_iolists, PosList}, erlang:get(io_priority)) of
         {ok, DataMd5s} ->
-            Data = lists:zipwith(fun({Pos, _}, {IoList, Md5}) ->
+            Data = lists:zipwith(fun(Pos, {IoList, Md5}) ->
                 verify_md5(Fd, Pos, IoList, Md5)
             end, PosList, DataMd5s),
             {ok, Data};
@@ -487,9 +487,9 @@ handle_call({pread_iolist, Pos}, _From, File) ->
 
 handle_call({pread_iolists, PosL}, _From, File) ->
     update_read_timestamp(),
-    LocNums = [{Pos, 4} || Pos <- PosL],
-    DataSizes = read_multi_raw_iolists_int(File, LocNums),
-    LocNums = lists:map(fun({LenIoList, NextPos}) ->
+    LocNums1 = [{Pos, 4} || Pos <- PosL],
+    DataSizes = read_multi_raw_iolists_int(File, LocNums1),
+    LocNums2 = lists:map(fun({LenIoList, NextPos}) ->
         case iolist_to_binary(LenIoList) of
             <<1:1/integer, Len:31/integer>> -> % an MD5-prefixed term
                 {NextPos, Len + 16};
@@ -497,13 +497,13 @@ handle_call({pread_iolists, PosL}, _From, File) ->
                 {NextPos, Len}
         end
     end, DataSizes),
-    {ok, Resps} = read_multi_raw_iolists_int(File, LocNums),
+    Resps = read_multi_raw_iolists_int(File, LocNums2),
     Extracted = lists:zipwith(fun({LenIoList, _}, {IoList, _}) ->
         case iolist_to_binary(LenIoList) of
-            <<1:1/integer, _/binary>> ->
+            <<1:1/integer, _:31/integer>> ->
                 {Md5, IoList} = extract_md5(IoList),
                 {IoList, Md5};
-            <<0:1/integer, _/binary>> ->
+            <<0:1/integer, _:31/integer>> ->
                 {IoList, <<>>}
         end
     end, DataSizes, Resps),

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <co...@couchdb.apache.org>.