summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Branca <chewbranca@apache.org>2021-09-22 16:42:05 -0700
committerRussell Branca <chewbranca@apache.org>2021-09-22 16:42:05 -0700
commit96c462e5f639044439ec8ffb4f65f7d96153b7d7 (patch)
tree62bd8be19e92cd5b3b4fde25e070fd836bf34936
parent01305b518dda09330e924e29ab4c37b983033173 (diff)
downloadcouchdb-96c462e5f639044439ec8ffb4f65f7d96153b7d7.tar.gz
Fix pread logic
-rw-r--r--src/couch/src/couch_file.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index 0cfc91ec8..e7fd229ef 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