]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw: fix memory fragmentation problem reading data from client.
authorMarcus Watts <mwatts@redhat.com>
Mon, 5 Mar 2018 21:10:29 +0000 (16:10 -0500)
committerMarcus Watts <mwatts@redhat.com>
Thu, 8 Mar 2018 19:55:40 +0000 (14:55 -0500)
commitd9a150b1f1f9ec3952555186722c9b13d7448e2d
tree3bec753cd5189c350d4546c57236b164a45b7c23
parentcb12e1afd5beedf1b8c0b85e24e412e34c2fc427
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>
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb.h