From f6ccc6d7bddb32784f2bfb41d5b6d9c1986d2742 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 5 Jul 2018 17:39:58 -0700 Subject: [PATCH] rgw: pubsub: doesn't support quota Check if handler supports quota, pubsub doesn't. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_op.h | 12 +++++++++--- src/rgw/rgw_sync_module_pubsub_rest.cc | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index dec114b90de..f993c350d26 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -104,6 +104,10 @@ public: virtual int postauth_init() = 0; virtual int error_handler(int err_no, std::string* error_content); virtual void dump(const string& code, const string& message) const {} + + virtual bool supports_quota() { + return true; + } }; @@ -141,9 +145,11 @@ public: int get_ret() const { return op_ret; } virtual int init_processing() { - op_ret = init_quota(); - if (op_ret < 0) - return op_ret; + if (dialect_handler->supports_quota()) { + op_ret = init_quota(); + if (op_ret < 0) + return op_ret; + } return 0; } diff --git a/src/rgw/rgw_sync_module_pubsub_rest.cc b/src/rgw/rgw_sync_module_pubsub_rest.cc index cb0d4d0c9a9..8d014534864 100644 --- a/src/rgw/rgw_sync_module_pubsub_rest.cc +++ b/src/rgw/rgw_sync_module_pubsub_rest.cc @@ -277,6 +277,9 @@ public: class RGWHandler_REST_PSTopic_S3 : public RGWHandler_REST_S3 { protected: + bool supports_quota() override { + return false; + } RGWOp *op_get() override { if (s->init_state.url_bucket.empty()) { return nullptr; -- 2.39.5