Merge pull request #25758 from xiexingguo/wip-async-prefetch

msg/async: improve read-prefetch logic

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-01-04 11:16:22 +08:00 committed by GitHub
commit 1b17bf1ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,7 +213,7 @@ ssize_t AsyncConnection::read_until(unsigned len, char *p)
recv_end = recv_start = 0;
/* nothing left in the prefetch buffer */
if (len > recv_max_prefetch) {
if (left > (uint64_t)recv_max_prefetch) {
/* this was a large read, we don't prefetch for these */
do {
r = read_bulk(p+state_offset, left);