You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2021/09/22 23:42:15 UTC

[couchdb] branch chewbranca-ioq-experiments-rebase updated: Fix pread logic

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

chewbranca pushed a commit to branch chewbranca-ioq-experiments-rebase
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/chewbranca-ioq-experiments-rebase by this push:
     new 96c462e  Fix pread logic
96c462e is described below

commit 96c462e5f639044439ec8ffb4f65f7d96153b7d7
Author: Russell Branca <ch...@apache.org>
AuthorDate: Wed Sep 22 16:42:05 2021 -0700

    Fix pread logic
---
 src/couch/src/couch_file.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index 0cfc91e..e7fd229 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -199,7 +199,9 @@ pread_binary(Fd, Pos) ->
     {ok, iolist_to_binary(L)}.
 
 
-pread_iolist(#ioq_file{parallel=true, fd=File}, Pos) ->
+pread_iolist(#ioq_file{parallel=true, fd=Fd}, Pos) ->
+    Limit = get_pread_limit(),
+    File = #file{fd=Fd, is_sys=false, pread_limit=Limit},
     {LenIolist, NextPos} = read_raw_iolist_int(File, Pos, 4),
     case iolist_to_binary(LenIolist) of
         <<1:1/integer,Len:31/integer>> -> % an MD5-prefixed term