Code

grpc plugin: Rename "err" to "status".
authorFlorian Forster <octo@collectd.org>
Thu, 11 Aug 2016 05:53:10 +0000 (07:53 +0200)
committerFlorian Forster <octo@collectd.org>
Thu, 11 Aug 2016 05:53:10 +0000 (07:53 +0200)
src/grpc.cc

index 53b8fa53a87e52a8d1d2fabae54e9656feb9947a..42c6b327ba99801de1012b75b000081a8f21ccc3 100644 (file)
@@ -264,15 +264,15 @@ class CollectdImpl : public collectd::Collectd::Service {
 public:
        grpc::Status QueryValues(grpc::ServerContext *ctx, QueryValuesRequest const *req, grpc::ServerWriter<QueryValuesResponse> *writer) override {
                value_list_t match;
-               auto err = unmarshal_ident(req->identifier(), &match, false);
-               if (!err.ok()) {
-                       return err;
+               auto status = unmarshal_ident(req->identifier(), &match, false);
+               if (!status.ok()) {
+                       return status;
                }
 
                std::queue<value_list_t> value_lists;
-               err = this->queryValuesRead(&match, &value_lists);
-               if (err.ok()) {
-                       err = this->queryValuesWrite(ctx, writer, &value_lists);
+               status = this->queryValuesRead(&match, &value_lists);
+               if (status.ok()) {
+                       status = this->queryValuesWrite(ctx, writer, &value_lists);
                }
 
                while (!value_lists.empty()) {
@@ -281,7 +281,7 @@ public:
                        sfree(vl.values);
                }
 
-               return err;
+               return status;
        }
 
        grpc::Status DispatchValues(grpc::ServerContext *ctx,
@@ -356,9 +356,9 @@ private:
                        QueryValuesResponse res;
                        res.Clear();
 
-                       auto err = marshal_value_list(&vl, res.mutable_value_list());
-                       if (!err.ok()) {
-                               return err;
+                       auto status = marshal_value_list(&vl, res.mutable_value_list());
+                       if (!status.ok()) {
+                               return status;
                        }
 
                        if (!writer->Write(res)) {