summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-11-13 10:20:27 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-11-13 10:20:27 +0000
commitb838aa5423d99cae683bd9c344c325a7aa3a08b0 (patch)
tree55e93a5ba4a44df9a08f23dee2f30235f63455bf /src
parent8c132f5822b48f77bcaaea11d80e6e6eb487d708 (diff)
downloadrabbitmq-server-git-b838aa5423d99cae683bd9c344c325a7aa3a08b0.tar.gz
If they ask to read more than the buffer size, do so.
Diffstat (limited to 'src')
-rw-r--r--src/file_handle_cache.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 519c596d1d..a7d5ce1596 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -346,11 +346,11 @@ read(Ref, Count) ->
read_buffer_size = BufSz - Count}]};
([Handle = #handle{read_buffer = Buf,
read_buffer_size = BufSz,
- read_buffer_size_limit = Limit,
+ read_buffer_size_limit = BufSzLimit,
hdl = Hdl,
offset = Offset}]) ->
WantedCount = Count - BufSz,
- case prim_file_read(Hdl, Limit) of
+ case prim_file_read(Hdl, lists:max([BufSzLimit, WantedCount])) of
{ok, Data} ->
ReadCount = size(Data),
case ReadCount < WantedCount of