]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: fix memory fragmentation problem reading data from client. 20953/head
authorMarcus Watts <mwatts@redhat.com>
Mon, 5 Mar 2018 21:10:29 +0000 (16:10 -0500)
committerPrashant D <pdhange@redhat.com>
Mon, 19 Mar 2018 01:00:20 +0000 (21:00 -0400)
commitab046c4b984349c8cb1ce64d18e7a0f8af88b6b0
tree1636b9b319ce6973763561c12c134a1b7a77fd52
parent460f1e53cea4d2cfa7377c9364e568093f0e7822
rgw: fix memory fragmentation problem reading data from client.

mg_read returns 0 on EOF.  In some versions of civetweb, mg_read can
return "short" reads.  The logic in the rest of ceph depends on a read
always filling its buffer when possible.  So loop here and fill the
buffer.  Looping to fill the buffer means we must also track when
mg_read returns EOF, because after that further calls to mg_read will return -1.

Fixes: https://tracker.ceph.com/issues/23207
Signed-off-by: Marcus Watts <mwatts@redhat.com>
(cherry picked from commit d9a150b1f1f9ec3952555186722c9b13d7448e2d)
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb.h