Skip to content

Commit

Permalink
rgw: Added code to correctly account for bytes sent/ received during …
Browse files Browse the repository at this point in the history
…a 'PUT' operation.

Currently, the bytes sent/ received are both set to zero after
an object is uploaded to a bucket. Added code to correct the logic.

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
  • Loading branch information
pritha-srivastava committed Mar 20, 2017
1 parent 0214e06 commit 85735c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rgw/rgw_rest.cc
Expand Up @@ -1192,6 +1192,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)

int len = 0;
if (cl) {
ACCOUNTING_IO(s)->set_account(true);
bufferptr bp(cl);

const auto read_len = recv_body(s, bp.c_str(), cl);
Expand Down Expand Up @@ -1222,7 +1223,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
bl.rebuild();
}
}

ACCOUNTING_IO(s)->set_account(false);
}

if ((uint64_t)ofs + len > s->cct->_conf->rgw_max_put_size) {
Expand Down

0 comments on commit 85735c9

Please sign in to comment.