{
/* source is in a different zonegroup, copy from there */
- RGWRESTStreamReadRequest *in_stream_req;
+ RGWRESTStreamRWRequest *in_stream_req;
string tag;
map<string, bufferlist> src_attrs;
int i;
ret = conn->get_obj(user_id, info, src_obj, pmod, unmod_ptr,
dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver,
- true, &cb, &in_stream_req);
+ true, true, &cb, &in_stream_req);
if (ret < 0) {
goto set_err_state;
}
param_vec_t *_params) : RGWRESTStreamRWRequest(_cct, "GET", _url, _cb, _headers, _params) {}
};
+class RGWRESTStreamHeadRequest : public RGWRESTStreamRWRequest {
+public:
+ RGWRESTStreamHeadRequest(CephContext *_cct, const string& _url, RGWGetDataCB *_cb, param_vec_t *_headers,
+ param_vec_t *_params) : RGWRESTStreamRWRequest(_cct, "HEAD", _url, _cb, _headers, _params) {}
+};
+
#endif
int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw_obj& obj,
const real_time *mod_ptr, const real_time *unmod_ptr,
uint32_t mod_zone_id, uint64_t mod_pg_ver,
- bool prepend_metadata, RGWGetDataCB *cb, RGWRESTStreamReadRequest **req)
+ bool prepend_metadata, bool read_data,
+ RGWGetDataCB *cb, RGWRESTStreamRWRequest **req)
{
string url;
int ret = get_url(url);
const string& instance = obj.get_instance();
params.push_back(param_pair_t("versionId", instance));
}
- *req = new RGWRESTStreamReadRequest(cct, url, cb, NULL, ¶ms);
+ if (read_data) {
+ *req = new RGWRESTStreamReadRequest(cct, url, cb, NULL, ¶ms);
+ } else {
+ *req = new RGWRESTStreamHeadRequest(cct, url, cb, NULL, ¶ms);
+ }
map<string, string> extra_headers;
if (info) {
map<string, string, ltstr_nocase>& orig_map = info->env->get_map();
return (*req)->get_obj(key, extra_headers, obj);
}
-int RGWRESTConn::complete_request(RGWRESTStreamReadRequest *req, string& etag, real_time *mtime, map<string, string>& attrs)
+int RGWRESTConn::complete_request(RGWRESTStreamRWRequest *req, string& etag, real_time *mtime, map<string, string>& attrs)
{
int ret = req->complete(etag, mtime, attrs);
delete req;
int get_obj(const rgw_user& uid, req_info *info /* optional */, rgw_obj& obj,
const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
uint32_t mod_zone_id, uint64_t mod_pg_ver,
- bool prepend_metadata, RGWGetDataCB *cb, RGWRESTStreamReadRequest **req);
- int complete_request(RGWRESTStreamReadRequest *req, string& etag, ceph::real_time *mtime, map<string, string>& attrs);
+ bool prepend_metadata, bool read_data,
+ RGWGetDataCB *cb, RGWRESTStreamRWRequest **req);
+ int complete_request(RGWRESTStreamRWRequest *req, string& etag, ceph::real_time *mtime, map<string, string>& attrs);
int get_resource(const string& resource,
param_vec_t *extra_params,