delete object_acl;
}
+void req_state::gen_trans_id()
+{
+ char buf[256];
+ timeval timetest;
+ gettimeofday(&timetest, NULL);
+ if (strftime(buf, sizeof(buf), "%Y%m%d:%H%M%S",gmtime(&(timetest.tv_sec))) == 0)
+ return;
+
+ snprintf(buf + strlen(buf), sizeof(buf)-strlen(buf) ,":%03ld", timetest.tv_usec/1000);
+ trans_id = req_id + "-" + buf;
+}
+
struct str_len {
const char *str;
int len;
string req_id;
+ string trans_id;
+
req_info info;
req_state(CephContext *_cct, class RGWEnv *e);
~req_state();
+
+ void gen_trans_id();
};
/** Store basic data on an object */
s->req_id = store->unique_id(req->id);
+ s->gen_trans_id();
+
req->log(s, "initializing");
RGWOp *op = NULL;
}
}
+void dump_trans_id(req_state *s)
+{
+ if (s->prot_flags & RGW_REST_SWIFT) {
+ s->cio->print("X-Trans-Id: ts-%s\r\n", s->trans_id.c_str());
+ }
+ else {
+ s->cio->print("x-amz-request-id: %s\r\n", s->trans_id.c_str());
+ }
+}
+
void end_header(struct req_state *s, RGWOp *op, const char *content_type, const int64_t proposed_content_length)
{
string ctype;
+ dump_trans_id(s);
+
if (op) {
dump_access_control(s, op);
}