From: Yehuda Sadeh Date: Mon, 22 Oct 2012 19:41:30 +0000 (-0700) Subject: rgw: check client write status on swift get_obj X-Git-Tag: v0.55~223 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cc39f558d88c87122d011cea243637c6dc10cb4;p=ceph.git rgw: check client write status on swift get_obj Fixes: #3381 We check the return code of the cio->write() operation when doing get_obj(). This makes sure that we don't continue processing the request if client has disconnected. This commit complements another commit that does the same for the specific s3 operation. backport: argonaut Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index d3d45e5525c..6fefb548e75 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -492,7 +492,9 @@ int RGWGetObj_ObjStore_SWIFT::send_response(bufferlist& bl) send_data: if (get_data && !orig_ret) { - s->cio->write(bl.c_str(), len); + int r = s->cio->write(bl.c_str(), len); + if (r < 0) + return r; } rgw_flush_formatter_and_reset(s, s->formatter);