#include "rgw_file.h"
-/* XXX
- * ASSERT_H somehow not defined after all the above (which bring
- * in common/debug.h [e.g., dout])
- */
-#include "include/assert.h"
-
#define dout_subsys ceph_subsys_rgw
extern RGWLib librgw;
RGWGetObjRequest req(cct, fs->get_user(), rgw_fh->bucket_name(),
rgw_fh->object_name(), uio->uio_offset, uio->uio_resid,
bl);
+ req.do_hexdump = false;
int rc = librgw.get_fe()->execute_req(&req);
#include "xxhash.h"
#include "include/buffer.h"
+/* XXX
+ * ASSERT_H somehow not defined after all the above (which bring
+ * in common/debug.h [e.g., dout])
+ */
+#include "include/assert.h"
+
+
class RGWLibFS;
class RGWFileHandle;
const std::string& bucket_name;
const std::string& obj_name;
buffer::list& bl;
+ bool do_hexdump = false;
RGWGetObjRequest(CephContext* _cct, RGWUserInfo *_user,
const std::string& _bname, const std::string& _oname,
virtual int send_response_data(ceph::buffer::list& _bl, off_t s_off,
off_t e_off) {
/* XXX deal with offsets */
+ if (do_hexdump) {
+ dout(15) << __func__ << " s_off " << s_off
+ << " e_off " << e_off << " len " << _bl.length()
+ << " ";
+ _bl.hexdump(*_dout);
+ *_dout << dendl;
+ }
bl.claim_append(_bl);
return 0;
}
bool do_readv = false;
bool do_get = false;
bool do_delete = false;
+ bool do_hexdump = false;
string bucket_name = "sorry_dave";
string object_name = "jocaml";
ASSERT_EQ(ret, 0);
buffer::list bl;
bl.push_back(buffer::create_static(nread, sbuf));
- dout(15) << "";
- bl.hexdump(*_dout);
- *_dout << dendl;
+ if (do_hexdump) {
+ dout(15) << "";
+ bl.hexdump(*_dout);
+ *_dout << dendl;
+ }
}
}
rgw_uio uio[1];
memset(uio, 0, sizeof(rgw_uio));
uio->uio_offset = 0; // ok, it was already 0
+ uio->uio_resid = UINT64_MAX;
int ret = rgw_readv(fs, object_fh, uio);
ASSERT_EQ(ret, 0);
//buffer::list bl;
static_cast<char*>(vio->vio_base)));
}
- dout(15) << "";
- bl.hexdump(*_dout);
- *_dout << dendl;
+ ASSERT_EQ(uint32_t{bl.length()}, uint32_t{iovcnt*page_size});
+
+ if (do_hexdump) {
+ dout(15) << "";
+ bl.hexdump(*_dout);
+ *_dout << dendl;
+ }
// release resources
ASSERT_NE(uio->uio_rele, nullptr);
} else if (ceph_argparse_flag(args, arg_iter, "--prelist",
(char*) nullptr)) {
do_pre_list = true;
+ } else if (ceph_argparse_flag(args, arg_iter, "--hexdump",
+ (char*) nullptr)) {
+ do_hexdump = true;
} else {
++arg_iter;
}