diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-11-13 10:20:27 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-11-13 10:20:27 +0000 |
commit | 16b013458097e1a9a7d20f0138c24f705a8251f3 (patch) | |
tree | 55e93a5ba4a44df9a08f23dee2f30235f63455bf | |
parent | b2f148b473f1ac50c17b52e95dd2b1ae52958c74 (diff) | |
download | rabbitmq-server-16b013458097e1a9a7d20f0138c24f705a8251f3.tar.gz |
If they ask to read more than the buffer size, do so.
-rw-r--r-- | src/file_handle_cache.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index 519c596d..a7d5ce15 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 |