diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/grpc/src/cpp/util | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc/src/cpp/util')
-rw-r--r-- | contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc | 28 | ||||
-rw-r--r-- | contrib/libs/grpc/src/cpp/util/error_details.cc | 66 | ||||
-rw-r--r-- | contrib/libs/grpc/src/cpp/util/status.cc | 22 | ||||
-rw-r--r-- | contrib/libs/grpc/src/cpp/util/string_ref.cc | 22 | ||||
-rw-r--r-- | contrib/libs/grpc/src/cpp/util/time_cc.cc | 34 |
5 files changed, 86 insertions, 86 deletions
diff --git a/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc b/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc index fb70590645..01fbe33239 100644 --- a/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc +++ b/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc @@ -1,29 +1,29 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2015 gRPC authors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ -#include <grpc/byte_buffer.h> +#include <grpc/byte_buffer.h> #include <grpc/byte_buffer_reader.h> -#include <grpcpp/impl/grpc_library.h> -#include <grpcpp/support/byte_buffer.h> +#include <grpcpp/impl/grpc_library.h> +#include <grpcpp/support/byte_buffer.h> namespace grpc { -static internal::GrpcLibraryInitializer g_gli_initializer; +static internal::GrpcLibraryInitializer g_gli_initializer; Status ByteBuffer::Dump(std::vector<Slice>* slices) const { slices->clear(); diff --git a/contrib/libs/grpc/src/cpp/util/error_details.cc b/contrib/libs/grpc/src/cpp/util/error_details.cc index dfd3351be1..49d6054454 100644 --- a/contrib/libs/grpc/src/cpp/util/error_details.cc +++ b/contrib/libs/grpc/src/cpp/util/error_details.cc @@ -1,50 +1,50 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#include <grpcpp/support/error_details.h> - -#include "src/proto/grpc/status/status.pb.h" - +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <grpcpp/support/error_details.h> + +#include "src/proto/grpc/status/status.pb.h" + namespace grpc { - + grpc::Status ExtractErrorDetails(const grpc::Status& from, ::google::rpc::Status* to) { - if (to == nullptr) { + if (to == nullptr) { return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, ""); - } + } if (!to->ParseFromString(TProtoStringType(from.error_details()))) { return grpc::Status(grpc::StatusCode::INVALID_ARGUMENT, ""); - } + } return grpc::Status::OK; -} - +} + grpc::Status SetErrorDetails(const ::google::rpc::Status& from, grpc::Status* to) { - if (to == nullptr) { + if (to == nullptr) { return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION, ""); - } + } grpc::StatusCode code = grpc::StatusCode::UNKNOWN; if (from.code() >= grpc::StatusCode::OK && from.code() <= grpc::StatusCode::UNAUTHENTICATED) { code = static_cast<grpc::StatusCode>(from.code()); - } + } *to = grpc::Status(code, from.message(), from.SerializeAsString()); return grpc::Status::OK; -} - +} + } // namespace grpc diff --git a/contrib/libs/grpc/src/cpp/util/status.cc b/contrib/libs/grpc/src/cpp/util/status.cc index 93696d8126..95c20b2148 100644 --- a/contrib/libs/grpc/src/cpp/util/status.cc +++ b/contrib/libs/grpc/src/cpp/util/status.cc @@ -1,22 +1,22 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2015 gRPC authors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ -#include <grpcpp/support/status.h> +#include <grpcpp/support/status.h> namespace grpc { diff --git a/contrib/libs/grpc/src/cpp/util/string_ref.cc b/contrib/libs/grpc/src/cpp/util/string_ref.cc index 8b09a82a63..6b15c2a53b 100644 --- a/contrib/libs/grpc/src/cpp/util/string_ref.cc +++ b/contrib/libs/grpc/src/cpp/util/string_ref.cc @@ -1,22 +1,22 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2015 gRPC authors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ -#include <grpcpp/support/string_ref.h> +#include <grpcpp/support/string_ref.h> namespace grpc { diff --git a/contrib/libs/grpc/src/cpp/util/time_cc.cc b/contrib/libs/grpc/src/cpp/util/time_cc.cc index 6c9c228d7c..2bfe2bd40e 100644 --- a/contrib/libs/grpc/src/cpp/util/time_cc.cc +++ b/contrib/libs/grpc/src/cpp/util/time_cc.cc @@ -1,27 +1,27 @@ /* * - * Copyright 2015 gRPC authors. + * Copyright 2015 gRPC authors. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. * */ #include <grpc/support/time.h> -#include <grpcpp/support/config.h> -#include <grpcpp/support/time.h> +#include <grpcpp/support/config.h> +#include <grpcpp/support/time.h> using std::chrono::duration_cast; -using std::chrono::high_resolution_clock; +using std::chrono::high_resolution_clock; using std::chrono::nanoseconds; using std::chrono::seconds; using std::chrono::system_clock; @@ -39,8 +39,8 @@ void Timepoint2Timespec(const system_clock::time_point& from, return; } nanoseconds nsecs = duration_cast<nanoseconds>(deadline - secs); - to->tv_sec = static_cast<int64_t>(secs.count()); - to->tv_nsec = static_cast<int32_t>(nsecs.count()); + to->tv_sec = static_cast<int64_t>(secs.count()); + to->tv_nsec = static_cast<int32_t>(nsecs.count()); to->clock_type = GPR_CLOCK_REALTIME; } @@ -55,8 +55,8 @@ void TimepointHR2Timespec(const high_resolution_clock::time_point& from, return; } nanoseconds nsecs = duration_cast<nanoseconds>(deadline - secs); - to->tv_sec = static_cast<int64_t>(secs.count()); - to->tv_nsec = static_cast<int32_t>(nsecs.count()); + to->tv_sec = static_cast<int64_t>(secs.count()); + to->tv_nsec = static_cast<int32_t>(nsecs.count()); to->clock_type = GPR_CLOCK_REALTIME; } |