]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/cleanup: fix compile warnning
authorChang Liu <liuchang0812@gmail.com>
Thu, 23 Nov 2017 13:47:52 +0000 (21:47 +0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 10 Apr 2018 15:05:39 +0000 (08:05 -0700)
1. overloaded virtual function
2. virtual functions but no virtual destructors

Signed-off-by: Chang Liu <liuchang0812@gmail.com>
src/rgw/rgw_cr_rest.h
src/rgw/rgw_http_client.cc
src/rgw/rgw_http_client.h
src/rgw/rgw_rest_client.cc
src/rgw/rgw_rest_client.h
src/rgw/rgw_rest_conn.h

index 66bb663ecf9dcaf9d8b5131420874ef63d02f83c..63d1f124ef2ad157317116924fa93a71f555b890 100644 (file)
@@ -339,6 +339,7 @@ public:
   virtual int decode_rest_obj(map<string, string>& headers, bufferlist& extra_data, rgw_rest_obj *info) = 0;
   virtual bool has_attrs() = 0;
   virtual void get_attrs(std::map<string, string> *attrs) = 0;
+  virtual ~RGWStreamReadResourceCRF() = default;
 };
 
 class RGWStreamWriteResourceCRF {
@@ -352,6 +353,8 @@ public:
   virtual int send() = 0;
   virtual int write(bufferlist& data, bool *need_retry) = 0; /* reentrant */
   virtual int drain_writes(bool *need_retry) = 0; /* reentrant */
+  
+  virtual ~RGWStreamWriteResourceCRF() = default;
 };
 
 class RGWStreamReadHTTPResourceCRF : public RGWStreamReadResourceCRF {
@@ -391,7 +394,7 @@ public:
                                                                 env(_env),
                                                                 caller(_caller),
                                                                 http_manager(_http_manager) {}
-  virtual ~RGWStreamReadHTTPResourceCRF();
+  ~RGWStreamReadHTTPResourceCRF() override;
 
   int init() override;
   int read(bufferlist *data, uint64_t max, bool *need_retry) override; /* reentrant */
@@ -451,7 +454,7 @@ public:
                                                                caller(_caller),
                                                                http_manager(_http_manager),
                                                                write_drain_notify_cb(this) {}
-  virtual ~RGWStreamWriteHTTPResourceCRF() {}
+  virtual ~RGWStreamWriteHTTPResourceCRF() = default;
 
   int init() override {
     return 0;
index 5c84131f9307d86dd4d81471eb8df4965544faeb..02410d9a018982013eed4a9b0e173d017b9bbc34 100644 (file)
@@ -564,7 +564,7 @@ int RGWHTTPHeadersCollector::receive_header(void * const ptr, const size_t len)
   return 0;
 }
 
-int RGWHTTPTransceiver::send_data(void* ptr, size_t len)
+int RGWHTTPTransceiver::send_data(void* ptr, size_t len, bool* pause)
 {
   int length_to_copy = 0;
   if (post_data_index < post_data.length()) {
index 127e9e81ad1e35f9604223fa0991c9b31353862d..41c4c5bbbf1427f68c15ae7da5ec108e2e5cc886 100644 (file)
@@ -57,6 +57,7 @@ class RGWIOProvider
 
 public:
   RGWIOProvider() {}
+  virtual ~RGWIOProvider() = default; 
 
   void assign_io(RGWIOIDProvider& io_id_provider, int io_type = -1);
   rgw_io_id get_io_id(int io_type) {
@@ -107,10 +108,8 @@ protected:
   virtual int receive_data(void *ptr, size_t len, bool *pause) {
     return 0;
   }
-  virtual int send_data(void *ptr, size_t len, bool *pause) {
-    return send_data(ptr, len);
-  }
-  virtual int send_data(void *ptr, size_t len) {
+
+  virtual int send_data(void *ptr, size_t len, bool *pause=nullptr) {
     return 0;
   }
 
@@ -269,7 +268,7 @@ public:
   }
 
 protected:
-  int send_data(void* ptr, size_t len) override;
+  int send_data(void* ptr, size_t len, bool *pause=nullptr) override;
 
   int receive_data(void *ptr, size_t len, bool *pause) override {
     read_bl->append((char *)ptr, len);
index 7d6130a81eb54fc8a409bf157a05c398b567b3cf..4a8dcd1b437e74d9ac2a0eafe771348b6666df15 100644 (file)
@@ -149,7 +149,7 @@ int RGWRESTSimpleRequest::execute(RGWAccessKey& key, const char *_method, const
   return status;
 }
 
-int RGWHTTPSimpleRequest::send_data(void *ptr, size_t len)
+int RGWHTTPSimpleRequest::send_data(void *ptr, size_t len, bool* pause)
 {
   if (!send_iter)
     return 0;
index 5d033ab41e5a7d822999b2a85561c7a506df1f5f..3fb4e88f8e9841903f9e05fee12d5d6f0e4301a2 100644 (file)
@@ -50,7 +50,7 @@ public:
 
   int receive_header(void *ptr, size_t len) override;
   int receive_data(void *ptr, size_t len, bool *pause) override;
-  int send_data(void *ptr, size_t len) override;
+  int send_data(void *ptr, size_t len, bool* pause=nullptr) override;
 
   bufferlist& get_response() { return response; }
 
index dfbec06785f9f7779e4a0486da6109f28802ea72..1385e870633a9bc278e349d279429a0fdd83ee8a 100644 (file)
@@ -68,10 +68,10 @@ public:
 
   RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints);
   RGWRESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred);
-
   // custom move needed for atomic
   RGWRESTConn(RGWRESTConn&& other);
   RGWRESTConn& operator=(RGWRESTConn&& other);
+  virtual ~RGWRESTConn() = default;
 
   int get_url(string& endpoint);
   string get_url();
@@ -175,6 +175,7 @@ public:
 
   S3RESTConn(CephContext *_cct, RGWRados *store, const string& _remote_id, const list<string>& endpoints, RGWAccessKey _cred):
     RGWRESTConn(_cct, store, _remote_id, endpoints, _cred) {}
+  ~S3RESTConn() override = default;
 
   void populate_params(param_vec_t& params, const rgw_user *uid, const string& zonegroup) override {
     // do not populate any params in S3 REST Connection.
@@ -249,6 +250,7 @@ public:
                      param_vec_t& _params,
                      param_vec_t *extra_headers,
                      RGWHTTPManager *_mgr);
+  ~RGWRESTReadResource() = default;
 
   rgw_io_id get_io_id(int io_type) {
     return req.get_io_id(io_type);
@@ -372,6 +374,8 @@ public:
                      param_vec_t *extra_headers,
                      RGWHTTPManager *_mgr);
 
+  ~RGWRESTSendResource() = default;
+
   rgw_io_id get_io_id(int io_type) {
     return req.get_io_id(io_type);
   }