Fix assert() condition in evbuffer_drain() for IOCP

In the case of iocp, in the for loop above, there is a situation where:
  remaining == chain->off == 0

And this happens due to CHAIN_PINNED_R() case (that is used only in
buffer_iocp.c)

Closes: #630 (picked)
(cherry picked from commit ab3224c3e66cf92779f8bd91ffe90445e636fa50)
This commit is contained in:
SuckShit 2018-04-20 15:48:32 +08:00 committed by Azat Khuzhin
parent 8886eed498
commit d632610468
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -1146,7 +1146,7 @@ evbuffer_drain(struct evbuffer *buf, size_t len)
}
buf->first = chain;
EVUTIL_ASSERT(remaining < chain->off);
EVUTIL_ASSERT(remaining <= chain->off);
chain->misalign += remaining;
chain->off -= remaining;
}