From 70ff7147ac3e7e1892c05154ea28c35e9d1ce5f9 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 7 Apr 2016 16:09:49 +0200 Subject: [PATCH] Added RGWPutObjEncryptFilter. Will be used for encryption and compression filters. Signed-off-by: Adam Kupczyk (akupczyk@mirantis.com) --- src/rgw/rgw_op.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 292cb531310..0b886ea9bf8 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2818,6 +2818,24 @@ int RGWPutObjProcessor_Multipart::do_complete(string& etag, real_time *mtime, re } + +class RGWPutObjEncryptFilter : public RGWPutObjDataProcessor +{ +protected: + RGWPutObjDataProcessor& next; +public: + RGWPutObjEncryptFilter(RGWPutObjDataProcessor& next) : + next(next){} + virtual ~RGWPutObjEncryptFilter(){} + virtual int handle_data(bufferlist& bl, off_t ofs, void **phandle, bool *again) { + return next.handle_data(bl, ofs, phandle, again); + } + virtual int throttle_data(void *handle, bool need_to_wait) { + return next.throttle_data(handle, need_to_wait); + } +}; /* RGWPutObjEncryptFilter */ + + RGWPutObjProcessor *RGWPutObj::select_processor(RGWObjectCtx& obj_ctx, bool *is_multipart) { RGWPutObjProcessor *processor; -- 2.47.3