diff --git a/include/grpc++/alarm.h b/include/grpc++/alarm.h index dce742ee884..20f23c75c60 100644 --- a/include/grpc++/alarm.h +++ b/include/grpc++/alarm.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/channel.h b/include/grpc++/channel.h index b1154cefb34..45557a19d0d 100644 --- a/include/grpc++/channel.h +++ b/include/grpc++/channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 4b236440596..41adb97cba4 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 98ef18f0f65..198f87953fe 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/create_channel.h b/include/grpc++/create_channel.h index d95f3a97972..53c7549c802 100644 --- a/include/grpc++/create_channel.h +++ b/include/grpc++/create_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/create_channel_posix.h b/include/grpc++/create_channel_posix.h index 8c8983ba606..6e8ebad8eeb 100644 --- a/include/grpc++/create_channel_posix.h +++ b/include/grpc++/create_channel_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/ext/health_check_service_server_builder_option.h b/include/grpc++/ext/health_check_service_server_builder_option.h index cb82fc03b6b..847bf52a5e7 100644 --- a/include/grpc++/ext/health_check_service_server_builder_option.h +++ b/include/grpc++/ext/health_check_service_server_builder_option.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/ext/proto_server_reflection_plugin.h b/include/grpc++/ext/proto_server_reflection_plugin.h index 02e21b92190..1c583474d18 100644 --- a/include/grpc++/ext/proto_server_reflection_plugin.h +++ b/include/grpc++/ext/proto_server_reflection_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/generic/async_generic_service.h b/include/grpc++/generic/async_generic_service.h index d3283fac6f4..f95c6c83a64 100644 --- a/include/grpc++/generic/async_generic_service.h +++ b/include/grpc++/generic/async_generic_service.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/generic/generic_stub.h b/include/grpc++/generic/generic_stub.h index 502953b5de9..2361c5803cf 100644 --- a/include/grpc++/generic/generic_stub.h +++ b/include/grpc++/generic/generic_stub.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/grpc++.h b/include/grpc++/grpc++.h index 9f1d7b1bc1e..6f6f4946ade 100644 --- a/include/grpc++/grpc++.h +++ b/include/grpc++/grpc++.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/health_check_service_interface.h b/include/grpc++/health_check_service_interface.h index 0cb0668e48d..90b5e3b16e1 100644 --- a/include/grpc++/health_check_service_interface.h +++ b/include/grpc++/health_check_service_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index b1da2b6358d..efb3fdf9dde 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/channel_argument_option.h b/include/grpc++/impl/channel_argument_option.h index 3468378de6e..37e647e2f35 100644 --- a/include/grpc++/impl/channel_argument_option.h +++ b/include/grpc++/impl/channel_argument_option.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h index 75e656071f4..9c4b30f67a3 100644 --- a/include/grpc++/impl/client_unary_call.h +++ b/include/grpc++/impl/client_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h index a034470a707..076d66fc96c 100644 --- a/include/grpc++/impl/codegen/async_stream.h +++ b/include/grpc++/impl/codegen/async_stream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h index 2b08920a304..33265ce00ec 100644 --- a/include/grpc++/impl/codegen/async_unary_call.h +++ b/include/grpc++/impl/codegen/async_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/byte_buffer.h b/include/grpc++/impl/codegen/byte_buffer.h index b754fa24e9c..4ccd991887e 100644 --- a/include/grpc++/impl/codegen/byte_buffer.h +++ b/include/grpc++/impl/codegen/byte_buffer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index dadab5454ab..7e9265a3cb0 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/call_hook.h b/include/grpc++/impl/codegen/call_hook.h index cf5ed571b2d..3609b2c3ac3 100644 --- a/include/grpc++/impl/codegen/call_hook.h +++ b/include/grpc++/impl/codegen/call_hook.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/channel_interface.h b/include/grpc++/impl/codegen/channel_interface.h index c6e782e9c41..bdd0890ce39 100644 --- a/include/grpc++/impl/codegen/channel_interface.h +++ b/include/grpc++/impl/codegen/channel_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index 107532cb6b6..9a46bc21e29 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h index f7dff1f1f05..c0cbfcd8773 100644 --- a/include/grpc++/impl/codegen/client_unary_call.h +++ b/include/grpc++/impl/codegen/client_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index 107549550bd..005ce408628 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/completion_queue_tag.h b/include/grpc++/impl/codegen/completion_queue_tag.h index 994fa2a904a..1fefe59de9d 100644 --- a/include/grpc++/impl/codegen/completion_queue_tag.h +++ b/include/grpc++/impl/codegen/completion_queue_tag.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h index 237bf38d3ed..07a72a202f5 100644 --- a/include/grpc++/impl/codegen/config.h +++ b/include/grpc++/impl/codegen/config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/config_protobuf.h b/include/grpc++/impl/codegen/config_protobuf.h index debd74aae79..85c13055876 100644 --- a/include/grpc++/impl/codegen/config_protobuf.h +++ b/include/grpc++/impl/codegen/config_protobuf.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/create_auth_context.h b/include/grpc++/impl/codegen/create_auth_context.h index ef89229f4d2..9c43acfe906 100644 --- a/include/grpc++/impl/codegen/create_auth_context.h +++ b/include/grpc++/impl/codegen/create_auth_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/metadata_map.h b/include/grpc++/impl/codegen/metadata_map.h index 41c5ad375e1..660eae85448 100644 --- a/include/grpc++/impl/codegen/metadata_map.h +++ b/include/grpc++/impl/codegen/metadata_map.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h index 0bdb620616b..9fec30e972f 100644 --- a/include/grpc++/impl/codegen/method_handler_impl.h +++ b/include/grpc++/impl/codegen/method_handler_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/proto_utils.h b/include/grpc++/impl/codegen/proto_utils.h index 1f47884abc3..f40b3661ded 100644 --- a/include/grpc++/impl/codegen/proto_utils.h +++ b/include/grpc++/impl/codegen/proto_utils.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/rpc_method.h b/include/grpc++/impl/codegen/rpc_method.h index 2906c74dda7..dfce31e4e09 100644 --- a/include/grpc++/impl/codegen/rpc_method.h +++ b/include/grpc++/impl/codegen/rpc_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/rpc_service_method.h b/include/grpc++/impl/codegen/rpc_service_method.h index 999c0d5e935..7d3dbacee9f 100644 --- a/include/grpc++/impl/codegen/rpc_service_method.h +++ b/include/grpc++/impl/codegen/rpc_service_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/security/auth_context.h b/include/grpc++/impl/codegen/security/auth_context.h index b4663739a6a..4a7f4e75b00 100644 --- a/include/grpc++/impl/codegen/security/auth_context.h +++ b/include/grpc++/impl/codegen/security/auth_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/serialization_traits.h b/include/grpc++/impl/codegen/serialization_traits.h index 480575d1099..647b5bd5ccf 100644 --- a/include/grpc++/impl/codegen/serialization_traits.h +++ b/include/grpc++/impl/codegen/serialization_traits.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index 1c3342d5d4b..fb3452cf1df 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/server_interface.h b/include/grpc++/impl/codegen/server_interface.h index ceea44c50cb..c9b35c00d4f 100644 --- a/include/grpc++/impl/codegen/server_interface.h +++ b/include/grpc++/impl/codegen/server_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/service_type.h b/include/grpc++/impl/codegen/service_type.h index be02b75bae4..f01ccb00693 100644 --- a/include/grpc++/impl/codegen/service_type.h +++ b/include/grpc++/impl/codegen/service_type.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/slice.h b/include/grpc++/impl/codegen/slice.h index 6714badc37d..7bde84d7d38 100644 --- a/include/grpc++/impl/codegen/slice.h +++ b/include/grpc++/impl/codegen/slice.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/status.h b/include/grpc++/impl/codegen/status.h index 6cf9459fff2..1587bf20b87 100644 --- a/include/grpc++/impl/codegen/status.h +++ b/include/grpc++/impl/codegen/status.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/status_code_enum.h b/include/grpc++/impl/codegen/status_code_enum.h index 7503eaeeca6..1118d0d9989 100644 --- a/include/grpc++/impl/codegen/status_code_enum.h +++ b/include/grpc++/impl/codegen/status_code_enum.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/string_ref.h b/include/grpc++/impl/codegen/string_ref.h index 66e250efddb..de8de2f0771 100644 --- a/include/grpc++/impl/codegen/string_ref.h +++ b/include/grpc++/impl/codegen/string_ref.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/stub_options.h b/include/grpc++/impl/codegen/stub_options.h index 07cb4417b7a..52ef352cb98 100644 --- a/include/grpc++/impl/codegen/stub_options.h +++ b/include/grpc++/impl/codegen/stub_options.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index 1e6ba27bf51..2542ae0d623 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/codegen/time.h b/include/grpc++/impl/codegen/time.h index f9b70f83135..7c3d1bde141 100644 --- a/include/grpc++/impl/codegen/time.h +++ b/include/grpc++/impl/codegen/time.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/grpc_library.h b/include/grpc++/impl/grpc_library.h index f34a281ac39..b70deed7054 100644 --- a/include/grpc++/impl/grpc_library.h +++ b/include/grpc++/impl/grpc_library.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/method_handler_impl.h b/include/grpc++/impl/method_handler_impl.h index 3840f48742f..6bf330db8d5 100644 --- a/include/grpc++/impl/method_handler_impl.h +++ b/include/grpc++/impl/method_handler_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/rpc_method.h b/include/grpc++/impl/rpc_method.h index 7cba7c40c45..cb727eacc0d 100644 --- a/include/grpc++/impl/rpc_method.h +++ b/include/grpc++/impl/rpc_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index 2c75087b7c8..ef1b6d9ea3e 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/serialization_traits.h b/include/grpc++/impl/serialization_traits.h index 33b3a0bb31e..cfbd1f4bd11 100644 --- a/include/grpc++/impl/serialization_traits.h +++ b/include/grpc++/impl/serialization_traits.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/server_builder_option.h b/include/grpc++/impl/server_builder_option.h index 833f8db772f..25f8ddfe0e0 100644 --- a/include/grpc++/impl/server_builder_option.h +++ b/include/grpc++/impl/server_builder_option.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/server_builder_plugin.h b/include/grpc++/impl/server_builder_plugin.h index 844d32c55f1..48c38e62b1f 100644 --- a/include/grpc++/impl/server_builder_plugin.h +++ b/include/grpc++/impl/server_builder_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/server_initializer.h b/include/grpc++/impl/server_initializer.h index 6a1669ccf57..5a1c3d1a8a3 100644 --- a/include/grpc++/impl/server_initializer.h +++ b/include/grpc++/impl/server_initializer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/impl/service_type.h b/include/grpc++/impl/service_type.h index 86422160d4d..69cb30ac41c 100644 --- a/include/grpc++/impl/service_type.h +++ b/include/grpc++/impl/service_type.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/resource_quota.h b/include/grpc++/resource_quota.h index aad1b5659fd..c41d1a06e71 100644 --- a/include/grpc++/resource_quota.h +++ b/include/grpc++/resource_quota.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/security/auth_context.h b/include/grpc++/security/auth_context.h index 9fe59d448e3..9718a3c883c 100644 --- a/include/grpc++/security/auth_context.h +++ b/include/grpc++/security/auth_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/security/auth_metadata_processor.h b/include/grpc++/security/auth_metadata_processor.h index d0453139655..b6992973609 100644 --- a/include/grpc++/security/auth_metadata_processor.h +++ b/include/grpc++/security/auth_metadata_processor.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/security/credentials.h b/include/grpc++/security/credentials.h index 940441827db..73619d762d0 100644 --- a/include/grpc++/security/credentials.h +++ b/include/grpc++/security/credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/security/server_credentials.h b/include/grpc++/security/server_credentials.h index c6d1c4f0e4c..1a581ee4213 100644 --- a/include/grpc++/security/server_credentials.h +++ b/include/grpc++/security/server_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 086c24cc699..b27bb80c8a5 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h index 2c6dab44453..46e4bc4ede0 100644 --- a/include/grpc++/server_builder.h +++ b/include/grpc++/server_builder.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/server_context.h b/include/grpc++/server_context.h index 672ccdca6d9..5f55d3aa6c4 100644 --- a/include/grpc++/server_context.h +++ b/include/grpc++/server_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/server_posix.h b/include/grpc++/server_posix.h index d2866d96402..bde4f47d226 100644 --- a/include/grpc++/server_posix.h +++ b/include/grpc++/server_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/async_stream.h b/include/grpc++/support/async_stream.h index 9bb2b725c3c..a42a57f5ab5 100644 --- a/include/grpc++/support/async_stream.h +++ b/include/grpc++/support/async_stream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/async_unary_call.h b/include/grpc++/support/async_unary_call.h index 56fbf31417e..2e253649826 100644 --- a/include/grpc++/support/async_unary_call.h +++ b/include/grpc++/support/async_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/byte_buffer.h b/include/grpc++/support/byte_buffer.h index ec607ee01aa..121700d4f45 100644 --- a/include/grpc++/support/byte_buffer.h +++ b/include/grpc++/support/byte_buffer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/channel_arguments.h b/include/grpc++/support/channel_arguments.h index 6d5300ccb79..7025334e11d 100644 --- a/include/grpc++/support/channel_arguments.h +++ b/include/grpc++/support/channel_arguments.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/config.h b/include/grpc++/support/config.h index f8eee5075a8..3db2ae03b4a 100644 --- a/include/grpc++/support/config.h +++ b/include/grpc++/support/config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/error_details.h b/include/grpc++/support/error_details.h index 7ace308e52f..d9f7eb7adfd 100644 --- a/include/grpc++/support/error_details.h +++ b/include/grpc++/support/error_details.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/slice.h b/include/grpc++/support/slice.h index b02b1a977ed..70a6cbcc62f 100644 --- a/include/grpc++/support/slice.h +++ b/include/grpc++/support/slice.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/status.h b/include/grpc++/support/status.h index e58a18bdf99..4e442ee0115 100644 --- a/include/grpc++/support/status.h +++ b/include/grpc++/support/status.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/status_code_enum.h b/include/grpc++/support/status_code_enum.h index c278add0c65..3eb0cafda2a 100644 --- a/include/grpc++/support/status_code_enum.h +++ b/include/grpc++/support/status_code_enum.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/string_ref.h b/include/grpc++/support/string_ref.h index 49de6dafce9..8fb05fa924f 100644 --- a/include/grpc++/support/string_ref.h +++ b/include/grpc++/support/string_ref.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/stub_options.h b/include/grpc++/support/stub_options.h index a712ce8716c..289fb4af052 100644 --- a/include/grpc++/support/stub_options.h +++ b/include/grpc++/support/stub_options.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/sync_stream.h b/include/grpc++/support/sync_stream.h index c118df9f7b4..996dbe06e51 100644 --- a/include/grpc++/support/sync_stream.h +++ b/include/grpc++/support/sync_stream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/support/time.h b/include/grpc++/support/time.h index d356b910013..da677e9a1e1 100644 --- a/include/grpc++/support/time.h +++ b/include/grpc++/support/time.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/test/mock_stream.h b/include/grpc++/test/mock_stream.h index a29345b061f..045bb5b9f94 100644 --- a/include/grpc++/test/mock_stream.h +++ b/include/grpc++/test/mock_stream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpc++/test/server_context_test_spouse.h b/include/grpc++/test/server_context_test_spouse.h index 48a4838c2d6..b31fb58e5ca 100644 --- a/include/grpc++/test/server_context_test_spouse.h +++ b/include/grpc++/test/server_context_test_spouse.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards diff --git a/include/grpcpp/alarm.h b/include/grpcpp/alarm.h index da47c63d573..319fc29f1e2 100644 --- a/include/grpcpp/alarm.h +++ b/include/grpcpp/alarm.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// /// An Alarm posts the user-provided tag to its associated completion queue or /// invokes the user-provided function on expiry or cancellation. diff --git a/include/grpcpp/channel.h b/include/grpcpp/channel.h index ef05d0747fd..aef567390d9 100644 --- a/include/grpcpp/channel.h +++ b/include/grpcpp/channel.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_CHANNEL_H #define GRPCPP_CHANNEL_H diff --git a/include/grpcpp/client_context.h b/include/grpcpp/client_context.h index f5bbf0f3e7c..7493f6a8601 100644 --- a/include/grpcpp/client_context.h +++ b/include/grpcpp/client_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// /// A ClientContext allows the person implementing a service client to: /// @@ -224,16 +224,16 @@ class ClientContext { /// must end in "-bin". /// /// Metadata must conform to the following format: - /** - \verbatim - Custom-Metadata -> Binary-Header / ASCII-Header - Binary-Header -> {Header-Name "-bin" } {binary value} - ASCII-Header -> Header-Name ASCII-Value - Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . - ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII - Custom-Metadata -> Binary-Header / ASCII-Header - \endverbatim - **/ + /// + ///\verbatim + /// Custom-Metadata -> Binary-Header / ASCII-Header + /// Binary-Header -> {Header-Name "-bin" } {binary value} + /// ASCII-Header -> Header-Name ASCII-Value + /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . + /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII + /// Custom-Metadata -> Binary-Header / ASCII-Header + ///\endverbatim + /// void AddMetadata(const std::string& meta_key, const std::string& meta_value); /// Return a collection of initial metadata key-value pairs. Note that keys diff --git a/include/grpcpp/completion_queue.h b/include/grpcpp/completion_queue.h index 3bf97b75790..23c98e09749 100644 --- a/include/grpcpp/completion_queue.h +++ b/include/grpcpp/completion_queue.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// /// A completion queue implements a concurrent producer-consumer queue, with /// two main API-exposed methods: \a Next and \a AsyncNext. These diff --git a/include/grpcpp/create_channel.h b/include/grpcpp/create_channel.h index df015b98694..83f905e776f 100644 --- a/include/grpcpp/create_channel.h +++ b/include/grpcpp/create_channel.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_CREATE_CHANNEL_H #define GRPCPP_CREATE_CHANNEL_H diff --git a/include/grpcpp/create_channel_posix.h b/include/grpcpp/create_channel_posix.h index e6019d2cbf4..651471da017 100644 --- a/include/grpcpp/create_channel_posix.h +++ b/include/grpcpp/create_channel_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_CREATE_CHANNEL_POSIX_H #define GRPCPP_CREATE_CHANNEL_POSIX_H diff --git a/include/grpcpp/ext/call_metric_recorder.h b/include/grpcpp/ext/call_metric_recorder.h index 57d9202c6c7..3cf9039e97b 100644 --- a/include/grpcpp/ext/call_metric_recorder.h +++ b/include/grpcpp/ext/call_metric_recorder.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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. +// +// #ifndef GRPCPP_EXT_CALL_METRIC_RECORDER_H #define GRPCPP_EXT_CALL_METRIC_RECORDER_H diff --git a/include/grpcpp/ext/channelz_service_plugin.h b/include/grpcpp/ext/channelz_service_plugin.h index af3192d4513..23882abb50f 100644 --- a/include/grpcpp/ext/channelz_service_plugin.h +++ b/include/grpcpp/ext/channelz_service_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H #define GRPCPP_EXT_CHANNELZ_SERVICE_PLUGIN_H diff --git a/include/grpcpp/ext/health_check_service_server_builder_option.h b/include/grpcpp/ext/health_check_service_server_builder_option.h index dd43b05ef07..85b661ee515 100644 --- a/include/grpcpp/ext/health_check_service_server_builder_option.h +++ b/include/grpcpp/ext/health_check_service_server_builder_option.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_EXT_HEALTH_CHECK_SERVICE_SERVER_BUILDER_OPTION_H #define GRPCPP_EXT_HEALTH_CHECK_SERVICE_SERVER_BUILDER_OPTION_H diff --git a/include/grpcpp/ext/proto_server_reflection_plugin.h b/include/grpcpp/ext/proto_server_reflection_plugin.h index 3c58debc698..2e3964c957f 100644 --- a/include/grpcpp/ext/proto_server_reflection_plugin.h +++ b/include/grpcpp/ext/proto_server_reflection_plugin.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H #define GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H diff --git a/include/grpcpp/ext/server_load_reporting.h b/include/grpcpp/ext/server_load_reporting.h index cb20311e58b..8b4e7e371fa 100644 --- a/include/grpcpp/ext/server_load_reporting.h +++ b/include/grpcpp/ext/server_load_reporting.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_EXT_SERVER_LOAD_REPORTING_H #define GRPCPP_EXT_SERVER_LOAD_REPORTING_H diff --git a/include/grpcpp/generic/async_generic_service.h b/include/grpcpp/generic/async_generic_service.h index 172d7df47ff..cd9d43dfe31 100644 --- a/include/grpcpp/generic/async_generic_service.h +++ b/include/grpcpp/generic/async_generic_service.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H #define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H diff --git a/include/grpcpp/generic/generic_stub.h b/include/grpcpp/generic/generic_stub.h index 0cdd6a5c85d..a44232bc519 100644 --- a/include/grpcpp/generic/generic_stub.h +++ b/include/grpcpp/generic/generic_stub.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_GENERIC_GENERIC_STUB_H #define GRPCPP_GENERIC_GENERIC_STUB_H diff --git a/include/grpcpp/grpcpp.h b/include/grpcpp/grpcpp.h index d692b7f0038..61623cb67e5 100644 --- a/include/grpcpp/grpcpp.h +++ b/include/grpcpp/grpcpp.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// /// \mainpage gRPC C++ API /// diff --git a/include/grpcpp/health_check_service_interface.h b/include/grpcpp/health_check_service_interface.h index 9eab8fc115f..073bdb76c35 100644 --- a/include/grpcpp/health_check_service_interface.h +++ b/include/grpcpp/health_check_service_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H #define GRPCPP_HEALTH_CHECK_SERVICE_INTERFACE_H diff --git a/include/grpcpp/impl/call.h b/include/grpcpp/impl/call.h index ac4b85e20b9..32c58175327 100644 --- a/include/grpcpp/impl/call.h +++ b/include/grpcpp/impl/call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CALL_H #define GRPCPP_IMPL_CALL_H @@ -40,7 +40,7 @@ class Call final { cq_(nullptr), call_(nullptr), max_receive_message_size_(-1) {} - /** call is owned by the caller */ + /// call is owned by the caller Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) : call_hook_(call_hook), cq_(cq), diff --git a/include/grpcpp/impl/call_hook.h b/include/grpcpp/impl/call_hook.h index 8903b9a06e4..2376769194e 100644 --- a/include/grpcpp/impl/call_hook.h +++ b/include/grpcpp/impl/call_hook.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CALL_HOOK_H #define GRPCPP_IMPL_CALL_HOOK_H diff --git a/include/grpcpp/impl/call_op_set.h b/include/grpcpp/impl/call_op_set.h index 5f676ac2a1d..40d8f5d01c5 100644 --- a/include/grpcpp/impl/call_op_set.h +++ b/include/grpcpp/impl/call_op_set.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CALL_OP_SET_H #define GRPCPP_IMPL_CALL_OP_SET_H diff --git a/include/grpcpp/impl/call_op_set_interface.h b/include/grpcpp/impl/call_op_set_interface.h index 416fe8fe0c3..c9667bd391f 100644 --- a/include/grpcpp/impl/call_op_set_interface.h +++ b/include/grpcpp/impl/call_op_set_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H #define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/include/grpcpp/impl/channel_argument_option.h b/include/grpcpp/impl/channel_argument_option.h index 335072a2d30..c80a1ccc7cf 100644 --- a/include/grpcpp/impl/channel_argument_option.h +++ b/include/grpcpp/impl/channel_argument_option.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPCPP_IMPL_CHANNEL_ARGUMENT_OPTION_H #define GRPCPP_IMPL_CHANNEL_ARGUMENT_OPTION_H diff --git a/include/grpcpp/impl/channel_interface.h b/include/grpcpp/impl/channel_interface.h index 365185b7547..48d9661f6fa 100644 --- a/include/grpcpp/impl/channel_interface.h +++ b/include/grpcpp/impl/channel_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CHANNEL_INTERFACE_H #define GRPCPP_IMPL_CHANNEL_INTERFACE_H diff --git a/include/grpcpp/impl/client_unary_call.h b/include/grpcpp/impl/client_unary_call.h index ac6d4905a01..c2fdcd99a34 100644 --- a/include/grpcpp/impl/client_unary_call.h +++ b/include/grpcpp/impl/client_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CLIENT_UNARY_CALL_H #define GRPCPP_IMPL_CLIENT_UNARY_CALL_H diff --git a/include/grpcpp/impl/codegen/async_generic_service.h b/include/grpcpp/impl/codegen/async_generic_service.h index 03a096c52be..e4ff965564a 100644 --- a/include/grpcpp/impl/codegen/async_generic_service.h +++ b/include/grpcpp/impl/codegen/async_generic_service.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H #define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H diff --git a/include/grpcpp/impl/codegen/async_stream.h b/include/grpcpp/impl/codegen/async_stream.h index 524f619f815..e10bc8c219b 100644 --- a/include/grpcpp/impl/codegen/async_stream.h +++ b/include/grpcpp/impl/codegen/async_stream.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H diff --git a/include/grpcpp/impl/codegen/async_unary_call.h b/include/grpcpp/impl/codegen/async_unary_call.h index 55227b2e4a8..e90b9069c9e 100644 --- a/include/grpcpp/impl/codegen/async_unary_call.h +++ b/include/grpcpp/impl/codegen/async_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H diff --git a/include/grpcpp/impl/codegen/byte_buffer.h b/include/grpcpp/impl/codegen/byte_buffer.h index d1969953929..4e01e92f357 100644 --- a/include/grpcpp/impl/codegen/byte_buffer.h +++ b/include/grpcpp/impl/codegen/byte_buffer.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H #define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h index 71f6cb8e4e8..ec06d94d0e9 100644 --- a/include/grpcpp/impl/codegen/call.h +++ b/include/grpcpp/impl/codegen/call.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H diff --git a/include/grpcpp/impl/codegen/call_hook.h b/include/grpcpp/impl/codegen/call_hook.h index db10a0fc2b5..c2c8efd45fb 100644 --- a/include/grpcpp/impl/codegen/call_hook.h +++ b/include/grpcpp/impl/codegen/call_hook.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CALL_HOOK_H #define GRPCPP_IMPL_CODEGEN_CALL_HOOK_H diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h index fe8f0535923..f81f44d1001 100644 --- a/include/grpcpp/impl/codegen/call_op_set.h +++ b/include/grpcpp/impl/codegen/call_op_set.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H #define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H diff --git a/include/grpcpp/impl/codegen/call_op_set_interface.h b/include/grpcpp/impl/codegen/call_op_set_interface.h index ce5f2036d1b..ba2d1519e8a 100644 --- a/include/grpcpp/impl/codegen/call_op_set_interface.h +++ b/include/grpcpp/impl/codegen/call_op_set_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H #define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/include/grpcpp/impl/codegen/callback_common.h b/include/grpcpp/impl/codegen/callback_common.h index 3057e2aed42..3e7db6f3ad3 100644 --- a/include/grpcpp/impl/codegen/callback_common.h +++ b/include/grpcpp/impl/codegen/callback_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H #define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h index 70d36b729f4..71616d86137 100644 --- a/include/grpcpp/impl/codegen/channel_interface.h +++ b/include/grpcpp/impl/codegen/channel_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H #define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H diff --git a/include/grpcpp/impl/codegen/client_callback.h b/include/grpcpp/impl/codegen/client_callback.h index ac1bd93b71a..8aaa958be94 100644 --- a/include/grpcpp/impl/codegen/client_callback.h +++ b/include/grpcpp/impl/codegen/client_callback.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H #define GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H diff --git a/include/grpcpp/impl/codegen/client_context.h b/include/grpcpp/impl/codegen/client_context.h index c3818abf561..98afa3162ca 100644 --- a/include/grpcpp/impl/codegen/client_context.h +++ b/include/grpcpp/impl/codegen/client_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H #define GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H diff --git a/include/grpcpp/impl/codegen/client_interceptor.h b/include/grpcpp/impl/codegen/client_interceptor.h index 1c6b8ce51f8..c706145c39f 100644 --- a/include/grpcpp/impl/codegen/client_interceptor.h +++ b/include/grpcpp/impl/codegen/client_interceptor.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H diff --git a/include/grpcpp/impl/codegen/client_unary_call.h b/include/grpcpp/impl/codegen/client_unary_call.h index 7e7944e6598..d7d778a5cac 100644 --- a/include/grpcpp/impl/codegen/client_unary_call.h +++ b/include/grpcpp/impl/codegen/client_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H #define GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H diff --git a/include/grpcpp/impl/codegen/completion_queue.h b/include/grpcpp/impl/codegen/completion_queue.h index 67decf636f8..2221cf63f5c 100644 --- a/include/grpcpp/impl/codegen/completion_queue.h +++ b/include/grpcpp/impl/codegen/completion_queue.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H #define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H diff --git a/include/grpcpp/impl/codegen/completion_queue_tag.h b/include/grpcpp/impl/codegen/completion_queue_tag.h index 7ca70306a61..902f0bbc2ca 100644 --- a/include/grpcpp/impl/codegen/completion_queue_tag.h +++ b/include/grpcpp/impl/codegen/completion_queue_tag.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H #define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H diff --git a/include/grpcpp/impl/codegen/config.h b/include/grpcpp/impl/codegen/config.h index 59fc0b5c0b2..c7bfb198e8a 100644 --- a/include/grpcpp/impl/codegen/config.h +++ b/include/grpcpp/impl/codegen/config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CONFIG_H #define GRPCPP_IMPL_CODEGEN_CONFIG_H diff --git a/include/grpcpp/impl/codegen/config_protobuf.h b/include/grpcpp/impl/codegen/config_protobuf.h index da874c58eb6..e1f3d40ac92 100644 --- a/include/grpcpp/impl/codegen/config_protobuf.h +++ b/include/grpcpp/impl/codegen/config_protobuf.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H #define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H diff --git a/include/grpcpp/impl/codegen/create_auth_context.h b/include/grpcpp/impl/codegen/create_auth_context.h index b3a10428f30..9120100cd69 100644 --- a/include/grpcpp/impl/codegen/create_auth_context.h +++ b/include/grpcpp/impl/codegen/create_auth_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H #define GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H diff --git a/include/grpcpp/impl/codegen/delegating_channel.h b/include/grpcpp/impl/codegen/delegating_channel.h index 1a51f01872e..7c4b3178691 100644 --- a/include/grpcpp/impl/codegen/delegating_channel.h +++ b/include/grpcpp/impl/codegen/delegating_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H #define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H diff --git a/include/grpcpp/impl/codegen/intercepted_channel.h b/include/grpcpp/impl/codegen/intercepted_channel.h index d90d156d30c..2f412078688 100644 --- a/include/grpcpp/impl/codegen/intercepted_channel.h +++ b/include/grpcpp/impl/codegen/intercepted_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H #define GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h index e34bda841bc..e44a64843ce 100644 --- a/include/grpcpp/impl/codegen/interceptor.h +++ b/include/grpcpp/impl/codegen/interceptor.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h index 87aefd73c85..25df69b2c6e 100644 --- a/include/grpcpp/impl/codegen/interceptor_common.h +++ b/include/grpcpp/impl/codegen/interceptor_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H diff --git a/include/grpcpp/impl/codegen/message_allocator.h b/include/grpcpp/impl/codegen/message_allocator.h index df21e02a8fb..d89ce9dda7e 100644 --- a/include/grpcpp/impl/codegen/message_allocator.h +++ b/include/grpcpp/impl/codegen/message_allocator.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H #define GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H diff --git a/include/grpcpp/impl/codegen/metadata_map.h b/include/grpcpp/impl/codegen/metadata_map.h index 3f769021c47..aad4d5ab78f 100644 --- a/include/grpcpp/impl/codegen/metadata_map.h +++ b/include/grpcpp/impl/codegen/metadata_map.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_METADATA_MAP_H #define GRPCPP_IMPL_CODEGEN_METADATA_MAP_H diff --git a/include/grpcpp/impl/codegen/method_handler.h b/include/grpcpp/impl/codegen/method_handler.h index 594727cec62..d7444a6bf08 100644 --- a/include/grpcpp/impl/codegen/method_handler.h +++ b/include/grpcpp/impl/codegen/method_handler.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H #define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H diff --git a/include/grpcpp/impl/codegen/method_handler_impl.h b/include/grpcpp/impl/codegen/method_handler_impl.h index 3f1d573ba5f..71669382774 100644 --- a/include/grpcpp/impl/codegen/method_handler_impl.h +++ b/include/grpcpp/impl/codegen/method_handler_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H #define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H diff --git a/include/grpcpp/impl/codegen/proto_buffer_reader.h b/include/grpcpp/impl/codegen/proto_buffer_reader.h index d60d20052e6..a1f466292c9 100644 --- a/include/grpcpp/impl/codegen/proto_buffer_reader.h +++ b/include/grpcpp/impl/codegen/proto_buffer_reader.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H #define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H diff --git a/include/grpcpp/impl/codegen/proto_buffer_writer.h b/include/grpcpp/impl/codegen/proto_buffer_writer.h index edb7f454c0f..f0fe8ce2427 100644 --- a/include/grpcpp/impl/codegen/proto_buffer_writer.h +++ b/include/grpcpp/impl/codegen/proto_buffer_writer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H #define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H diff --git a/include/grpcpp/impl/codegen/proto_utils.h b/include/grpcpp/impl/codegen/proto_utils.h index 3251cec6442..e5c57a40256 100644 --- a/include/grpcpp/impl/codegen/proto_utils.h +++ b/include/grpcpp/impl/codegen/proto_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H #define GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H diff --git a/include/grpcpp/impl/codegen/rpc_method.h b/include/grpcpp/impl/codegen/rpc_method.h index bd8904c49ef..2c2be6fce17 100644 --- a/include/grpcpp/impl/codegen/rpc_method.h +++ b/include/grpcpp/impl/codegen/rpc_method.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_RPC_METHOD_H #define GRPCPP_IMPL_CODEGEN_RPC_METHOD_H diff --git a/include/grpcpp/impl/codegen/rpc_service_method.h b/include/grpcpp/impl/codegen/rpc_service_method.h index 5900706325e..d6f6c5da946 100644 --- a/include/grpcpp/impl/codegen/rpc_service_method.h +++ b/include/grpcpp/impl/codegen/rpc_service_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H #define GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H diff --git a/include/grpcpp/impl/codegen/security/auth_context.h b/include/grpcpp/impl/codegen/security/auth_context.h index 7fd7ca10fb7..df62c2d7b2d 100644 --- a/include/grpcpp/impl/codegen/security/auth_context.h +++ b/include/grpcpp/impl/codegen/security/auth_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H #define GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H diff --git a/include/grpcpp/impl/codegen/serialization_traits.h b/include/grpcpp/impl/codegen/serialization_traits.h index fff4ac4abf0..3b18f758276 100644 --- a/include/grpcpp/impl/codegen/serialization_traits.h +++ b/include/grpcpp/impl/codegen/serialization_traits.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H #define GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H diff --git a/include/grpcpp/impl/codegen/server_callback.h b/include/grpcpp/impl/codegen/server_callback.h index d33283ca1bf..8f6ce0a55fb 100644 --- a/include/grpcpp/impl/codegen/server_callback.h +++ b/include/grpcpp/impl/codegen/server_callback.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H #define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H diff --git a/include/grpcpp/impl/codegen/server_callback_handlers.h b/include/grpcpp/impl/codegen/server_callback_handlers.h index 3ef3ce19bbf..bd767dcb3a3 100644 --- a/include/grpcpp/impl/codegen/server_callback_handlers.h +++ b/include/grpcpp/impl/codegen/server_callback_handlers.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H #define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H diff --git a/include/grpcpp/impl/codegen/server_context.h b/include/grpcpp/impl/codegen/server_context.h index 805e038def1..33374815dc1 100644 --- a/include/grpcpp/impl/codegen/server_context.h +++ b/include/grpcpp/impl/codegen/server_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H #define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H diff --git a/include/grpcpp/impl/codegen/server_interceptor.h b/include/grpcpp/impl/codegen/server_interceptor.h index 7d71ba695b2..6c6c6e9c885 100644 --- a/include/grpcpp/impl/codegen/server_interceptor.h +++ b/include/grpcpp/impl/codegen/server_interceptor.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H #define GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h index a50c23dde64..2599b46a3ed 100644 --- a/include/grpcpp/impl/codegen/server_interface.h +++ b/include/grpcpp/impl/codegen/server_interface.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H #define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H diff --git a/include/grpcpp/impl/codegen/service_type.h b/include/grpcpp/impl/codegen/service_type.h index 2db76e2af77..a8c8912b844 100644 --- a/include/grpcpp/impl/codegen/service_type.h +++ b/include/grpcpp/impl/codegen/service_type.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H #define GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H diff --git a/include/grpcpp/impl/codegen/slice.h b/include/grpcpp/impl/codegen/slice.h index e2c8778f1f2..a347f9242ac 100644 --- a/include/grpcpp/impl/codegen/slice.h +++ b/include/grpcpp/impl/codegen/slice.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SLICE_H #define GRPCPP_IMPL_CODEGEN_SLICE_H diff --git a/include/grpcpp/impl/codegen/status.h b/include/grpcpp/impl/codegen/status.h index 7c302568e18..0f691859684 100644 --- a/include/grpcpp/impl/codegen/status.h +++ b/include/grpcpp/impl/codegen/status.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_STATUS_H #define GRPCPP_IMPL_CODEGEN_STATUS_H diff --git a/include/grpcpp/impl/codegen/status_code_enum.h b/include/grpcpp/impl/codegen/status_code_enum.h index 0d47f3b0330..6ed1d8d8cb3 100644 --- a/include/grpcpp/impl/codegen/status_code_enum.h +++ b/include/grpcpp/impl/codegen/status_code_enum.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H #define GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H diff --git a/include/grpcpp/impl/codegen/string_ref.h b/include/grpcpp/impl/codegen/string_ref.h index be312e8758f..d32b6b4e7b6 100644 --- a/include/grpcpp/impl/codegen/string_ref.h +++ b/include/grpcpp/impl/codegen/string_ref.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_STRING_REF_H #define GRPCPP_IMPL_CODEGEN_STRING_REF_H diff --git a/include/grpcpp/impl/codegen/stub_options.h b/include/grpcpp/impl/codegen/stub_options.h index ca83c5cc571..fee732cf443 100644 --- a/include/grpcpp/impl/codegen/stub_options.h +++ b/include/grpcpp/impl/codegen/stub_options.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H #define GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H diff --git a/include/grpcpp/impl/codegen/sync.h b/include/grpcpp/impl/codegen/sync.h index 614cee625fe..c4a2c4a43da 100644 --- a/include/grpcpp/impl/codegen/sync.h +++ b/include/grpcpp/impl/codegen/sync.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_SYNC_H #define GRPCPP_IMPL_CODEGEN_SYNC_H diff --git a/include/grpcpp/impl/codegen/sync_stream.h b/include/grpcpp/impl/codegen/sync_stream.h index 9e50e375a9a..ba86165945f 100644 --- a/include/grpcpp/impl/codegen/sync_stream.h +++ b/include/grpcpp/impl/codegen/sync_stream.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H #define GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H diff --git a/include/grpcpp/impl/codegen/time.h b/include/grpcpp/impl/codegen/time.h index 6c9bb7b30fe..9f27ff683ee 100644 --- a/include/grpcpp/impl/codegen/time.h +++ b/include/grpcpp/impl/codegen/time.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CODEGEN_TIME_H #define GRPCPP_IMPL_CODEGEN_TIME_H diff --git a/include/grpcpp/impl/completion_queue_tag.h b/include/grpcpp/impl/completion_queue_tag.h index 5828e54eb66..bb1fa96087c 100644 --- a/include/grpcpp/impl/completion_queue_tag.h +++ b/include/grpcpp/impl/completion_queue_tag.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_COMPLETION_QUEUE_TAG_H #define GRPCPP_IMPL_COMPLETION_QUEUE_TAG_H diff --git a/include/grpcpp/impl/create_auth_context.h b/include/grpcpp/impl/create_auth_context.h index 252b4aba93d..10844bec92c 100644 --- a/include/grpcpp/impl/create_auth_context.h +++ b/include/grpcpp/impl/create_auth_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_CREATE_AUTH_CONTEXT_H #define GRPCPP_IMPL_CREATE_AUTH_CONTEXT_H diff --git a/include/grpcpp/impl/delegating_channel.h b/include/grpcpp/impl/delegating_channel.h index eeb0c9c32fd..802237f2efd 100644 --- a/include/grpcpp/impl/delegating_channel.h +++ b/include/grpcpp/impl/delegating_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_DELEGATING_CHANNEL_H #define GRPCPP_IMPL_DELEGATING_CHANNEL_H diff --git a/include/grpcpp/impl/grpc_library.h b/include/grpcpp/impl/grpc_library.h index 2e960cf2d04..6f20d2bf413 100644 --- a/include/grpcpp/impl/grpc_library.h +++ b/include/grpcpp/impl/grpc_library.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_GRPC_LIBRARY_H #define GRPCPP_IMPL_GRPC_LIBRARY_H diff --git a/include/grpcpp/impl/intercepted_channel.h b/include/grpcpp/impl/intercepted_channel.h index 32a5e3f3fb4..908655a6e47 100644 --- a/include/grpcpp/impl/intercepted_channel.h +++ b/include/grpcpp/impl/intercepted_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_INTERCEPTED_CHANNEL_H #define GRPCPP_IMPL_INTERCEPTED_CHANNEL_H diff --git a/include/grpcpp/impl/interceptor_common.h b/include/grpcpp/impl/interceptor_common.h index 4d0aac87c3d..81e66df4095 100644 --- a/include/grpcpp/impl/interceptor_common.h +++ b/include/grpcpp/impl/interceptor_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_IMPL_INTERCEPTOR_COMMON_H #define GRPCPP_IMPL_INTERCEPTOR_COMMON_H diff --git a/include/grpcpp/impl/metadata_map.h b/include/grpcpp/impl/metadata_map.h index 5aeec99f538..6ac9ed29844 100644 --- a/include/grpcpp/impl/metadata_map.h +++ b/include/grpcpp/impl/metadata_map.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_METADATA_MAP_H #define GRPCPP_IMPL_METADATA_MAP_H diff --git a/include/grpcpp/impl/method_handler_impl.h b/include/grpcpp/impl/method_handler_impl.h index ba66c8e3dab..22a54b6b0f1 100644 --- a/include/grpcpp/impl/method_handler_impl.h +++ b/include/grpcpp/impl/method_handler_impl.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_METHOD_HANDLER_IMPL_H #define GRPCPP_IMPL_METHOD_HANDLER_IMPL_H diff --git a/include/grpcpp/impl/proto_utils.h b/include/grpcpp/impl/proto_utils.h index 603402d5ce4..c6240ffa84d 100644 --- a/include/grpcpp/impl/proto_utils.h +++ b/include/grpcpp/impl/proto_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_PROTO_UTILS_H #define GRPCPP_IMPL_PROTO_UTILS_H diff --git a/include/grpcpp/impl/rpc_method.h b/include/grpcpp/impl/rpc_method.h index 3b7bc3e6090..e1dcd003367 100644 --- a/include/grpcpp/impl/rpc_method.h +++ b/include/grpcpp/impl/rpc_method.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_RPC_METHOD_H #define GRPCPP_IMPL_RPC_METHOD_H diff --git a/include/grpcpp/impl/rpc_service_method.h b/include/grpcpp/impl/rpc_service_method.h index db187eed815..73694263cdd 100644 --- a/include/grpcpp/impl/rpc_service_method.h +++ b/include/grpcpp/impl/rpc_service_method.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_RPC_SERVICE_METHOD_H #define GRPCPP_IMPL_RPC_SERVICE_METHOD_H @@ -68,11 +68,11 @@ class MethodHandler { }; virtual void RunHandler(const HandlerParameter& param) = 0; - /* Returns a pointer to the deserialized request. \a status reflects the - result of deserialization. This pointer and the status should be filled in - a HandlerParameter and passed to RunHandler. It is illegal to access the - pointer after calling RunHandler. Ownership of the deserialized request is - retained by the handler. Returns nullptr if deserialization failed. */ + // Returns a pointer to the deserialized request. \a status reflects the + // result of deserialization. This pointer and the status should be filled in + // a HandlerParameter and passed to RunHandler. It is illegal to access the + // pointer after calling RunHandler. Ownership of the deserialized request is + // retained by the handler. Returns nullptr if deserialization failed. virtual void* Deserialize(grpc_call* /*call*/, grpc_byte_buffer* req, Status* /*status*/, void** /*handler_data*/) { GPR_ASSERT(req == nullptr); diff --git a/include/grpcpp/impl/serialization_traits.h b/include/grpcpp/impl/serialization_traits.h index d7d8a1f86a0..83ba0bb2d56 100644 --- a/include/grpcpp/impl/serialization_traits.h +++ b/include/grpcpp/impl/serialization_traits.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_SERIALIZATION_TRAITS_H #define GRPCPP_IMPL_SERIALIZATION_TRAITS_H diff --git a/include/grpcpp/impl/server_builder_option.h b/include/grpcpp/impl/server_builder_option.h index c8f047b90e3..d5745c6fb0c 100644 --- a/include/grpcpp/impl/server_builder_option.h +++ b/include/grpcpp/impl/server_builder_option.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_SERVER_BUILDER_OPTION_H #define GRPCPP_IMPL_SERVER_BUILDER_OPTION_H diff --git a/include/grpcpp/impl/server_builder_plugin.h b/include/grpcpp/impl/server_builder_plugin.h index e5bb0584600..d7ef0be5c29 100644 --- a/include/grpcpp/impl/server_builder_plugin.h +++ b/include/grpcpp/impl/server_builder_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H #define GRPCPP_IMPL_SERVER_BUILDER_PLUGIN_H diff --git a/include/grpcpp/impl/server_callback_handlers.h b/include/grpcpp/impl/server_callback_handlers.h index ef001dbab62..f8aa1d374a9 100644 --- a/include/grpcpp/impl/server_callback_handlers.h +++ b/include/grpcpp/impl/server_callback_handlers.h @@ -1,19 +1,19 @@ -/* - * - * Copyright 2019 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. - */ +// +// +// Copyright 2019 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. +// #ifndef GRPCPP_IMPL_SERVER_CALLBACK_HANDLERS_H #define GRPCPP_IMPL_SERVER_CALLBACK_HANDLERS_H diff --git a/include/grpcpp/impl/server_initializer.h b/include/grpcpp/impl/server_initializer.h index 610df802930..c2ad90bd269 100644 --- a/include/grpcpp/impl/server_initializer.h +++ b/include/grpcpp/impl/server_initializer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_IMPL_SERVER_INITIALIZER_H #define GRPCPP_IMPL_SERVER_INITIALIZER_H diff --git a/include/grpcpp/impl/service_type.h b/include/grpcpp/impl/service_type.h index f73015b3dd5..9699e2328d4 100644 --- a/include/grpcpp/impl/service_type.h +++ b/include/grpcpp/impl/service_type.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_SERVICE_TYPE_H #define GRPCPP_IMPL_SERVICE_TYPE_H diff --git a/include/grpcpp/impl/status.h b/include/grpcpp/impl/status.h index 84cbe4fe2e0..95436ab8fbc 100644 --- a/include/grpcpp/impl/status.h +++ b/include/grpcpp/impl/status.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_IMPL_STATUS_H #define GRPCPP_IMPL_STATUS_H diff --git a/include/grpcpp/impl/sync.h b/include/grpcpp/impl/sync.h index 05cd62391f3..2fadf6fab1c 100644 --- a/include/grpcpp/impl/sync.h +++ b/include/grpcpp/impl/sync.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_IMPL_SYNC_H #define GRPCPP_IMPL_SYNC_H diff --git a/include/grpcpp/opencensus.h b/include/grpcpp/opencensus.h index 0f2de622203..260c4a50d9a 100644 --- a/include/grpcpp/opencensus.h +++ b/include/grpcpp/opencensus.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_OPENCENSUS_H #define GRPCPP_OPENCENSUS_H diff --git a/include/grpcpp/resource_quota.h b/include/grpcpp/resource_quota.h index 2d2f363c5d2..4f9e9cee55f 100644 --- a/include/grpcpp/resource_quota.h +++ b/include/grpcpp/resource_quota.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_RESOURCE_QUOTA_H #define GRPCPP_RESOURCE_QUOTA_H diff --git a/include/grpcpp/security/alts_context.h b/include/grpcpp/security/alts_context.h index 8d842575d6f..2f2de4e8824 100644 --- a/include/grpcpp/security/alts_context.h +++ b/include/grpcpp/security/alts_context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_SECURITY_ALTS_CONTEXT_H #define GRPCPP_SECURITY_ALTS_CONTEXT_H diff --git a/include/grpcpp/security/alts_util.h b/include/grpcpp/security/alts_util.h index 5c8cfcee4b8..c196823d1a8 100644 --- a/include/grpcpp/security/alts_util.h +++ b/include/grpcpp/security/alts_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_SECURITY_ALTS_UTIL_H #define GRPCPP_SECURITY_ALTS_UTIL_H diff --git a/include/grpcpp/security/auth_context.h b/include/grpcpp/security/auth_context.h index 7253069768a..f6e3fae481b 100644 --- a/include/grpcpp/security/auth_context.h +++ b/include/grpcpp/security/auth_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SECURITY_AUTH_CONTEXT_H #define GRPCPP_SECURITY_AUTH_CONTEXT_H diff --git a/include/grpcpp/security/auth_metadata_processor.h b/include/grpcpp/security/auth_metadata_processor.h index 545bdf16e02..c491a13b198 100644 --- a/include/grpcpp/security/auth_metadata_processor.h +++ b/include/grpcpp/security/auth_metadata_processor.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_H #define GRPCPP_SECURITY_AUTH_METADATA_PROCESSOR_H diff --git a/include/grpcpp/security/credentials.h b/include/grpcpp/security/credentials.h index 7dcbae2f33b..cdbdbaf396e 100644 --- a/include/grpcpp/security/credentials.h +++ b/include/grpcpp/security/credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SECURITY_CREDENTIALS_H #define GRPCPP_SECURITY_CREDENTIALS_H diff --git a/include/grpcpp/security/server_credentials.h b/include/grpcpp/security/server_credentials.h index fa39dbcadde..850dd2b4880 100644 --- a/include/grpcpp/security/server_credentials.h +++ b/include/grpcpp/security/server_credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SECURITY_SERVER_CREDENTIALS_H #define GRPCPP_SECURITY_SERVER_CREDENTIALS_H diff --git a/include/grpcpp/security/tls_credentials_options.h b/include/grpcpp/security/tls_credentials_options.h index 220c9533f67..e2907c6d0e3 100644 --- a/include/grpcpp/security/tls_credentials_options.h +++ b/include/grpcpp/security/tls_credentials_options.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H #define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H diff --git a/include/grpcpp/server.h b/include/grpcpp/server.h index 3d44e5ae2da..120f03c3cbd 100644 --- a/include/grpcpp/server.h +++ b/include/grpcpp/server.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SERVER_H #define GRPCPP_SERVER_H diff --git a/include/grpcpp/server_builder.h b/include/grpcpp/server_builder.h index 8e52f2b94a9..9e08c873e8a 100644 --- a/include/grpcpp/server_builder.h +++ b/include/grpcpp/server_builder.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPCPP_SERVER_BUILDER_H #define GRPCPP_SERVER_BUILDER_H diff --git a/include/grpcpp/server_context.h b/include/grpcpp/server_context.h index fcf19008ef0..b745c9091cc 100644 --- a/include/grpcpp/server_context.h +++ b/include/grpcpp/server_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SERVER_CONTEXT_H #define GRPCPP_SERVER_CONTEXT_H @@ -147,15 +147,15 @@ class ServerContextBase { /// must end in "-bin". /// /// Metadata must conform to the following format: - /** - \verbatim - Custom-Metadata -> Binary-Header / ASCII-Header - Binary-Header -> {Header-Name "-bin" } {binary value} - ASCII-Header -> Header-Name ASCII-Value - Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . - ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII - \endverbatim - **/ + /// + ///\verbatim + /// Custom-Metadata -> Binary-Header / ASCII-Header + /// Binary-Header -> {Header-Name "-bin" } {binary value} + /// ASCII-Header -> Header-Name ASCII-Value + /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . + /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII + ///\endverbatim + /// void AddInitialMetadata(const std::string& key, const std::string& value); /// Add the (\a key, \a value) pair to the initial metadata @@ -172,15 +172,15 @@ class ServerContextBase { /// must end in "-bin". /// /// Metadata must conform to the following format: - /** - \verbatim - Custom-Metadata -> Binary-Header / ASCII-Header - Binary-Header -> {Header-Name "-bin" } {binary value} - ASCII-Header -> Header-Name ASCII-Value - Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . - ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII - \endverbatim - **/ + /// + ///\verbatim + /// Custom-Metadata -> Binary-Header / ASCII-Header + /// Binary-Header -> {Header-Name "-bin" } {binary value} + /// ASCII-Header -> Header-Name ASCII-Value + /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - . + /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII + ///\endverbatim + /// void AddTrailingMetadata(const std::string& key, const std::string& value); /// Return whether this RPC failed before the server could provide its status diff --git a/include/grpcpp/server_interface.h b/include/grpcpp/server_interface.h index dd8f10dd45d..23ccb3afd60 100644 --- a/include/grpcpp/server_interface.h +++ b/include/grpcpp/server_interface.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SERVER_INTERFACE_H #define GRPCPP_SERVER_INTERFACE_H @@ -199,7 +199,7 @@ class ServerInterface : public internal::CallHook { internal::RpcMethod::RpcType type); bool FinalizeResult(void** tag, bool* status) override { - /* If we are done intercepting, then there is nothing more for us to do */ + // If we are done intercepting, then there is nothing more for us to do if (done_intercepting_) { return BaseAsyncRequest::FinalizeResult(tag, status); } @@ -257,7 +257,7 @@ class ServerInterface : public internal::CallHook { } bool FinalizeResult(void** tag, bool* status) override { - /* If we are done intercepting, then there is nothing more for us to do */ + // If we are done intercepting, then there is nothing more for us to do if (done_intercepting_) { return RegisteredAsyncRequest::FinalizeResult(tag, status); } @@ -279,7 +279,7 @@ class ServerInterface : public internal::CallHook { return false; } } - /* Set interception point for recv message */ + // Set interception point for recv message interceptor_methods_.AddInterceptionHookPoint( experimental::InterceptionHookPoints::POST_RECV_MESSAGE); interceptor_methods_.SetRecvMessage(request_, nullptr); diff --git a/include/grpcpp/server_posix.h b/include/grpcpp/server_posix.h index 2e938624d2a..75ef4470b7c 100644 --- a/include/grpcpp/server_posix.h +++ b/include/grpcpp/server_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_SERVER_POSIX_H #define GRPCPP_SERVER_POSIX_H diff --git a/include/grpcpp/support/async_stream.h b/include/grpcpp/support/async_stream.h index fb49ce38611..1bf67d301d5 100644 --- a/include/grpcpp/support/async_stream.h +++ b/include/grpcpp/support/async_stream.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H #define GRPCPP_SUPPORT_ASYNC_STREAM_H diff --git a/include/grpcpp/support/async_unary_call.h b/include/grpcpp/support/async_unary_call.h index fb79630b0a4..a831d73f72f 100644 --- a/include/grpcpp/support/async_unary_call.h +++ b/include/grpcpp/support/async_unary_call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H #define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H diff --git a/include/grpcpp/support/byte_buffer.h b/include/grpcpp/support/byte_buffer.h index b3867b456ff..5bbfb664961 100644 --- a/include/grpcpp/support/byte_buffer.h +++ b/include/grpcpp/support/byte_buffer.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_BYTE_BUFFER_H #define GRPCPP_SUPPORT_BYTE_BUFFER_H @@ -198,14 +198,14 @@ class ByteBuffer final { class ByteBufferPointer { public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) ByteBufferPointer(const ByteBuffer* b) : bbuf_(const_cast(b)) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) operator ByteBuffer*() { return bbuf_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) operator grpc_byte_buffer*() { return bbuf_->buffer_; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) operator grpc_byte_buffer**() { return &bbuf_->buffer_; } private: diff --git a/include/grpcpp/support/callback_common.h b/include/grpcpp/support/callback_common.h index 33bb3b1a621..a99a47dbf4d 100644 --- a/include/grpcpp/support/callback_common.h +++ b/include/grpcpp/support/callback_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_SUPPORT_CALLBACK_COMMON_H #define GRPCPP_SUPPORT_CALLBACK_COMMON_H @@ -188,7 +188,7 @@ class CallbackWithSuccessTag : public grpc_completion_queue_functor { void force_run(bool ok) { Run(ok); } /// check if this tag is currently set - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) operator bool() const { return call_ != nullptr; } private: diff --git a/include/grpcpp/support/channel_arguments.h b/include/grpcpp/support/channel_arguments.h index afee7041a22..bfda5a69760 100644 --- a/include/grpcpp/support/channel_arguments.h +++ b/include/grpcpp/support/channel_arguments.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H #define GRPCPP_SUPPORT_CHANNEL_ARGUMENTS_H diff --git a/include/grpcpp/support/client_callback.h b/include/grpcpp/support/client_callback.h index e29a37cc34a..e44764d8387 100644 --- a/include/grpcpp/support/client_callback.h +++ b/include/grpcpp/support/client_callback.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_SUPPORT_CLIENT_CALLBACK_H #define GRPCPP_SUPPORT_CLIENT_CALLBACK_H diff --git a/include/grpcpp/support/client_interceptor.h b/include/grpcpp/support/client_interceptor.h index 59835e5122d..ef84d184393 100644 --- a/include/grpcpp/support/client_interceptor.h +++ b/include/grpcpp/support/client_interceptor.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H #define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H diff --git a/include/grpcpp/support/config.h b/include/grpcpp/support/config.h index b323a3ed4a8..c846c43c6e6 100644 --- a/include/grpcpp/support/config.h +++ b/include/grpcpp/support/config.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_CONFIG_H #define GRPCPP_SUPPORT_CONFIG_H diff --git a/include/grpcpp/support/error_details.h b/include/grpcpp/support/error_details.h index 72305e8f3ab..ffcbd193180 100644 --- a/include/grpcpp/support/error_details.h +++ b/include/grpcpp/support/error_details.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_ERROR_DETAILS_H #define GRPCPP_SUPPORT_ERROR_DETAILS_H diff --git a/include/grpcpp/support/interceptor.h b/include/grpcpp/support/interceptor.h index 6765b144db9..9248fbb28c7 100644 --- a/include/grpcpp/support/interceptor.h +++ b/include/grpcpp/support/interceptor.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_INTERCEPTOR_H #define GRPCPP_SUPPORT_INTERCEPTOR_H diff --git a/include/grpcpp/support/message_allocator.h b/include/grpcpp/support/message_allocator.h index e801548fa3e..8e627900e57 100644 --- a/include/grpcpp/support/message_allocator.h +++ b/include/grpcpp/support/message_allocator.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H #define GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H diff --git a/include/grpcpp/support/method_handler.h b/include/grpcpp/support/method_handler.h index d20cf3f1512..def30a0ad8c 100644 --- a/include/grpcpp/support/method_handler.h +++ b/include/grpcpp/support/method_handler.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_METHOD_HANDLER_H #define GRPCPP_SUPPORT_METHOD_HANDLER_H diff --git a/include/grpcpp/support/proto_buffer_reader.h b/include/grpcpp/support/proto_buffer_reader.h index 0e264c65f66..e89818a3d6a 100644 --- a/include/grpcpp/support/proto_buffer_reader.h +++ b/include/grpcpp/support/proto_buffer_reader.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_SUPPORT_PROTO_BUFFER_READER_H #define GRPCPP_SUPPORT_PROTO_BUFFER_READER_H diff --git a/include/grpcpp/support/proto_buffer_writer.h b/include/grpcpp/support/proto_buffer_writer.h index d4b47fb88c6..eb7b2c40b98 100644 --- a/include/grpcpp/support/proto_buffer_writer.h +++ b/include/grpcpp/support/proto_buffer_writer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H #define GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H diff --git a/include/grpcpp/support/server_callback.h b/include/grpcpp/support/server_callback.h index ace9aa749a7..47fb03d5152 100644 --- a/include/grpcpp/support/server_callback.h +++ b/include/grpcpp/support/server_callback.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPCPP_SUPPORT_SERVER_CALLBACK_H #define GRPCPP_SUPPORT_SERVER_CALLBACK_H diff --git a/include/grpcpp/support/server_interceptor.h b/include/grpcpp/support/server_interceptor.h index 95c20052d98..ecb4e342598 100644 --- a/include/grpcpp/support/server_interceptor.h +++ b/include/grpcpp/support/server_interceptor.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H #define GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H diff --git a/include/grpcpp/support/slice.h b/include/grpcpp/support/slice.h index 853252e5a98..c338ba071e6 100644 --- a/include/grpcpp/support/slice.h +++ b/include/grpcpp/support/slice.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_SLICE_H #define GRPCPP_SUPPORT_SLICE_H @@ -54,7 +54,7 @@ class Slice final { len)) {} /// Construct a slice from a copied string - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) Slice(const std::string& str) : slice_(grpc_slice_from_copied_buffer(str.c_str(), str.length())) {} diff --git a/include/grpcpp/support/status.h b/include/grpcpp/support/status.h index 23d3a7bc555..0930e642b08 100644 --- a/include/grpcpp/support/status.h +++ b/include/grpcpp/support/status.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_STATUS_H #define GRPCPP_SUPPORT_STATUS_H diff --git a/include/grpcpp/support/status_code_enum.h b/include/grpcpp/support/status_code_enum.h index a1b46dcd561..7110071478b 100644 --- a/include/grpcpp/support/status_code_enum.h +++ b/include/grpcpp/support/status_code_enum.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_STATUS_CODE_ENUM_H #define GRPCPP_SUPPORT_STATUS_CODE_ENUM_H diff --git a/include/grpcpp/support/string_ref.h b/include/grpcpp/support/string_ref.h index 6960cc91845..380ceee2ffb 100644 --- a/include/grpcpp/support/string_ref.h +++ b/include/grpcpp/support/string_ref.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_STRING_REF_H #define GRPCPP_SUPPORT_STRING_REF_H @@ -58,10 +58,10 @@ class string_ref { return *this; } - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) string_ref(const char* s) : data_(s), length_(strlen(s)) {} string_ref(const char* s, size_t l) : data_(s), length_(l) {} - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) string_ref(const std::string& s) : data_(s.data()), length_(s.length()) {} /// iterators diff --git a/include/grpcpp/support/stub_options.h b/include/grpcpp/support/stub_options.h index 114681a82e3..4b62f6a9d89 100644 --- a/include/grpcpp/support/stub_options.h +++ b/include/grpcpp/support/stub_options.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_STUB_OPTIONS_H #define GRPCPP_SUPPORT_STUB_OPTIONS_H diff --git a/include/grpcpp/support/sync_stream.h b/include/grpcpp/support/sync_stream.h index 846dc9ec0b1..ce583f6ed7c 100644 --- a/include/grpcpp/support/sync_stream.h +++ b/include/grpcpp/support/sync_stream.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_SYNC_STREAM_H #define GRPCPP_SUPPORT_SYNC_STREAM_H diff --git a/include/grpcpp/support/time.h b/include/grpcpp/support/time.h index f026d4685a7..5397eb6ba24 100644 --- a/include/grpcpp/support/time.h +++ b/include/grpcpp/support/time.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPCPP_SUPPORT_TIME_H #define GRPCPP_SUPPORT_TIME_H @@ -26,16 +26,16 @@ namespace grpc { -/** If you are trying to use CompletionQueue::AsyncNext with a time class that - isn't either gpr_timespec or std::chrono::system_clock::time_point, you - will most likely be looking at this comment as your compiler will have - fired an error below. In order to fix this issue, you have two potential - solutions: +/// If you are trying to use CompletionQueue::AsyncNext with a time class that +/// isn't either gpr_timespec or std::chrono::system_clock::time_point, you +/// will most likely be looking at this comment as your compiler will have +/// fired an error below. In order to fix this issue, you have two potential +/// solutions: - 1. Use gpr_timespec or std::chrono::system_clock::time_point instead - 2. Specialize the TimePoint class with whichever time class that you - want to use here. See below for two examples of how to do this. - */ +/// 1. Use gpr_timespec or std::chrono::system_clock::time_point instead +/// 2. Specialize the TimePoint class with whichever time class that you +/// want to use here. See below for two examples of how to do this. +/// template class TimePoint { public: @@ -50,7 +50,7 @@ class TimePoint { template <> class TimePoint { public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) TimePoint(const gpr_timespec& time) : time_(time) {} gpr_timespec raw_time() { return time_; } @@ -74,7 +74,7 @@ std::chrono::system_clock::time_point Timespec2Timepoint(gpr_timespec t); template <> class TimePoint { public: - /* NOLINTNEXTLINE(google-explicit-constructor) */ + // NOLINTNEXTLINE(google-explicit-constructor) TimePoint(const std::chrono::system_clock::time_point& time) { Timepoint2Timespec(time, &time_); } diff --git a/include/grpcpp/support/validate_service_config.h b/include/grpcpp/support/validate_service_config.h index 4306cb8d136..6a9ac6e8d53 100644 --- a/include/grpcpp/support/validate_service_config.h +++ b/include/grpcpp/support/validate_service_config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_SUPPORT_VALIDATE_SERVICE_CONFIG_H #define GRPCPP_SUPPORT_VALIDATE_SERVICE_CONFIG_H diff --git a/include/grpcpp/test/channel_test_peer.h b/include/grpcpp/test/channel_test_peer.h index e41bbfa4604..b180b8feda1 100644 --- a/include/grpcpp/test/channel_test_peer.h +++ b/include/grpcpp/test/channel_test_peer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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. +// +// #ifndef GRPCPP_TEST_CHANNEL_TEST_PEER_H #define GRPCPP_TEST_CHANNEL_TEST_PEER_H diff --git a/include/grpcpp/test/client_context_test_peer.h b/include/grpcpp/test/client_context_test_peer.h index 0ce9643933e..9cb1f683787 100644 --- a/include/grpcpp/test/client_context_test_peer.h +++ b/include/grpcpp/test/client_context_test_peer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2021 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. - * - */ +// +// +// Copyright 2021 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. +// +// #ifndef GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H #define GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H diff --git a/include/grpcpp/test/default_reactor_test_peer.h b/include/grpcpp/test/default_reactor_test_peer.h index 4d4ae5c39d3..abe5eabe96c 100644 --- a/include/grpcpp/test/default_reactor_test_peer.h +++ b/include/grpcpp/test/default_reactor_test_peer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPCPP_TEST_DEFAULT_REACTOR_TEST_PEER_H #define GRPCPP_TEST_DEFAULT_REACTOR_TEST_PEER_H diff --git a/include/grpcpp/test/mock_stream.h b/include/grpcpp/test/mock_stream.h index 7941423a151..7c39358d949 100644 --- a/include/grpcpp/test/mock_stream.h +++ b/include/grpcpp/test/mock_stream.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPCPP_TEST_MOCK_STREAM_H #define GRPCPP_TEST_MOCK_STREAM_H diff --git a/include/grpcpp/test/server_context_test_spouse.h b/include/grpcpp/test/server_context_test_spouse.h index 743d417c08f..88dc7205588 100644 --- a/include/grpcpp/test/server_context_test_spouse.h +++ b/include/grpcpp/test/server_context_test_spouse.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCPP_TEST_SERVER_CONTEXT_TEST_SPOUSE_H #define GRPCPP_TEST_SERVER_CONTEXT_TEST_SPOUSE_H diff --git a/include/grpcpp/version_info.h b/include/grpcpp/version_info.h index c256410f4e6..590131c3cd3 100644 --- a/include/grpcpp/version_info.h +++ b/include/grpcpp/version_info.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -/* This file is autogenerated from: - templates/include/grpcpp/version_info.h.template */ +// This file is autogenerated from: +// templates/include/grpcpp/version_info.h.template #ifndef GRPCPP_VERSION_INFO_H #define GRPCPP_VERSION_INFO_H diff --git a/include/grpcpp/xds_server_builder.h b/include/grpcpp/xds_server_builder.h index debda85f635..1962ac6cdd1 100644 --- a/include/grpcpp/xds_server_builder.h +++ b/include/grpcpp/xds_server_builder.h @@ -108,4 +108,4 @@ class XdsServerBuilder : public grpc::ServerBuilder { } // namespace grpc -#endif /* GRPCPP_XDS_SERVER_BUILDER_H */ +#endif // GRPCPP_XDS_SERVER_BUILDER_H diff --git a/src/core/ext/filters/census/grpc_context.cc b/src/core/ext/filters/census/grpc_context.cc index 418da0a0de8..a26ccf05898 100644 --- a/src/core/ext/filters/census/grpc_context.cc +++ b/src/core/ext/filters/census/grpc_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/filters/channel_idle/channel_idle_filter.cc b/src/core/ext/filters/channel_idle/channel_idle_filter.cc index 783e8ba9fa4..e2a6c36bb2b 100644 --- a/src/core/ext/filters/channel_idle/channel_idle_filter.cc +++ b/src/core/ext/filters/channel_idle/channel_idle_filter.cc @@ -94,10 +94,10 @@ struct MaxAgeFilter::Config { max_connection_idle != Duration::Infinity(); } - /* A random jitter of +/-10% will be added to MAX_CONNECTION_AGE to spread out - connection storms. Note that the MAX_CONNECTION_AGE option without jitter - would not create connection storms by itself, but if there happened to be a - connection storm it could cause it to repeat at a fixed period. */ + // A random jitter of +/-10% will be added to MAX_CONNECTION_AGE to spread out + // connection storms. Note that the MAX_CONNECTION_AGE option without jitter + // would not create connection storms by itself, but if there happened to be a + // connection storm it could cause it to repeat at a fixed period. static Config FromChannelArgs(const ChannelArgs& args) { const Duration args_max_age = args.GetDurationFromIntMillis(GRPC_ARG_MAX_CONNECTION_AGE_MS) @@ -108,13 +108,13 @@ struct MaxAgeFilter::Config { const Duration args_max_age_grace = args.GetDurationFromIntMillis(GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS) .value_or(kDefaultMaxConnectionAgeGrace); - /* generate a random number between 1 - kMaxConnectionAgeJitter and - 1 + kMaxConnectionAgeJitter */ + // generate a random number between 1 - kMaxConnectionAgeJitter and + // 1 + kMaxConnectionAgeJitter const double multiplier = rand() * kMaxConnectionAgeJitter * 2.0 / RAND_MAX + 1.0 - kMaxConnectionAgeJitter; - /* GRPC_MILLIS_INF_FUTURE - 0.5 converts the value to float, so that result - will not be cast to int implicitly before the comparison. */ + // GRPC_MILLIS_INF_FUTURE - 0.5 converts the value to float, so that result + // will not be cast to int implicitly before the comparison. return Config{args_max_age * multiplier, args_max_idle, args_max_age_grace}; } }; diff --git a/src/core/ext/filters/client_channel/backup_poller.cc b/src/core/ext/filters/client_channel/backup_poller.cc index b9cf3529977..cf74703ed13 100644 --- a/src/core/ext/filters/client_channel/backup_poller.cc +++ b/src/core/ext/filters/client_channel/backup_poller.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -166,10 +166,10 @@ void grpc_client_channel_start_backup_polling( gpr_mu_lock(&g_poller_mu); g_poller_init_locked(); gpr_ref(&g_poller->refs); - /* Get a reference to g_poller->pollset before releasing g_poller_mu to make - * TSAN happy. Otherwise, reading from g_poller (i.e g_poller->pollset) after - * releasing the lock and setting g_poller to NULL in g_poller_unref() is - * being flagged as a data-race by TSAN */ + // Get a reference to g_poller->pollset before releasing g_poller_mu to make + // TSAN happy. Otherwise, reading from g_poller (i.e g_poller->pollset) after + // releasing the lock and setting g_poller to NULL in g_poller_unref() is + // being flagged as a data-race by TSAN grpc_pollset* pollset = g_poller->pollset; gpr_mu_unlock(&g_poller_mu); diff --git a/src/core/ext/filters/client_channel/backup_poller.h b/src/core/ext/filters/client_channel/backup_poller.h index 128f5b50b7b..dd4b1ed24f7 100644 --- a/src/core/ext/filters/client_channel/backup_poller.h +++ b/src/core/ext/filters/client_channel/backup_poller.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H @@ -26,15 +26,15 @@ GPR_GLOBAL_CONFIG_DECLARE_INT32(grpc_client_channel_backup_poll_interval_ms); -/* Initializes backup polling. */ +// Initializes backup polling. void grpc_client_channel_global_init_backup_polling(); -/* Starts polling \a interested_parties periodically in the timer thread. */ +// Starts polling \a interested_parties periodically in the timer thread. void grpc_client_channel_start_backup_polling( grpc_pollset_set* interested_parties); -/* Stops polling \a interested_parties. */ +// Stops polling \a interested_parties. void grpc_client_channel_stop_backup_polling( grpc_pollset_set* interested_parties); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_BACKUP_POLLER_H diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.cc b/src/core/ext/filters/client_channel/client_channel_channelz.cc index 230f91e8b2a..4b6701dcdbd 100644 --- a/src/core/ext/filters/client_channel/client_channel_channelz.cc +++ b/src/core/ext/filters/client_channel/client_channel_channelz.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/ext/filters/client_channel/client_channel_channelz.h b/src/core/ext/filters/client_channel/client_channel_channelz.h index 2e88694ec88..bd4799e584b 100644 --- a/src/core/ext/filters/client_channel/client_channel_channelz.h +++ b/src/core/ext/filters/client_channel/client_channel_channelz.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H @@ -82,4 +82,4 @@ class SubchannelNode : public BaseNode { } // namespace channelz } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_CHANNELZ_H diff --git a/src/core/ext/filters/client_channel/client_channel_factory.cc b/src/core/ext/filters/client_channel/client_channel_factory.cc index 88dcaad2ece..45804e7db26 100644 --- a/src/core/ext/filters/client_channel/client_channel_factory.cc +++ b/src/core/ext/filters/client_channel/client_channel_factory.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc index f19714af184..f2272d783df 100644 --- a/src/core/ext/filters/client_channel/client_channel_plugin.cc +++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/filters/client_channel/dynamic_filters.cc b/src/core/ext/filters/client_channel/dynamic_filters.cc index 6d0a015b4ea..a96e2bc51b0 100644 --- a/src/core/ext/filters/client_channel/dynamic_filters.cc +++ b/src/core/ext/filters/client_channel/dynamic_filters.cc @@ -56,14 +56,14 @@ DynamicFilters::Call::Call(Args args, grpc_error_handle* error) : channel_stack_(std::move(args.channel_stack)) { grpc_call_stack* call_stack = CALL_TO_CALL_STACK(this); const grpc_call_element_args call_args = { - call_stack, /* call_stack */ - nullptr, /* server_transport_data */ - args.context, /* context */ - args.path, /* path */ - args.start_time, /* start_time */ - args.deadline, /* deadline */ - args.arena, /* arena */ - args.call_combiner /* call_combiner */ + call_stack, // call_stack + nullptr, // server_transport_data + args.context, // context + args.path, // path + args.start_time, // start_time + args.deadline, // deadline + args.arena, // arena + args.call_combiner // call_combiner }; *error = grpc_call_stack_init(channel_stack_->channel_stack_.get(), 1, Destroy, this, &call_args); diff --git a/src/core/ext/filters/client_channel/global_subchannel_pool.h b/src/core/ext/filters/client_channel/global_subchannel_pool.h index 301cdb9e491..aaf60e3179a 100644 --- a/src/core/ext/filters/client_channel/global_subchannel_pool.h +++ b/src/core/ext/filters/client_channel/global_subchannel_pool.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H @@ -60,4 +60,4 @@ class GlobalSubchannelPool final : public SubchannelPoolInterface { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_GLOBAL_SUBCHANNEL_POOL_H diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc index 3f404bac7a7..113e5e6ab95 100644 --- a/src/core/ext/filters/client_channel/http_proxy.cc +++ b/src/core/ext/filters/client_channel/http_proxy.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -52,24 +52,24 @@ namespace grpc_core { namespace { -/** - * Parses the 'https_proxy' env var (fallback on 'http_proxy') and returns the - * proxy hostname to resolve or nullopt on error. Also sets 'user_cred' to user - * credentials if present in the 'http_proxy' env var, otherwise leaves it - * unchanged. - */ +/// +/// Parses the 'https_proxy' env var (fallback on 'http_proxy') and returns the +/// proxy hostname to resolve or nullopt on error. Also sets 'user_cred' to user +/// credentials if present in the 'http_proxy' env var, otherwise leaves it +/// unchanged. +/// absl::optional GetHttpProxyServer( const ChannelArgs& args, absl::optional* user_cred) { GPR_ASSERT(user_cred != nullptr); absl::StatusOr uri; - /* We check the following places to determine the HTTP proxy to use, stopping - * at the first one that is set: - * 1. GRPC_ARG_HTTP_PROXY channel arg - * 2. grpc_proxy environment variable - * 3. https_proxy environment variable - * 4. http_proxy environment variable - * If none of the above are set, then no HTTP proxy will be used. - */ + // We check the following places to determine the HTTP proxy to use, stopping + // at the first one that is set: + // 1. GRPC_ARG_HTTP_PROXY channel arg + // 2. grpc_proxy environment variable + // 3. https_proxy environment variable + // 4. http_proxy environment variable + // If none of the above are set, then no HTTP proxy will be used. + // absl::optional uri_str = args.GetOwnedString(GRPC_ARG_HTTP_PROXY); if (!uri_str.has_value()) uri_str = GetEnv("grpc_proxy"); @@ -89,23 +89,23 @@ absl::optional GetHttpProxyServer( uri->scheme().c_str()); return absl::nullopt; } - /* Split on '@' to separate user credentials from host */ + // Split on '@' to separate user credentials from host char** authority_strs = nullptr; size_t authority_nstrs; gpr_string_split(uri->authority().c_str(), "@", &authority_strs, &authority_nstrs); - GPR_ASSERT(authority_nstrs != 0); /* should have at least 1 string */ + GPR_ASSERT(authority_nstrs != 0); // should have at least 1 string absl::optional proxy_name; if (authority_nstrs == 1) { - /* User cred not present in authority */ + // User cred not present in authority proxy_name = authority_strs[0]; } else if (authority_nstrs == 2) { - /* User cred found */ + // User cred found *user_cred = authority_strs[0]; proxy_name = authority_strs[1]; gpr_log(GPR_DEBUG, "userinfo found in proxy URI"); } else { - /* Bad authority */ + // Bad authority proxy_name = absl::nullopt; } for (size_t i = 0; i < authority_nstrs; i++) { @@ -149,7 +149,7 @@ absl::optional HttpProxyMapper::MapName( std::string(server_uri).c_str()); return absl::nullopt; } - /* Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. */ + // Prefer using 'no_grpc_proxy'. Fallback on 'no_proxy' if it is not set. auto no_proxy_str = GetEnv("no_grpc_proxy"); if (!no_proxy_str.has_value()) { no_proxy_str = GetEnv("no_proxy"); @@ -181,7 +181,7 @@ absl::optional HttpProxyMapper::MapName( *args = args->Set(GRPC_ARG_HTTP_CONNECT_SERVER, MaybeAddDefaultPort(absl::StripPrefix(uri->path(), "/"))); if (user_cred.has_value()) { - /* Use base64 encoding for user credentials as stated in RFC 7617 */ + // Use base64 encoding for user credentials as stated in RFC 7617 auto encoded_user_cred = UniquePtr( grpc_base64_encode(user_cred->data(), user_cred->length(), 0, 0)); *args = args->Set( diff --git a/src/core/ext/filters/client_channel/http_proxy.h b/src/core/ext/filters/client_channel/http_proxy.h index 4ccf43b8191..116509f4d22 100644 --- a/src/core/ext/filters/client_channel/http_proxy.h +++ b/src/core/ext/filters/client_channel/http_proxy.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H @@ -49,4 +49,4 @@ void RegisterHttpProxyMapper(CoreConfiguration::Builder* builder); } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_PROXY_H diff --git a/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h b/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h index 6b5f156acd4..7e394473762 100644 --- a/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h +++ b/src/core/ext/filters/client_channel/lb_policy/backend_metric_data.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_BACKEND_METRIC_DATA_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_BACKEND_METRIC_DATA_H diff --git a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h index 19651aa0a1c..209f5090258 100644 --- a/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h +++ b/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h @@ -85,5 +85,4 @@ class ChildPolicyHandler : public LoadBalancingPolicy { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc index e4e561df4d8..5215dc1cb3e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h index a869d2b8161..2530dacf393 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H @@ -43,5 +43,4 @@ class ClientLoadReportingFilter : public ChannelFilter { }; } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_CLIENT_LOAD_REPORTING_FILTER_H diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc index 129c20f9d4a..11ddaa255bd 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc @@ -609,8 +609,8 @@ void ParseServer(const GrpcLbServer& server, grpc_resolved_address* addr) { memset(addr, 0, sizeof(*addr)); if (server.drop) return; const uint16_t netorder_port = grpc_htons(static_cast(server.port)); - /* the addresses are given in binary format (a in(6)_addr struct) in - * server->ip_address.bytes. */ + // the addresses are given in binary format (a in(6)_addr struct) in + // server->ip_address.bytes. if (server.ip_size == 4) { addr->len = static_cast(sizeof(grpc_sockaddr_in)); grpc_sockaddr_in* addr4 = reinterpret_cast(&addr->addr); @@ -1377,13 +1377,13 @@ ServerAddressList ExtractBalancerAddresses(const ChannelArgs& args) { return ServerAddressList(); } -/* Returns the channel args for the LB channel, used to create a bidirectional - * stream for the reception of load balancing updates. - * - * Inputs: - * - \a response_generator: in order to propagate updates from the resolver - * above the grpclb policy. - * - \a args: other args inherited from the grpclb policy. */ +// Returns the channel args for the LB channel, used to create a bidirectional +// stream for the reception of load balancing updates. +// +// Inputs: +// - \a response_generator: in order to propagate updates from the resolver +// above the grpclb policy. +// - \a args: other args inherited from the grpclb policy. ChannelArgs BuildBalancerChannelArgs( FakeResolverResponseGenerator* response_generator, const ChannelArgs& args) { diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h index 91aa541b908..6dd04a96d75 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h @@ -1,34 +1,34 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H #include -/** Channel arg indicating if a target corresponding to the address is grpclb - * loadbalancer. The type of this arg is an integer and the value is treated as - * a bool. */ +/// Channel arg indicating if a target corresponding to the address is grpclb +/// loadbalancer. The type of this arg is an integer and the value is treated as +/// a bool. #define GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER \ "grpc.address_is_grpclb_load_balancer" -/** Channel arg indicating if a target corresponding to the address is a backend - * received from a balancer. The type of this arg is an integer and the value is - * treated as a bool. */ +/// Channel arg indicating if a target corresponding to the address is a backend +/// received from a balancer. The type of this arg is an integer and the value +/// is treated as a bool. #define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \ "grpc.address_is_backend_from_grpclb_load_balancer" @@ -36,5 +36,4 @@ #define GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS \ "grpc.internal.grpclb_subchannel_cache_interval_ms" -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_H diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h index e2316ba80e8..9cc128a374b 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h @@ -36,6 +36,4 @@ const ServerAddressList* FindGrpclbBalancerAddressesInChannelArgs( } // namespace grpc_core -#endif /* \ -GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_BALANCER_ADDRESSES_H diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc index 9427a99b0b1..ca23f28609f 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h index b6917da25a0..bea20c79736 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H @@ -78,5 +78,4 @@ class GrpcLbClientStats : public RefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_GRPCLB_CLIENT_STATS_H diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc index 480e754979e..297c0f165a2 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h index 4774bbf5d29..1bc7e546fa0 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H @@ -72,5 +72,4 @@ bool GrpcLbResponseParse(const grpc_slice& serialized_response, } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H diff --git a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h index 1d26a0b63ff..4acaf8f3b09 100644 --- a/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +++ b/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h @@ -47,25 +47,25 @@ // Code for maintaining a list of subchannels within an LB policy. // // To use this, callers must create their own subclasses, like so: -/* +// -class MySubchannelList; // Forward declaration. +// class MySubchannelList; // Forward declaration. -class MySubchannelData - : public SubchannelData { - public: - void ProcessConnectivityChangeLocked( - absl::optional old_state, - grpc_connectivity_state new_state) override { - // ...code to handle connectivity changes... - } -}; +// class MySubchannelData +// : public SubchannelData { +// public: +// void ProcessConnectivityChangeLocked( +// absl::optional old_state, +// grpc_connectivity_state new_state) override { +// // ...code to handle connectivity changes... +// } +// }; -class MySubchannelList - : public SubchannelList { -}; +// class MySubchannelList +// : public SubchannelList { +// }; -*/ +// // All methods will be called from within the client_channel work serializer. namespace grpc_core { diff --git a/src/core/ext/filters/client_channel/local_subchannel_pool.h b/src/core/ext/filters/client_channel/local_subchannel_pool.h index e16079d2b23..e02a4b5ca2e 100644 --- a/src/core/ext/filters/client_channel/local_subchannel_pool.h +++ b/src/core/ext/filters/client_channel/local_subchannel_pool.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H @@ -56,4 +56,4 @@ class LocalSubchannelPool final : public SubchannelPoolInterface { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LOCAL_SUBCHANNEL_POOL_H diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc index 9d9257c7bec..36ab1bc26c3 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc @@ -855,7 +855,7 @@ void grpc_resolver_dns_ares_shutdown() { } } -#else /* GRPC_ARES == 1 */ +#else // GRPC_ARES == 1 namespace grpc_core { void RegisterAresDnsResolver(CoreConfiguration::Builder*) {} @@ -865,4 +865,4 @@ void grpc_resolver_dns_ares_init() {} void grpc_resolver_dns_ares_shutdown() {} -#endif /* GRPC_ARES == 1 */ +#endif // GRPC_ARES == 1 diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h index 39fba7984fd..5813a9e9114 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H @@ -35,57 +35,56 @@ namespace grpc_core { -/* A wrapped fd that integrates with the grpc iomgr of the current platform. - * A GrpcPolledFd knows how to create grpc platform-specific iomgr endpoints - * from "ares_socket_t" sockets, and then sign up for readability/writeability - * with that poller, and do shutdown and destruction. */ +// A wrapped fd that integrates with the grpc iomgr of the current platform. +// A GrpcPolledFd knows how to create grpc platform-specific iomgr endpoints +// from "ares_socket_t" sockets, and then sign up for readability/writeability +// with that poller, and do shutdown and destruction. class GrpcPolledFd { public: virtual ~GrpcPolledFd() {} - /* Called when c-ares library is interested and there's no pending callback */ + // Called when c-ares library is interested and there's no pending callback virtual void RegisterForOnReadableLocked(grpc_closure* read_closure) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* Called when c-ares library is interested and there's no pending callback */ + // Called when c-ares library is interested and there's no pending callback virtual void RegisterForOnWriteableLocked(grpc_closure* write_closure) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* Indicates if there is data left even after just being read from */ + // Indicates if there is data left even after just being read from virtual bool IsFdStillReadableLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* Called once and only once. Must cause cancellation of any pending - * read/write callbacks. */ + // Called once and only once. Must cause cancellation of any pending + // read/write callbacks. virtual void ShutdownLocked(grpc_error_handle error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* Get the underlying ares_socket_t that this was created from */ + // Get the underlying ares_socket_t that this was created from virtual ares_socket_t GetWrappedAresSocketLocked() ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* A unique name, for logging */ + // A unique name, for logging virtual const char* GetName() const = 0; }; -/* A GrpcPolledFdFactory is 1-to-1 with and owned by the - * ares event driver. It knows how to create GrpcPolledFd's - * for the current platform, and the ares driver uses it for all of - * its fd's. */ +// A GrpcPolledFdFactory is 1-to-1 with and owned by the +// ares event driver. It knows how to create GrpcPolledFd's +// for the current platform, and the ares driver uses it for all of +// its fd's. class GrpcPolledFdFactory { public: virtual ~GrpcPolledFdFactory() {} - /* Creates a new wrapped fd for the current platform */ + // Creates a new wrapped fd for the current platform virtual GrpcPolledFd* NewGrpcPolledFdLocked( ares_socket_t as, grpc_pollset_set* driver_pollset_set) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; - /* Optionally configures the ares channel after creation */ + // Optionally configures the ares channel after creation virtual void ConfigureAresChannelLocked(ares_channel channel) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu) = 0; }; -/* Creates a new polled fd factory. - * Note that even though ownership of mu is not transferred, the mu - * parameter is guaranteed to be alive for the the whole lifetime of - * the resulting GrpcPolledFdFactory as well as any GrpcPolledFd - * returned by the factory. */ +// Creates a new polled fd factory. +// Note that even though ownership of mu is not transferred, the mu +// parameter is guaranteed to be alive for the the whole lifetime of +// the resulting GrpcPolledFdFactory as well as any GrpcPolledFd +// returned by the factory. std::unique_ptr NewGrpcPolledFdFactory(Mutex* mu); } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_EV_DRIVER_H diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc index 371a61f8f2d..4f0813edcca 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -53,9 +53,9 @@ class GrpcPolledFdPosix : public GrpcPolledFd { ~GrpcPolledFdPosix() override { grpc_pollset_set_del_fd(driver_pollset_set_, fd_); - /* c-ares library will close the fd inside grpc_fd. This fd may be picked up - immediately by another thread, and should not be closed by the following - grpc_fd_orphan. */ + // c-ares library will close the fd inside grpc_fd. This fd may be picked up + // immediately by another thread, and should not be closed by the following + // grpc_fd_orphan. int phony_release_fd; grpc_fd_orphan(fd_, nullptr, &phony_release_fd, "c-ares query finished"); } @@ -112,4 +112,4 @@ std::unique_ptr NewGrpcPolledFdFactory(Mutex* /* mu */) { } // namespace grpc_core -#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) */ +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc index deb72194f36..5f1fd0d34a8 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include "src/core/lib/iomgr/port.h" // IWYU pragma: keep @@ -44,11 +44,11 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/slice/slice_internal.h" -/* TODO(apolcyn): remove this hack after fixing upstream. - * Our grpc/c-ares code on Windows uses the ares_set_socket_functions API, - * which uses "struct iovec" type, which on Windows is defined inside of - * a c-ares header that is not public. - * See https://github.com/c-ares/c-ares/issues/206. */ +// TODO(apolcyn): remove this hack after fixing upstream. +// Our grpc/c-ares code on Windows uses the ares_set_socket_functions API, +// which uses "struct iovec" type, which on Windows is defined inside of +// a c-ares header that is not public. +// See https://github.com/c-ares/c-ares/issues/206. struct iovec { void* iov_base; size_t iov_len; @@ -56,12 +56,12 @@ struct iovec { namespace grpc_core { -/* c-ares reads and takes action on the error codes of the - * "virtual socket operations" in this file, via the WSAGetLastError - * APIs. If code in this file wants to set a specific WSA error that - * c-ares should read, it must do so by calling SetWSAError() on the - * WSAErrorContext instance passed to it. A WSAErrorContext must only be - * instantiated at the top of the virtual socket function callstack. */ +// c-ares reads and takes action on the error codes of the +// "virtual socket operations" in this file, via the WSAGetLastError +// APIs. If code in this file wants to set a specific WSA error that +// c-ares should read, it must do so by calling SetWSAError() on the +// WSAErrorContext instance passed to it. A WSAErrorContext must only be +// instantiated at the top of the virtual socket function callstack. class WSAErrorContext { public: explicit WSAErrorContext(){}; @@ -72,7 +72,7 @@ class WSAErrorContext { } } - /* Disallow copy and assignment operators */ + // Disallow copy and assignment operators WSAErrorContext(const WSAErrorContext&) = delete; WSAErrorContext& operator=(const WSAErrorContext&) = delete; @@ -82,15 +82,15 @@ class WSAErrorContext { int error_ = 0; }; -/* c-ares creates its own sockets and is meant to read them when readable and - * write them when writeable. To fit this socket usage model into the grpc - * windows poller (which gives notifications when attempted reads and writes are - * actually fulfilled rather than possible), this GrpcPolledFdWindows class - * takes advantage of the ares_set_socket_functions API and acts as a virtual - * socket. It holds its own read and write buffers which are written to and read - * from c-ares and are used with the grpc windows poller, and it, e.g., - * manufactures virtual socket error codes when it e.g. needs to tell the c-ares - * library to wait for an async read. */ +// c-ares creates its own sockets and is meant to read them when readable and +// write them when writeable. To fit this socket usage model into the grpc +// windows poller (which gives notifications when attempted reads and writes are +// actually fulfilled rather than possible), this GrpcPolledFdWindows class +// takes advantage of the ares_set_socket_functions API and acts as a virtual +// socket. It holds its own read and write buffers which are written to and read +// from c-ares and are used with the grpc windows poller, and it, e.g., +// manufactures virtual socket error codes when it e.g. needs to tell the c-ares +// library to wait for an async read. class GrpcPolledFdWindows { public: enum WriteState { @@ -282,8 +282,8 @@ class GrpcPolledFdWindows { if (GRPC_SLICE_LENGTH(read_buf_) == 0) { read_buf_has_data_ = false; } - /* c-ares overloads this recv_from virtual socket function to receive - * data on both UDP and TCP sockets, and from is nullptr for TCP. */ + // c-ares overloads this recv_from virtual socket function to receive + // data on both UDP and TCP sockets, and from is nullptr for TCP. if (from != nullptr) { GPR_ASSERT(*from_len <= recv_from_source_addr_len_); memcpy(from, &recv_from_source_addr_, recv_from_source_addr_len_); @@ -581,10 +581,10 @@ class GrpcPolledFdWindows { void OnIocpReadableLocked(grpc_error_handle error) { if (error.ok()) { if (winsocket_->read_info.wsa_error != 0) { - /* WSAEMSGSIZE would be due to receiving more data - * than our read buffer's fixed capacity. Assume that - * the connection is TCP and read the leftovers - * in subsequent c-ares reads. */ + // WSAEMSGSIZE would be due to receiving more data + // than our read buffer's fixed capacity. Assume that + // the connection is TCP and read the leftovers + // in subsequent c-ares reads. if (winsocket_->read_info.wsa_error != WSAEMSGSIZE) { error = GRPC_WSA_ERROR(winsocket_->read_info.wsa_error, "OnIocpReadableInner"); @@ -683,11 +683,11 @@ struct SockToPolledFdEntry { SockToPolledFdEntry* next = nullptr; }; -/* A SockToPolledFdMap can make ares_socket_t types (SOCKET's on windows) - * to GrpcPolledFdWindow's, and is used to find the appropriate - * GrpcPolledFdWindows to handle a virtual socket call when c-ares makes that - * socket call on the ares_socket_t type. Instances are owned by and one-to-one - * with a GrpcPolledFdWindows factory and event driver */ +// A SockToPolledFdMap can make ares_socket_t types (SOCKET's on windows) +// to GrpcPolledFdWindow's, and is used to find the appropriate +// GrpcPolledFdWindows to handle a virtual socket call when c-ares makes that +// socket call on the ares_socket_t type. Instances are owned by and one-to-one +// with a GrpcPolledFdWindows factory and event driver class SockToPolledFdMap { public: explicit SockToPolledFdMap(Mutex* mu) : mu_(mu) {} @@ -726,12 +726,12 @@ class SockToPolledFdMap { abort(); } - /* These virtual socket functions are called from within the c-ares - * library. These methods generally dispatch those socket calls to the - * appropriate methods. The virtual "socket" and "close" methods are - * special and instead create/add and remove/destroy GrpcPolledFdWindows - * objects. - */ + // These virtual socket functions are called from within the c-ares + // library. These methods generally dispatch those socket calls to the + // appropriate methods. The virtual "socket" and "close" methods are + // special and instead create/add and remove/destroy GrpcPolledFdWindows + // objects. + // static ares_socket_t Socket(int af, int type, int protocol, void* user_data) { if (type != SOCK_DGRAM && type != SOCK_STREAM) { GRPC_CARES_TRACE_LOG("Socket called with invalid socket type:%d", type); @@ -815,9 +815,9 @@ const struct ares_socket_functions custom_ares_sock_funcs = { &SockToPolledFdMap::SendV /* sendv */, }; -/* A thin wrapper over a GrpcPolledFdWindows object but with a shorter - lifetime. This object releases it's GrpcPolledFdWindows upon destruction, - so that c-ares can close it via usual socket teardown. */ +// A thin wrapper over a GrpcPolledFdWindows object but with a shorter +// lifetime. This object releases it's GrpcPolledFdWindows upon destruction, +// so that c-ares can close it via usual socket teardown. class GrpcPolledFdWindowsWrapper : public GrpcPolledFd { public: explicit GrpcPolledFdWindowsWrapper(GrpcPolledFdWindows* wrapped) @@ -879,4 +879,4 @@ std::unique_ptr NewGrpcPolledFdFactory(Mutex* mu) { } // namespace grpc_core -#endif /* GRPC_ARES == 1 && defined(GPR_WINDOWS) */ +#endif // GRPC_ARES == 1 && defined(GPR_WINDOWS) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc index 1f5011f2b52..d3dfcd8b06f 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -81,61 +81,61 @@ grpc_core::TraceFlag grpc_trace_cares_address_sorting(false, grpc_core::TraceFlag grpc_trace_cares_resolver(false, "cares_resolver"); typedef struct fd_node { - /* default constructor exists only for linked list manipulation */ + // default constructor exists only for linked list manipulation fd_node() : ev_driver(nullptr) {} explicit fd_node(grpc_ares_ev_driver* ev_driver) : ev_driver(ev_driver) {} - /** the owner of this fd node */ + /// the owner of this fd node grpc_ares_ev_driver* const ev_driver; - /** a closure wrapping on_readable_locked, which should be - invoked when the grpc_fd in this node becomes readable. */ + /// a closure wrapping on_readable_locked, which should be + /// invoked when the grpc_fd in this node becomes readable. grpc_closure read_closure ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** a closure wrapping on_writable_locked, which should be - invoked when the grpc_fd in this node becomes writable. */ + /// a closure wrapping on_writable_locked, which should be + /// invoked when the grpc_fd in this node becomes writable. grpc_closure write_closure ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** next fd node in the list */ + /// next fd node in the list struct fd_node* next ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** wrapped fd that's polled by grpc's poller for the current platform */ + /// wrapped fd that's polled by grpc's poller for the current platform grpc_core::GrpcPolledFd* grpc_polled_fd ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** if the readable closure has been registered */ + /// if the readable closure has been registered bool readable_registered ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** if the writable closure has been registered */ + /// if the writable closure has been registered bool writable_registered ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** if the fd has been shutdown yet from grpc iomgr perspective */ + /// if the fd has been shutdown yet from grpc iomgr perspective bool already_shutdown ABSL_GUARDED_BY(&grpc_ares_request::mu); } fd_node; struct grpc_ares_ev_driver { explicit grpc_ares_ev_driver(grpc_ares_request* request) : request(request) {} - /** the ares_channel owned by this event driver */ + /// the ares_channel owned by this event driver ares_channel channel ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** pollset set for driving the IO events of the channel */ + /// pollset set for driving the IO events of the channel grpc_pollset_set* pollset_set ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** refcount of the event driver */ + /// refcount of the event driver gpr_refcount refs; - /** a list of grpc_fd that this event driver is currently using. */ + /// a list of grpc_fd that this event driver is currently using. fd_node* fds ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** is this event driver being shut down */ + /// is this event driver being shut down bool shutting_down ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** request object that's using this ev driver */ + /// request object that's using this ev driver grpc_ares_request* const request; - /** Owned by the ev_driver. Creates new GrpcPolledFd's */ + /// Owned by the ev_driver. Creates new GrpcPolledFd's std::unique_ptr polled_fd_factory ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** query timeout in milliseconds */ + /// query timeout in milliseconds int query_timeout_ms ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** alarm to cancel active queries */ + /// alarm to cancel active queries grpc_timer query_timeout ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** cancels queries on a timeout */ + /// cancels queries on a timeout grpc_closure on_timeout_locked ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** alarm to poll ares_process on in case fd events don't happen */ + /// alarm to poll ares_process on in case fd events don't happen grpc_timer ares_backup_poll_alarm ABSL_GUARDED_BY(&grpc_ares_request::mu); - /** polls ares_process on a periodic timer */ + /// polls ares_process on a periodic timer grpc_closure on_ares_backup_poll_alarm_locked ABSL_GUARDED_BY(&grpc_ares_request::mu); }; @@ -143,17 +143,17 @@ struct grpc_ares_ev_driver { // TODO(apolcyn): make grpc_ares_hostbyname_request a sub-class // of GrpcAresQuery. typedef struct grpc_ares_hostbyname_request { - /** following members are set in create_hostbyname_request_locked - */ - /** the top-level request instance */ + /// following members are set in create_hostbyname_request_locked + /// + /// the top-level request instance grpc_ares_request* parent_request; - /** host to resolve, parsed from the name to resolve */ + /// host to resolve, parsed from the name to resolve char* host; - /** port to fill in sockaddr_in, parsed from the name to resolve */ + /// port to fill in sockaddr_in, parsed from the name to resolve uint16_t port; - /** is it a grpclb address */ + /// is it a grpclb address bool is_balancer; - /** for logging and errors: the query type ("A" or "AAAA") */ + /// for logging and errors: the query type ("A" or "AAAA") const char* qtype; } grpc_ares_hostbyname_request; @@ -180,9 +180,9 @@ class GrpcAresQuery { const std::string& name() { return name_; } private: - /* the top level request instance */ + // the top level request instance grpc_ares_request* r_; - /** for logging and errors */ + /// for logging and errors const std::string name_; }; @@ -305,14 +305,14 @@ static void on_timeout(void* arg, grpc_error_handle error) { static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver) ABSL_EXCLUSIVE_LOCKS_REQUIRED(&grpc_ares_request::mu); -/* In case of non-responsive DNS servers, dropped packets, etc., c-ares has - * intelligent timeout and retry logic, which we can take advantage of by - * polling ares_process_fd on time intervals. Overall, the c-ares library is - * meant to be called into and given a chance to proceed name resolution: - * a) when fd events happen - * b) when some time has passed without fd events having happened - * For the latter, we use this backup poller. Also see - * https://github.com/grpc/grpc/pull/17688 description for more details. */ +// In case of non-responsive DNS servers, dropped packets, etc., c-ares has +// intelligent timeout and retry logic, which we can take advantage of by +// polling ares_process_fd on time intervals. Overall, the c-ares library is +// meant to be called into and given a chance to proceed name resolution: +// a) when fd events happen +// b) when some time has passed without fd events having happened +// For the latter, we use this backup poller. Also see +// https://github.com/grpc/grpc/pull/17688 description for more details. static void on_ares_backup_poll_alarm(void* arg, grpc_error_handle error) { grpc_ares_ev_driver* driver = static_cast(arg); grpc_core::MutexLock lock(&driver->request->mu); @@ -617,8 +617,8 @@ void grpc_ares_complete_request_locked(grpc_ares_request* r) grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, r->error); } -/* Note that the returned object takes a reference to qtype, so - * qtype must outlive it. */ +// Note that the returned object takes a reference to qtype, so +// qtype must outlive it. static grpc_ares_hostbyname_request* create_hostbyname_request_locked( grpc_ares_request* parent_request, const char* host, uint16_t port, bool is_balancer, const char* qtype) @@ -868,7 +868,7 @@ grpc_error_handle grpc_dns_lookup_ares_continued( int query_timeout_ms, std::string* host, std::string* port, bool check_port) ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) { grpc_error_handle error; - /* parse name, splitting it into host and port parts */ + // parse name, splitting it into host and port parts grpc_core::SplitHostPort(name, host, port); if (host->empty()) { error = @@ -1012,14 +1012,14 @@ static bool grpc_ares_maybe_resolve_localhost_manually_locked( return inner_maybe_resolve_localhost_manually_locked(r, name, default_port, addrs, &host, &port); } -#else /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */ +#else // GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY static bool grpc_ares_maybe_resolve_localhost_manually_locked( const grpc_ares_request* /*r*/, const char* /*name*/, const char* /*default_port*/, std::unique_ptr* /*addrs*/) { return false; } -#endif /* GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY */ +#endif // GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY static grpc_ares_request* grpc_dns_lookup_hostname_ares_impl( const char* dns_server, const char* name, const char* default_port, @@ -1104,7 +1104,7 @@ grpc_ares_request* grpc_dns_lookup_srv_ares_impl( return r; } r->pending_queries = 1; - /* Query the SRV record */ + // Query the SRV record std::string service_name = absl::StrCat("_grpclb._tcp.", host); GrpcAresQuery* srv_query = new GrpcAresQuery(r, service_name); ares_query(r->ev_driver->channel, service_name.c_str(), ns_c_in, ns_t_srv, @@ -1142,7 +1142,7 @@ grpc_ares_request* grpc_dns_lookup_txt_ares_impl( return r; } r->pending_queries = 1; - /* Query the TXT record */ + // Query the TXT record std::string config_name = absl::StrCat("_grpc_config.", host); GrpcAresQuery* txt_query = new GrpcAresQuery(r, config_name); ares_search(r->ev_driver->channel, config_name.c_str(), ns_c_in, ns_t_txt, @@ -1202,4 +1202,4 @@ grpc_error_handle grpc_ares_init(void) { return absl::OkStatus(); } void grpc_ares_cleanup(void) {} #endif // GPR_WINDOWS -#endif /* GRPC_ARES == 1 */ +#endif // GRPC_ARES == 1 diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h index c949c813d44..c2d3de0b2ac 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H @@ -54,41 +54,41 @@ extern grpc_core::TraceFlag grpc_trace_cares_resolver; typedef struct grpc_ares_ev_driver grpc_ares_ev_driver; struct grpc_ares_request { - /** synchronizes access to this request, and also to associated - * ev_driver and fd_node objects */ + /// synchronizes access to this request, and also to associated + /// ev_driver and fd_node objects grpc_core::Mutex mu; - /** indicates the DNS server to use, if specified */ + /// indicates the DNS server to use, if specified struct ares_addr_port_node dns_server_addr ABSL_GUARDED_BY(mu); - /** following members are set in grpc_resolve_address_ares_impl */ - /** closure to call when the request completes */ + /// following members are set in grpc_resolve_address_ares_impl + /// closure to call when the request completes grpc_closure* on_done ABSL_GUARDED_BY(mu) = nullptr; - /** the pointer to receive the resolved addresses */ + /// the pointer to receive the resolved addresses std::unique_ptr* addresses_out ABSL_GUARDED_BY(mu); - /** the pointer to receive the resolved balancer addresses */ + /// the pointer to receive the resolved balancer addresses std::unique_ptr* balancer_addresses_out ABSL_GUARDED_BY(mu); - /** the pointer to receive the service config in JSON */ + /// the pointer to receive the service config in JSON char** service_config_json_out ABSL_GUARDED_BY(mu) = nullptr; - /** the event driver used by this request */ + /// the event driver used by this request grpc_ares_ev_driver* ev_driver ABSL_GUARDED_BY(mu) = nullptr; - /** number of ongoing queries */ + /// number of ongoing queries size_t pending_queries ABSL_GUARDED_BY(mu) = 0; - /** the errors explaining query failures, appended to in query callbacks */ + /// the errors explaining query failures, appended to in query callbacks grpc_error_handle error ABSL_GUARDED_BY(mu); }; -/* Asynchronously resolve \a name (A/AAAA records only). - It uses \a default_port if a port isn't designated in \a name, otherwise it - uses the port in \a name. grpc_ares_init() must be called at least once before - this function. The returned grpc_ares_request object is owned by the caller - and it is safe to free after on_done is called back. - - Note on synchronization: \a as on_done might be called from another thread - ~immediately, access to the grpc_ares_request* return value must be - synchronized by the caller. TODO(apolcyn): we should remove this requirement - by changing this API to use two phase initialization - one API to create - the grpc_ares_request* and another to start the async work. */ +// Asynchronously resolve \a name (A/AAAA records only). +// It uses \a default_port if a port isn't designated in \a name, otherwise it +// uses the port in \a name. grpc_ares_init() must be called at least once +// before this function. The returned grpc_ares_request object is owned by the +// caller and it is safe to free after on_done is called back. + +// Note on synchronization: \a as on_done might be called from another thread +//~immediately, access to the grpc_ares_request* return value must be +// synchronized by the caller. TODO(apolcyn): we should remove this requirement +// by changing this API to use two phase initialization - one API to create +// the grpc_ares_request* and another to start the async work. extern grpc_ares_request* (*grpc_dns_lookup_hostname_ares)( const char* dns_server, const char* name, const char* default_port, grpc_pollset_set* interested_parties, grpc_closure* on_done, @@ -110,28 +110,27 @@ extern grpc_ares_request* (*grpc_dns_lookup_txt_ares)( grpc_pollset_set* interested_parties, grpc_closure* on_done, char** service_config_json, int query_timeout_ms); -/* Cancel the pending grpc_ares_request \a request */ +// Cancel the pending grpc_ares_request \a request extern void (*grpc_cancel_ares_request)(grpc_ares_request* request); -/* Initialize gRPC ares wrapper. Must be called at least once before - grpc_resolve_address_ares(). */ +// Initialize gRPC ares wrapper. Must be called at least once before +// grpc_resolve_address_ares(). grpc_error_handle grpc_ares_init(void); -/* Uninitialized gRPC ares wrapper. If there was more than one previous call to - grpc_ares_init(), this function uninitializes the gRPC ares wrapper only if - it has been called the same number of times as grpc_ares_init(). */ +// Uninitialized gRPC ares wrapper. If there was more than one previous call to +// grpc_ares_init(), this function uninitializes the gRPC ares wrapper only if +// it has been called the same number of times as grpc_ares_init(). void grpc_ares_cleanup(void); -/* Indicates whether or not AAAA queries should be attempted. */ -/* E.g., return false if ipv6 is known to not be available. */ +// Indicates whether or not AAAA queries should be attempted. +// E.g., return false if ipv6 is known to not be available. bool grpc_ares_query_ipv6(); -/* Sorts destinations in lb_addrs according to RFC 6724. */ +// Sorts destinations in lb_addrs according to RFC 6724. void grpc_cares_wrapper_address_sorting_sort( const grpc_ares_request* request, grpc_core::ServerAddressList* addresses); -/* Exposed in this header for C-core tests only */ +// Exposed in this header for C-core tests only extern void (*grpc_ares_test_only_inject_config)(ares_channel channel); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_C_ARES_GRPC_ARES_WRAPPER_H diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc index 23c0fec74f3..db9c30208c3 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -26,4 +26,4 @@ bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); } -#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) */ +#endif // GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc index 1085accd292..5232479e930 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -32,4 +32,4 @@ bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); } -#endif /* GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER) */ +#endif // GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER) diff --git a/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h b/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h index 964fa1df892..6d94cc26155 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h +++ b/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H @@ -26,5 +26,4 @@ GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_dns_resolver); -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_DNS_DNS_RESOLVER_SELECTION_H diff --git a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h index 09889e4f73a..7f83e3a3f29 100644 --- a/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h +++ b/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h @@ -27,4 +27,4 @@ UniqueTypeName XdsClusterAttributeTypeName(); } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_XDS_XDS_RESOLVER_H diff --git a/src/core/ext/filters/client_channel/retry_throttle.cc b/src/core/ext/filters/client_channel/retry_throttle.cc index 4d7be4c4a5b..91403843e41 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.cc +++ b/src/core/ext/filters/client_channel/retry_throttle.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/filters/client_channel/retry_throttle.h b/src/core/ext/filters/client_channel/retry_throttle.h index 62464c09894..8ef2ebb9832 100644 --- a/src/core/ext/filters/client_channel/retry_throttle.h +++ b/src/core/ext/filters/client_channel/retry_throttle.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H @@ -89,4 +89,4 @@ class ServerRetryThrottleMap { } // namespace internal } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_THROTTLE_H diff --git a/src/core/ext/filters/client_channel/subchannel.cc b/src/core/ext/filters/client_channel/subchannel.cc index 20422f8360f..77f97309486 100644 --- a/src/core/ext/filters/client_channel/subchannel.cc +++ b/src/core/ext/filters/client_channel/subchannel.cc @@ -151,14 +151,14 @@ SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error) deadline_(args.deadline) { grpc_call_stack* callstk = SUBCHANNEL_CALL_TO_CALL_STACK(this); const grpc_call_element_args call_args = { - callstk, /* call_stack */ - nullptr, /* server_transport_data */ - args.context, /* context */ - args.path.c_slice(), /* path */ - args.start_time, /* start_time */ - args.deadline, /* deadline */ - args.arena, /* arena */ - args.call_combiner /* call_combiner */ + callstk, // call_stack + nullptr, // server_transport_data + args.context, // context + args.path.c_slice(), // path + args.start_time, // start_time + args.deadline, // deadline + args.arena, // arena + args.call_combiner // call_combiner }; *error = grpc_call_stack_init(connected_subchannel_->channel_stack(), 1, SubchannelCall::Destroy, this, &call_args); diff --git a/src/core/ext/filters/client_channel/subchannel_pool_interface.h b/src/core/ext/filters/client_channel/subchannel_pool_interface.h index b3ab78fdbc7..f809869bd80 100644 --- a/src/core/ext/filters/client_channel/subchannel_pool_interface.h +++ b/src/core/ext/filters/client_channel/subchannel_pool_interface.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H @@ -97,4 +97,4 @@ class SubchannelPoolInterface : public RefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H */ +#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_POOL_INTERFACE_H diff --git a/src/core/ext/filters/deadline/deadline_filter.h b/src/core/ext/filters/deadline/deadline_filter.h index 85071a90f36..da0231f0d96 100644 --- a/src/core/ext/filters/deadline/deadline_filter.h +++ b/src/core/ext/filters/deadline/deadline_filter.h @@ -90,4 +90,4 @@ bool grpc_deadline_checking_enabled(const grpc_core::ChannelArgs& args); extern const grpc_channel_filter grpc_client_deadline_filter; extern const grpc_channel_filter grpc_server_deadline_filter; -#endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */ +#endif // GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H diff --git a/src/core/ext/filters/http/client/http_client_filter.cc b/src/core/ext/filters/http/client/http_client_filter.cc index 88ec6ce9a54..6d1f2acb9d7 100644 --- a/src/core/ext/filters/http/client/http_client_filter.cc +++ b/src/core/ext/filters/http/client/http_client_filter.cc @@ -1,19 +1,19 @@ -/* - * 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 - * - * 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. - * - */ +// +// 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 +// +// 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 @@ -58,10 +58,10 @@ const grpc_channel_filter HttpClientFilter::kFilter = namespace { absl::Status CheckServerMetadata(ServerMetadata* b) { if (auto* status = b->get_pointer(HttpStatusMetadata())) { - /* If both gRPC status and HTTP status are provided in the response, we - * should prefer the gRPC status code, as mentioned in - * https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md. - */ + // If both gRPC status and HTTP status are provided in the response, we + // should prefer the gRPC status code, as mentioned in + // https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md. + // const grpc_status_code* grpc_status = b->get_pointer(GrpcStatusMetadata()); if (grpc_status != nullptr || *status == 200) { b->Remove(HttpStatusMetadata()); diff --git a/src/core/ext/filters/http/client/http_client_filter.h b/src/core/ext/filters/http/client/http_client_filter.h index 5a62d01053a..ced0cf3a150 100644 --- a/src/core/ext/filters/http/client/http_client_filter.h +++ b/src/core/ext/filters/http/client/http_client_filter.h @@ -1,19 +1,19 @@ -/* - * 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 - * - * 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. - * - */ +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H @@ -58,4 +58,4 @@ class HttpClientFilter : public ChannelFilter { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */ +#endif // GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index 0467888e2dd..9e15fa18da6 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/ext/filters/http/client_authority_filter.h b/src/core/ext/filters/http/client_authority_filter.h index 4f52e52f88a..ce88414a52e 100644 --- a/src/core/ext/filters/http/client_authority_filter.h +++ b/src/core/ext/filters/http/client_authority_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H @@ -53,4 +53,4 @@ class ClientAuthorityFilter final : public ChannelFilter { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H */ +#endif // GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_AUTHORITY_FILTER_H diff --git a/src/core/ext/filters/http/http_filters_plugin.cc b/src/core/ext/filters/http/http_filters_plugin.cc index f2a30fedfb3..7a4274e858d 100644 --- a/src/core/ext/filters/http/http_filters_plugin.cc +++ b/src/core/ext/filters/http/http_filters_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/filters/http/message_compress/compression_filter.h b/src/core/ext/filters/http/message_compress/compression_filter.h index c0a28a7c7ab..408810f97ff 100644 --- a/src/core/ext/filters/http/message_compress/compression_filter.h +++ b/src/core/ext/filters/http/message_compress/compression_filter.h @@ -38,27 +38,27 @@ namespace grpc_core { -/** Compression filter for messages. - * - * See for the available compression settings. - * - * Compression settings may come from: - * - Channel configuration, as established at channel creation time. - * - The metadata accompanying the outgoing data to be compressed. This is - * taken as a request only. We may choose not to honor it. The metadata key - * is given by \a GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY. - * - * Compression can be disabled for concrete messages (for instance in order to - * prevent CRIME/BEAST type attacks) by having the GRPC_WRITE_NO_COMPRESS set in - * the MessageHandle flags. - * - * The attempted compression mechanism is added to the resulting initial - * metadata under the 'grpc-encoding' key. - * - * If compression is actually performed, the MessageHandle's flag is modified to - * incorporate GRPC_WRITE_INTERNAL_COMPRESS. Otherwise, and regardless of the - * aforementioned 'grpc-encoding' metadata value, data will pass through - * uncompressed. */ +/// Compression filter for messages. +/// +/// See for the available compression settings. +/// +/// Compression settings may come from: +/// - Channel configuration, as established at channel creation time. +/// - The metadata accompanying the outgoing data to be compressed. This is +/// taken as a request only. We may choose not to honor it. The metadata key +/// is given by \a GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY. +/// +/// Compression can be disabled for concrete messages (for instance in order to +/// prevent CRIME/BEAST type attacks) by having the GRPC_WRITE_NO_COMPRESS set +/// in the MessageHandle flags. +/// +/// The attempted compression mechanism is added to the resulting initial +/// metadata under the 'grpc-encoding' key. +/// +/// If compression is actually performed, the MessageHandle's flag is modified +/// to incorporate GRPC_WRITE_INTERNAL_COMPRESS. Otherwise, and regardless of +/// the aforementioned 'grpc-encoding' metadata value, data will pass through +/// uncompressed. class CompressionFilter : public ChannelFilter { protected: @@ -129,5 +129,4 @@ class ServerCompressionFilter final : public CompressionFilter { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_COMPRESSION_FILTER_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_COMPRESSION_FILTER_H diff --git a/src/core/ext/filters/http/server/http_server_filter.cc b/src/core/ext/filters/http/server/http_server_filter.cc index b8121be1f33..23062d5c007 100644 --- a/src/core/ext/filters/http/server/http_server_filter.cc +++ b/src/core/ext/filters/http/server/http_server_filter.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/filters/http/server/http_server_filter.h b/src/core/ext/filters/http/server/http_server_filter.h index b4fc7ecc496..1038059cb07 100644 --- a/src/core/ext/filters/http/server/http_server_filter.h +++ b/src/core/ext/filters/http/server/http_server_filter.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H @@ -60,4 +60,4 @@ class HttpServerFilter : public ChannelFilter { "grpc.http.do_not_use_unless_you_have_permission_from_grpc_team_allow_" \ "broken_put_requests" -#endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */ +#endif // GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H diff --git a/src/core/ext/filters/load_reporting/registered_opencensus_objects.h b/src/core/ext/filters/load_reporting/registered_opencensus_objects.h index ed11ff42239..d91c5539d20 100644 --- a/src/core/ext/filters/load_reporting/registered_opencensus_objects.h +++ b/src/core/ext/filters/load_reporting/registered_opencensus_objects.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H #define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H @@ -114,5 +114,4 @@ inline ::opencensus::tags::TagKey TagKeyMetricName() { } // namespace load_reporter } // namespace grpc -#endif /* GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H \ - */ +#endif // GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_REGISTERED_OPENCENSUS_OBJECTS_H diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc index 0bded16d96b..4c591ea9721 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h index f786bfe0b9b..ab3cde380de 100644 --- a/src/core/ext/filters/load_reporting/server_load_reporting_filter.h +++ b/src/core/ext/filters/load_reporting/server_load_reporting_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H #define GRPC_CORE_EXT_FILTERS_LOAD_REPORTING_SERVER_LOAD_REPORTING_FILTER_H diff --git a/src/core/ext/filters/message_size/message_size_filter.cc b/src/core/ext/filters/message_size/message_size_filter.cc index e2fa9d3131b..53adae03d27 100644 --- a/src/core/ext/filters/message_size/message_size_filter.cc +++ b/src/core/ext/filters/message_size/message_size_filter.cc @@ -210,11 +210,11 @@ static void recv_message_ready(void* user_data, grpc_error_handle error) { grpc_closure* closure = calld->next_recv_message_ready; calld->next_recv_message_ready = nullptr; if (calld->seen_recv_trailing_metadata) { - /* We might potentially see another RECV_MESSAGE op. In that case, we do not - * want to run the recv_trailing_metadata_ready closure again. The newer - * RECV_MESSAGE op cannot cause any errors since the transport has already - * invoked the recv_trailing_metadata_ready closure and all further - * RECV_MESSAGE ops will get null payloads. */ + // We might potentially see another RECV_MESSAGE op. In that case, we do not + // want to run the recv_trailing_metadata_ready closure again. The newer + // RECV_MESSAGE op cannot cause any errors since the transport has already + // invoked the recv_trailing_metadata_ready closure and all further + // RECV_MESSAGE ops will get null payloads. calld->seen_recv_trailing_metadata = false; GRPC_CALL_COMBINER_START(calld->call_combiner, &calld->recv_trailing_metadata_ready, diff --git a/src/core/ext/filters/message_size/message_size_filter.h b/src/core/ext/filters/message_size/message_size_filter.h index e6b90ba9f9d..a4c7021cef2 100644 --- a/src/core/ext/filters/message_size/message_size_filter.h +++ b/src/core/ext/filters/message_size/message_size_filter.h @@ -87,4 +87,4 @@ absl::optional GetMaxSendSizeFromChannelArgs(const ChannelArgs& args); } // namespace grpc_core -#endif /* GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H */ +#endif // GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H diff --git a/src/core/ext/transport/binder/transport/binder_transport.cc b/src/core/ext/transport/binder/transport/binder_transport.cc index b18f5595b66..6cb1e091c50 100644 --- a/src/core/ext/transport/binder/transport/binder_transport.cc +++ b/src/core/ext/transport/binder/transport/binder_transport.cc @@ -728,7 +728,7 @@ grpc_binder_transport::grpc_binder_transport( GRPC_BINDER_REF_TRANSPORT(this, "wire reader"); wire_reader = grpc_core::MakeOrphanable( transport_stream_receiver, is_client, security_policy, - /*on_destruct_callback=*/ + // on_destruct_callback= [this] { // Unref transport when destructed. GRPC_BINDER_UNREF_TRANSPORT(this, "wire reader"); diff --git a/src/core/ext/transport/binder/transport/binder_transport.h b/src/core/ext/transport/binder/transport/binder_transport.h index 9205886701f..93a2034d758 100644 --- a/src/core/ext/transport/binder/transport/binder_transport.h +++ b/src/core/ext/transport/binder/transport/binder_transport.h @@ -57,7 +57,7 @@ struct grpc_binder_transport { return next_free_tx_code++; } - grpc_transport base; /* must be first */ + grpc_transport base; // must be first std::shared_ptr transport_stream_receiver; diff --git a/src/core/ext/transport/binder/utils/binder_auto_utils.h b/src/core/ext/transport/binder/utils/binder_auto_utils.h index 2317b5b1d41..c6ae0ba85cd 100644 --- a/src/core/ext/transport/binder/utils/binder_auto_utils.h +++ b/src/core/ext/transport/binder/utils/binder_auto_utils.h @@ -24,10 +24,10 @@ namespace grpc_binder { namespace ndk_util { -/** - * Represents one strong pointer to an AIBinder object. - * Copied from binder/ndk/include_cpp/android/binder_auto_utils.h - */ +/// +/// Represents one strong pointer to an AIBinder object. +/// Copied from binder/ndk/include_cpp/android/binder_auto_utils.h +/// class SpAIBinder { public: SpAIBinder() : mBinder(nullptr) {} diff --git a/src/core/ext/transport/binder/utils/ndk_binder.h b/src/core/ext/transport/binder/utils/ndk_binder.h index 25ebb80c46a..a4279e92d43 100644 --- a/src/core/ext/transport/binder/utils/ndk_binder.h +++ b/src/core/ext/transport/binder/utils/ndk_binder.h @@ -102,6 +102,6 @@ jobject AIBinder_toJavaBinder(JNIEnv* env, AIBinder* binder); } // namespace grpc_binder -#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/ +#endif // GPR_SUPPORT_BINDER_TRANSPORT #endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H diff --git a/src/core/ext/transport/binder/wire_format/binder_android.h b/src/core/ext/transport/binder/wire_format/binder_android.h index eec77218bba..dda59826532 100644 --- a/src/core/ext/transport/binder/wire_format/binder_android.h +++ b/src/core/ext/transport/binder/wire_format/binder_android.h @@ -117,6 +117,6 @@ class TransactionReceiverAndroid final : public TransactionReceiver { } // namespace grpc_binder -#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/ +#endif // GPR_SUPPORT_BINDER_TRANSPORT #endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H diff --git a/src/core/ext/transport/chttp2/alpn/alpn.cc b/src/core/ext/transport/chttp2/alpn/alpn.cc index 33f762760a8..f02249c0b8a 100644 --- a/src/core/ext/transport/chttp2/alpn/alpn.cc +++ b/src/core/ext/transport/chttp2/alpn/alpn.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -24,7 +24,7 @@ #include "src/core/lib/gpr/useful.h" -/* in order of preference */ +// in order of preference static const char* const supported_versions[] = {"grpc-exp", "h2"}; int grpc_chttp2_is_alpn_version_supported(const char* version, size_t size) { diff --git a/src/core/ext/transport/chttp2/alpn/alpn.h b/src/core/ext/transport/chttp2/alpn/alpn.h index e2ffe4e405e..64dc56e5d2c 100644 --- a/src/core/ext/transport/chttp2/alpn/alpn.h +++ b/src/core/ext/transport/chttp2/alpn/alpn.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H @@ -23,14 +23,14 @@ #include -/* Returns 1 if the version is supported, 0 otherwise. */ +// Returns 1 if the version is supported, 0 otherwise. int grpc_chttp2_is_alpn_version_supported(const char* version, size_t size); -/* Returns the number of protocol versions to advertise */ +// Returns the number of protocol versions to advertise size_t grpc_chttp2_num_alpn_versions(void); -/* Returns the protocol version at index i (0 <= i < - * grpc_chttp2_num_alpn_versions()) */ +// Returns the protocol version at index i (0 <= i < +// grpc_chttp2_num_alpn_versions()) const char* grpc_chttp2_get_alpn_version_index(size_t i); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_ALPN_ALPN_H diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/src/core/ext/transport/chttp2/client/chttp2_connector.cc index 3d95f641063..6f701c8a0be 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.cc +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/client/chttp2_connector.h b/src/core/ext/transport/chttp2/client/chttp2_connector.h index 72587d53423..026f4d54cdd 100644 --- a/src/core/ext/transport/chttp2/client/chttp2_connector.h +++ b/src/core/ext/transport/chttp2/client/chttp2_connector.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H @@ -80,4 +80,4 @@ class Chttp2Connector : public SubchannelConnector { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index e8ffc717f33..714c4150e02 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -759,7 +759,7 @@ Chttp2ServerListener::~Chttp2ServerListener() { } } -/* Server callback: start listening on our ports */ +// Server callback: start listening on our ports void Chttp2ServerListener::Start( Server* /*server*/, const std::vector* /* pollsets */) { if (server_->config_fetcher() != nullptr) { @@ -866,8 +866,8 @@ void Chttp2ServerListener::TcpServerShutdownComplete( delete self; } -/* Server callback: destroy the tcp listener (so we don't generate further - callbacks) */ +// Server callback: destroy the tcp listener (so we don't generate further +// callbacks) void Chttp2ServerListener::Orphan() { // Cancel the watch before shutting down so as to avoid holding a ref to the // listener in the watcher. @@ -1067,7 +1067,7 @@ void grpc_server_add_channel_from_fd(grpc_server* server, int fd, grpc_event_engine::experimental::ChannelArgsEndpointConfig(server_args), name); grpc_transport* transport = grpc_create_chttp2_transport( - server_args, server_endpoint, false /* is_client */ + server_args, server_endpoint, false // is_client ); grpc_error_handle error = core_server->SetupTransport(transport, nullptr, server_args, nullptr); diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.h b/src/core/ext/transport/chttp2/server/chttp2_server.h index 5db3a4f440f..1e1b7d4325b 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.h +++ b/src/core/ext/transport/chttp2/server/chttp2_server.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H @@ -44,4 +44,4 @@ grpc_error_handle Chttp2ServerAddPort( } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_SERVER_CHTTP2_SERVER_H diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.cc b/src/core/ext/transport/chttp2/transport/bin_decoder.cc index 8291778f7de..be22231b074 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.cc +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/ext/transport/chttp2/transport/bin_decoder.h b/src/core/ext/transport/chttp2/transport/bin_decoder.h index e494b46f209..c52ad1fe9cb 100644 --- a/src/core/ext/transport/chttp2/transport/bin_decoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_decoder.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H @@ -27,32 +27,32 @@ #include struct grpc_base64_decode_context { - /* input/output: */ + // input/output: const uint8_t* input_cur; const uint8_t* input_end; uint8_t* output_cur; uint8_t* output_end; - /* Indicate if the decoder should handle the tail of input data*/ + // Indicate if the decoder should handle the tail of input data bool contains_tail; }; -/* base64 decode a grpc_base64_decode_context util either input_end is reached - or output_end is reached. When input_end is reached, (input_end - input_cur) - is less than 4. When output_end is reached, (output_end - output_cur) is less - than 3. Returns false if decoding is failed. */ +// base64 decode a grpc_base64_decode_context util either input_end is reached +// or output_end is reached. When input_end is reached, (input_end - input_cur) +// is less than 4. When output_end is reached, (output_end - output_cur) is less +// than 3. Returns false if decoding is failed. bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx); -/* base64 decode a slice with pad chars. Returns a new slice, does not take - ownership of the input. Returns an empty slice if decoding is failed. */ +// base64 decode a slice with pad chars. Returns a new slice, does not take +// ownership of the input. Returns an empty slice if decoding is failed. grpc_slice grpc_chttp2_base64_decode(const grpc_slice& input); -/* base64 decode a slice without pad chars, data length is needed. Returns a new - slice, does not take ownership of the input. Returns an empty slice if - decoding is failed. */ +// base64 decode a slice without pad chars, data length is needed. Returns a new +// slice, does not take ownership of the input. Returns an empty slice if +// decoding is failed. grpc_slice grpc_chttp2_base64_decode_with_length(const grpc_slice& input, size_t output_length); -/* Infer the length of decoded data from encoded data. */ +// Infer the length of decoded data from encoded data. size_t grpc_chttp2_base64_infer_length_after_decode(const grpc_slice& slice); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_DECODER_H diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.cc b/src/core/ext/transport/chttp2/transport/bin_encoder.cc index 248d89c1da2..272907bf5ae 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -59,7 +59,7 @@ grpc_slice grpc_chttp2_base64_encode(const grpc_slice& input) { char* out = reinterpret_cast GRPC_SLICE_START_PTR(output); size_t i; - /* encode full triplets */ + // encode full triplets for (i = 0; i < input_triplets; i++) { out[0] = alphabet[in[0] >> 2]; out[1] = alphabet[((in[0] & 0x3) << 4) | (in[1] >> 4)]; @@ -69,7 +69,7 @@ grpc_slice grpc_chttp2_base64_encode(const grpc_slice& input) { in += 3; } - /* encode the remaining bytes */ + // encode the remaining bytes switch (tail_case) { case 0: break; @@ -123,10 +123,10 @@ grpc_slice grpc_chttp2_huffman_compress(const grpc_slice& input) { } if (temp_length) { - /* NB: the following integer arithmetic operation needs to be in its - * expanded form due to the "integral promotion" performed (see section - * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type - * is then required to avoid the compiler warning */ + // NB: the following integer arithmetic operation needs to be in its + // expanded form due to the "integral promotion" performed (see section + // 3.2.1.1 of the C89 draft standard). A cast to the smaller container type + // is then required to avoid the compiler warning *out++ = static_cast(static_cast(temp << (8u - temp_length)) | static_cast(0xffu >> temp_length)); @@ -184,7 +184,7 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress( out.temp_length = 0; out.out = start_out; - /* encode full triplets */ + // encode full triplets for (i = 0; i < input_triplets; i++) { const uint8_t low_to_high = static_cast((in[0] & 0x3) << 4); const uint8_t high_to_low = in[1] >> 4; @@ -196,7 +196,7 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress( in += 3; } - /* encode the remaining bytes */ + // encode the remaining bytes switch (tail_case) { case 0: break; @@ -215,10 +215,10 @@ grpc_slice grpc_chttp2_base64_encode_and_huffman_compress( } if (out.temp_length) { - /* NB: the following integer arithmetic operation needs to be in its - * expanded form due to the "integral promotion" performed (see section - * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type - * is then required to avoid the compiler warning */ + // NB: the following integer arithmetic operation needs to be in its + // expanded form due to the "integral promotion" performed (see section + // 3.2.1.1 of the C89 draft standard). A cast to the smaller container type + // is then required to avoid the compiler warning *out.out++ = static_cast( static_cast(out.temp << (8u - out.temp_length)) | static_cast(0xffu >> out.temp_length)); diff --git a/src/core/ext/transport/chttp2/transport/bin_encoder.h b/src/core/ext/transport/chttp2/transport/bin_encoder.h index 03970dff420..dd1b0c2590e 100644 --- a/src/core/ext/transport/chttp2/transport/bin_encoder.h +++ b/src/core/ext/transport/chttp2/transport/bin_encoder.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H @@ -23,20 +23,20 @@ #include -/* base64 encode a slice. Returns a new slice, does not take ownership of the - input */ +// base64 encode a slice. Returns a new slice, does not take ownership of the +// input grpc_slice grpc_chttp2_base64_encode(const grpc_slice& input); -/* Compress a slice with the static huffman encoder detailed in the hpack - standard. Returns a new slice, does not take ownership of the input */ +// Compress a slice with the static huffman encoder detailed in the hpack +// standard. Returns a new slice, does not take ownership of the input grpc_slice grpc_chttp2_huffman_compress(const grpc_slice& input); -/* equivalent to: - grpc_slice x = grpc_chttp2_base64_encode(input); - grpc_slice y = grpc_chttp2_huffman_compress(x); - grpc_core::CSliceUnref( x); - return y; */ +// equivalent to: +// grpc_slice x = grpc_chttp2_base64_encode(input); +// grpc_slice y = grpc_chttp2_huffman_compress(x); +// grpc_core::CSliceUnref( x); +// return y; grpc_slice grpc_chttp2_base64_encode_and_huffman_compress( const grpc_slice& input); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_BIN_ENCODER_H diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index b0008496505..7e9928dfd77 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -98,13 +98,13 @@ #define DEFAULT_MAX_HEADER_LIST_SIZE (8 * 1024) #define DEFAULT_CLIENT_KEEPALIVE_TIME_MS INT_MAX -#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 /* 20 seconds */ -#define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000 /* 2 hours */ -#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000 /* 20 seconds */ +#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 // 20 seconds +#define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000 // 2 hours +#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000 // 20 seconds #define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS false #define KEEPALIVE_TIME_BACKOFF_MULTIPLIER 2 -#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS 300000 /* 5 minutes */ +#define DEFAULT_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS 300000 // 5 minutes #define DEFAULT_MAX_PINGS_BETWEEN_DATA 2 #define DEFAULT_MAX_PING_STRIKES 2 @@ -2178,8 +2178,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s, status_hdr = GRPC_SLICE_MALLOC(15 + (grpc_status >= 10)); p = GRPC_SLICE_START_PTR(status_hdr); - *p++ = 0x00; /* literal header, not indexed */ - *p++ = 11; /* len(grpc-status) */ + *p++ = 0x00; // literal header, not indexed + *p++ = 11; // len(grpc-status) *p++ = 'g'; *p++ = 'r'; *p++ = 'p'; @@ -2207,8 +2207,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_core::VarintWriter<1> msg_len_writer(static_cast(msg_len)); message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length()); p = GRPC_SLICE_START_PTR(message_pfx); - *p++ = 0x00; /* literal header, not indexed */ - *p++ = 12; /* len(grpc-message) */ + *p++ = 0x00; // literal header, not indexed + *p++ = 12; // len(grpc-message) *p++ = 'g'; *p++ = 'r'; *p++ = 'p'; @@ -2983,7 +2983,7 @@ void grpc_chttp2_transport_start_reading( grpc_chttp2_transport* t = reinterpret_cast(transport); GRPC_CHTTP2_REF_TRANSPORT( - t, "reading_action"); /* matches unref inside reading_action */ + t, "reading_action"); // matches unref inside reading_action if (read_buffer != nullptr) { grpc_slice_buffer_move_into(read_buffer, &t->read_buffer); gpr_free(read_buffer); diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/src/core/ext/transport/chttp2/transport/chttp2_transport.h index fac9410364c..5f2523c4a1f 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.h +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H @@ -73,4 +73,4 @@ void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification( bool disable); } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CHTTP2_TRANSPORT_H diff --git a/src/core/ext/transport/chttp2/transport/context_list.cc b/src/core/ext/transport/chttp2/transport/context_list.cc index d714c34c93e..1f729b56954 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.cc +++ b/src/core/ext/transport/chttp2/transport/context_list.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -36,7 +36,7 @@ void ContextList::Append(ContextList** head, grpc_chttp2_stream* s) { write_timestamps_callback_g == nullptr) { return; } - /* Create a new element in the list and add it at the front */ + // Create a new element in the list and add it at the front ContextList* elem = new ContextList(); elem->trace_context_ = get_copied_context_fn_g(s->context); elem->byte_offset_ = s->byte_counter; @@ -68,4 +68,4 @@ void grpc_http2_set_write_timestamps_callback( void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*)) { get_copied_context_fn_g = fn; } -} /* namespace grpc_core */ +} // namespace grpc_core diff --git a/src/core/ext/transport/chttp2/transport/context_list.h b/src/core/ext/transport/chttp2/transport/context_list.h index db8e33ae85d..61df593ce31 100644 --- a/src/core/ext/transport/chttp2/transport/context_list.h +++ b/src/core/ext/transport/chttp2/transport/context_list.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CONTEXT_LIST_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CONTEXT_LIST_H @@ -28,16 +28,16 @@ #include "src/core/lib/iomgr/error.h" namespace grpc_core { -/** A list of RPC Contexts */ +/// A list of RPC Contexts class ContextList { public: - /* Creates a new element with \a context as the value and appends it to the - * list. */ + // Creates a new element with \a context as the value and appends it to the + // list. static void Append(ContextList** head, grpc_chttp2_stream* s); - /* Executes a function \a fn with each context in the list and \a ts. It also - * frees up the entire list after this operation. It is intended as a callback - * and hence does not take a ref on \a error */ + // Executes a function \a fn with each context in the list and \a ts. It also + // frees up the entire list after this operation. It is intended as a callback + // and hence does not take a ref on \a error static void Execute(void* arg, Timestamps* ts, grpc_error_handle error); private: @@ -49,6 +49,6 @@ class ContextList { void grpc_http2_set_write_timestamps_callback( void (*fn)(void*, Timestamps*, grpc_error_handle error)); void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*)); -} /* namespace grpc_core */ +} // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CONTEXT_LIST_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_CONTEXT_LIST_H diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index e1c26124bc5..be1db630299 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h index e4d71d2e133..ce6bac4ba3f 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.h +++ b/src/core/ext/transport/chttp2/transport/flow_control.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H @@ -291,23 +291,23 @@ class TransportFlowControl final { MemoryOwner* const memory_owner_; - /** calculating what we should give for local window: - we track the total amount of flow control over initial window size - across all streams: this is data that we want to receive right now (it - has an outstanding read) - and the total amount of flow control under initial window size across all - streams: this is data we've read early - we want to adjust incoming_window such that: - incoming_window = total_over - max(bdp - total_under, 0) */ + /// calculating what we should give for local window: + /// we track the total amount of flow control over initial window size + /// across all streams: this is data that we want to receive right now (it + /// has an outstanding read) + /// and the total amount of flow control under initial window size across all + /// streams: this is data we've read early + /// we want to adjust incoming_window such that: + /// incoming_window = total_over - max(bdp - total_under, 0) int64_t announced_stream_total_over_incoming_window_ = 0; - /** should we probe bdp? */ + /// should we probe bdp? const bool enable_bdp_probe_; - /* bdp estimation */ + // bdp estimation BdpEstimator bdp_estimator_; - /* pid controller */ + // pid controller PidController pid_controller_; Timestamp last_pid_update_; diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h index fa5d74a8ec3..e1463173b30 100644 --- a/src/core/ext/transport/chttp2/transport/frame.h +++ b/src/core/ext/transport/chttp2/transport/frame.h @@ -1,27 +1,27 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H #include -/* defined in internal.h */ +// defined in internal.h typedef struct grpc_chttp2_stream grpc_chttp2_stream; typedef struct grpc_chttp2_transport grpc_chttp2_transport; @@ -40,4 +40,4 @@ typedef struct grpc_chttp2_transport grpc_chttp2_transport; #define GRPC_CHTTP2_DATA_FLAG_PADDED 8 #define GRPC_CHTTP2_FLAG_HAS_PRIORITY 0x20 -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_H diff --git a/src/core/ext/transport/chttp2/transport/frame_data.cc b/src/core/ext/transport/chttp2/transport/frame_data.cc index 31b368fcef8..0cead5912de 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.cc +++ b/src/core/ext/transport/chttp2/transport/frame_data.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h index e79a6beee4b..d23e408736a 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.h +++ b/src/core/ext/transport/chttp2/transport/frame_data.h @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H -/* Parser for GRPC streams embedded in DATA frames */ +// Parser for GRPC streams embedded in DATA frames #include @@ -35,13 +35,13 @@ #include "src/core/lib/slice/slice_buffer.h" #include "src/core/lib/transport/transport.h" -/* start processing a new data frame */ +// start processing a new data frame absl::Status grpc_chttp2_data_parser_begin_frame(uint8_t flags, uint32_t stream_id, grpc_chttp2_stream* s); -/* handle a slice of a data frame - is_last indicates the last slice of a - frame */ +// handle a slice of a data frame - is_last indicates the last slice of a +// frame grpc_error_handle grpc_chttp2_data_parser_parse(void* parser, grpc_chttp2_transport* t, grpc_chttp2_stream* s, @@ -57,4 +57,4 @@ grpc_core::Poll grpc_deframe_unprocessed_incoming_frames( grpc_chttp2_stream* s, int64_t* min_progress_size, grpc_core::SliceBuffer* stream_out, uint32_t* message_flags); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/src/core/ext/transport/chttp2/transport/frame_goaway.cc index 701353d3b49..e7d1c558d4f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.cc +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -161,25 +161,25 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code, GPR_ASSERT(GRPC_SLICE_LENGTH(debug_data) < UINT32_MAX - 4 - 4); frame_length = 4 + 4 + static_cast GRPC_SLICE_LENGTH(debug_data); - /* frame header: length */ + // frame header: length *p++ = static_cast(frame_length >> 16); *p++ = static_cast(frame_length >> 8); *p++ = static_cast(frame_length); - /* frame header: type */ + // frame header: type *p++ = GRPC_CHTTP2_FRAME_GOAWAY; - /* frame header: flags */ + // frame header: flags *p++ = 0; - /* frame header: stream id */ + // frame header: stream id *p++ = 0; *p++ = 0; *p++ = 0; *p++ = 0; - /* payload: last stream id */ + // payload: last stream id *p++ = static_cast(last_stream_id >> 24); *p++ = static_cast(last_stream_id >> 16); *p++ = static_cast(last_stream_id >> 8); *p++ = static_cast(last_stream_id); - /* payload: error code */ + // payload: error code *p++ = static_cast(error_code >> 24); *p++ = static_cast(error_code >> 16); *p++ = static_cast(error_code >> 8); diff --git a/src/core/ext/transport/chttp2/transport/frame_goaway.h b/src/core/ext/transport/chttp2/transport/frame_goaway.h index cc86146b761..46c226da366 100644 --- a/src/core/ext/transport/chttp2/transport/frame_goaway.h +++ b/src/core/ext/transport/chttp2/transport/frame_goaway.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H @@ -62,4 +62,4 @@ void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code, const grpc_slice& debug_data, grpc_slice_buffer* slice_buffer); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.cc b/src/core/ext/transport/chttp2/transport/frame_ping.cc index 2e01f860ec4..4f25f46e23f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.cc +++ b/src/core/ext/transport/chttp2/transport/frame_ping.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -102,9 +102,9 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, if (t->keepalive_permit_without_calls == 0 && grpc_chttp2_stream_map_size(&t->stream_map) == 0) { - /* According to RFC1122, the interval of TCP Keep-Alive is default to - no less than two hours. When there is no outstanding streams, we - restrict the number of PINGS equivalent to TCP Keep-Alive. */ + // According to RFC1122, the interval of TCP Keep-Alive is default to + // no less than two hours. When there is no outstanding streams, we + // restrict the number of PINGS equivalent to TCP Keep-Alive. next_allowed_ping = t->ping_recv_state.last_ping_recv_time + grpc_core::Duration::Hours(2); } diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.h b/src/core/ext/transport/chttp2/transport/frame_ping.h index 46ed6bcd757..e4598073fcd 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.h +++ b/src/core/ext/transport/chttp2/transport/frame_ping.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H @@ -43,7 +43,7 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser, const grpc_slice& slice, int is_last); -/* Test-only function for disabling ping ack */ +// Test-only function for disabling ping ack void grpc_set_disable_ping_ack(bool disable_ping_ack); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_PING_H diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc index 3568f8880b2..f915b5fda1d 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h index 840e71e3abc..2442e88c0e3 100644 --- a/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +++ b/src/core/ext/transport/chttp2/transport/frame_rst_stream.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H @@ -51,4 +51,4 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser, const grpc_slice& slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.cc b/src/core/ext/transport/chttp2/transport/frame_settings.cc index c92b87bd9d2..3731d0778ea 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.cc +++ b/src/core/ext/transport/chttp2/transport/frame_settings.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/frame_settings.h b/src/core/ext/transport/chttp2/transport/frame_settings.h index 5616a11e005..2b854d39ee3 100644 --- a/src/core/ext/transport/chttp2/transport/frame_settings.h +++ b/src/core/ext/transport/chttp2/transport/frame_settings.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H @@ -47,11 +47,11 @@ struct grpc_chttp2_settings_parser { uint32_t value; uint32_t incoming_settings[GRPC_CHTTP2_NUM_SETTINGS]; }; -/* Create a settings frame by diffing old & new, and updating old to be new */ +// Create a settings frame by diffing old & new, and updating old to be new grpc_slice grpc_chttp2_settings_create(uint32_t* old_settings, const uint32_t* new_settings, uint32_t force_mask, size_t count); -/* Create an ack settings frame */ +// Create an ack settings frame grpc_slice grpc_chttp2_settings_ack_create(void); grpc_error_handle grpc_chttp2_settings_parser_begin_frame( @@ -63,4 +63,4 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* parser, const grpc_slice& slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/src/core/ext/transport/chttp2/transport/frame_window_update.cc index 7ea6a71cb5e..87dac6aaa92 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.cc +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/frame_window_update.h b/src/core/ext/transport/chttp2/transport/frame_window_update.h index 05dee14f3fa..5cd5cf4b1a4 100644 --- a/src/core/ext/transport/chttp2/transport/frame_window_update.h +++ b/src/core/ext/transport/chttp2/transport/frame_window_update.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H @@ -43,4 +43,4 @@ grpc_error_handle grpc_chttp2_window_update_parser_parse( void* parser, grpc_chttp2_transport* t, grpc_chttp2_stream* s, const grpc_slice& slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index d45fa2a5e9a..5f6ff3f1252 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -43,24 +43,24 @@ namespace { constexpr size_t kDataFrameHeaderSize = 9; -} /* namespace */ +} // namespace -/* fills p (which is expected to be kDataFrameHeaderSize bytes long) - * with a data frame header */ +// fills p (which is expected to be kDataFrameHeaderSize bytes long) +// with a data frame header static void FillHeader(uint8_t* p, uint8_t type, uint32_t id, size_t len, uint8_t flags) { - /* len is the current frame size (i.e. for the frame we're finishing). - We finish a frame if: - 1) We called ensure_space(), (i.e. add_tiny_header_data()) and adding - 'need_bytes' to the frame would cause us to exceed max_frame_size. - 2) We called add_header_data, and adding the slice would cause us to exceed - max_frame_size. - 3) We're done encoding the header. - - Thus, len is always <= max_frame_size. - max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE, - which has a max allowable value of 16777215 (see chttp_transport.cc). - Thus, the following assert can be a debug assert. */ + // len is the current frame size (i.e. for the frame we're finishing). + // We finish a frame if: + // 1) We called ensure_space(), (i.e. add_tiny_header_data()) and adding + // 'need_bytes' to the frame would cause us to exceed max_frame_size. + // 2) We called add_header_data, and adding the slice would cause us to exceed + // max_frame_size. + // 3) We're done encoding the header. + + // Thus, len is always <= max_frame_size. + // max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE, + // which has a max allowable value of 16777215 (see chttp_transport.cc). + // Thus, the following assert can be a debug assert. GPR_DEBUG_ASSERT(len <= 16777216); *p++ = static_cast(len >> 16); *p++ = static_cast(len >> 8); @@ -137,7 +137,7 @@ static WireValue GetWireValue(Slice value, bool true_binary_enabled, value.c_slice()))); } } else { - /* TODO(ctiller): opportunistically compress non-binary headers */ + // TODO(ctiller): opportunistically compress non-binary headers return WireValue(0x00, false, std::move(value)); } } diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index 5a0e8f1c81a..871c4401ed4 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H @@ -214,4 +214,4 @@ class HPackCompressor { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc index 02e7526f428..f8916ca2372 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -56,12 +56,12 @@ namespace grpc_core { TraceFlag grpc_trace_chttp2_hpack_parser(false, "chttp2_hpack_parser"); -/* state table for huffman decoding: given a state, gives an index/16 into - next_sub_tbl. Taking that index and adding the value of the nibble being - considered returns the next state. - generated by gen_hpack_tables.c - TODO(ctiller): remove once the new_hpack_huffman_decoder experiment is - complete. */ +// state table for huffman decoding: given a state, gives an index/16 into +// next_sub_tbl. Taking that index and adding the value of the nibble being +// considered returns the next state. +// generated by gen_hpack_tables.c +// TODO(ctiller): remove once the new_hpack_huffman_decoder experiment is +// complete. static const uint8_t next_tbl[256] = { 0, 1, 2, 3, 4, 1, 2, 5, 6, 1, 7, 8, 1, 3, 3, 9, 10, 11, 1, 1, 1, 12, 1, 2, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, @@ -78,8 +78,8 @@ static const uint8_t next_tbl[256] = { 3, 3, 3, 45, 46, 1, 1, 2, 2, 2, 35, 3, 3, 18, 47, 2, }; -/* next state, based upon current state and the current nibble: see above. - generated by gen_hpack_tables.c */ +// next state, based upon current state and the current nibble: see above. +// generated by gen_hpack_tables.c static const int16_t next_sub_tbl[48 * 16] = { 1, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 2, 6, 10, 13, 14, 15, 16, 17, 2, 6, 10, 13, 14, 15, @@ -135,9 +135,9 @@ static const int16_t next_sub_tbl[48 * 16] = { 0, 0, 255, }; -/* emission table: indexed like next_tbl, ultimately gives the byte to be - emitted, or -1 for no byte, or 256 for end of stream - generated by gen_hpack_tables.c */ +// emission table: indexed like next_tbl, ultimately gives the byte to be +// emitted, or -1 for no byte, or 256 for end of stream +// generated by gen_hpack_tables.c static const uint16_t emit_tbl[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 23, 24, 25, 26, 27, @@ -159,7 +159,7 @@ static const uint16_t emit_tbl[256] = { 248, }; -/* generated by gen_hpack_tables.c */ +// generated by gen_hpack_tables.c static const int16_t emit_sub_tbl[249 * 16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, @@ -1263,7 +1263,7 @@ Slice HPackParser::String::Take() { GPR_UNREACHABLE_CODE(return Slice()); } -/* PUBLIC INTERFACE */ +// PUBLIC INTERFACE HPackParser::HPackParser() = default; diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.h b/src/core/ext/transport/chttp2/transport/hpack_parser.h index d01b6061f5b..230b0587aae 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H @@ -131,12 +131,12 @@ class HPackParser { } // namespace grpc_core -/* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for - the transport */ +// wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for +// the transport grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser, grpc_chttp2_transport* t, grpc_chttp2_stream* s, const grpc_slice& slice, int is_last); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc index 6ddcb455000..dc210e359fb 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -78,7 +78,7 @@ void HPackTable::MementoRingBuffer::Rebuild(uint32_t max_entries) { entries_.swap(entries); } -/* Evict one element from the table */ +// Evict one element from the table void HPackTable::EvictOne() { auto first_entry = entries_.PopOne(); GPR_ASSERT(first_entry.transport_size() <= mem_used_); diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h index a1b0733655b..c9c71f01a2e 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser_table.h +++ b/src/core/ext/transport/chttp2/transport/hpack_parser_table.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H @@ -134,4 +134,4 @@ class HPackTable { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.cc b/src/core/ext/transport/chttp2/transport/http2_settings.cc index 4fdd8519629..d966a7aebea 100644 --- a/src/core/ext/transport/chttp2/transport/http2_settings.cc +++ b/src/core/ext/transport/chttp2/transport/http2_settings.cc @@ -1,22 +1,22 @@ -/* - * 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. - */ +// +// 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. +// -/* - * Automatically generated by tools/codegen/core/gen_settings_ids.py - */ +// +// Automatically generated by tools/codegen/core/gen_settings_ids.py +// #include diff --git a/src/core/ext/transport/chttp2/transport/http2_settings.h b/src/core/ext/transport/chttp2/transport/http2_settings.h index 9e5329341fa..1336cda1617 100644 --- a/src/core/ext/transport/chttp2/transport/http2_settings.h +++ b/src/core/ext/transport/chttp2/transport/http2_settings.h @@ -1,22 +1,22 @@ -/* - * 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. - */ - -/* - * Automatically generated by tools/codegen/core/gen_settings_ids.py - */ +// +// 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. +// + +// +// Automatically generated by tools/codegen/core/gen_settings_ids.py +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H @@ -26,15 +26,15 @@ #include typedef enum { - GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0, /* wire id 1 */ - GRPC_CHTTP2_SETTINGS_ENABLE_PUSH = 1, /* wire id 2 */ - GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 2, /* wire id 3 */ - GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 3, /* wire id 4 */ - GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE = 4, /* wire id 5 */ - GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 5, /* wire id 6 */ - GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA = 6, /* wire id 65027 */ + GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0, // wire id 1 + GRPC_CHTTP2_SETTINGS_ENABLE_PUSH = 1, // wire id 2 + GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 2, // wire id 3 + GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 3, // wire id 4 + GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE = 4, // wire id 5 + GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 5, // wire id 6 + GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA = 6, // wire id 65027 GRPC_CHTTP2_SETTINGS_GRPC_PREFERRED_RECEIVE_CRYPTO_FRAME_SIZE = - 7, /* wire id 65028 */ + 7, // wire id 65028 } grpc_chttp2_setting_id; #define GRPC_CHTTP2_NUM_SETTINGS 8 @@ -59,4 +59,4 @@ typedef struct { extern const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS]; -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H diff --git a/src/core/ext/transport/chttp2/transport/huffsyms.cc b/src/core/ext/transport/chttp2/transport/huffsyms.cc index 813e4c91b19..32f451e3913 100644 --- a/src/core/ext/transport/chttp2/transport/huffsyms.cc +++ b/src/core/ext/transport/chttp2/transport/huffsyms.cc @@ -1,28 +1,28 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include "src/core/ext/transport/chttp2/transport/huffsyms.h" -/* Constants pulled from the HPACK spec, and converted to C using the vim - command: - :%s/.* \([0-9a-f]\+\) \[ *\([0-9]\+\)\]/{0x\1, \2},/g */ +// Constants pulled from the HPACK spec, and converted to C using the vim +// command: +// :%s/.* \([0-9a-f]\+\) \[ *\([0-9]\+\)\]/{0x\1, \2},/g const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS] = { {0x1ff8, 13}, {0x7fffd8, 23}, {0xfffffe2, 28}, {0xfffffe3, 28}, {0xfffffe4, 28}, {0xfffffe5, 28}, {0xfffffe6, 28}, {0xfffffe7, 28}, diff --git a/src/core/ext/transport/chttp2/transport/huffsyms.h b/src/core/ext/transport/chttp2/transport/huffsyms.h index 49feb238f10..ed38db33c97 100644 --- a/src/core/ext/transport/chttp2/transport/huffsyms.h +++ b/src/core/ext/transport/chttp2/transport/huffsyms.h @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H -/* HPACK static huffman table */ +// HPACK static huffman table #define GRPC_CHTTP2_NUM_HUFFSYMS 257 @@ -29,4 +29,4 @@ struct grpc_chttp2_huffsym { }; extern const grpc_chttp2_huffsym grpc_chttp2_huffsyms[GRPC_CHTTP2_NUM_HUFFSYMS]; -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HUFFSYMS_H diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 8f6f8abb084..f29f3f254ed 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H @@ -72,21 +72,21 @@ namespace grpc_core { class ContextList; } -/* streams are kept in various linked lists depending on what things need to - happen to them... this enum labels each list */ +// streams are kept in various linked lists depending on what things need to +// happen to them... this enum labels each list typedef enum { - /* If a stream is in the following two lists, an explicit ref is associated - with the stream */ + // If a stream is in the following two lists, an explicit ref is associated + // with the stream GRPC_CHTTP2_LIST_WRITABLE, GRPC_CHTTP2_LIST_WRITING, - /* No additional ref is taken for the following refs. Make sure to remove the - stream from these lists when the stream is removed. */ + // No additional ref is taken for the following refs. Make sure to remove the + // stream from these lists when the stream is removed. GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT, GRPC_CHTTP2_LIST_STALLED_BY_STREAM, - /** streams that are waiting to start because there are too many concurrent - streams on the connection */ + /// streams that are waiting to start because there are too many concurrent + /// streams on the connection GRPC_CHTTP2_LIST_WAITING_FOR_CONCURRENCY, - STREAM_LIST_COUNT /* must be last */ + STREAM_LIST_COUNT // must be last } grpc_chttp2_stream_list_id; typedef enum { @@ -104,7 +104,7 @@ typedef enum { GRPC_CHTTP2_PCL_INITIATE = 0, GRPC_CHTTP2_PCL_NEXT, GRPC_CHTTP2_PCL_INFLIGHT, - GRPC_CHTTP2_PCL_COUNT /* must be last */ + GRPC_CHTTP2_PCL_COUNT // must be last } grpc_chttp2_ping_closure_list; typedef enum { @@ -154,9 +154,9 @@ struct grpc_chttp2_server_ping_recv_state { grpc_core::Timestamp last_ping_recv_time; int ping_strikes; }; -/* deframer state for the overall http2 stream of bytes */ +// deframer state for the overall http2 stream of bytes typedef enum { - /* prefix: one entry per http2 connection prefix byte */ + // prefix: one entry per http2 connection prefix byte GRPC_DTS_CLIENT_PREFIX_0 = 0, GRPC_DTS_CLIENT_PREFIX_1, GRPC_DTS_CLIENT_PREFIX_2, @@ -181,8 +181,8 @@ typedef enum { GRPC_DTS_CLIENT_PREFIX_21, GRPC_DTS_CLIENT_PREFIX_22, GRPC_DTS_CLIENT_PREFIX_23, - /* frame header byte 0... */ - /* must follow from the prefix states */ + // frame header byte 0... + // must follow from the prefix states GRPC_DTS_FH_0, GRPC_DTS_FH_1, GRPC_DTS_FH_2, @@ -191,9 +191,9 @@ typedef enum { GRPC_DTS_FH_5, GRPC_DTS_FH_6, GRPC_DTS_FH_7, - /* ... frame header byte 8 */ + // ... frame header byte 8 GRPC_DTS_FH_8, - /* inside a http2 frame */ + // inside a http2 frame GRPC_DTS_FRAME } grpc_chttp2_deframe_transport_state; @@ -205,15 +205,15 @@ struct grpc_chttp2_stream_link { grpc_chttp2_stream* next; grpc_chttp2_stream* prev; }; -/* We keep several sets of connection wide parameters */ +// We keep several sets of connection wide parameters typedef enum { - /* The settings our peer has asked for (and we have acked) */ + // The settings our peer has asked for (and we have acked) GRPC_PEER_SETTINGS = 0, - /* The settings we'd like to have */ + // The settings we'd like to have GRPC_LOCAL_SETTINGS, - /* The settings we've published to our peer */ + // The settings we've published to our peer GRPC_SENT_SETTINGS, - /* The settings the peer has acked */ + // The settings the peer has acked GRPC_ACKED_SETTINGS, GRPC_NUM_SETTING_SETS } grpc_chttp2_setting_set; @@ -257,7 +257,7 @@ struct grpc_chttp2_transport grpc_endpoint* ep, bool is_client); ~grpc_chttp2_transport(); - grpc_transport base; /* must be first */ + grpc_transport base; // must be first grpc_core::RefCount refs; grpc_endpoint* ep; std::string peer_string; @@ -271,21 +271,21 @@ struct grpc_chttp2_transport grpc_closure* notify_on_receive_settings = nullptr; grpc_closure* notify_on_close = nullptr; - /** write execution state of the transport */ + /// write execution state of the transport grpc_chttp2_write_state write_state = GRPC_CHTTP2_WRITE_STATE_IDLE; - /** is the transport destroying itself? */ + /// is the transport destroying itself? uint8_t destroying = false; - /** has the upper layer closed the transport? */ + /// has the upper layer closed the transport? grpc_error_handle closed_with_error; - /** is there a read request to the endpoint outstanding? */ + /// is there a read request to the endpoint outstanding? uint8_t endpoint_reading = 1; - /** various lists of streams */ + /// various lists of streams grpc_chttp2_stream_list lists[STREAM_LIST_COUNT] = {}; - /** maps stream id to grpc_chttp2_stream objects */ + /// maps stream id to grpc_chttp2_stream objects grpc_chttp2_stream_map stream_map; grpc_closure write_action_begin_locked; @@ -294,92 +294,92 @@ struct grpc_chttp2_transport grpc_closure read_action_locked; - /** incoming read bytes */ + /// incoming read bytes grpc_slice_buffer read_buffer; - /** address to place a newly accepted stream - set and unset by - grpc_chttp2_parsing_accept_stream; used by init_stream to - publish the accepted server stream */ + /// address to place a newly accepted stream - set and unset by + /// grpc_chttp2_parsing_accept_stream; used by init_stream to + /// publish the accepted server stream grpc_chttp2_stream** accepting_stream = nullptr; - /* accept stream callback */ + // accept stream callback void (*accept_stream_cb)(void* user_data, grpc_transport* transport, const void* server_data); void* accept_stream_cb_user_data; - /** connectivity tracking */ + /// connectivity tracking grpc_core::ConnectivityStateTracker state_tracker; - /** data to write now */ + /// data to write now grpc_slice_buffer outbuf; - /** hpack encoding */ + /// hpack encoding grpc_core::HPackCompressor hpack_compressor; - /** is this a client? */ + /// is this a client? bool is_client; - /** data to write next write */ + /// data to write next write grpc_slice_buffer qbuf; - /** how much data are we willing to buffer when the WRITE_BUFFER_HINT is set? - */ + /// how much data are we willing to buffer when the WRITE_BUFFER_HINT is set? + /// uint32_t write_buffer_size = grpc_core::chttp2::kDefaultWindow; - /** Set to a grpc_error object if a goaway frame is received. By default, set - * to absl::OkStatus() */ + /// Set to a grpc_error object if a goaway frame is received. By default, set + /// to absl::OkStatus() grpc_error_handle goaway_error; grpc_chttp2_sent_goaway_state sent_goaway_state = GRPC_CHTTP2_NO_GOAWAY_SEND; - /** are the local settings dirty and need to be sent? */ + /// are the local settings dirty and need to be sent? bool dirtied_local_settings = true; - /** have local settings been sent? */ + /// have local settings been sent? bool sent_local_settings = false; - /** bitmask of setting indexes to send out - Hack: it's common for implementations to assume 65536 bytes initial send - window -- this should by rights be 0 */ + /// bitmask of setting indexes to send out + /// Hack: it's common for implementations to assume 65536 bytes initial send + /// window -- this should by rights be 0 uint32_t force_send_settings = 1 << GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; - /** settings values */ + /// settings values uint32_t settings[GRPC_NUM_SETTING_SETS][GRPC_CHTTP2_NUM_SETTINGS]; - /** what is the next stream id to be allocated by this peer? - copied to next_stream_id in parsing when parsing commences */ + /// what is the next stream id to be allocated by this peer? + /// copied to next_stream_id in parsing when parsing commences uint32_t next_stream_id = 0; - /** last new stream id */ + /// last new stream id uint32_t last_new_stream_id = 0; - /** ping queues for various ping insertion points */ + /// ping queues for various ping insertion points grpc_chttp2_ping_queue ping_queue = grpc_chttp2_ping_queue(); grpc_chttp2_repeated_ping_policy ping_policy; grpc_chttp2_repeated_ping_state ping_state; - uint64_t ping_ctr = 0; /* unique id for pings */ + uint64_t ping_ctr = 0; // unique id for pings grpc_closure retry_initiate_ping_locked; - /** ping acks */ + /// ping acks size_t ping_ack_count = 0; size_t ping_ack_capacity = 0; uint64_t* ping_acks = nullptr; grpc_chttp2_server_ping_recv_state ping_recv_state; - /** parser for headers */ + /// parser for headers grpc_core::HPackParser hpack_parser; - /** simple one shot parsers */ + /// simple one shot parsers union { grpc_chttp2_window_update_parser window_update; grpc_chttp2_settings_parser settings; grpc_chttp2_ping_parser ping; grpc_chttp2_rst_stream_parser rst_stream; } simple; - /** parser for goaway frames */ + /// parser for goaway frames grpc_chttp2_goaway_parser goaway_parser; grpc_core::chttp2::TransportFlowControl flow_control; - /** initial window change. This is tracked as we parse settings frames from - * the remote peer. If there is a positive delta, then we will make all - * streams readable since they may have become unstalled */ + /// initial window change. This is tracked as we parse settings frames from + /// the remote peer. If there is a positive delta, then we will make all + /// streams readable since they may have become unstalled int64_t initial_window_update = 0; - /* deframing */ + // deframing grpc_chttp2_deframe_transport_state deframe_state = GRPC_DTS_CLIENT_PREFIX_0; uint8_t incoming_frame_type = 0; uint8_t incoming_frame_flags = 0; @@ -389,7 +389,7 @@ struct grpc_chttp2_transport uint32_t incoming_frame_size = 0; uint32_t incoming_stream_id = 0; - /* active parser */ + // active parser void* parser_data = nullptr; grpc_chttp2_stream* incoming_stream = nullptr; grpc_error_handle (*parser)(void* parser_user_data, grpc_chttp2_transport* t, @@ -398,72 +398,72 @@ struct grpc_chttp2_transport grpc_chttp2_write_cb* write_cb_pool = nullptr; - /* bdp estimator */ + // bdp estimator bool bdp_ping_blocked = - false; /* Is the BDP blocked due to not receiving any data? */ + false; // Is the BDP blocked due to not receiving any data? grpc_closure next_bdp_ping_timer_expired_locked; grpc_closure start_bdp_ping_locked; grpc_closure finish_bdp_ping_locked; - /* if non-NULL, close the transport with this error when writes are finished - */ + // if non-NULL, close the transport with this error when writes are finished + // grpc_error_handle close_transport_on_writes_finished; - /* a list of closures to run after writes are finished */ + // a list of closures to run after writes are finished grpc_closure_list run_after_write = GRPC_CLOSURE_LIST_INIT; - /* buffer pool state */ - /** have we scheduled a benign cleanup? */ + // buffer pool state + /// have we scheduled a benign cleanup? bool benign_reclaimer_registered = false; - /** have we scheduled a destructive cleanup? */ + /// have we scheduled a destructive cleanup? bool destructive_reclaimer_registered = false; - /** benign cleanup closure */ + /// benign cleanup closure grpc_closure benign_reclaimer_locked; - /** destructive cleanup closure */ + /// destructive cleanup closure grpc_closure destructive_reclaimer_locked; - /* next bdp ping timer */ + // next bdp ping timer bool have_next_bdp_ping_timer = false; - /** If start_bdp_ping_locked has been called */ + /// If start_bdp_ping_locked has been called bool bdp_ping_started = false; grpc_timer next_bdp_ping_timer; - /* keep-alive ping support */ - /** Closure to initialize a keepalive ping */ + // keep-alive ping support + /// Closure to initialize a keepalive ping grpc_closure init_keepalive_ping_locked; - /** Closure to run when the keepalive ping is sent */ + /// Closure to run when the keepalive ping is sent grpc_closure start_keepalive_ping_locked; - /** Cousure to run when the keepalive ping ack is received */ + /// Cousure to run when the keepalive ping ack is received grpc_closure finish_keepalive_ping_locked; - /** Closrue to run when the keepalive ping timeouts */ + /// Closrue to run when the keepalive ping timeouts grpc_closure keepalive_watchdog_fired_locked; - /** timer to initiate ping events */ + /// timer to initiate ping events grpc_timer keepalive_ping_timer; - /** watchdog to kill the transport when waiting for the keepalive ping */ + /// watchdog to kill the transport when waiting for the keepalive ping grpc_timer keepalive_watchdog_timer; - /** time duration in between pings */ + /// time duration in between pings grpc_core::Duration keepalive_time; - /** grace period for a ping to complete before watchdog kicks in */ + /// grace period for a ping to complete before watchdog kicks in grpc_core::Duration keepalive_timeout; - /** if keepalive pings are allowed when there's no outstanding streams */ + /// if keepalive pings are allowed when there's no outstanding streams bool keepalive_permit_without_calls = false; - /** If start_keepalive_ping_locked has been called */ + /// If start_keepalive_ping_locked has been called bool keepalive_ping_started = false; - /** keep-alive state machine state */ + /// keep-alive state machine state grpc_chttp2_keepalive_state keepalive_state; grpc_core::ContextList* cl = nullptr; grpc_core::RefCountedPtr channelz_socket; uint32_t num_messages_in_next_write = 0; - /** The number of pending induced frames (SETTINGS_ACK, PINGS_ACK and - * RST_STREAM) in the outgoing buffer (t->qbuf). If this number goes beyond - * DEFAULT_MAX_PENDING_INDUCED_FRAMES, we pause reading new frames. We would - * only continue reading when we are able to write to the socket again, - * thereby reducing the number of induced frames. */ + /// The number of pending induced frames (SETTINGS_ACK, PINGS_ACK and + /// RST_STREAM) in the outgoing buffer (t->qbuf). If this number goes beyond + /// DEFAULT_MAX_PENDING_INDUCED_FRAMES, we pause reading new frames. We would + /// only continue reading when we are able to write to the socket again, + /// thereby reducing the number of induced frames. uint32_t num_pending_induced_frames = 0; bool reading_paused_on_pending_induced_frames = false; - /** Based on channel args, preferred_rx_crypto_frame_sizes are advertised to - * the peer - */ + /// Based on channel args, preferred_rx_crypto_frame_sizes are advertised to + /// the peer + /// bool enable_preferred_rx_crypto_frame_advertisement = false; }; @@ -495,10 +495,10 @@ struct grpc_chttp2_stream { grpc_chttp2_stream_link links[STREAM_LIST_COUNT]; grpc_core::BitSet included; - /** HTTP2 stream id for this stream, or zero if one has not been assigned */ + /// HTTP2 stream id for this stream, or zero if one has not been assigned uint32_t id = 0; - /** things the upper layers would like to send */ + /// things the upper layers would like to send grpc_metadata_batch* send_initial_metadata = nullptr; grpc_closure* send_initial_metadata_finished = nullptr; grpc_metadata_batch* send_trailing_metadata = nullptr; @@ -530,26 +530,26 @@ struct grpc_chttp2_stream { grpc_transport_stream_stats* collecting_stats = nullptr; grpc_transport_stream_stats stats = grpc_transport_stream_stats(); - /** Is this stream closed for writing. */ + /// Is this stream closed for writing. bool write_closed = false; - /** Is this stream reading half-closed. */ + /// Is this stream reading half-closed. bool read_closed = false; - /** Are all published incoming byte streams closed. */ + /// Are all published incoming byte streams closed. bool all_incoming_byte_streams_finished = false; - /** Has this stream seen an error. - If true, then pending incoming frames can be thrown away. */ + /// Has this stream seen an error. + /// If true, then pending incoming frames can be thrown away. bool seen_error = false; - /** Are we buffering writes on this stream? If yes, we won't become writable - until there's enough queued up in the flow_controlled_buffer */ + /// Are we buffering writes on this stream? If yes, we won't become writable + /// until there's enough queued up in the flow_controlled_buffer bool write_buffering = false; - /* have we sent or received the EOS bit? */ + // have we sent or received the EOS bit? bool eos_received = false; bool eos_sent = false; - /** the error that resulted in this stream being read-closed */ + /// the error that resulted in this stream being read-closed grpc_error_handle read_closed_error; - /** the error that resulted in this stream being write-closed */ + /// the error that resulted in this stream being write-closed grpc_error_handle write_closed_error; grpc_published_metadata_method published_metadata[2] = {}; @@ -558,16 +558,16 @@ struct grpc_chttp2_stream { grpc_metadata_batch initial_metadata_buffer; grpc_metadata_batch trailing_metadata_buffer; - grpc_slice_buffer frame_storage; /* protected by t combiner */ - bool received_last_frame = false; /* protected by t combiner */ + grpc_slice_buffer frame_storage; // protected by t combiner + bool received_last_frame = false; // protected by t combiner grpc_core::Timestamp deadline = grpc_core::Timestamp::InfFuture(); - /** saw some stream level error */ + /// saw some stream level error grpc_error_handle forced_close_error; - /** how many header frames have we received? */ + /// how many header frames have we received? uint8_t header_frames_received = 0; - /** number of bytes received - reset at end of parse thread execution */ + /// number of bytes received - reset at end of parse thread execution int64_t received_bytes = 0; bool sent_initial_metadata = false; @@ -582,51 +582,51 @@ struct grpc_chttp2_stream { grpc_chttp2_write_cb* finish_after_write = nullptr; size_t sending_bytes = 0; - /** Whether the bytes needs to be traced using Fathom */ + /// Whether the bytes needs to be traced using Fathom bool traced = false; - /** Byte counter for number of bytes written */ + /// Byte counter for number of bytes written size_t byte_counter = 0; // time this stream was created gpr_timespec creation_time = gpr_now(GPR_CLOCK_MONOTONIC); }; -/** Transport writing call flow: - grpc_chttp2_initiate_write() is called anywhere that we know bytes need to - go out on the wire. - If no other write has been started, a task is enqueued onto our workqueue. - When that task executes, it obtains the global lock, and gathers the data - to write. - The global lock is dropped and we do the syscall to write. - After writing, a follow-up check is made to see if another round of writing - should be performed. - - The actual call chain is documented in the implementation of this function. - */ +/// Transport writing call flow: +/// grpc_chttp2_initiate_write() is called anywhere that we know bytes need to +/// go out on the wire. +/// If no other write has been started, a task is enqueued onto our workqueue. +/// When that task executes, it obtains the global lock, and gathers the data +/// to write. +/// The global lock is dropped and we do the syscall to write. +/// After writing, a follow-up check is made to see if another round of writing +/// should be performed. + +/// The actual call chain is documented in the implementation of this function. +/// void grpc_chttp2_initiate_write(grpc_chttp2_transport* t, grpc_chttp2_initiate_write_reason reason); struct grpc_chttp2_begin_write_result { - /** are we writing? */ + /// are we writing? bool writing; - /** if writing: was it a complete flush (false) or a partial flush (true) */ + /// if writing: was it a complete flush (false) or a partial flush (true) bool partial; - /** did we queue any completions as part of beginning the write */ + /// did we queue any completions as part of beginning the write bool early_results_scheduled; }; grpc_chttp2_begin_write_result grpc_chttp2_begin_write( grpc_chttp2_transport* t); void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error); -/** Process one slice of incoming data; return 1 if the connection is still - viable after reading, or 0 if the connection should be torn down */ +/// Process one slice of incoming data; return 1 if the connection is still +/// viable after reading, or 0 if the connection should be torn down grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t, const grpc_slice& slice); bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s); -/** Get a writable stream - returns non-zero if there was a stream available */ +/// Get a writable stream +/// returns non-zero if there was a stream available bool grpc_chttp2_list_pop_writable_stream(grpc_chttp2_transport* t, grpc_chttp2_stream** s); bool grpc_chttp2_list_remove_writable_stream(grpc_chttp2_transport* t, @@ -664,14 +664,14 @@ bool grpc_chttp2_list_pop_stalled_by_stream(grpc_chttp2_transport* t, bool grpc_chttp2_list_remove_stalled_by_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s); -/********* Flow Control ***************/ +//******** Flow Control ************** // Takes in a flow control action and performs all the needed operations. void grpc_chttp2_act_on_flowctl_action( const grpc_core::chttp2::FlowControlAction& action, grpc_chttp2_transport* t, grpc_chttp2_stream* s); -/********* End of Flow Control ***************/ +//******** End of Flow Control ************** inline grpc_chttp2_stream* grpc_chttp2_parsing_lookup_stream( grpc_chttp2_transport* t, uint32_t id) { @@ -765,20 +765,20 @@ inline void grpc_chttp2_ref_transport(grpc_chttp2_transport* t) { void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id); -/** Add a new ping strike to ping_recv_state.ping_strikes. If - ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY - with error code ENHANCE_YOUR_CALM and additional debug data resembling - "too_many_pings" followed by immediately closing the connection. */ +/// Add a new ping strike to ping_recv_state.ping_strikes. If +/// ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY +/// with error code ENHANCE_YOUR_CALM and additional debug data resembling +/// "too_many_pings" followed by immediately closing the connection. void grpc_chttp2_add_ping_strike(grpc_chttp2_transport* t); -/** Resets ping clock. Should be called when flushing window updates, - * initial/trailing metadata or data frames. For a server, it resets the number - * of ping strikes and the last_ping_recv_time. For a ping sender, it resets - * pings_before_data_required. */ +/// Resets ping clock. Should be called when flushing window updates, +/// initial/trailing metadata or data frames. For a server, it resets the number +/// of ping strikes and the last_ping_recv_time. For a ping sender, it resets +/// pings_before_data_required. void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t); -/** add a ref to the stream and add it to the writable list; - ref will be dropped in writing.c */ +/// add a ref to the stream and add it to the writable list; +/// ref will be dropped in writing.c void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t, grpc_chttp2_stream* s); @@ -796,8 +796,8 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_error_handle error); -/** Set the default keepalive configurations, must only be called at - initialization */ +/// Set the default keepalive configurations, must only be called at +/// initialization void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args, bool is_client); @@ -807,4 +807,4 @@ void schedule_bdp_ping_locked(grpc_chttp2_transport* t); uint32_t grpc_chttp2_min_read_progress_size(grpc_chttp2_transport* t); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H diff --git a/src/core/ext/transport/chttp2/transport/parsing.cc b/src/core/ext/transport/chttp2/transport/parsing.cc index 144907773fa..d87c6d34eb2 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.cc +++ b/src/core/ext/transport/chttp2/transport/parsing.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -264,7 +264,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t, t->deframe_state = GRPC_DTS_FH_0; return absl::OkStatus(); } - goto dts_fh_0; /* loop */ + goto dts_fh_0; // loop } else if (t->incoming_frame_size > t->settings[GRPC_ACKED_SETTINGS] [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]) { @@ -304,7 +304,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t, } cur += t->incoming_frame_size; t->incoming_stream = nullptr; - goto dts_fh_0; /* loop */ + goto dts_fh_0; // loop } else { err = parse_frame_slice( t, @@ -471,13 +471,13 @@ static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) { error_handler: if (status.ok()) { t->incoming_stream = s; - /* t->parser = grpc_chttp2_data_parser_parse;*/ + // t->parser = grpc_chttp2_data_parser_parse; t->parser = grpc_chttp2_data_parser_parse; t->parser_data = nullptr; t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast(); return absl::OkStatus(); } else if (s != nullptr) { - /* handle stream errors by closing the stream */ + // handle stream errors by closing the stream grpc_chttp2_mark_stream_closed(t, s, true, false, absl_status_to_grpc_error(status)); grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id, @@ -495,7 +495,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, (t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0; grpc_chttp2_stream* s; - /* TODO(ctiller): when to increment header_frames_received? */ + // TODO(ctiller): when to increment header_frames_received? if (is_eoh) { t->expect_continuation_stream_id = 0; @@ -515,7 +515,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast(); - /* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */ + // could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id); if (s == nullptr) { if (GPR_UNLIKELY(is_continuation)) { @@ -527,7 +527,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t, if (t->is_client) { if (GPR_LIKELY((t->incoming_stream_id & 1) && t->incoming_stream_id < t->next_stream_id)) { - /* this is an old (probably cancelled) grpc_chttp2_stream */ + // this is an old (probably cancelled) grpc_chttp2_stream } else { GRPC_CHTTP2_IF_TRACING(gpr_log( GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client")); @@ -766,8 +766,8 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser, return error; } if (is_last) { - /* need to check for null stream: this can occur if we receive an invalid - stream id on a header */ + // need to check for null stream: this can occur if we receive an invalid + // stream id on a header if (s != nullptr) { if (parser->is_boundary()) { if (s->header_frames_received == 2) { @@ -780,10 +780,10 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser, } if (parser->is_eof()) { if (t->is_client && !s->write_closed) { - /* server eof ==> complete closure; we may need to forcefully close - the stream. Wait until the combiner lock is ready to be released - however -- it might be that we receive a RST_STREAM following this - and can avoid the extra write */ + // server eof ==> complete closure; we may need to forcefully close + // the stream. Wait until the combiner lock is ready to be released + // however -- it might be that we receive a RST_STREAM following this + // and can avoid the extra write GRPC_CHTTP2_STREAM_REF(s, "final_rst"); t->combiner->FinallyRun( GRPC_CLOSURE_CREATE(force_client_rst_stream, s, nullptr), diff --git a/src/core/ext/transport/chttp2/transport/stream_lists.cc b/src/core/ext/transport/chttp2/transport/stream_lists.cc index 92c36a60934..4bf4cfdfe60 100644 --- a/src/core/ext/transport/chttp2/transport/stream_lists.cc +++ b/src/core/ext/transport/chttp2/transport/stream_lists.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -45,7 +45,7 @@ static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) { grpc_core::TraceFlag grpc_trace_http2_stream_state(false, "http2_stream_state"); -/* core list management */ +// core list management static bool stream_list_empty(grpc_chttp2_transport* t, grpc_chttp2_stream_list_id id) { @@ -138,7 +138,7 @@ static bool stream_list_add(grpc_chttp2_transport* t, grpc_chttp2_stream* s, return true; } -/* wrappers for specializations */ +// wrappers for specializations bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s) { diff --git a/src/core/ext/transport/chttp2/transport/stream_map.cc b/src/core/ext/transport/chttp2/transport/stream_map.cc index c837f4df3bb..905e2bbe5f6 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.cc +++ b/src/core/ext/transport/chttp2/transport/stream_map.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -80,8 +80,8 @@ void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key, count = compact(keys, values, count); map->free = 0; } else { - /* resize when less than 25% of the table is free, because compaction - won't help much */ + // resize when less than 25% of the table is free, because compaction + // won't help much map->capacity = capacity = 2 * capacity; map->keys = keys = static_cast( gpr_realloc(keys, capacity * sizeof(uint32_t))); @@ -108,7 +108,7 @@ static void** find(grpc_chttp2_stream_map* map, uint32_t key) { if (!strict_find && max_idx == 0) return nullptr; while (min_idx < max_idx) { - /* find the midpoint, avoiding overflow */ + // find the midpoint, avoiding overflow mid_idx = min_idx + ((max_idx - min_idx) / 2); mid_key = keys[mid_idx]; @@ -116,7 +116,7 @@ static void** find(grpc_chttp2_stream_map* map, uint32_t key) { min_idx = mid_idx + 1; } else if (mid_key > key) { max_idx = mid_idx; - } else /* mid_key == key */ + } else // mid_key == key { return &values[mid_idx]; } @@ -133,8 +133,8 @@ void* grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map* map, uint32_t key) { GPR_DEBUG_ASSERT(out != nullptr); *pvalue = nullptr; map->free++; - /* recognize complete emptyness and ensure we can skip - defragmentation later */ + // recognize complete emptyness and ensure we can skip + // defragmentation later if (map->free == map->count) { map->free = map->count = 0; } diff --git a/src/core/ext/transport/chttp2/transport/stream_map.h b/src/core/ext/transport/chttp2/transport/stream_map.h index 845fa01dbeb..93da73d6b99 100644 --- a/src/core/ext/transport/chttp2/transport/stream_map.h +++ b/src/core/ext/transport/chttp2/transport/stream_map.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H @@ -24,12 +24,12 @@ #include #include -/* Data structure to map a uint32_t to a data object (represented by a void*) +// Data structure to map a uint32_t to a data object (represented by a void*) - Represented as a sorted array of keys, and a corresponding array of values. - Lookups are performed with binary search. - Adds are restricted to strictly higher keys than previously seen (this is - guaranteed by http2). */ +// Represented as a sorted array of keys, and a corresponding array of values. +// Lookups are performed with binary search. +// Adds are restricted to strictly higher keys than previously seen (this is +// guaranteed by http2). struct grpc_chttp2_stream_map { uint32_t* keys; void** values; @@ -41,28 +41,28 @@ void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map* map, size_t initial_capacity); void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map* map); -/* Add a new key: given http2 semantics, new keys must always be greater than - existing keys - this is asserted */ +// Add a new key: given http2 semantics, new keys must always be greater than +// existing keys - this is asserted void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map* map, uint32_t key, void* value); -/* Delete an existing key - returns the previous value of the key if it existed, - or NULL otherwise */ +// Delete an existing key - returns the previous value of the key if it existed, +// or NULL otherwise void* grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map* map, uint32_t key); -/* Return an existing key, or NULL if it does not exist */ +// Return an existing key, or NULL if it does not exist void* grpc_chttp2_stream_map_find(grpc_chttp2_stream_map* map, uint32_t key); -/* Return a random entry */ +// Return a random entry void* grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map* map); -/* How many (populated) entries are in the stream map? */ +// How many (populated) entries are in the stream map? size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map* map); -/* Callback on each stream */ +// Callback on each stream void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map* map, void (*f)(void* user_data, uint32_t key, void* value), void* user_data); -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H diff --git a/src/core/ext/transport/chttp2/transport/varint.cc b/src/core/ext/transport/chttp2/transport/varint.cc index 59b500aebb5..db08fe054bf 100644 --- a/src/core/ext/transport/chttp2/transport/varint.cc +++ b/src/core/ext/transport/chttp2/transport/varint.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/ext/transport/chttp2/transport/varint.h b/src/core/ext/transport/chttp2/transport/varint.h index 36bba05a3a4..32b8d76d11a 100644 --- a/src/core/ext/transport/chttp2/transport/varint.h +++ b/src/core/ext/transport/chttp2/transport/varint.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H @@ -26,19 +26,19 @@ #include -/* Helpers for hpack varint encoding */ +// Helpers for hpack varint encoding namespace grpc_core { -/* maximum value that can be bitpacked with the opcode if the opcode has a - prefix of length prefix_bits */ +// maximum value that can be bitpacked with the opcode if the opcode has a +// prefix of length prefix_bits constexpr uint32_t MaxInVarintPrefix(uint8_t prefix_bits) { return (1 << (8 - prefix_bits)) - 1; } -/* length of a value that needs varint tail encoding (it's bigger than can be - bitpacked into the opcode byte) - returned value includes the length of the - opcode byte */ +// length of a value that needs varint tail encoding (it's bigger than can be +// bitpacked into the opcode byte) - returned value includes the length of the +// opcode byte size_t VarintLength(size_t tail_value); void VarintWriteTail(size_t tail_value, uint8_t* target, size_t tail_length); @@ -73,4 +73,4 @@ class VarintWriter { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 98689b39583..8b3221757cb 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -84,11 +84,11 @@ static void finish_write_cb(grpc_chttp2_transport* t, grpc_chttp2_stream* s, static void maybe_initiate_ping(grpc_chttp2_transport* t) { grpc_chttp2_ping_queue* pq = &t->ping_queue; if (grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_NEXT])) { - /* no ping needed: wait */ + // no ping needed: wait return; } if (!grpc_closure_list_empty(pq->lists[GRPC_CHTTP2_PCL_INFLIGHT])) { - /* ping already in-flight: wait */ + // ping already in-flight: wait if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { @@ -99,7 +99,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { } if (t->is_client && t->ping_state.pings_before_data_required == 0 && t->ping_policy.max_pings_without_data != 0) { - /* need to receive something of substance before sending a ping again */ + // need to receive something of substance before sending a ping again if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { @@ -122,8 +122,9 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { (t->keepalive_permit_without_calls == 0 && grpc_chttp2_stream_map_size(&t->stream_map) == 0) ? grpc_core::Duration::Hours(2) - : grpc_core::Duration::Seconds(1); /* A second is added to deal with - network delays and timing imprecision */ + : grpc_core::Duration::Seconds( + 1); // A second is added to deal with + // network delays and timing imprecision } else if (t->sent_goaway_state != GRPC_CHTTP2_GRACEFUL_GOAWAY) { // The gRPC keepalive spec doesn't call for any throttling on the server // side, but we are adding some throttling for protection anyway, unless @@ -137,7 +138,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) { t->ping_state.last_ping_sent_time + next_allowed_ping_interval; if (next_allowed_ping > now) { - /* not enough elapsed time between successive pings */ + // not enough elapsed time between successive pings if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace) || GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) { @@ -230,7 +231,7 @@ static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s, } } -/* How many bytes would we like to put on the wire during a single syscall */ +// How many bytes would we like to put on the wire during a single syscall static uint32_t target_write_size(grpc_chttp2_transport* /*t*/) { return 1024 * 1024; } @@ -284,7 +285,7 @@ class WriteContext { } void FlushQueuedBuffers() { - /* simple writes are queued to qbuf, and flushed here */ + // simple writes are queued to qbuf, and flushed here grpc_slice_buffer_move_into(&t_->qbuf, &t_->outbuf); t_->num_pending_induced_frames = 0; GPR_ASSERT(t_->qbuf.count == 0); @@ -359,8 +360,8 @@ class WriteContext { private: grpc_chttp2_transport* const t_; - /* stats histogram counters: we increment these throughout this function, - and at the end publish to the central stats histograms */ + // stats histogram counters: we increment these throughout this function, + // and at the end publish to the central stats histograms int flow_control_writes_ = 0; int initial_metadata_writes_ = 0; int trailing_metadata_writes_ = 0; @@ -442,7 +443,7 @@ class StreamWriteContext { } void FlushInitialMetadata() { - /* send initial metadata if it's available */ + // send initial metadata if it's available if (s_->sent_initial_metadata) return; if (s_->send_initial_metadata == nullptr) return; @@ -485,7 +486,7 @@ class StreamWriteContext { void FlushWindowUpdates() { if (s_->read_closed) return; - /* send any window updates */ + // send any window updates const uint32_t stream_announce = s_->flow_control.MaybeSendUpdate(); if (stream_announce == 0) return; @@ -630,8 +631,8 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write( ctx.UpdateStreamsNoLongerStalled(); } - /* for each grpc_chttp2_stream that's become writable, frame it's data - (according to available window sizes) and add to the output buffer */ + // for each grpc_chttp2_stream that's become writable, frame it's data + // (according to available window sizes) and add to the output buffer while (grpc_chttp2_stream* s = ctx.NextStream()) { StreamWriteContext stream_ctx(&ctx, s); size_t orig_len = t->outbuf.length; @@ -640,7 +641,7 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write( stream_ctx.FlushData(); stream_ctx.FlushTrailingMetadata(); if (t->outbuf.length > orig_len) { - /* Add this stream to the list of the contexts to be traced at TCP */ + // Add this stream to the list of the contexts to be traced at TCP s->byte_counter += t->outbuf.length - orig_len; if (s->traced && grpc_endpoint_can_track_err(t->ep)) { grpc_core::ContextList::Append(&t->cl, s); @@ -648,10 +649,10 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write( } if (stream_ctx.stream_became_writable()) { if (!grpc_chttp2_list_add_writing_stream(t, s)) { - /* already in writing list: drop ref */ + // already in writing list: drop ref GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:already_writing"); } else { - /* ref will be dropped at end of write */ + // ref will be dropped at end of write } } else { GRPC_CHTTP2_STREAM_UNREF(s, "chttp2_writing:no_write"); diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc index fba5dc217ba..f5e602fc89c 100644 --- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc +++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.h b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.h index 42f568ac214..ba9413bbcae 100644 --- a/src/core/ext/transport/cronet/client/secure/cronet_channel_create.h +++ b/src/core/ext/transport/cronet/client/secure/cronet_channel_create.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_CLIENT_SECURE_CRONET_CHANNEL_CREATE_H #define GRPC_CORE_EXT_TRANSPORT_CRONET_CLIENT_SECURE_CRONET_CHANNEL_CREATE_H @@ -34,5 +34,4 @@ GRPCAPI grpc_channel* grpc_cronet_secure_channel_create( } #endif -#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_CLIENT_SECURE_CRONET_CHANNEL_CREATE_H \ - */ +#endif // GRPC_CORE_EXT_TRANSPORT_CRONET_CLIENT_SECURE_CRONET_CHANNEL_CREATE_H diff --git a/src/core/ext/transport/cronet/transport/cronet_api_phony.cc b/src/core/ext/transport/cronet/transport/cronet_api_phony.cc index 7946daad9be..024c3245b26 100644 --- a/src/core/ext/transport/cronet/transport/cronet_api_phony.cc +++ b/src/core/ext/transport/cronet/transport/cronet_api_phony.cc @@ -1,23 +1,23 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// -/* This file has empty implementation of all the functions exposed by the cronet -library, so we can build it in all environments */ +// This file has empty implementation of all the functions exposed by the cronet +// library, so we can build it in all environments #include @@ -26,9 +26,9 @@ library, so we can build it in all environments */ #include #ifdef GRPC_COMPILE_WITH_CRONET -/* link with the real CRONET library in the build system */ +// link with the real CRONET library in the build system #else -/* Phony implementation of cronet API just to test for build-ability */ +// Phony implementation of cronet API just to test for build-ability bidirectional_stream* bidirectional_stream_create( stream_engine* /*engine*/, void* /*annotation*/, bidirectional_stream_callback* /*callback*/) { @@ -81,4 +81,4 @@ void bidirectional_stream_flush(bidirectional_stream* /*stream*/) { GPR_ASSERT(0); } -#endif /* GRPC_COMPILE_WITH_CRONET */ +#endif // GRPC_COMPILE_WITH_CRONET diff --git a/src/core/ext/transport/cronet/transport/cronet_status.cc b/src/core/ext/transport/cronet/transport/cronet_status.cc index 8b831f2d4bf..322dfdd9643 100644 --- a/src/core/ext/transport/cronet/transport/cronet_status.cc +++ b/src/core/ext/transport/cronet/transport/cronet_status.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 diff --git a/src/core/ext/transport/cronet/transport/cronet_status.h b/src/core/ext/transport/cronet/transport/cronet_status.h index 0b4ff3f4197..4cfc8dba36b 100644 --- a/src/core/ext/transport/cronet/transport/cronet_status.h +++ b/src/core/ext/transport/cronet/transport/cronet_status.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H #define GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H @@ -1042,4 +1042,4 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error); grpc_status_code cronet_net_error_to_grpc_error( cronet_net_error_code net_error); -#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_STATUS_H diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.cc b/src/core/ext/transport/cronet/transport/cronet_transport.cc index f5fd127f779..5f304dd9ecc 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.cc +++ b/src/core/ext/transport/cronet/transport/cronet_transport.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -95,7 +95,7 @@ enum e_op_id { OP_NUM_OPS }; -/* Cronet callbacks. See cronet_c_for_grpc.h for documentation for each. */ +// Cronet callbacks. See cronet_c_for_grpc.h for documentation for each. static void on_stream_ready(bidirectional_stream*); static void on_response_headers_received( @@ -118,22 +118,22 @@ static bidirectional_stream_callback cronet_callbacks = { on_failed, on_canceled}; -/* Cronet transport object */ +// Cronet transport object struct grpc_cronet_transport { - grpc_transport base; /* must be first element in this structure */ + grpc_transport base; // must be first element in this structure stream_engine* engine; char* host; bool use_packet_coalescing; }; typedef struct grpc_cronet_transport grpc_cronet_transport; -/* TODO (makdharma): reorder structure for memory efficiency per - http://www.catb.org/esr/structure-packing/#_structure_reordering: */ +// TODO (makdharma): reorder structure for memory efficiency per +// http://www.catb.org/esr/structure-packing/#_structure_reordering: struct read_state { explicit read_state(grpc_core::Arena* arena) : trailing_metadata(arena), initial_metadata(arena) {} - /* vars to store data coming from server */ + // vars to store data coming from server char* read_buffer = nullptr; bool length_field_received = false; int received_bytes = 0; @@ -144,14 +144,14 @@ struct read_state { char* payload_field = nullptr; bool read_stream_closed = false; - /* vars for holding data destined for the application */ + // vars for holding data destined for the application grpc_core::SliceBuffer read_slice_buffer; - /* vars for trailing metadata */ + // vars for trailing metadata grpc_metadata_batch trailing_metadata; bool trailing_metadata_valid = false; - /* vars for initial metadata */ + // vars for initial metadata grpc_metadata_batch initial_metadata; }; @@ -159,26 +159,26 @@ struct write_state { char* write_buffer = nullptr; }; -/* track state of one stream op */ +// track state of one stream op struct op_state { explicit op_state(grpc_core::Arena* arena) : rs(arena) {} bool state_op_done[OP_NUM_OPS] = {}; bool state_callback_received[OP_NUM_OPS] = {}; - /* A non-zero gRPC status code has been seen */ + // A non-zero gRPC status code has been seen bool fail_state = false; - /* Transport is discarding all buffered messages */ + // Transport is discarding all buffered messages bool flush_read = false; bool flush_cronet_when_ready = false; bool pending_write_for_trailer = false; bool pending_send_message = false; - /* User requested RECV_TRAILING_METADATA */ + // User requested RECV_TRAILING_METADATA bool pending_recv_trailing_metadata = false; cronet_net_error_code net_error = OK; grpc_error_handle cancel_error; - /* data structure for storing data coming from server */ + // data structure for storing data coming from server struct read_state rs; - /* data structure for storing data going to the server */ + // data structure for storing data going to the server struct write_state ws; }; @@ -190,8 +190,8 @@ struct op_and_state { grpc_transport_stream_op_batch op; struct op_state state; bool done = false; - struct stream_obj* s; /* Pointer back to the stream object */ - /* next op_and_state in the linked list */ + struct stream_obj* s; // Pointer back to the stream object + // next op_and_state in the linked list struct op_and_state* next = nullptr; }; @@ -214,17 +214,17 @@ struct stream_obj { bidirectional_stream_header_array header_array = bidirectional_stream_header_array(); // Zero-initialize the structure. - /* Stream level state. Some state will be tracked both at stream and stream_op - * level */ + // Stream level state. Some state will be tracked both at stream and stream_op + // level struct op_state state; - /* OP storage */ + // OP storage struct op_storage storage; - /* Mutex to protect storage */ + // Mutex to protect storage gpr_mu mu; - /* Refcount object of the stream */ + // Refcount object of the stream grpc_stream_refcount* refcount; }; @@ -249,9 +249,9 @@ void grpc_cronet_stream_unref(stream_obj* s) { grpc_stream_unref(s->refcount); } static enum e_op_result execute_stream_op(struct op_and_state* oas); -/* - Utility function to translate enum into string for printing -*/ +// +// Utility function to translate enum into string for printing +// static const char* op_result_string(enum e_op_result i) { switch (i) { case ACTION_TAKEN_WITH_CALLBACK: @@ -330,14 +330,14 @@ inline op_and_state::op_and_state(stream_obj* s, const grpc_transport_stream_op_batch& op) : op(op), state(s->arena), s(s) {} -/* - Add a new stream op to op storage. -*/ +// +// Add a new stream op to op storage. +// static void add_to_storage(struct stream_obj* s, grpc_transport_stream_op_batch* op) { struct op_storage* storage = &s->storage; - /* add new op at the beginning of the linked list. The memory is freed - in remove_from_storage */ + // add new op at the beginning of the linked list. The memory is freed + // in remove_from_storage op_and_state* new_op = new op_and_state(s, *op); gpr_mu_lock(&s->mu); new_op->next = storage->head; @@ -354,9 +354,9 @@ static void add_to_storage(struct stream_obj* s, gpr_mu_unlock(&s->mu); } -/* - Traverse the linked list and delete op and free memory -*/ +// +// Traverse the linked list and delete op and free memory +// static void remove_from_storage(struct stream_obj* s, struct op_and_state* oas) { struct op_and_state* curr; @@ -385,12 +385,12 @@ static void remove_from_storage(struct stream_obj* s, } } -/* - Cycle through ops and try to take next action. Break when either - an action with callback is taken, or no action is possible. - This can get executed from the Cronet network thread via cronet callback - or on the application supplied thread via the perform_stream_op function. -*/ +// +// Cycle through ops and try to take next action. Break when either +// an action with callback is taken, or no action is possible. +// This can get executed from the Cronet network thread via cronet callback +// or on the application supplied thread via the perform_stream_op function. +// static void execute_from_storage(stream_obj* s) { gpr_mu_lock(&s->mu); for (struct op_and_state* curr = s->storage.head; curr != nullptr;) { @@ -399,7 +399,7 @@ static void execute_from_storage(stream_obj* s) { enum e_op_result result = execute_stream_op(curr); CRONET_LOG(GPR_DEBUG, "execute_stream_op[%p] returns %s", curr, op_result_string(result)); - /* if this op is done, then remove it and free memory */ + // if this op is done, then remove it and free memory if (curr->done) { struct op_and_state* next = curr->next; remove_from_storage(s, curr); @@ -407,9 +407,9 @@ static void execute_from_storage(stream_obj* s) { } else if (result == NO_ACTION_POSSIBLE) { curr = curr->next; } else if (result == ACTION_TAKEN_WITH_CALLBACK) { - /* wait for the callback */ + // wait for the callback break; - } /* continue processing the same op if ACTION_TAKEN_WITHOUT_CALLBACK */ + } // continue processing the same op if ACTION_TAKEN_WITHOUT_CALLBACK } gpr_mu_unlock(&s->mu); } @@ -439,9 +439,9 @@ static void convert_cronet_array_to_metadata( } } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_failed(bidirectional_stream* stream, int net_error) { gpr_log(GPR_ERROR, "on_failed(%p, %d)", stream, net_error); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -467,9 +467,9 @@ static void on_failed(bidirectional_stream* stream, int net_error) { GRPC_CRONET_STREAM_UNREF(s, "cronet transport"); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_canceled(bidirectional_stream* stream) { CRONET_LOG(GPR_DEBUG, "on_canceled(%p)", stream); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -494,9 +494,9 @@ static void on_canceled(bidirectional_stream* stream) { GRPC_CRONET_STREAM_UNREF(s, "cronet transport"); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_succeeded(bidirectional_stream* stream) { CRONET_LOG(GPR_DEBUG, "on_succeeded(%p)", stream); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -513,9 +513,9 @@ static void on_succeeded(bidirectional_stream* stream) { GRPC_CRONET_STREAM_UNREF(s, "cronet transport"); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_stream_ready(bidirectional_stream* stream) { CRONET_LOG(GPR_DEBUG, "W: on_stream_ready(%p)", stream); grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -525,13 +525,13 @@ static void on_stream_ready(bidirectional_stream* stream) { gpr_mu_lock(&s->mu); s->state.state_op_done[OP_SEND_INITIAL_METADATA] = true; s->state.state_callback_received[OP_SEND_INITIAL_METADATA] = true; - /* Free the memory allocated for headers */ + // Free the memory allocated for headers if (s->header_array.headers) { gpr_free(s->header_array.headers); s->header_array.headers = nullptr; } - /* Send the initial metadata on wire if there is no SEND_MESSAGE or - * SEND_TRAILING_METADATA ops pending */ + // Send the initial metadata on wire if there is no SEND_MESSAGE or + // SEND_TRAILING_METADATA ops pending if (t->use_packet_coalescing) { if (s->state.flush_cronet_when_ready) { CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_flush (%p)", s->cbs); @@ -542,9 +542,9 @@ static void on_stream_ready(bidirectional_stream* stream) { execute_from_storage(s); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_response_headers_received( bidirectional_stream* stream, const bidirectional_stream_header_array* headers, @@ -555,14 +555,14 @@ static void on_response_headers_received( headers, negotiated_protocol); stream_obj* s = static_cast(stream->annotation); - /* Identify if this is a header or a trailer (in a trailer-only response case) - */ + // Identify if this is a header or a trailer (in a trailer-only response case) + // for (size_t i = 0; i < headers->count; i++) { if (0 == strcmp("grpc-status", headers->headers[i].key)) { on_response_trailers_received(stream, headers); - /* Do an extra read for a trailer-only stream to trigger on_succeeded() - * callback */ + // Do an extra read for a trailer-only stream to trigger on_succeeded() + // callback read_grpc_header(s); return; } @@ -573,8 +573,8 @@ static void on_response_headers_received( s->state.state_callback_received[OP_RECV_INITIAL_METADATA] = true; if (!(s->state.state_op_done[OP_CANCEL_ERROR] || s->state.state_callback_received[OP_FAILED])) { - /* Do an extra read to trigger on_succeeded() callback in case connection - is closed */ + // Do an extra read to trigger on_succeeded() callback in case connection + // is closed GPR_ASSERT(s->state.rs.length_field_received == false); read_grpc_header(s); } @@ -582,9 +582,9 @@ static void on_response_headers_received( execute_from_storage(s); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_write_completed(bidirectional_stream* stream, const char* data) { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; @@ -600,9 +600,9 @@ static void on_write_completed(bidirectional_stream* stream, const char* data) { execute_from_storage(s); } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_read_completed(bidirectional_stream* stream, char* data, int count) { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; @@ -639,9 +639,9 @@ static void on_read_completed(bidirectional_stream* stream, char* data, } } -/* - Cronet callback -*/ +// +// Cronet callback +// static void on_response_trailers_received( bidirectional_stream* stream, const bidirectional_stream_header_array* trailers) { @@ -658,8 +658,8 @@ static void on_response_trailers_received( s->state.rs.trailing_metadata_valid = true; } s->state.state_callback_received[OP_RECV_TRAILING_METADATA] = true; - /* Send a EOS when server terminates the stream (testServerFinishesRequest) to - * trigger on_succeeded */ + // Send a EOS when server terminates the stream (testServerFinishesRequest) to + // trigger on_succeeded if (!s->state.state_op_done[OP_SEND_TRAILING_METADATA] && !(s->state.state_op_done[OP_CANCEL_ERROR] || s->state.state_callback_received[OP_FAILED])) { @@ -679,29 +679,29 @@ static void on_response_trailers_received( } } -/* - Utility function that takes the data from s->write_slice_buffer and assembles - into a contiguous byte stream with 5 byte gRPC header prepended. -*/ +// +// Utility function that takes the data from s->write_slice_buffer and assembles +// into a contiguous byte stream with 5 byte gRPC header prepended. +// static void create_grpc_frame(grpc_slice_buffer* write_slice_buffer, char** pp_write_buffer, size_t* p_write_buffer_size, uint32_t flags) { size_t length = write_slice_buffer->length; *p_write_buffer_size = length + GRPC_HEADER_SIZE_IN_BYTES; - /* This is freed in the on_write_completed callback */ + // This is freed in the on_write_completed callback char* write_buffer = static_cast(gpr_malloc(length + GRPC_HEADER_SIZE_IN_BYTES)); *pp_write_buffer = write_buffer; uint8_t* p = reinterpret_cast(write_buffer); - /* Append 5 byte header */ - /* Compressed flag */ + // Append 5 byte header + // Compressed flag *p++ = static_cast((flags & GRPC_WRITE_INTERNAL_COMPRESS) ? 1 : 0); - /* Message length */ + // Message length *p++ = static_cast(length >> 24); *p++ = static_cast(length >> 16); *p++ = static_cast(length >> 8); *p++ = static_cast(length); - /* append actual data */ + // append actual data size_t offset = 0; for (size_t i = 0; i < write_slice_buffer->count; ++i) { memcpy(p + offset, GRPC_SLICE_START_PTR(write_slice_buffer->slices[i]), @@ -739,11 +739,11 @@ class CronetMetadataEncoder { void Encode(grpc_core::HttpSchemeMetadata, grpc_core::HttpSchemeMetadata::ValueType) { - /* Cronet populates these fields on its own */ + // Cronet populates these fields on its own } void Encode(grpc_core::HttpAuthorityMetadata, const grpc_core::HttpAuthorityMetadata::ValueType&) { - /* Cronet populates these fields on its own */ + // Cronet populates these fields on its own } void Encode(grpc_core::HttpMethodMetadata, @@ -761,7 +761,7 @@ class CronetMetadataEncoder { void Encode(grpc_core::HttpPathMetadata, const grpc_core::HttpPathMetadata::ValueType& path) { - /* Create URL by appending :path value to the hostname */ + // Create URL by appending :path value to the hostname *url_ = absl::StrCat("https://", host_, path.as_string_view()); } @@ -793,9 +793,9 @@ class CronetMetadataEncoder { }; } // namespace -/* - Convert metadata in a format that Cronet can consume -*/ +// +// Convert metadata in a format that Cronet can consume +// static void convert_metadata_to_cronet_headers( grpc_metadata_batch* metadata, const char* host, std::string* pp_url, bidirectional_stream_header** pp_headers, size_t* p_num_headers, @@ -821,19 +821,19 @@ static bool header_has_authority(const grpc_metadata_batch* b) { return b->get_pointer(grpc_core::HttpAuthorityMetadata()) != nullptr; } -/* - Op Execution: Decide if one of the actions contained in the stream op can be - executed. This is the heart of the state machine. -*/ +// +// Op Execution: Decide if one of the actions contained in the stream op can be +// executed. This is the heart of the state machine. +// static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, struct stream_obj* s, struct op_state* op_state, enum e_op_id op_id) { struct op_state* stream_state = &s->state; grpc_cronet_transport* t = s->curr_ct; bool result = true; - /* When call is canceled, every op can be run, except under following - conditions - */ + // When call is canceled, every op can be run, except under following + // conditions + // bool is_canceled_or_failed = stream_state->state_op_done[OP_CANCEL_ERROR] || stream_state->state_callback_received[OP_FAILED]; if (is_canceled_or_failed) { @@ -853,7 +853,7 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, CRONET_LOG(GPR_DEBUG, "Because"); result = false; } - /* already executed */ + // already executed if (op_id == OP_RECV_INITIAL_METADATA && stream_state->state_op_done[OP_RECV_INITIAL_METADATA]) { CRONET_LOG(GPR_DEBUG, "Because"); @@ -868,11 +868,11 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, CRONET_LOG(GPR_DEBUG, "Because"); result = false; } - /* ON_COMPLETE can be processed if one of the following conditions is met: - * 1. the stream failed - * 2. the stream is cancelled, and the callback is received - * 3. the stream succeeded before cancel is effective - * 4. the stream is cancelled, and the stream is never started */ + // ON_COMPLETE can be processed if one of the following conditions is met: + // 1. the stream failed + // 2. the stream is cancelled, and the callback is received + // 3. the stream succeeded before cancel is effective + // 4. the stream is cancelled, and the stream is never started if (op_id == OP_ON_COMPLETE && !(stream_state->state_callback_received[OP_FAILED] || stream_state->state_callback_received[OP_CANCELED] || @@ -882,92 +882,92 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, result = false; } } else if (op_id == OP_SEND_INITIAL_METADATA) { - /* already executed */ + // already executed if (stream_state->state_op_done[OP_SEND_INITIAL_METADATA]) result = false; } else if (op_id == OP_RECV_INITIAL_METADATA) { if (stream_state->state_op_done[OP_RECV_INITIAL_METADATA]) { - /* already executed */ + // already executed result = false; } else if (!stream_state ->state_callback_received[OP_SEND_INITIAL_METADATA]) { - /* we haven't sent headers yet. */ + // we haven't sent headers yet. result = false; } else if (!stream_state ->state_callback_received[OP_RECV_INITIAL_METADATA] && !stream_state->state_op_done[OP_RECV_TRAILING_METADATA]) { - /* we haven't received headers yet. */ + // we haven't received headers yet. result = false; } } else if (op_id == OP_SEND_MESSAGE) { if (op_state->state_op_done[OP_SEND_MESSAGE]) { - /* already executed (note we're checking op specific state, not stream - state) */ + // already executed (note we're checking op specific state, not stream + // state) result = false; } else if (!stream_state ->state_callback_received[OP_SEND_INITIAL_METADATA]) { - /* we haven't sent headers yet. */ + // we haven't sent headers yet. result = false; } } else if (op_id == OP_RECV_MESSAGE) { if (op_state->state_op_done[OP_RECV_MESSAGE]) { - /* already executed */ + // already executed result = false; } else if (!stream_state ->state_callback_received[OP_RECV_INITIAL_METADATA] && !stream_state->state_op_done[OP_RECV_TRAILING_METADATA]) { - /* we haven't received headers yet. */ + // we haven't received headers yet. result = false; } } else if (op_id == OP_RECV_TRAILING_METADATA) { if (stream_state->state_op_done[OP_RECV_TRAILING_METADATA]) { - /* already executed */ + // already executed result = false; } else if (stream_state->state_op_done[OP_READ_REQ_MADE] && !stream_state->state_op_done[OP_RECV_MESSAGE]) { - /* we have asked for but haven't received message yet. */ + // we have asked for but haven't received message yet. result = false; } else if (!stream_state ->state_callback_received[OP_RECV_TRAILING_METADATA]) { - /* we haven't received trailers yet. */ + // we haven't received trailers yet. result = false; } else if (!stream_state->state_callback_received[OP_SUCCEEDED]) { - /* we haven't received on_succeeded yet. */ + // we haven't received on_succeeded yet. result = false; } } else if (op_id == OP_SEND_TRAILING_METADATA) { if (stream_state->state_op_done[OP_SEND_TRAILING_METADATA]) { - /* already executed */ + // already executed result = false; } else if (!stream_state ->state_callback_received[OP_SEND_INITIAL_METADATA]) { - /* we haven't sent initial metadata yet */ + // we haven't sent initial metadata yet result = false; } else if (stream_state->pending_send_message && !stream_state->state_op_done[OP_SEND_MESSAGE]) { - /* we haven't sent message yet */ + // we haven't sent message yet result = false; } else if (stream_state->state_op_done[OP_SEND_MESSAGE] && !stream_state->state_callback_received[OP_SEND_MESSAGE] && !(t->use_packet_coalescing && stream_state->pending_write_for_trailer)) { - /* we haven't got on_write_completed for the send yet */ + // we haven't got on_write_completed for the send yet result = false; } } else if (op_id == OP_CANCEL_ERROR) { - /* already executed */ + // already executed if (stream_state->state_op_done[OP_CANCEL_ERROR]) result = false; } else if (op_id == OP_ON_COMPLETE) { if (op_state->state_op_done[OP_ON_COMPLETE]) { - /* already executed (note we're checking op specific state, not stream - state) */ + // already executed (note we're checking op specific state, not stream + // state) CRONET_LOG(GPR_DEBUG, "Because"); result = false; } - /* Check if every op that was asked for is done. */ - /* TODO(muxi): We should not consider the recv ops here, since they - * have their own callbacks. We should invoke a batch's on_complete - * as soon as all of the batch's send ops are complete, even if - * there are still recv ops pending. */ + // Check if every op that was asked for is done. + // TODO(muxi): We should not consider the recv ops here, since they + // have their own callbacks. We should invoke a batch's on_complete + // as soon as all of the batch's send ops are complete, even if + // there are still recv ops pending. else if (curr_op->send_initial_metadata && !stream_state->state_callback_received[OP_SEND_INITIAL_METADATA]) { CRONET_LOG(GPR_DEBUG, "Because"); @@ -997,16 +997,16 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, CRONET_LOG(GPR_DEBUG, "Because"); result = false; } else if (curr_op->recv_trailing_metadata) { - /* We aren't done with trailing metadata yet */ + // We aren't done with trailing metadata yet if (!stream_state->state_op_done[OP_RECV_TRAILING_METADATA]) { CRONET_LOG(GPR_DEBUG, "Because"); result = false; } - /* We've asked for actual message in an earlier op, and it hasn't been - delivered yet. */ + // We've asked for actual message in an earlier op, and it hasn't been + // delivered yet. else if (stream_state->state_op_done[OP_READ_REQ_MADE]) { - /* If this op is not the one asking for read, (which means some earlier - op has asked), and the read hasn't been delivered. */ + // If this op is not the one asking for read, (which means some earlier + // op has asked), and the read hasn't been delivered. if (!curr_op->recv_message && !stream_state->state_callback_received[OP_SUCCEEDED]) { CRONET_LOG(GPR_DEBUG, "Because"); @@ -1014,8 +1014,8 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, } } } - /* We should see at least one on_write_completed for the trailers that we - sent */ + // We should see at least one on_write_completed for the trailers that we + // sent else if (curr_op->send_trailing_metadata && !stream_state->state_callback_received[OP_SEND_MESSAGE]) { result = false; @@ -1026,9 +1026,9 @@ static bool op_can_be_run(grpc_transport_stream_op_batch* curr_op, return result; } -/* - TODO (makdharma): Break down this function in smaller chunks for readability. -*/ +// +// TODO (makdharma): Break down this function in smaller chunks for readability. +// static enum e_op_result execute_stream_op(struct op_and_state* oas) { grpc_transport_stream_op_batch* stream_op = &oas->op; struct stream_obj* s = oas->s; @@ -1038,8 +1038,8 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { if (stream_op->send_initial_metadata && op_can_be_run(stream_op, s, &oas->state, OP_SEND_INITIAL_METADATA)) { CRONET_LOG(GPR_DEBUG, "running: %p OP_SEND_INITIAL_METADATA", oas); - /* Start new cronet stream. It is destroyed in on_succeeded, on_canceled, - * on_failed */ + // Start new cronet stream. It is destroyed in on_succeeded, on_canceled, + // on_failed GPR_ASSERT(s->cbs == nullptr); GPR_ASSERT(!stream_state->state_op_done[OP_SEND_INITIAL_METADATA]); s->cbs = @@ -1108,7 +1108,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { result = ACTION_TAKEN_WITH_CALLBACK; } } else { - /* Should never reach here */ + // Should never reach here GPR_ASSERT(false); } } @@ -1183,7 +1183,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { oas->state.state_op_done[OP_RECV_MESSAGE] = true; result = ACTION_TAKEN_NO_CALLBACK; } else if (stream_state->rs.read_stream_closed) { - /* No more data will be received */ + // No more data will be received CRONET_LOG(GPR_DEBUG, "read stream closed"); grpc_core::ExecCtx::Run( DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready, @@ -1202,7 +1202,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { } else if (!stream_state->rs.length_field_received) { if (stream_state->rs.received_bytes == GRPC_HEADER_SIZE_IN_BYTES && stream_state->rs.remaining_bytes == 0) { - /* Start a read operation for data */ + // Start a read operation for data stream_state->rs.length_field_received = true; parse_grpc_header( reinterpret_cast(stream_state->rs.read_buffer), @@ -1217,14 +1217,14 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { stream_state->rs.received_bytes = 0; CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs); stream_state->state_op_done[OP_READ_REQ_MADE] = - true; /* Indicates that at least one read request has been made */ + true; // Indicates that at least one read request has been made bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer, stream_state->rs.remaining_bytes); result = ACTION_TAKEN_WITH_CALLBACK; } else { stream_state->rs.remaining_bytes = 0; CRONET_LOG(GPR_DEBUG, "read operation complete. Empty response."); - /* Clean up read_slice_buffer in case there is unread data. */ + // Clean up read_slice_buffer in case there is unread data. stream_state->rs.read_slice_buffer.Clear(); uint32_t flags = 0; if (stream_state->rs.compressed) { @@ -1240,22 +1240,22 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { stream_state->state_op_done[OP_RECV_MESSAGE] = true; oas->state.state_op_done[OP_RECV_MESSAGE] = true; - /* Extra read to trigger on_succeed */ + // Extra read to trigger on_succeed stream_state->rs.length_field_received = false; stream_state->state_op_done[OP_READ_REQ_MADE] = - true; /* Indicates that at least one read request has been made */ + true; // Indicates that at least one read request has been made read_grpc_header(s); result = ACTION_TAKEN_NO_CALLBACK; } } else if (stream_state->rs.remaining_bytes == 0) { - /* Start a read operation for first 5 bytes (GRPC header) */ + // Start a read operation for first 5 bytes (GRPC header) stream_state->rs.read_buffer = stream_state->rs.grpc_header_bytes; stream_state->rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES; stream_state->rs.received_bytes = 0; stream_state->rs.compressed = false; CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs); stream_state->state_op_done[OP_READ_REQ_MADE] = - true; /* Indicates that at least one read request has been made */ + true; // Indicates that at least one read request has been made bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer, stream_state->rs.remaining_bytes); result = ACTION_TAKEN_WITH_CALLBACK; @@ -1270,7 +1270,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { memcpy(dst_p, stream_state->rs.read_buffer, static_cast(stream_state->rs.length_field)); null_and_maybe_free_read_buffer(s); - /* Clean up read_slice_buffer in case there is unread data. */ + // Clean up read_slice_buffer in case there is unread data. stream_state->rs.read_slice_buffer.Clear(); stream_state->rs.read_slice_buffer.Append( grpc_core::Slice(read_data_slice)); @@ -1286,8 +1286,8 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { absl::OkStatus()); stream_state->state_op_done[OP_RECV_MESSAGE] = true; oas->state.state_op_done[OP_RECV_MESSAGE] = true; - /* Do an extra read to trigger on_succeeded() callback in case connection - is closed */ + // Do an extra read to trigger on_succeeded() callback in case connection + // is closed stream_state->rs.length_field_received = false; read_grpc_header(s); result = ACTION_TAKEN_NO_CALLBACK; @@ -1350,9 +1350,9 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { error_message)); } } else { - /* All actions in this stream_op are complete. Call the on_complete - * callback - */ + // All actions in this stream_op are complete. Call the on_complete + // callback + // if (stream_op->on_complete) { grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_op->on_complete, absl::OkStatus()); @@ -1360,15 +1360,15 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { } oas->state.state_op_done[OP_ON_COMPLETE] = true; oas->done = true; - /* reset any send message state, only if this ON_COMPLETE is about a send. - */ + // reset any send message state, only if this ON_COMPLETE is about a send. + // if (stream_op->send_message) { stream_state->state_callback_received[OP_SEND_MESSAGE] = false; stream_state->state_op_done[OP_SEND_MESSAGE] = false; } result = ACTION_TAKEN_NO_CALLBACK; - /* If this is the on_complete callback being called for a received message - - make a note */ + // If this is the on_complete callback being called for a received message - + // make a note if (stream_op->recv_message) { stream_state->state_op_done[OP_RECV_MESSAGE_AND_ON_COMPLETE] = true; } @@ -1378,9 +1378,9 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) { return result; } -/* - Functions used by upper layers to access transport functionality. -*/ +// +// Functions used by upper layers to access transport functionality. +// inline stream_obj::stream_obj(grpc_transport* gt, grpc_stream* gs, grpc_stream_refcount* refcount, @@ -1416,8 +1416,8 @@ static void perform_stream_op(grpc_transport* /*gt*/, grpc_stream* gs, if (op->send_initial_metadata && header_has_authority( op->payload->send_initial_metadata.send_initial_metadata)) { - /* Cronet does not support :authority header field. We cancel the call when - this field is present in metadata */ + // Cronet does not support :authority header field. We cancel the call when + // this field is present in metadata if (op->recv_initial_metadata) { grpc_core::ExecCtx::Run( DEBUG_LOCATION, diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.h b/src/core/ext/transport/cronet/transport/cronet_transport.h index 86863f92f09..a4c4f14dfcd 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.h +++ b/src/core/ext/transport/cronet/transport/cronet_transport.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H #define GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H @@ -29,4 +29,4 @@ grpc_transport* grpc_create_cronet_transport(void* engine, const char* target, const grpc_channel_args* args, void* reserved); -#endif /* GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_CRONET_TRANSPORT_CRONET_TRANSPORT_H diff --git a/src/core/ext/transport/inproc/inproc_plugin.cc b/src/core/ext/transport/inproc/inproc_plugin.cc index e0abdbbe638..98ac752e6b2 100644 --- a/src/core/ext/transport/inproc/inproc_plugin.cc +++ b/src/core/ext/transport/inproc/inproc_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/ext/transport/inproc/inproc_transport.cc b/src/core/ext/transport/inproc/inproc_transport.cc index aa761a38ec9..dc6b4804f0a 100644 --- a/src/core/ext/transport/inproc/inproc_transport.cc +++ b/src/core/ext/transport/inproc/inproc_transport.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -1093,7 +1093,7 @@ void close_transport_locked(inproc_transport* t) { "close transport"); if (!t->is_closed) { t->is_closed = true; - /* Also end all streams on this transport */ + // Also end all streams on this transport while (t->stream_list != nullptr) { // cancel_stream_locked also adjusts stream list cancel_stream_locked( @@ -1161,9 +1161,9 @@ void destroy_transport(grpc_transport* gt) { t->unref(); } -/******************************************************************************* - * INTEGRATION GLUE - */ +//****************************************************************************** +// INTEGRATION GLUE +// void set_pollset(grpc_transport* /*gt*/, grpc_stream* /*gs*/, grpc_pollset* /*pollset*/) { @@ -1185,9 +1185,9 @@ const grpc_transport_vtable inproc_vtable = { destroy_stream, destroy_transport, get_endpoint}; -/******************************************************************************* - * Main inproc transport functions - */ +//****************************************************************************** +// Main inproc transport functions +// void inproc_transports_create(grpc_transport** server_transport, grpc_transport** client_transport) { INPROC_LOG(GPR_INFO, "inproc_transports_create"); diff --git a/src/core/ext/transport/inproc/inproc_transport.h b/src/core/ext/transport/inproc/inproc_transport.h index 7dbb9c1752a..cfc12936657 100644 --- a/src/core/ext/transport/inproc/inproc_transport.h +++ b/src/core/ext/transport/inproc/inproc_transport.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H #define GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H @@ -31,4 +31,4 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server, extern grpc_core::TraceFlag grpc_inproc_trace; -#endif /* GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H */ +#endif // GRPC_CORE_EXT_TRANSPORT_INPROC_INPROC_TRANSPORT_H diff --git a/src/core/ext/xds/xds_channel_args.h b/src/core/ext/xds/xds_channel_args.h index ea6c862b497..c70e0a07bd6 100644 --- a/src/core/ext/xds/xds_channel_args.h +++ b/src/core/ext/xds/xds_channel_args.h @@ -29,4 +29,4 @@ #define GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS \ "grpc.xds_resource_does_not_exist_timeout_ms" -#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H */ +#endif // GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H diff --git a/src/core/ext/xds/xds_channel_stack_modifier.h b/src/core/ext/xds/xds_channel_stack_modifier.h index 3355ca52c5d..d76c9f423d9 100644 --- a/src/core/ext/xds/xds_channel_stack_modifier.h +++ b/src/core/ext/xds/xds_channel_stack_modifier.h @@ -62,4 +62,4 @@ class XdsChannelStackModifier : public RefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H */ +#endif // GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H diff --git a/src/core/ext/xds/xds_client_stats.cc b/src/core/ext/xds/xds_client_stats.cc index 0013ad92fde..1cdca73220c 100644 --- a/src/core/ext/xds/xds_client_stats.cc +++ b/src/core/ext/xds/xds_client_stats.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/ext/xds/xds_client_stats.h b/src/core/ext/xds/xds_client_stats.h index bc42dc085db..5fc6fa4b2d9 100644 --- a/src/core/ext/xds/xds_client_stats.h +++ b/src/core/ext/xds/xds_client_stats.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H #define GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H @@ -239,4 +239,4 @@ class XdsClusterLocalityStats : public RefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H */ +#endif // GRPC_CORE_EXT_XDS_XDS_CLIENT_STATS_H diff --git a/src/core/lib/address_utils/parse_address.cc b/src/core/lib/address_utils/parse_address.cc index aaf676d3de5..c72987c5d29 100644 --- a/src/core/lib/address_utils/parse_address.cc +++ b/src/core/lib/address_utils/parse_address.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -117,7 +117,7 @@ grpc_error_handle UnixAbstractSockaddrPopulate( } // namespace grpc_core -#else /* GRPC_HAVE_UNIX_SOCKET */ +#else // GRPC_HAVE_UNIX_SOCKET bool grpc_parse_unix(const grpc_core::URI& /* uri */, grpc_resolved_address* /* resolved_addr */) { @@ -142,7 +142,7 @@ grpc_error_handle UnixAbstractSockaddrPopulate( } } // namespace grpc_core -#endif /* GRPC_HAVE_UNIX_SOCKET */ +#endif // GRPC_HAVE_UNIX_SOCKET bool grpc_parse_ipv4_hostport(absl::string_view hostport, grpc_resolved_address* addr, bool log_errors) { diff --git a/src/core/lib/address_utils/parse_address.h b/src/core/lib/address_utils/parse_address.h index c44ec619449..6005f5f262c 100644 --- a/src/core/lib/address_utils/parse_address.h +++ b/src/core/lib/address_utils/parse_address.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H #define GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H @@ -30,37 +30,37 @@ #include "src/core/lib/iomgr/resolved_address.h" #include "src/core/lib/uri/uri_parser.h" -/** Populate \a resolved_addr from \a uri, whose path is expected to contain a - * unix socket path. Returns true upon success. */ +/// Populate \a resolved_addr from \a uri, whose path is expected to contain a +/// unix socket path. Returns true upon success. bool grpc_parse_unix(const grpc_core::URI& uri, grpc_resolved_address* resolved_addr); -/** Populate \a resolved_addr from \a uri, whose path is expected to contain a - * unix socket path in the abstract namespace. Returns true upon success. */ +/// Populate \a resolved_addr from \a uri, whose path is expected to contain a +/// unix socket path in the abstract namespace. Returns true upon success. bool grpc_parse_unix_abstract(const grpc_core::URI& uri, grpc_resolved_address* resolved_addr); -/** Populate \a resolved_addr from \a uri, whose path is expected to contain an - * IPv4 host:port pair. Returns true upon success. */ +/// Populate \a resolved_addr from \a uri, whose path is expected to contain an +/// IPv4 host:port pair. Returns true upon success. bool grpc_parse_ipv4(const grpc_core::URI& uri, grpc_resolved_address* resolved_addr); -/** Populate \a resolved_addr from \a uri, whose path is expected to contain an - * IPv6 host:port pair. Returns true upon success. */ +/// Populate \a resolved_addr from \a uri, whose path is expected to contain an +/// IPv6 host:port pair. Returns true upon success. bool grpc_parse_ipv6(const grpc_core::URI& uri, grpc_resolved_address* resolved_addr); -/** Populate \a resolved_addr from \a uri. Returns true upon success. */ +/// Populate \a resolved_addr from \a uri. Returns true upon success. bool grpc_parse_uri(const grpc_core::URI& uri, grpc_resolved_address* resolved_addr); -/** Parse bare IPv4 or IPv6 "IP:port" strings. */ +/// Parse bare IPv4 or IPv6 "IP:port" strings. bool grpc_parse_ipv4_hostport(absl::string_view hostport, grpc_resolved_address* addr, bool log_errors); bool grpc_parse_ipv6_hostport(absl::string_view hostport, grpc_resolved_address* addr, bool log_errors); -/* Converts named or numeric port to a uint16 suitable for use in a sockaddr. */ +// Converts named or numeric port to a uint16 suitable for use in a sockaddr. uint16_t grpc_strhtons(const char* port); namespace grpc_core { @@ -72,15 +72,15 @@ absl::StatusOr StringToSockaddr( absl::StatusOr StringToSockaddr( absl::string_view address, int port); -/** Populate \a resolved_addr to be a unix socket at |path| */ +/// Populate \a resolved_addr to be a unix socket at |path| grpc_error_handle UnixSockaddrPopulate(absl::string_view path, grpc_resolved_address* resolved_addr); -/** Populate \a resolved_addr to be a unix socket in the abstract namespace - * at |path| */ +/// Populate \a resolved_addr to be a unix socket in the abstract namespace +/// at |path| grpc_error_handle UnixAbstractSockaddrPopulate( absl::string_view path, grpc_resolved_address* resolved_addr); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H */ +#endif // GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H diff --git a/src/core/lib/address_utils/sockaddr_utils.cc b/src/core/lib/address_utils/sockaddr_utils.cc index 9e49410c671..08a39cd82c1 100644 --- a/src/core/lib/address_utils/sockaddr_utils.cc +++ b/src/core/lib/address_utils/sockaddr_utils.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -93,10 +93,10 @@ int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* resolved_addr, if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix, sizeof(kV4MappedPrefix)) == 0) { if (resolved_addr4_out != nullptr) { - /* Normalize ::ffff:0.0.0.0/96 to IPv4. */ + // Normalize ::ffff:0.0.0.0/96 to IPv4. memset(resolved_addr4_out, 0, sizeof(*resolved_addr4_out)); addr4_out->sin_family = GRPC_AF_INET; - /* s6_addr32 would be nice, but it's non-standard. */ + // s6_addr32 would be nice, but it's non-standard. memcpy(&addr4_out->sin_addr, &addr6->sin6_addr.s6_addr[12], 4); addr4_out->sin_port = addr6->sin6_port; resolved_addr4_out->len = @@ -138,7 +138,7 @@ int grpc_sockaddr_is_wildcard(const grpc_resolved_address* resolved_addr, } addr = reinterpret_cast(resolved_addr->addr); if (addr->sa_family == GRPC_AF_INET) { - /* Check for 0.0.0.0 */ + // Check for 0.0.0.0 const grpc_sockaddr_in* addr4 = reinterpret_cast(addr); if (addr4->sin_addr.s_addr != 0) { @@ -147,7 +147,7 @@ int grpc_sockaddr_is_wildcard(const grpc_resolved_address* resolved_addr, *port_out = grpc_ntohs(addr4->sin_port); return 1; } else if (addr->sa_family == GRPC_AF_INET6) { - /* Check for :: */ + // Check for :: const grpc_sockaddr_in6* addr6 = reinterpret_cast(addr); int i; @@ -252,7 +252,7 @@ absl::StatusOr grpc_sockaddr_to_string( return absl::InvalidArgumentError( absl::StrCat("Unknown sockaddr family: ", addr->sa_family)); } - /* This is probably redundant, but we wouldn't want to log the wrong error. */ + // This is probably redundant, but we wouldn't want to log the wrong error. errno = save_errno; return out; } diff --git a/src/core/lib/address_utils/sockaddr_utils.h b/src/core/lib/address_utils/sockaddr_utils.h index 600614298db..acde2aaaab8 100644 --- a/src/core/lib/address_utils/sockaddr_utils.h +++ b/src/core/lib/address_utils/sockaddr_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H #define GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H @@ -29,37 +29,37 @@ #include "src/core/lib/iomgr/resolved_address.h" -/* Returns true if addr is an IPv4-mapped IPv6 address within the - ::ffff:0.0.0.0/96 range, or false otherwise. +// Returns true if addr is an IPv4-mapped IPv6 address within the +// ::ffff:0.0.0.0/96 range, or false otherwise. - If addr4_out is non-NULL, the inner IPv4 address will be copied here when - returning true. */ +// If addr4_out is non-NULL, the inner IPv4 address will be copied here when +// returning true. int grpc_sockaddr_is_v4mapped(const grpc_resolved_address* addr, grpc_resolved_address* addr4_out); -/* If addr is an AF_INET address, writes the corresponding ::ffff:0.0.0.0/96 - address to addr6_out and returns true. Otherwise returns false. */ +// If addr is an AF_INET address, writes the corresponding ::ffff:0.0.0.0/96 +// address to addr6_out and returns true. Otherwise returns false. int grpc_sockaddr_to_v4mapped(const grpc_resolved_address* addr, grpc_resolved_address* addr6_out); -/* If addr is ::, 0.0.0.0, or ::ffff:0.0.0.0, writes the port number to - *port_out (if not NULL) and returns true, otherwise returns false. */ +// If addr is ::, 0.0.0.0, or ::ffff:0.0.0.0, writes the port number to +// port_out (if not NULL) and returns true, otherwise returns false. int grpc_sockaddr_is_wildcard(const grpc_resolved_address* addr, int* port_out); -/* Writes 0.0.0.0:port and [::]:port to separate sockaddrs. */ +// Writes 0.0.0.0:port and [::]:port to separate sockaddrs. void grpc_sockaddr_make_wildcards(int port, grpc_resolved_address* wild4_out, grpc_resolved_address* wild6_out); -/* Writes 0.0.0.0:port. */ +// Writes 0.0.0.0:port. void grpc_sockaddr_make_wildcard4(int port, grpc_resolved_address* wild_out); -/* Writes [::]:port. */ +// Writes [::]:port. void grpc_sockaddr_make_wildcard6(int port, grpc_resolved_address* wild_out); -/* Return the IP port number of a sockaddr */ +// Return the IP port number of a sockaddr int grpc_sockaddr_get_port(const grpc_resolved_address* addr); -/* Set IP port number of a sockaddr */ +// Set IP port number of a sockaddr int grpc_sockaddr_set_port(grpc_resolved_address* addr, int port); // Converts a sockaddr into a newly-allocated human-readable string. @@ -70,11 +70,11 @@ int grpc_sockaddr_set_port(grpc_resolved_address* addr, int port); absl::StatusOr grpc_sockaddr_to_string( const grpc_resolved_address* addr, bool normalize) GRPC_MUST_USE_RESULT; -/* Returns the URI string corresponding to \a addr */ +// Returns the URI string corresponding to \a addr absl::StatusOr grpc_sockaddr_to_uri( const grpc_resolved_address* addr); -/* Returns the URI scheme corresponding to \a addr */ +// Returns the URI scheme corresponding to \a addr const char* grpc_sockaddr_get_uri_scheme(const grpc_resolved_address* addr); int grpc_sockaddr_get_family(const grpc_resolved_address* resolved_addr); @@ -97,4 +97,4 @@ bool grpc_sockaddr_match_subnet(const grpc_resolved_address* address, const grpc_resolved_address* subnet_address, uint32_t mask_bits); -#endif /* GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H */ +#endif // GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H diff --git a/src/core/lib/avl/avl.h b/src/core/lib/avl/avl.h index 33d2ae661f7..117bd64d312 100644 --- a/src/core/lib/avl/avl.h +++ b/src/core/lib/avl/avl.h @@ -215,7 +215,7 @@ class AVL { static NodePtr RotateLeftRight(K key, V value, const NodePtr& left, const NodePtr& right) { - /* rotate_right(..., rotate_left(left), right) */ + // rotate_right(..., rotate_left(left), right) return MakeNode( left->right->kv.first, left->right->kv.second, MakeNode(left->kv.first, left->kv.second, left->left, @@ -225,7 +225,7 @@ class AVL { static NodePtr RotateRightLeft(K key, V value, const NodePtr& left, const NodePtr& right) { - /* rotate_left(..., left, rotate_right(right)) */ + // rotate_left(..., left, rotate_right(right)) return MakeNode( right->left->kv.first, right->left->kv.second, MakeNode(std::move(key), std::move(value), left, right->left->left), @@ -390,7 +390,7 @@ class AVL { static NodePtr RotateLeftRight(K key, const NodePtr& left, const NodePtr& right) { - /* rotate_right(..., rotate_left(left), right) */ + // rotate_right(..., rotate_left(left), right) return MakeNode(left->right->key, MakeNode(left->key, left->left, left->right->left), MakeNode(std::move(key), left->right->right, right)); @@ -398,7 +398,7 @@ class AVL { static NodePtr RotateRightLeft(K key, const NodePtr& left, const NodePtr& right) { - /* rotate_left(..., left, rotate_right(right)) */ + // rotate_left(..., left, rotate_right(right)) return MakeNode(right->left->key, MakeNode(std::move(key), left, right->left->left), MakeNode(right->key, right->left->right, right->right)); diff --git a/src/core/lib/backoff/backoff.cc b/src/core/lib/backoff/backoff.cc index bec0af3ea8d..65716155c40 100644 --- a/src/core/lib/backoff/backoff.cc +++ b/src/core/lib/backoff/backoff.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/backoff/backoff.h b/src/core/lib/backoff/backoff.h index 9c03d8b4192..5b1313c4109 100644 --- a/src/core/lib/backoff/backoff.h +++ b/src/core/lib/backoff/backoff.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_BACKOFF_BACKOFF_H #define GRPC_CORE_LIB_BACKOFF_BACKOFF_H @@ -86,4 +86,4 @@ class BackOff { }; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_BACKOFF_BACKOFF_H */ +#endif // GRPC_CORE_LIB_BACKOFF_BACKOFF_H diff --git a/src/core/lib/channel/channel_args.cc b/src/core/lib/channel/channel_args.cc index 18f98721bcd..ca165e3d577 100644 --- a/src/core/lib/channel/channel_args.cc +++ b/src/core/lib/channel/channel_args.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -392,8 +392,8 @@ static int cmp_arg(const grpc_arg* a, const grpc_arg* b) { GPR_UNREACHABLE_CODE(return 0); } -/* stabilizing comparison function: since channel_args ordering matters for - * keys with the same name, we need to preserve that ordering */ +// stabilizing comparison function: since channel_args ordering matters for +// keys with the same name, we need to preserve that ordering static int cmp_key_stable(const void* ap, const void* bp) { const grpc_arg* const* a = static_cast(ap); const grpc_arg* const* b = static_cast(bp); diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index c9dbfb8b6d6..08fddf7d814 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H #define GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H @@ -431,34 +431,34 @@ std::ostream& operator<<(std::ostream& out, const ChannelArgs& args); } // namespace grpc_core -/** Copy the arguments in \a src into a new instance */ +/// Copy the arguments in \a src into a new instance grpc_channel_args* grpc_channel_args_copy(const grpc_channel_args* src); -/** Copy the arguments in \a src into a new instance, stably sorting keys */ +/// Copy the arguments in \a src into a new instance, stably sorting keys grpc_channel_args* grpc_channel_args_normalize(const grpc_channel_args* src); -/** Copy the arguments in \a src and append \a to_add. If \a to_add is NULL, it - * is equivalent to calling \a grpc_channel_args_copy. */ +/// Copy the arguments in \a src and append \a to_add. If \a to_add is NULL, it +/// is equivalent to calling \a grpc_channel_args_copy. grpc_channel_args* grpc_channel_args_copy_and_add(const grpc_channel_args* src, const grpc_arg* to_add, size_t num_to_add); -/** Copies the arguments in \a src except for those whose keys are in - \a to_remove. */ +/// Copies the arguments in \a src except for those whose keys are in +/// \a to_remove. grpc_channel_args* grpc_channel_args_copy_and_remove( const grpc_channel_args* src, const char** to_remove, size_t num_to_remove); -/** Copies the arguments from \a src except for those whose keys are in - \a to_remove and appends the arguments in \a to_add. */ +/// Copies the arguments from \a src except for those whose keys are in +/// \a to_remove and appends the arguments in \a to_add. grpc_channel_args* grpc_channel_args_copy_and_add_and_remove( const grpc_channel_args* src, const char** to_remove, size_t num_to_remove, const grpc_arg* to_add, size_t num_to_add); -/** Perform the union of \a a and \a b, prioritizing \a a entries */ +/// Perform the union of \a a and \a b, prioritizing \a a entries grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a, const grpc_channel_args* b); -/** Destroy arguments created by \a grpc_channel_args_copy */ +/// Destroy arguments created by \a grpc_channel_args_copy void grpc_channel_args_destroy(grpc_channel_args* a); inline void grpc_channel_args_destroy(const grpc_channel_args* a) { grpc_channel_args_destroy(const_cast(a)); @@ -467,7 +467,7 @@ inline void grpc_channel_args_destroy(const grpc_channel_args* a) { int grpc_channel_args_compare(const grpc_channel_args* a, const grpc_channel_args* b); -/** Returns the value of argument \a name from \a args, or NULL if not found. */ +/// Returns the value of argument \a name from \a args, or NULL if not found. const grpc_arg* grpc_channel_args_find(const grpc_channel_args* args, const char* name); @@ -479,28 +479,28 @@ typedef struct grpc_integer_options { int max_value; } grpc_integer_options; -/** Returns the value of \a arg, subject to the constraints in \a options. */ +/// Returns the value of \a arg, subject to the constraints in \a options. int grpc_channel_arg_get_integer(const grpc_arg* arg, const grpc_integer_options options); -/** Similar to the above, but needs to find the arg from \a args by the name - * first. */ +/// Similar to the above, but needs to find the arg from \a args by the name +/// first. int grpc_channel_args_find_integer(const grpc_channel_args* args, const char* name, const grpc_integer_options options); -/** Returns the value of \a arg if \a arg is of type GRPC_ARG_STRING. - Otherwise, emits a warning log, and returns nullptr. - If arg is nullptr, returns nullptr, and does not emit a warning. */ +/// Returns the value of \a arg if \a arg is of type GRPC_ARG_STRING. +/// Otherwise, emits a warning log, and returns nullptr. +/// If arg is nullptr, returns nullptr, and does not emit a warning. char* grpc_channel_arg_get_string(const grpc_arg* arg); -/** Similar to the above, but needs to find the arg from \a args by the name - * first. */ +/// Similar to the above, but needs to find the arg from \a args by the name +/// first. char* grpc_channel_args_find_string(const grpc_channel_args* args, const char* name); -/** If \a arg is of type GRPC_ARG_INTEGER, returns true if it's non-zero. - * Returns \a default_value if \a arg is of other types. */ +/// If \a arg is of type GRPC_ARG_INTEGER, returns true if it's non-zero. +/// Returns \a default_value if \a arg is of other types. bool grpc_channel_arg_get_bool(const grpc_arg* arg, bool default_value); -/** Similar to the above, but needs to find the arg from \a args by the name - * first. */ +/// Similar to the above, but needs to find the arg from \a args by the name +/// first. bool grpc_channel_args_find_bool(const grpc_channel_args* args, const char* name, bool default_value); @@ -541,4 +541,4 @@ void grpc_channel_args_set_client_channel_creation_mutator( grpc_channel_args_client_channel_creation_mutator grpc_channel_args_get_client_channel_creation_mutator(); -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H diff --git a/src/core/lib/channel/channel_stack.cc b/src/core/lib/channel/channel_stack.cc index 163a605cee4..1dce2b0e05c 100644 --- a/src/core/lib/channel/channel_stack.cc +++ b/src/core/lib/channel/channel_stack.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -35,25 +35,25 @@ using grpc_event_engine::experimental::EventEngine; grpc_core::TraceFlag grpc_trace_channel(false, "channel"); grpc_core::TraceFlag grpc_trace_channel_stack(false, "channel_stack"); -/* Memory layouts. +// Memory layouts. - Channel stack is laid out as: { - grpc_channel_stack stk; - padding to GPR_MAX_ALIGNMENT - grpc_channel_element[stk.count]; - per-filter memory, aligned to GPR_MAX_ALIGNMENT - } +// Channel stack is laid out as: { +// grpc_channel_stack stk; +// padding to GPR_MAX_ALIGNMENT +// grpc_channel_element[stk.count]; +// per-filter memory, aligned to GPR_MAX_ALIGNMENT +// } - Call stack is laid out as: { - grpc_call_stack stk; - padding to GPR_MAX_ALIGNMENT - grpc_call_element[stk.count]; - per-filter memory, aligned to GPR_MAX_ALIGNMENT - } */ +// Call stack is laid out as: { +// grpc_call_stack stk; +// padding to GPR_MAX_ALIGNMENT +// grpc_call_element[stk.count]; +// per-filter memory, aligned to GPR_MAX_ALIGNMENT +// } size_t grpc_channel_stack_size(const grpc_channel_filter** filters, size_t filter_count) { - /* always need the header, and size for the channel elements */ + // always need the header, and size for the channel elements size_t size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_channel_stack)) + GPR_ROUND_UP_TO_ALIGNMENT_SIZE(filter_count * sizeof(grpc_channel_element)); @@ -62,7 +62,7 @@ size_t grpc_channel_stack_size(const grpc_channel_filter** filters, GPR_ASSERT((GPR_MAX_ALIGNMENT & (GPR_MAX_ALIGNMENT - 1)) == 0 && "GPR_MAX_ALIGNMENT must be a power of two"); - /* add the size for each filter */ + // add the size for each filter for (i = 0; i < filter_count; i++) { size += GPR_ROUND_UP_TO_ALIGNMENT_SIZE(filters[i]->sizeof_channel_data); } @@ -137,7 +137,7 @@ grpc_error_handle grpc_channel_stack_init( GPR_ROUND_UP_TO_ALIGNMENT_SIZE(filter_count * sizeof(grpc_channel_element)); - /* init per-filter data */ + // init per-filter data grpc_error_handle first_error; auto c_channel_args = channel_args.ToC(); for (i = 0; i < filter_count; i++) { @@ -172,7 +172,7 @@ void grpc_channel_stack_destroy(grpc_channel_stack* stack) { size_t count = stack->count; size_t i; - /* destroy per-filter data */ + // destroy per-filter data for (i = 0; i < count; i++) { channel_elems[i].filter->destroy_channel_elem(&channel_elems[i]); } @@ -198,7 +198,7 @@ grpc_error_handle grpc_call_stack_init( user_data = (reinterpret_cast(call_elems)) + GPR_ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element)); - /* init per-filter data */ + // init per-filter data grpc_error_handle first_error; for (size_t i = 0; i < count; i++) { call_elems[i].filter = channel_elems[i].filter; @@ -227,7 +227,7 @@ void grpc_call_stack_set_pollset_or_pollset_set(grpc_call_stack* call_stack, call_elems = CALL_ELEMS_FROM_STACK(call_stack); - /* init per-filter data */ + // init per-filter data for (i = 0; i < count; i++) { call_elems[i].filter->set_pollset_or_pollset_set(&call_elems[i], pollent); } @@ -243,7 +243,7 @@ void grpc_call_stack_destroy(grpc_call_stack* stack, size_t count = stack->count; size_t i; - /* destroy per-filter data */ + // destroy per-filter data for (i = 0; i < count; i++) { elems[i].filter->destroy_call_elem( &elems[i], final_info, diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index b9de6f14a34..1772c902246 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H #define GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H @@ -26,23 +26,23 @@ // the C++ API in src/cpp/common/channel_filter.{h,cc} ////////////////////////////////////////////////////////////////////////////// -/* A channel filter defines how operations on a channel are implemented. - Channel filters are chained together to create full channels, and if those - chains are linear, then channel stacks provide a mechanism to minimize - allocations for that chain. - Call stacks are created by channel stacks and represent the per-call data - for that stack. - - Implementations should take care of the following details for a batch - - 1. Synchronization is achieved with a CallCombiner. View - src/core/lib/iomgr/call_combiner.h for more details. - 2. If the filter wants to inject an error on the way down, it needs to call - grpc_transport_stream_op_batch_finish_with_failure from within the call - combiner. This will cause any batch callbacks to be called with that error. - 3. If the filter wants to inject an error on the way up (from a callback), it - should also inject that error in the recv_trailing_metadata callback so that - it can have an effect on the call status. -*/ +// A channel filter defines how operations on a channel are implemented. +// Channel filters are chained together to create full channels, and if those +// chains are linear, then channel stacks provide a mechanism to minimize +// allocations for that chain. +// Call stacks are created by channel stacks and represent the per-call data +// for that stack. + +// Implementations should take care of the following details for a batch - +// 1. Synchronization is achieved with a CallCombiner. View +// src/core/lib/iomgr/call_combiner.h for more details. +// 2. If the filter wants to inject an error on the way down, it needs to call +// grpc_transport_stream_op_batch_finish_with_failure from within the call +// combiner. This will cause any batch callbacks to be called with that error. +// 3. If the filter wants to inject an error on the way up (from a callback), it +// should also inject that error in the recv_trailing_metadata callback so that +// it can have an effect on the call status. +// #include @@ -92,121 +92,121 @@ struct grpc_call_element_args { }; struct grpc_call_stats { grpc_transport_stream_stats transport_stream_stats; - gpr_timespec latency; /* From call creating to enqueing of received status */ + gpr_timespec latency; // From call creating to enqueing of received status }; -/** Information about the call upon completion. */ +/// Information about the call upon completion. struct grpc_call_final_info { grpc_call_stats stats; grpc_status_code final_status = GRPC_STATUS_OK; const char* error_string = nullptr; }; -/* Channel filters specify: - 1. the amount of memory needed in the channel & call (via the sizeof_XXX - members) - 2. functions to initialize and destroy channel & call data - (init_XXX, destroy_XXX) - 3. functions to implement call operations and channel operations (call_op, - channel_op) - 4. a name, which is useful when debugging +// Channel filters specify: +// 1. the amount of memory needed in the channel & call (via the sizeof_XXX +// members) +// 2. functions to initialize and destroy channel & call data +// (init_XXX, destroy_XXX) +// 3. functions to implement call operations and channel operations (call_op, +// channel_op) +// 4. a name, which is useful when debugging - Members are laid out in approximate frequency of use order. */ +// Members are laid out in approximate frequency of use order. struct grpc_channel_filter { - /* Called to eg. send/receive data on a call. - See grpc_call_next_op on how to call the next element in the stack */ + // Called to eg. send/receive data on a call. + // See grpc_call_next_op on how to call the next element in the stack void (*start_transport_stream_op_batch)(grpc_call_element* elem, grpc_transport_stream_op_batch* op); - /* Create a promise to execute one call. - If this is non-null, it may be used in preference to - start_transport_stream_op_batch. - If this is used in preference to start_transport_stream_op_batch, the - following can be omitted also: - - calling init_call_elem, destroy_call_elem, set_pollset_or_pollset_set - - allocation of memory for call data - There is an on-going migration to move all filters to providing this, and - then to drop start_transport_stream_op_batch. */ + // Create a promise to execute one call. + // If this is non-null, it may be used in preference to + // start_transport_stream_op_batch. + // If this is used in preference to start_transport_stream_op_batch, the + // following can be omitted also: + // - calling init_call_elem, destroy_call_elem, set_pollset_or_pollset_set + // - allocation of memory for call data + // There is an on-going migration to move all filters to providing this, and + // then to drop start_transport_stream_op_batch. grpc_core::ArenaPromise (*make_call_promise)( grpc_channel_element* elem, grpc_core::CallArgs call_args, grpc_core::NextPromiseFactory next_promise_factory); - /* Called to handle channel level operations - e.g. new calls, or transport - closure. - See grpc_channel_next_op on how to call the next element in the stack */ + // Called to handle channel level operations - e.g. new calls, or transport + // closure. + // See grpc_channel_next_op on how to call the next element in the stack void (*start_transport_op)(grpc_channel_element* elem, grpc_transport_op* op); - /* sizeof(per call data) */ + // sizeof(per call data) size_t sizeof_call_data; - /* Initialize per call data. - elem is initialized at the start of the call, and elem->call_data is what - needs initializing. - The filter does not need to do any chaining. - server_transport_data is an opaque pointer. If it is NULL, this call is - on a client; if it is non-NULL, then it points to memory owned by the - transport and is on the server. Most filters want to ignore this - argument. - Implementations may assume that elem->call_data is all zeros. */ + // Initialize per call data. + // elem is initialized at the start of the call, and elem->call_data is what + // needs initializing. + // The filter does not need to do any chaining. + // server_transport_data is an opaque pointer. If it is NULL, this call is + // on a client; if it is non-NULL, then it points to memory owned by the + // transport and is on the server. Most filters want to ignore this + // argument. + // Implementations may assume that elem->call_data is all zeros. grpc_error_handle (*init_call_elem)(grpc_call_element* elem, const grpc_call_element_args* args); void (*set_pollset_or_pollset_set)(grpc_call_element* elem, grpc_polling_entity* pollent); - /* Destroy per call data. - The filter does not need to do any chaining. - The bottom filter of a stack will be passed a non-NULL pointer to - \a then_schedule_closure that should be passed to GRPC_CLOSURE_SCHED when - destruction is complete. \a final_info contains data about the completed - call, mainly for reporting purposes. */ + // Destroy per call data. + // The filter does not need to do any chaining. + // The bottom filter of a stack will be passed a non-NULL pointer to + // \a then_schedule_closure that should be passed to GRPC_CLOSURE_SCHED when + // destruction is complete. \a final_info contains data about the completed + // call, mainly for reporting purposes. void (*destroy_call_elem)(grpc_call_element* elem, const grpc_call_final_info* final_info, grpc_closure* then_schedule_closure); - /* sizeof(per channel data) */ + // sizeof(per channel data) size_t sizeof_channel_data; - /* Initialize per-channel data. - elem is initialized at the creating of the channel, and elem->channel_data - is what needs initializing. - is_first, is_last designate this elements position in the stack, and are - useful for asserting correct configuration by upper layer code. - The filter does not need to do any chaining. - Implementations may assume that elem->channel_data is all zeros. */ + // Initialize per-channel data. + // elem is initialized at the creating of the channel, and elem->channel_data + // is what needs initializing. + // is_first, is_last designate this elements position in the stack, and are + // useful for asserting correct configuration by upper layer code. + // The filter does not need to do any chaining. + // Implementations may assume that elem->channel_data is all zeros. grpc_error_handle (*init_channel_elem)(grpc_channel_element* elem, grpc_channel_element_args* args); - /* Post init per-channel data. - Called after all channel elements have been successfully created. */ + // Post init per-channel data. + // Called after all channel elements have been successfully created. void (*post_init_channel_elem)(grpc_channel_stack* stk, grpc_channel_element* elem); - /* Destroy per channel data. - The filter does not need to do any chaining */ + // Destroy per channel data. + // The filter does not need to do any chaining void (*destroy_channel_elem)(grpc_channel_element* elem); - /* Implement grpc_channel_get_info() */ + // Implement grpc_channel_get_info() void (*get_channel_info)(grpc_channel_element* elem, const grpc_channel_info* channel_info); - /* The name of this filter */ + // The name of this filter const char* name; }; -/* A channel_element tracks its filter and the filter requested memory within - a channel allocation */ +// A channel_element tracks its filter and the filter requested memory within +// a channel allocation struct grpc_channel_element { const grpc_channel_filter* filter; void* channel_data; }; -/* A call_element tracks its filter, the filter requested memory within - a channel allocation, and the filter requested memory within a call - allocation */ +// A call_element tracks its filter, the filter requested memory within +// a channel allocation, and the filter requested memory within a call +// allocation struct grpc_call_element { const grpc_channel_filter* filter; void* channel_data; void* call_data; }; -/* A channel stack tracks a set of related filters for one channel, and - guarantees they live within a single malloc() allocation */ +// A channel stack tracks a set of related filters for one channel, and +// guarantees they live within a single malloc() allocation struct grpc_channel_stack { grpc_stream_refcount refcount; size_t count; - /* Memory required for a call stack (computed at channel stack - initialization) */ + // Memory required for a call stack (computed at channel stack + // initialization) size_t call_stack_size; // TODO(ctiller): remove this mechanism... it's a hack to allow // Channel to be separated from grpc_channel_stack's allocation. As the @@ -240,13 +240,13 @@ struct grpc_channel_stack { MakeServerCallPromise(grpc_core::CallArgs call_args); }; -/* A call stack tracks a set of related filters for one call, and guarantees - they live within a single malloc() allocation */ +// A call stack tracks a set of related filters for one call, and guarantees +// they live within a single malloc() allocation struct grpc_call_stack { - /* shared refcount for this channel stack. - MUST be the first element: the underlying code calls destroy - with the address of the refcount, but higher layers prefer to think - about the address of the call stack itself. */ + // shared refcount for this channel stack. + // MUST be the first element: the underlying code calls destroy + // with the address of the refcount, but higher layers prefer to think + // about the address of the call stack itself. grpc_stream_refcount refcount; size_t count; @@ -261,10 +261,10 @@ struct grpc_call_stack { } }; -/* Get a channel element given a channel stack and its index */ +// Get a channel element given a channel stack and its index grpc_channel_element* grpc_channel_stack_element(grpc_channel_stack* stack, size_t i); -/* Get the last channel element in a channel stack */ +// Get the last channel element in a channel stack grpc_channel_element* grpc_channel_stack_last_element( grpc_channel_stack* stack); @@ -274,31 +274,31 @@ grpc_channel_element* grpc_channel_stack_last_element( size_t grpc_channel_stack_filter_instance_number( grpc_channel_stack* channel_stack, grpc_channel_element* elem); -/* Get a call stack element given a call stack and an index */ +// Get a call stack element given a call stack and an index grpc_call_element* grpc_call_stack_element(grpc_call_stack* stack, size_t i); -/* Determine memory required for a channel stack containing a set of filters */ +// Determine memory required for a channel stack containing a set of filters size_t grpc_channel_stack_size(const grpc_channel_filter** filters, size_t filter_count); -/* Initialize a channel stack given some filters */ +// Initialize a channel stack given some filters grpc_error_handle grpc_channel_stack_init( int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg, const grpc_channel_filter** filters, size_t filter_count, const grpc_core::ChannelArgs& args, const char* name, grpc_channel_stack* stack); -/* Destroy a channel stack */ +// Destroy a channel stack void grpc_channel_stack_destroy(grpc_channel_stack* stack); -/* Initialize a call stack given a channel stack. transport_server_data is - expected to be NULL on a client, or an opaque transport owned pointer on the - server. */ +// Initialize a call stack given a channel stack. transport_server_data is +// expected to be NULL on a client, or an opaque transport owned pointer on the +// server. grpc_error_handle grpc_call_stack_init(grpc_channel_stack* channel_stack, int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg, const grpc_call_element_args* elem_args); -/* Set a pollset or a pollset_set for a call stack: must occur before the first - * op is started */ +// Set a pollset or a pollset_set for a call stack: must occur before the first +// op is started void grpc_call_stack_set_pollset_or_pollset_set(grpc_call_stack* call_stack, grpc_polling_entity* pollent); @@ -350,29 +350,29 @@ inline void grpc_call_stack::Unref() { GRPC_CALL_STACK_UNREF(this, "smart_pointer"); } -/* Destroy a call stack */ +// Destroy a call stack void grpc_call_stack_destroy(grpc_call_stack* stack, const grpc_call_final_info* final_info, grpc_closure* then_schedule_closure); -/* Ignore set pollset{_set} - used by filters if they don't care about pollsets - * at all. Does nothing. */ +// Ignore set pollset{_set} - used by filters if they don't care about pollsets +// at all. Does nothing. void grpc_call_stack_ignore_set_pollset_or_pollset_set( grpc_call_element* elem, grpc_polling_entity* pollent); -/* Call the next operation in a call stack */ +// Call the next operation in a call stack void grpc_call_next_op(grpc_call_element* elem, grpc_transport_stream_op_batch* op); -/* Call the next operation (depending on call directionality) in a channel - stack */ +// Call the next operation (depending on call directionality) in a channel +// stack void grpc_channel_next_op(grpc_channel_element* elem, grpc_transport_op* op); -/* Pass through a request to get_channel_info() to the next child element */ +// Pass through a request to get_channel_info() to the next child element void grpc_channel_next_get_info(grpc_channel_element* elem, const grpc_channel_info* channel_info); -/* Given the top element of a channel stack, get the channel stack itself */ +// Given the top element of a channel stack, get the channel stack itself grpc_channel_stack* grpc_channel_stack_from_top_element( grpc_channel_element* elem); -/* Given the top element of a call stack, get the call stack itself */ +// Given the top element of a call stack, get the call stack itself grpc_call_stack* grpc_call_stack_from_top_element(grpc_call_element* elem); void grpc_call_log_op(const char* file, int line, gpr_log_severity severity, @@ -391,4 +391,4 @@ extern grpc_core::TraceFlag grpc_trace_channel; } \ } while (0) -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H diff --git a/src/core/lib/channel/channel_stack_builder.cc b/src/core/lib/channel/channel_stack_builder.cc index 9c86704e422..9f5ebda6a3a 100644 --- a/src/core/lib/channel/channel_stack_builder.cc +++ b/src/core/lib/channel/channel_stack_builder.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/channel/channel_stack_builder_impl.cc b/src/core/lib/channel/channel_stack_builder_impl.cc index d0452218039..c57e12258c4 100644 --- a/src/core/lib/channel/channel_stack_builder_impl.cc +++ b/src/core/lib/channel/channel_stack_builder_impl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/channel/channel_trace.cc b/src/core/lib/channel/channel_trace.cc index c12fb63d37a..eb2639480c0 100644 --- a/src/core/lib/channel/channel_trace.cc +++ b/src/core/lib/channel/channel_trace.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/channel/channel_trace.h b/src/core/lib/channel/channel_trace.h index c3494deabae..0504677939b 100644 --- a/src/core/lib/channel/channel_trace.h +++ b/src/core/lib/channel/channel_trace.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H #define GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H @@ -135,4 +135,4 @@ class ChannelTrace { } // namespace channelz } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc index 9e7af14ae0a..19b4d5ff1e7 100644 --- a/src/core/lib/channel/channelz.cc +++ b/src/core/lib/channel/channelz.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h index 47058c6cb9c..a4225e7c010 100644 --- a/src/core/lib/channel/channelz.h +++ b/src/core/lib/channel/channelz.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_H #define GRPC_CORE_LIB_CHANNEL_CHANNELZ_H @@ -53,14 +53,14 @@ #define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL \ "grpc.channelz_is_internal_channel" -/** This is the default value for whether or not to enable channelz. If - * GRPC_ARG_ENABLE_CHANNELZ is set, it will override this default value. */ +/// This is the default value for whether or not to enable channelz. If +/// GRPC_ARG_ENABLE_CHANNELZ is set, it will override this default value. #define GRPC_ENABLE_CHANNELZ_DEFAULT true -/** This is the default value for the maximum amount of memory used by trace - * events per channel trace node. If - * GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE is set, it will override - * this default value. */ +/// This is the default value for the maximum amount of memory used by trace +/// events per channel trace node. If +/// GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE is set, it will override +/// this default value. #define GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT (1024 * 4) namespace grpc_core { @@ -371,4 +371,4 @@ class ListenSocketNode : public BaseNode { } // namespace channelz } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNELZ_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CHANNELZ_H diff --git a/src/core/lib/channel/channelz_registry.cc b/src/core/lib/channel/channelz_registry.cc index 5b301f50705..c2db6705e00 100644 --- a/src/core/lib/channel/channelz_registry.cc +++ b/src/core/lib/channel/channelz_registry.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/channel/channelz_registry.h b/src/core/lib/channel/channelz_registry.h index 5542f1ea8f3..e6d31fd700f 100644 --- a/src/core/lib/channel/channelz_registry.h +++ b/src/core/lib/channel/channelz_registry.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H #define GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H @@ -97,4 +97,4 @@ class ChannelzRegistry { } // namespace channelz } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H diff --git a/src/core/lib/channel/connected_channel.cc b/src/core/lib/channel/connected_channel.cc index 8b66c0f628f..9d45df4ac80 100644 --- a/src/core/lib/channel/connected_channel.cc +++ b/src/core/lib/channel/connected_channel.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -127,9 +127,9 @@ static callback_state* get_state_for_batch( GPR_UNREACHABLE_CODE(return nullptr); } -/* We perform a small hack to locate transport data alongside the connected - channel data in call allocations, to allow everything to be pulled in minimal - cache line requests */ +// We perform a small hack to locate transport data alongside the connected +// channel data in call allocations, to allow everything to be pulled in minimal +// cache line requests #define TRANSPORT_STREAM_FROM_CALL_DATA(calld) \ ((grpc_stream*)(((char*)(calld)) + \ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data)))) @@ -137,8 +137,8 @@ static callback_state* get_state_for_batch( ((call_data*)(((char*)(transport_stream)) - \ GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(call_data)))) -/* Intercept a call operation and either push it directly up or translate it - into transport stream operations */ +// Intercept a call operation and either push it directly up or translate it +// into transport stream operations static void connected_channel_start_transport_stream_op_batch( grpc_call_element* elem, grpc_transport_stream_op_batch* batch) { call_data* calld = static_cast(elem->call_data); @@ -185,7 +185,7 @@ static void connected_channel_start_transport_op(grpc_channel_element* elem, grpc_transport_perform_op(chand->transport, op); } -/* Constructor for call_data */ +// Constructor for call_data static grpc_error_handle connected_channel_init_call_elem( grpc_call_element* elem, const grpc_call_element_args* args) { call_data* calld = static_cast(elem->call_data); @@ -206,7 +206,7 @@ static void set_pollset_or_pollset_set(grpc_call_element* elem, TRANSPORT_STREAM_FROM_CALL_DATA(calld), pollent); } -/* Destructor for call_data */ +// Destructor for call_data static void connected_channel_destroy_call_elem( grpc_call_element* elem, const grpc_call_final_info* /*final_info*/, grpc_closure* then_schedule_closure) { @@ -217,7 +217,7 @@ static void connected_channel_destroy_call_elem( then_schedule_closure); } -/* Constructor for channel_data */ +// Constructor for channel_data static grpc_error_handle connected_channel_init_channel_elem( grpc_channel_element* elem, grpc_channel_element_args* args) { channel_data* cd = static_cast(elem->channel_data); @@ -227,7 +227,7 @@ static grpc_error_handle connected_channel_init_channel_elem( return absl::OkStatus(); } -/* Destructor for channel_data */ +// Destructor for channel_data static void connected_channel_destroy_channel_elem(grpc_channel_element* elem) { channel_data* cd = static_cast(elem->channel_data); if (cd->transport) { @@ -235,7 +235,7 @@ static void connected_channel_destroy_channel_elem(grpc_channel_element* elem) { } } -/* No-op. */ +// No-op. static void connected_channel_get_channel_info( grpc_channel_element* /*elem*/, const grpc_channel_info* /*channel_info*/) { } @@ -852,12 +852,12 @@ grpc_channel_filter MakeConnectedFilter() { sizeof(channel_data), connected_channel_init_channel_elem, +[](grpc_channel_stack* channel_stack, grpc_channel_element* elem) { - /* HACK(ctiller): increase call stack size for the channel to make space - for channel data. We need a cleaner (but performant) way to do this, - and I'm not sure what that is yet. - This is only "safe" because call stacks place no additional data - after the last call element, and the last call element MUST be the - connected channel. */ + // HACK(ctiller): increase call stack size for the channel to make space + // for channel data. We need a cleaner (but performant) way to do this, + // and I'm not sure what that is yet. + // This is only "safe" because call stacks place no additional data + // after the last call element, and the last call element MUST be the + // connected channel. channel_stack->call_stack_size += grpc_transport_stream_size( static_cast(elem->channel_data)->transport); }, diff --git a/src/core/lib/channel/connected_channel.h b/src/core/lib/channel/connected_channel.h index a139907b72b..6523ac48dc5 100644 --- a/src/core/lib/channel/connected_channel.h +++ b/src/core/lib/channel/connected_channel.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H #define GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H @@ -29,4 +29,4 @@ extern const grpc_channel_filter grpc_connected_filter; bool grpc_add_connected_filter(grpc_core::ChannelStackBuilder* builder); -#endif /* GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CONNECTED_CHANNEL_H diff --git a/src/core/lib/channel/context.h b/src/core/lib/channel/context.h index ad1021b822b..db98cdc5207 100644 --- a/src/core/lib/channel/context.h +++ b/src/core/lib/channel/context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_CONTEXT_H #define GRPC_CORE_LIB_CHANNEL_CONTEXT_H @@ -60,4 +60,4 @@ template <> struct ContextType {}; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CHANNEL_CONTEXT_H */ +#endif // GRPC_CORE_LIB_CHANNEL_CONTEXT_H diff --git a/src/core/lib/channel/status_util.cc b/src/core/lib/channel/status_util.cc index 9af7c231812..bd6bb3845e3 100644 --- a/src/core/lib/channel/status_util.cc +++ b/src/core/lib/channel/status_util.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/channel/status_util.h b/src/core/lib/channel/status_util.h index b43f2aa5baa..9d31f8a0066 100644 --- a/src/core/lib/channel/status_util.h +++ b/src/core/lib/channel/status_util.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_CHANNEL_STATUS_UTIL_H #define GRPC_CORE_LIB_CHANNEL_STATUS_UTIL_H @@ -78,4 +78,4 @@ absl::Status MaybeRewriteIllegalStatusCode(absl::Status status, } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CHANNEL_STATUS_UTIL_H */ +#endif // GRPC_CORE_LIB_CHANNEL_STATUS_UTIL_H diff --git a/src/core/lib/compression/compression.cc b/src/core/lib/compression/compression.cc index 5f0f8ca4183..821d153fabf 100644 --- a/src/core/lib/compression/compression.cc +++ b/src/core/lib/compression/compression.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -73,7 +73,7 @@ grpc_compression_algorithm grpc_compression_algorithm_for_level( void grpc_compression_options_init(grpc_compression_options* opts) { memset(opts, 0, sizeof(*opts)); - /* all enabled by default */ + // all enabled by default opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; } diff --git a/src/core/lib/compression/compression_internal.cc b/src/core/lib/compression/compression_internal.cc index 7fae483c6e8..eb1a31afbc2 100644 --- a/src/core/lib/compression/compression_internal.cc +++ b/src/core/lib/compression/compression_internal.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -123,10 +123,10 @@ CompressionAlgorithmSet::CompressionAlgorithmForLevel( GPR_ASSERT(level > 0); - /* Establish a "ranking" or compression algorithms in increasing order of - * compression. - * This is simplistic and we will probably want to introduce other dimensions - * in the future (cpu/memory cost, etc). */ + // Establish a "ranking" or compression algorithms in increasing order of + // compression. + // This is simplistic and we will probably want to introduce other dimensions + // in the future (cpu/memory cost, etc). absl::InlinedVector algos; @@ -142,7 +142,7 @@ CompressionAlgorithmSet::CompressionAlgorithmForLevel( switch (level) { case GRPC_COMPRESS_LEVEL_NONE: - abort(); /* should have been handled already */ + abort(); // should have been handled already case GRPC_COMPRESS_LEVEL_LOW: return algos[0]; case GRPC_COMPRESS_LEVEL_MED: diff --git a/src/core/lib/compression/compression_internal.h b/src/core/lib/compression/compression_internal.h index 284e8aeb498..782a24b6221 100644 --- a/src/core/lib/compression/compression_internal.h +++ b/src/core/lib/compression/compression_internal.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H #define GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H @@ -90,4 +90,4 @@ class CompressionAlgorithmSet { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H */ +#endif // GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H diff --git a/src/core/lib/compression/message_compress.cc b/src/core/lib/compression/message_compress.cc index 4ff3b049324..bd0571748bd 100644 --- a/src/core/lib/compression/message_compress.cc +++ b/src/core/lib/compression/message_compress.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -36,7 +36,7 @@ static int zlib_body(z_stream* zs, grpc_slice_buffer* input, grpc_slice_buffer* output, int (*flate)(z_stream* zs, int flush)) { - int r = Z_STREAM_END; /* Do not fail on an empty input. */ + int r = Z_STREAM_END; // Do not fail on an empty input. int flush; size_t i; grpc_slice outbuf = GRPC_SLICE_MALLOC(OUTPUT_BLOCK_SIZE); @@ -154,8 +154,8 @@ static int compress_inner(grpc_compression_algorithm algorithm, grpc_slice_buffer* input, grpc_slice_buffer* output) { switch (algorithm) { case GRPC_COMPRESS_NONE: - /* the fallback path always needs to be send uncompressed: we simply - rely on that here */ + // the fallback path always needs to be send uncompressed: we simply + // rely on that here return 0; case GRPC_COMPRESS_DEFLATE: return zlib_compress(input, output, 0); diff --git a/src/core/lib/compression/message_compress.h b/src/core/lib/compression/message_compress.h index c0b2da4326a..7cc6323b1d4 100644 --- a/src/core/lib/compression/message_compress.h +++ b/src/core/lib/compression/message_compress.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H #define GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H @@ -24,16 +24,16 @@ #include #include -/* compress 'input' to 'output' using 'algorithm'. - On success, appends compressed slices to output and returns 1. - On failure, appends uncompressed slices to output and returns 0. */ +// compress 'input' to 'output' using 'algorithm'. +// On success, appends compressed slices to output and returns 1. +// On failure, appends uncompressed slices to output and returns 0. int grpc_msg_compress(grpc_compression_algorithm algorithm, grpc_slice_buffer* input, grpc_slice_buffer* output); -/* decompress 'input' to 'output' using 'algorithm'. - On success, appends slices to output and returns 1. - On failure, output is unchanged, and returns 0. */ +// decompress 'input' to 'output' using 'algorithm'. +// On success, appends slices to output and returns 1. +// On failure, output is unchanged, and returns 0. int grpc_msg_decompress(grpc_compression_algorithm algorithm, grpc_slice_buffer* input, grpc_slice_buffer* output); -#endif /* GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H */ +#endif // GRPC_CORE_LIB_COMPRESSION_MESSAGE_COMPRESS_H diff --git a/src/core/lib/config/core_configuration.h b/src/core/lib/config/core_configuration.h index 6285c60bb0a..767dfbbc785 100644 --- a/src/core/lib/config/core_configuration.h +++ b/src/core/lib/config/core_configuration.h @@ -240,4 +240,4 @@ extern void BuildCoreConfiguration(CoreConfiguration::Builder* builder); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H */ +#endif // GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H diff --git a/src/core/lib/debug/stats.cc b/src/core/lib/debug/stats.cc index f9be5b62383..611ed4165ab 100644 --- a/src/core/lib/debug/stats.cc +++ b/src/core/lib/debug/stats.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/debug/stats.h b/src/core/lib/debug/stats.h index fe6d8193c5a..ddd73d84756 100644 --- a/src/core/lib/debug/stats.h +++ b/src/core/lib/debug/stats.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_DEBUG_STATS_H #define GRPC_CORE_LIB_DEBUG_STATS_H diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc index e9770851845..865f026b826 100644 --- a/src/core/lib/debug/trace.cc +++ b/src/core/lib/debug/trace.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -64,7 +64,7 @@ bool TraceFlagList::Set(const char* name, bool enabled) { // check for unknowns, but ignore "", to allow to GRPC_TRACE= if (!found && 0 != strcmp(name, "")) { gpr_log(GPR_ERROR, "Unknown trace var: '%s'", name); - return false; /* early return */ + return false; // early return } } return true; diff --git a/src/core/lib/debug/trace.h b/src/core/lib/debug/trace.h index 333f366fb86..687ddef435d 100644 --- a/src/core/lib/debug/trace.h +++ b/src/core/lib/debug/trace.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_DEBUG_TRACE_H #define GRPC_CORE_LIB_DEBUG_TRACE_H @@ -88,7 +88,7 @@ class TraceFlag { } #else bool enabled() { return false; } -#endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */ +#endif // defined(GRPC_USE_TRACERS) || !defined(NDEBUG) private: friend void testing::grpc_tracer_enable_flag(TraceFlag* flag); @@ -130,4 +130,4 @@ class DebugOnlyTraceFlag { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_DEBUG_TRACE_H */ +#endif // GRPC_CORE_LIB_DEBUG_TRACE_H diff --git a/src/core/lib/event_engine/executor/executor.h b/src/core/lib/event_engine/executor/executor.h index d45f4ae55bd..f883b91ed7d 100644 --- a/src/core/lib/event_engine/executor/executor.h +++ b/src/core/lib/event_engine/executor/executor.h @@ -35,4 +35,4 @@ class Executor { } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_EXECUTOR_EXECUTOR_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_EXECUTOR_EXECUTOR_H diff --git a/src/core/lib/event_engine/forkable.h b/src/core/lib/event_engine/forkable.h index de50a6bd4eb..e02d2fe2e41 100644 --- a/src/core/lib/event_engine/forkable.h +++ b/src/core/lib/event_engine/forkable.h @@ -58,4 +58,4 @@ void StopManagingForkable(Forkable* forkable); } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H diff --git a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc index 837d10d8387..036ffaf15df 100644 --- a/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc +++ b/src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc @@ -559,7 +559,7 @@ Epoll1Poller* MakeEpoll1Poller(Scheduler* scheduler) { } // namespace experimental } // namespace grpc_event_engine -#else /* defined(GRPC_LINUX_EPOLL) */ +#else // defined(GRPC_LINUX_EPOLL) #if defined(GRPC_POSIX_SOCKET_EV_EPOLL1) namespace grpc_event_engine { @@ -605,5 +605,5 @@ Epoll1Poller* MakeEpoll1Poller(Scheduler* /*scheduler*/) { return nullptr; } } // namespace experimental } // namespace grpc_event_engine -#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLL1) */ -#endif /* !defined(GRPC_LINUX_EPOLL) */ +#endif // defined(GRPC_POSIX_SOCKET_EV_EPOLL1) +#endif // !defined(GRPC_LINUX_EPOLL) diff --git a/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc b/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc index 6f2dd9900f3..883a170945b 100644 --- a/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc +++ b/src/core/lib/event_engine/posix_engine/ev_poll_posix.cc @@ -409,7 +409,7 @@ int PollEventHandle::NotifyOnLocked(PosixEngineClosure** st, scheduler_->Run(closure); return 1; } else { - /* upcallptr was set to a different closure. This is an error! */ + // upcallptr was set to a different closure. This is an error! gpr_log(GPR_ERROR, "User called a notify_on function with a previous callback still " "pending"); @@ -842,7 +842,7 @@ PollPoller* MakePollPoller(Scheduler* scheduler, bool use_phony_poll) { } // namespace experimental } // namespace grpc_event_engine -#else /* GRPC_POSIX_SOCKET_EV_POLL */ +#else // GRPC_POSIX_SOCKET_EV_POLL namespace grpc_event_engine { namespace experimental { @@ -890,4 +890,4 @@ void PollPoller::PollerHandlesListRemoveHandle(PollEventHandle* /*handle*/) { } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_POSIX_SOCKET_EV_POLL */ +#endif // GRPC_POSIX_SOCKET_EV_POLL diff --git a/src/core/lib/event_engine/posix_engine/ev_poll_posix.h b/src/core/lib/event_engine/posix_engine/ev_poll_posix.h index 6560da165e3..b4c68b70ebb 100644 --- a/src/core/lib/event_engine/posix_engine/ev_poll_posix.h +++ b/src/core/lib/event_engine/posix_engine/ev_poll_posix.h @@ -94,4 +94,4 @@ PollPoller* MakePollPoller(Scheduler* scheduler, bool use_phony_poll); } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_EV_POLL_POSIX_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_EV_POLL_POSIX_H diff --git a/src/core/lib/event_engine/posix_engine/event_poller.h b/src/core/lib/event_engine/posix_engine/event_poller.h index 2f2d0efcf9a..7b2b31cac6c 100644 --- a/src/core/lib/event_engine/posix_engine/event_poller.h +++ b/src/core/lib/event_engine/posix_engine/event_poller.h @@ -108,4 +108,4 @@ class PosixEventPoller : public grpc_event_engine::experimental::Poller { } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_EVENT_POLLER_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_EVENT_POLLER_H diff --git a/src/core/lib/event_engine/posix_engine/internal_errqueue.h b/src/core/lib/event_engine/posix_engine/internal_errqueue.h index 96dcf59e836..31c55e1215a 100644 --- a/src/core/lib/event_engine/posix_engine/internal_errqueue.h +++ b/src/core/lib/event_engine/posix_engine/internal_errqueue.h @@ -28,7 +28,7 @@ #ifdef GRPC_LINUX_ERRQUEUE #include // IWYU pragma: keep #include -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE namespace grpc_event_engine { namespace experimental { @@ -72,31 +72,31 @@ constexpr uint32_t kTimestampingRecordingOptions = // Netlink attribute types used for TCP opt stats. enum TCPOptStats { TCP_NLA_PAD, - TCP_NLA_BUSY, /* Time (usec) busy sending data. */ - TCP_NLA_RWND_LIMITED, /* Time (usec) limited by receive window. */ - TCP_NLA_SNDBUF_LIMITED, /* Time (usec) limited by send buffer. */ - TCP_NLA_DATA_SEGS_OUT, /* Data pkts sent including retransmission. */ - TCP_NLA_TOTAL_RETRANS, /* Data pkts retransmitted. */ - TCP_NLA_PACING_RATE, /* Pacing rate in Bps. */ - TCP_NLA_DELIVERY_RATE, /* Delivery rate in Bps. */ - TCP_NLA_SND_CWND, /* Sending congestion window. */ - TCP_NLA_REORDERING, /* Reordering metric. */ - TCP_NLA_MIN_RTT, /* minimum RTT. */ - TCP_NLA_RECUR_RETRANS, /* Recurring retransmits for the current pkt. */ - TCP_NLA_DELIVERY_RATE_APP_LMT, /* Delivery rate application limited? */ - TCP_NLA_SNDQ_SIZE, /* Data (bytes) pending in send queue */ - TCP_NLA_CA_STATE, /* ca_state of socket */ - TCP_NLA_SND_SSTHRESH, /* Slow start size threshold */ - TCP_NLA_DELIVERED, /* Data pkts delivered incl. out-of-order */ - TCP_NLA_DELIVERED_CE, /* Like above but only ones w/ CE marks */ - TCP_NLA_BYTES_SENT, /* Data bytes sent including retransmission */ - TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */ - TCP_NLA_DSACK_DUPS, /* DSACK blocks received */ - TCP_NLA_REORD_SEEN, /* reordering events seen */ - TCP_NLA_SRTT, /* smoothed RTT in usecs */ + TCP_NLA_BUSY, // Time (usec) busy sending data. + TCP_NLA_RWND_LIMITED, // Time (usec) limited by receive window. + TCP_NLA_SNDBUF_LIMITED, // Time (usec) limited by send buffer. + TCP_NLA_DATA_SEGS_OUT, // Data pkts sent including retransmission. + TCP_NLA_TOTAL_RETRANS, // Data pkts retransmitted. + TCP_NLA_PACING_RATE, // Pacing rate in Bps. + TCP_NLA_DELIVERY_RATE, // Delivery rate in Bps. + TCP_NLA_SND_CWND, // Sending congestion window. + TCP_NLA_REORDERING, // Reordering metric. + TCP_NLA_MIN_RTT, // minimum RTT. + TCP_NLA_RECUR_RETRANS, // Recurring retransmits for the current pkt. + TCP_NLA_DELIVERY_RATE_APP_LMT, // Delivery rate application limited? + TCP_NLA_SNDQ_SIZE, // Data (bytes) pending in send queue + TCP_NLA_CA_STATE, // ca_state of socket + TCP_NLA_SND_SSTHRESH, // Slow start size threshold + TCP_NLA_DELIVERED, // Data pkts delivered incl. out-of-order + TCP_NLA_DELIVERED_CE, // Like above but only ones w/ CE marks + TCP_NLA_BYTES_SENT, // Data bytes sent including retransmission + TCP_NLA_BYTES_RETRANS, // Data bytes retransmitted + TCP_NLA_DSACK_DUPS, // DSACK blocks received + TCP_NLA_REORD_SEEN, // reordering events seen + TCP_NLA_SRTT, // smoothed RTT in usecs }; -/* tcp_info from from linux/tcp.h */ +// tcp_info from from linux/tcp.h struct tcp_info { uint8_t tcpi_state; uint8_t tcpi_ca_state; @@ -115,12 +115,12 @@ struct tcp_info { uint32_t tcpi_lost; uint32_t tcpi_retrans; uint32_t tcpi_fackets; - /* Times. */ + // Times. uint32_t tcpi_last_data_sent; - uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ + uint32_t tcpi_last_ack_sent; // Not remembered, sorry. uint32_t tcpi_last_data_recv; uint32_t tcpi_last_ack_recv; - /* Metrics. */ + // Metrics. uint32_t tcpi_pmtu; uint32_t tcpi_rcv_ssthresh; uint32_t tcpi_rtt; @@ -134,29 +134,29 @@ struct tcp_info { uint32_t tcpi_total_retrans; uint64_t tcpi_pacing_rate; uint64_t tcpi_max_pacing_rate; - uint64_t tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */ - uint64_t tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */ + uint64_t tcpi_bytes_acked; // RFC4898 tcpEStatsAppHCThruOctetsAcked + uint64_t tcpi_bytes_received; // RFC4898 tcpEStatsAppHCThruOctetsReceived - uint32_t tcpi_segs_out; /* RFC4898 tcpEStatsPerfSegsOut */ - uint32_t tcpi_segs_in; /* RFC4898 tcpEStatsPerfSegsIn */ + uint32_t tcpi_segs_out; // RFC4898 tcpEStatsPerfSegsOut + uint32_t tcpi_segs_in; // RFC4898 tcpEStatsPerfSegsIn uint32_t tcpi_notsent_bytes; uint32_t tcpi_min_rtt; - uint32_t tcpi_data_segs_in; /* RFC4898 tcpEStatsDataSegsIn */ - uint32_t tcpi_data_segs_out; /* RFC4898 tcpEStatsDataSegsOut */ + uint32_t tcpi_data_segs_in; // RFC4898 tcpEStatsDataSegsIn + uint32_t tcpi_data_segs_out; // RFC4898 tcpEStatsDataSegsOut uint64_t tcpi_delivery_rate; - uint64_t tcpi_busy_time; /* Time (usec) busy sending data */ - uint64_t tcpi_rwnd_limited; /* Time (usec) limited by receive window */ - uint64_t tcpi_sndbuf_limited; /* Time (usec) limited by send buffer */ + uint64_t tcpi_busy_time; // Time (usec) busy sending data + uint64_t tcpi_rwnd_limited; // Time (usec) limited by receive window + uint64_t tcpi_sndbuf_limited; // Time (usec) limited by send buffer uint32_t tcpi_delivered; uint32_t tcpi_delivered_ce; - uint64_t tcpi_bytes_sent; /* RFC4898 tcpEStatsPerfHCDataOctetsOut */ - uint64_t tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */ - uint32_t tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */ - uint32_t tcpi_reord_seen; /* reordering events seen */ - socklen_t length; /* Length of struct returned by kernel */ + uint64_t tcpi_bytes_sent; // RFC4898 tcpEStatsPerfHCDataOctetsOut + uint64_t tcpi_bytes_retrans; // RFC4898 tcpEStatsPerfOctetsRetrans + uint32_t tcpi_dsack_dups; // RFC4898 tcpEStatsStackDSACKDups + uint32_t tcpi_reord_seen; // reordering events seen + socklen_t length; // Length of struct returned by kernel }; #ifndef TCP_INFO @@ -165,7 +165,7 @@ struct tcp_info { int GetSocketTcpInfo(tcp_info* info, int fd); -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE // Returns true if kernel is capable of supporting errqueue and timestamping. // Currently allowing only linux kernels above 4.0.0 @@ -174,6 +174,6 @@ bool KernelSupportsErrqueue(); } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP -#endif /* GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_INTERNAL_ERRQUEUE_H */ \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_INTERNAL_ERRQUEUE_H diff --git a/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc b/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc index fadd4b22655..6109922d3f1 100644 --- a/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc +++ b/src/core/lib/event_engine/posix_engine/posix_engine_listener.cc @@ -176,7 +176,7 @@ void PosixEngineListenerImpl::AsyncConnectionAcceptor::NotifyOnAccept( /*handle=*/listener_->poller_->CreateHandle( fd, peer_name, listener_->poller_->CanTrackErrors()), /*on_shutdown=*/nullptr, /*engine=*/listener_->engine_, - /*allocator=*/ + // allocator= listener_->memory_allocator_factory_->CreateMemoryAllocator( absl::StrCat("endpoint-tcp-server-connection: ", peer_name)), /*options=*/listener_->options_); diff --git a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc index 3bd4657ba4e..bbe74f49c9a 100644 --- a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc +++ b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc @@ -125,7 +125,7 @@ absl::Status PrepareTcpClientSocket(PosixSocketWrapper sock, return absl::OkStatus(); } -#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_UTILS_COMMON } // namespace @@ -222,7 +222,7 @@ int Accept4(int sockfd, return accept4(sockfd, const_cast(addr.address()), &len, flags); } -#endif /* GRPC_LINUX_SOCKETUTILS */ +#endif // GRPC_LINUX_SOCKETUTILS #ifdef GRPC_POSIX_SOCKET_UTILS_COMMON @@ -609,7 +609,7 @@ bool PosixSocketWrapper::IsIpv6LoopbackAvailable() { sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; - addr.sin6_addr.s6_addr[15] = 1; /* [::1]:0 */ + addr.sin6_addr.s6_addr[15] = 1; // [::1]:0 if (bind(fd, reinterpret_cast(&addr), sizeof(addr)) == 0) { loopback_available = true; } else { @@ -739,7 +739,7 @@ PosixSocketWrapper::CreateAndPrepareTcpClientSocket( mapped_target_addr}; } -#else /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#else // GRPC_POSIX_SOCKET_UTILS_COMMON absl::StatusOr PosixSocketWrapper::SetSocketRcvLowat(int /*bytes*/) { GPR_ASSERT(false && "unimplemented"); @@ -835,7 +835,7 @@ PosixSocketWrapper::CreateAndPrepareTcpClientSocket( GPR_ASSERT(false && "unimplemented"); } -#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_UTILS_COMMON } // namespace experimental } // namespace grpc_event_engine diff --git a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h index 1ee4af53955..037e6e7a84d 100644 --- a/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h +++ b/src/core/lib/event_engine/posix_engine/tcp_socket_utils.h @@ -45,7 +45,7 @@ #ifndef SO_EE_ORIGIN_ZEROCOPY #define SO_EE_ORIGIN_ZEROCOPY 5 #endif -#endif /* ifdef GRPC_LINUX_ERRQUEUE */ +#endif // ifdef GRPC_LINUX_ERRQUEUE namespace grpc_event_engine { namespace experimental { diff --git a/src/core/lib/event_engine/posix_engine/timer.cc b/src/core/lib/event_engine/posix_engine/timer.cc index f026d6a3960..4a7aa204439 100644 --- a/src/core/lib/event_engine/posix_engine/timer.cc +++ b/src/core/lib/event_engine/posix_engine/timer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -67,7 +67,7 @@ TimerList::TimerList(TimerListHost* host) } namespace { -/* returns true if the first element in the list */ +// returns true if the first element in the list void ListJoin(Timer* head, Timer* timer) { timer->next = head; timer->prev = head->prev; @@ -134,17 +134,17 @@ void TimerList::TimerInit(Timer* timer, grpc_core::Timestamp deadline, } } - /* Deadline may have decreased, we need to adjust the main queue. Note - that there is a potential racy unlocked region here. There could be a - reordering of multiple TimerInit calls, at this point, but the < test - below should ensure that we err on the side of caution. There could - also be a race with TimerCheck, which might beat us to the lock. In - that case, it is possible that the timer that we added will have already - run by the time we hold the lock, but that too is a safe error. - Finally, it's possible that the TimerCheck that intervened failed to - trigger the new timer because the min_deadline hadn't yet been reduced. - In that case, the timer will simply have to wait for the next - TimerCheck. */ + // Deadline may have decreased, we need to adjust the main queue. Note + // that there is a potential racy unlocked region here. There could be a + // reordering of multiple TimerInit calls, at this point, but the < test + // below should ensure that we err on the side of caution. There could + // also be a race with TimerCheck, which might beat us to the lock. In + // that case, it is possible that the timer that we added will have already + // run by the time we hold the lock, but that too is a safe error. + // Finally, it's possible that the TimerCheck that intervened failed to + // trigger the new timer because the min_deadline hadn't yet been reduced. + // In that case, the timer will simply have to wait for the next + // TimerCheck. if (is_first_timer) { grpc_core::MutexLock lock(&mu_); if (deadline < shard->min_deadline) { @@ -177,19 +177,19 @@ bool TimerList::TimerCancel(Timer* timer) { return false; } -/* Rebalances the timer shard by computing a new 'queue_deadline_cap' and moving - all relevant timers in shard->list (i.e timers with deadlines earlier than - 'queue_deadline_cap') into into shard->heap. - Returns 'true' if shard->heap has at least ONE element */ +// Rebalances the timer shard by computing a new 'queue_deadline_cap' and moving +// all relevant timers in shard->list (i.e timers with deadlines earlier than +// 'queue_deadline_cap') into into shard->heap. +// Returns 'true' if shard->heap has at least ONE element bool TimerList::Shard::RefillHeap(grpc_core::Timestamp now) { - /* Compute the new queue window width and bound by the limits: */ + // Compute the new queue window width and bound by the limits: double computed_deadline_delta = stats.UpdateAverage() * kAddDeadlineScale; double deadline_delta = grpc_core::Clamp(computed_deadline_delta, kMinQueueWindowDuration, kMaxQueueWindowDuration); Timer *timer, *next; - /* Compute the new cap and put all timers under it into the queue: */ + // Compute the new cap and put all timers under it into the queue: queue_deadline_cap = std::max(now, queue_deadline_cap) + grpc_core::Duration::FromSecondsAsDouble(deadline_delta); @@ -207,8 +207,8 @@ bool TimerList::Shard::RefillHeap(grpc_core::Timestamp now) { return !heap.is_empty(); } -/* This pops the next non-cancelled timer with deadline <= now from the - queue, or returns NULL if there isn't one. */ +// This pops the next non-cancelled timer with deadline <= now from the +// queue, or returns NULL if there isn't one. Timer* TimerList::Shard::PopOne(grpc_core::Timestamp now) { Timer* timer; for (;;) { @@ -256,16 +256,16 @@ std::vector TimerList::FindExpiredTimers( shard_queue_[0]->min_deadline == now)) { grpc_core::Timestamp new_min_deadline; - /* For efficiency, we pop as many available timers as we can from the - shard. This may violate perfect timer deadline ordering, but that - shouldn't be a big deal because we don't make ordering guarantees. */ + // For efficiency, we pop as many available timers as we can from the + // shard. This may violate perfect timer deadline ordering, but that + // shouldn't be a big deal because we don't make ordering guarantees. shard_queue_[0]->PopTimers(now, &new_min_deadline, &done); - /* An TimerInit() on the shard could intervene here, adding a new - timer that is earlier than new_min_deadline. However, - TimerInit() will block on the mutex before it can call - set_min_deadline, so this one will complete first and then the Addtimer - will reduce the min_deadline (perhaps unnecessarily). */ + // An TimerInit() on the shard could intervene here, adding a new + // timer that is earlier than new_min_deadline. However, + // TimerInit() will block on the mutex before it can call + // set_min_deadline, so this one will complete first and then the Addtimer + // will reduce the min_deadline (perhaps unnecessarily). shard_queue_[0]->min_deadline = new_min_deadline; NoteDeadlineChange(shard_queue_[0]); } @@ -286,8 +286,8 @@ TimerList::TimerCheck(grpc_core::Timestamp* next) { // prelude grpc_core::Timestamp now = host_->Now(); - /* fetch from a thread-local first: this avoids contention on a globally - mutable cacheline in the common case */ + // fetch from a thread-local first: this avoids contention on a globally + // mutable cacheline in the common case grpc_core::Timestamp min_timer = grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch( min_timer_.load(std::memory_order_relaxed)); diff --git a/src/core/lib/event_engine/posix_engine/timer.h b/src/core/lib/event_engine/posix_engine/timer.h index d3b99bb980f..9734db7e689 100644 --- a/src/core/lib/event_engine/posix_engine/timer.h +++ b/src/core/lib/event_engine/posix_engine/timer.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_H #define GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_H @@ -77,69 +77,69 @@ class TimerList { TimerList(const TimerList&) = delete; TimerList& operator=(const TimerList&) = delete; - /* Initialize *timer. When expired or canceled, closure will be called with - error set to indicate if it expired (absl::OkStatus()) or was canceled - (absl::CancelledError()). *closure is guaranteed to be called exactly once, - and application code should check the error to determine how it was invoked. - The application callback is also responsible for maintaining information - about when to free up any user-level state. Behavior is undefined for a - deadline of grpc_core::Timestamp::InfFuture(). */ + // Initialize *timer. When expired or canceled, closure will be called with + // error set to indicate if it expired (absl::OkStatus()) or was canceled + //(absl::CancelledError()). *closure is guaranteed to be called exactly once, + // and application code should check the error to determine how it was + // invoked. The application callback is also responsible for maintaining + // information about when to free up any user-level state. Behavior is + // undefined for a deadline of grpc_core::Timestamp::InfFuture(). void TimerInit(Timer* timer, grpc_core::Timestamp deadline, experimental::EventEngine::Closure* closure); - /* Note that there is no timer destroy function. This is because the - timer is a one-time occurrence with a guarantee that the callback will - be called exactly once, either at expiration or cancellation. Thus, all - the internal timer event management state is destroyed just before - that callback is invoked. If the user has additional state associated with - the timer, the user is responsible for determining when it is safe to - destroy that state. */ - - /* Cancel an *timer. - There are three cases: - 1. We normally cancel the timer - 2. The timer has already run - 3. We can't cancel the timer because it is "in flight". - - In all of these cases, the cancellation is still considered successful. - They are essentially distinguished in that the timer_cb will be run - exactly once from either the cancellation (with error - absl::CancelledError()) or from the activation (with error - absl::OkStatus()). - - Note carefully that the callback function MAY occur in the same callstack - as grpc_timer_cancel. It's expected that most timers will be cancelled - (their primary use is to implement deadlines), and so this code is - optimized such that cancellation costs as little as possible. Making - callbacks run inline matches this aim. - - Requires: cancel() must happen after init() on a given timer */ + // Note that there is no timer destroy function. This is because the + // timer is a one-time occurrence with a guarantee that the callback will + // be called exactly once, either at expiration or cancellation. Thus, all + // the internal timer event management state is destroyed just before + // that callback is invoked. If the user has additional state associated with + // the timer, the user is responsible for determining when it is safe to + // destroy that state. + + // Cancel an *timer. + // There are three cases: + // 1. We normally cancel the timer + // 2. The timer has already run + // 3. We can't cancel the timer because it is "in flight". + + // In all of these cases, the cancellation is still considered successful. + // They are essentially distinguished in that the timer_cb will be run + // exactly once from either the cancellation (with error + // absl::CancelledError()) or from the activation (with error + // absl::OkStatus()). + + // Note carefully that the callback function MAY occur in the same callstack + // as grpc_timer_cancel. It's expected that most timers will be cancelled + // (their primary use is to implement deadlines), and so this code is + // optimized such that cancellation costs as little as possible. Making + // callbacks run inline matches this aim. + + // Requires: cancel() must happen after init() on a given timer bool TimerCancel(Timer* timer) GRPC_MUST_USE_RESULT; - /* iomgr internal api for dealing with timers */ - - /* Check for timers to be run, and return them. - Return nullopt if timers could not be checked due to contention with - another thread checking. - Return a vector of closures that *must* be run otherwise. - If next is non-null, TRY to update *next with the next running timer - IF that timer occurs before *next current value. - *next is never guaranteed to be updated on any given execution; however, - with high probability at least one thread in the system will see an update - at any time slice. */ + // iomgr internal api for dealing with timers + + // Check for timers to be run, and return them. + // Return nullopt if timers could not be checked due to contention with + // another thread checking. + // Return a vector of closures that *must* be run otherwise. + // If next is non-null, TRY to update *next with the next running timer + // IF that timer occurs before *next current value. + // *next is never guaranteed to be updated on any given execution; however, + // with high probability at least one thread in the system will see an update + // at any time slice. absl::optional> TimerCheck( grpc_core::Timestamp* next); private: - /* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with - * deadlines earlier than 'queue_deadline_cap' are maintained in the heap and - * others are maintained in the list (unordered). This helps to keep the - * number of elements in the heap low. - * - * The 'queue_deadline_cap' gets recomputed periodically based on the timer - * stats maintained in 'stats' and the relevant timers are then moved from the - * 'list' to 'heap'. - */ + // A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with + // deadlines earlier than 'queue_deadline_cap' are maintained in the heap and + // others are maintained in the list (unordered). This helps to keep the + // number of elements in the heap low. + // + // The 'queue_deadline_cap' gets recomputed periodically based on the timer + // stats maintained in 'stats' and the relevant timers are then moved from the + // 'list' to 'heap'. + // struct Shard { Shard(); @@ -153,16 +153,16 @@ class TimerList { grpc_core::Mutex mu; grpc_core::TimeAveragedStats stats ABSL_GUARDED_BY(mu); - /* All and only timers with deadlines < this will be in the heap. */ + // All and only timers with deadlines < this will be in the heap. grpc_core::Timestamp queue_deadline_cap ABSL_GUARDED_BY(mu); - /* The deadline of the next timer due in this shard. */ + // The deadline of the next timer due in this shard. grpc_core::Timestamp min_deadline ABSL_GUARDED_BY(&TimerList::mu_); - /* Index of this timer_shard in the g_shard_queue. */ + // Index of this timer_shard in the g_shard_queue. uint32_t shard_queue_index ABSL_GUARDED_BY(&TimerList::mu_); - /* This holds all timers with deadlines < queue_deadline_cap. Timers in this - list have the top bit of their deadline set to 0. */ + // This holds all timers with deadlines < queue_deadline_cap. Timers in this + // list have the top bit of their deadline set to 0. TimerHeap heap ABSL_GUARDED_BY(mu); - /* This holds timers whose deadline is >= queue_deadline_cap. */ + // This holds timers whose deadline is >= queue_deadline_cap. Timer list ABSL_GUARDED_BY(mu); }; @@ -175,20 +175,20 @@ class TimerList { TimerListHost* const host_; const size_t num_shards_; grpc_core::Mutex mu_; - /* The deadline of the next timer due across all timer shards */ + // The deadline of the next timer due across all timer shards std::atomic min_timer_; - /* Allow only one FindExpiredTimers at once (used as a TryLock, protects no - * fields but ensures limits on concurrency) */ + // Allow only one FindExpiredTimers at once (used as a TryLock, protects no + // fields but ensures limits on concurrency) grpc_core::Mutex checker_mu_; - /* Array of timer shards. Whenever a timer (Timer *) is added, its address - * is hashed to select the timer shard to add the timer to */ + // Array of timer shards. Whenever a timer (Timer *) is added, its address + // is hashed to select the timer shard to add the timer to const std::unique_ptr shards_; - /* Maintains a sorted list of timer shards (sorted by their min_deadline, i.e - * the deadline of the next timer in each shard). */ + // Maintains a sorted list of timer shards (sorted by their min_deadline, i.e + // the deadline of the next timer in each shard). const std::unique_ptr shard_queue_ ABSL_GUARDED_BY(mu_); }; } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_H */ +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_H diff --git a/src/core/lib/event_engine/posix_engine/timer_heap.cc b/src/core/lib/event_engine/posix_engine/timer_heap.cc index 7ad40468824..776c2c3f6bd 100644 --- a/src/core/lib/event_engine/posix_engine/timer_heap.cc +++ b/src/core/lib/event_engine/posix_engine/timer_heap.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -29,11 +29,11 @@ namespace grpc_event_engine { namespace experimental { -/* Adjusts a heap so as to move a hole at position i closer to the root, - until a suitable position is found for element t. Then, copies t into that - position. This functor is called each time immediately after modifying a - value in the underlying container, with the offset of the modified element as - its argument. */ +// Adjusts a heap so as to move a hole at position i closer to the root, +// until a suitable position is found for element t. Then, copies t into that +// position. This functor is called each time immediately after modifying a +// value in the underlying container, with the offset of the modified element as +// its argument. void TimerHeap::AdjustUpwards(size_t i, Timer* t) { while (i > 0) { size_t parent = (i - 1) / 2; @@ -46,9 +46,9 @@ void TimerHeap::AdjustUpwards(size_t i, Timer* t) { t->heap_index = i; } -/* Adjusts a heap so as to move a hole at position i farther away from the root, - until a suitable position is found for element t. Then, copies t into that - position. */ +// Adjusts a heap so as to move a hole at position i farther away from the root, +// until a suitable position is found for element t. Then, copies t into that +// position. void TimerHeap::AdjustDownwards(size_t i, Timer* t) { for (;;) { size_t left_child = 1 + 2 * i; diff --git a/src/core/lib/event_engine/posix_engine/timer_heap.h b/src/core/lib/event_engine/posix_engine/timer_heap.h index e0060f39e84..4ac54e9abdb 100644 --- a/src/core/lib/event_engine/posix_engine/timer_heap.h +++ b/src/core/lib/event_engine/posix_engine/timer_heap.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_HEAP_H #define GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_HEAP_H @@ -31,7 +31,7 @@ struct Timer; class TimerHeap { public: - /* return true if the new timer is the first timer in the heap */ + // return true if the new timer is the first timer in the heap bool Add(Timer* timer); void Remove(Timer* timer); @@ -53,4 +53,4 @@ class TimerHeap { } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_HEAP_H */ +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_HEAP_H diff --git a/src/core/lib/event_engine/posix_engine/timer_manager.cc b/src/core/lib/event_engine/posix_engine/timer_manager.cc index 5faa8786102..2962f7a2eb9 100644 --- a/src/core/lib/event_engine/posix_engine/timer_manager.cc +++ b/src/core/lib/event_engine/posix_engine/timer_manager.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/event_engine/posix_engine/timer_manager.h b/src/core/lib/event_engine/posix_engine/timer_manager.h index 82c96fdfb2d..d882fd6e886 100644 --- a/src/core/lib/event_engine/posix_engine/timer_manager.h +++ b/src/core/lib/event_engine/posix_engine/timer_manager.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_MANAGER_H #define GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_MANAGER_H @@ -111,4 +111,4 @@ class TimerManager final : public grpc_event_engine::experimental::Forkable { } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_MANAGER_H */ +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TIMER_MANAGER_H diff --git a/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc b/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc index 96b5a50ddb1..e5119f0c840 100644 --- a/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc +++ b/src/core/lib/event_engine/posix_engine/traced_buffer_list.cc @@ -314,7 +314,7 @@ void TcpSetWriteTimestampsCallback( } // namespace experimental } // namespace grpc_event_engine -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE namespace grpc_event_engine { namespace experimental { @@ -327,4 +327,4 @@ void TcpSetWriteTimestampsCallback( } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE diff --git a/src/core/lib/event_engine/posix_engine/traced_buffer_list.h b/src/core/lib/event_engine/posix_engine/traced_buffer_list.h index 145a87e8e14..434147e6a34 100644 --- a/src/core/lib/event_engine/posix_engine/traced_buffer_list.h +++ b/src/core/lib/event_engine/posix_engine/traced_buffer_list.h @@ -32,58 +32,58 @@ namespace grpc_event_engine { namespace experimental { -struct ConnectionMetrics { /* Delivery rate in Bytes/s. */ +struct ConnectionMetrics { // Delivery rate in Bytes/s. absl::optional delivery_rate; - /* If the delivery rate is limited by the application, this is set to true. */ + // If the delivery rate is limited by the application, this is set to true. absl::optional is_delivery_rate_app_limited; - /* Total packets retransmitted. */ + // Total packets retransmitted. absl::optional packet_retx; - /* Total packets retransmitted spuriously. This metric is smaller than or - equal to packet_retx. */ + // Total packets retransmitted spuriously. This metric is smaller than or + // equal to packet_retx. absl::optional packet_spurious_retx; - /* Total packets sent. */ + // Total packets sent. absl::optional packet_sent; - /* Total packets delivered. */ + // Total packets delivered. absl::optional packet_delivered; - /* Total packets delivered with ECE marked. This metric is smaller than or - equal to packet_delivered. */ + // Total packets delivered with ECE marked. This metric is smaller than or + // equal to packet_delivered. absl::optional packet_delivered_ce; - /* Total bytes lost so far. */ + // Total bytes lost so far. absl::optional data_retx; - /* Total bytes sent so far. */ + // Total bytes sent so far. absl::optional data_sent; - /* Total bytes in write queue but not sent. */ + // Total bytes in write queue but not sent. absl::optional data_notsent; - /* Pacing rate of the connection in Bps */ + // Pacing rate of the connection in Bps absl::optional pacing_rate; - /* Minimum RTT observed in usec. */ + // Minimum RTT observed in usec. absl::optional min_rtt; - /* Smoothed RTT in usec */ + // Smoothed RTT in usec absl::optional srtt; - /* Send congestion window. */ + // Send congestion window. absl::optional congestion_window; - /* Slow start threshold in packets. */ + // Slow start threshold in packets. absl::optional snd_ssthresh; - /* Maximum degree of reordering (i.e., maximum number of packets reodered) - on the connection. */ + // Maximum degree of reordering (i.e., maximum number of packets reodered) + // on the connection. absl::optional reordering; - /* Represents the number of recurring retransmissions of the first sequence - that is not acknowledged yet. */ + // Represents the number of recurring retransmissions of the first sequence + // that is not acknowledged yet. absl::optional recurring_retrans; - /* The cumulative time (in usec) that the transport protocol was busy - sending data. */ + // The cumulative time (in usec) that the transport protocol was busy + // sending data. absl::optional busy_usec; - /* The cumulative time (in usec) that the transport protocol was limited by - the receive window size. */ + // The cumulative time (in usec) that the transport protocol was limited by + // the receive window size. absl::optional rwnd_limited_usec; - /* The cumulative time (in usec) that the transport protocol was limited by - the send buffer size. */ + // The cumulative time (in usec) that the transport protocol was limited by + // the send buffer size. absl::optional sndbuf_limited_usec; }; struct BufferTimestamp { gpr_timespec time; - ConnectionMetrics metrics; /* Metrics collected with this timestamp */ + ConnectionMetrics metrics; // Metrics collected with this timestamp }; struct Timestamps { @@ -92,11 +92,11 @@ struct Timestamps { BufferTimestamp sent_time; BufferTimestamp acked_time; - uint32_t byte_offset; /* byte offset relative to the start of the RPC */ + uint32_t byte_offset; // byte offset relative to the start of the RPC #ifdef GRPC_LINUX_ERRQUEUE - tcp_info info; /* tcp_info collected on sendmsg */ -#endif /* GRPC_LINUX_ERRQUEUE */ + tcp_info info; // tcp_info collected on sendmsg +#endif // GRPC_LINUX_ERRQUEUE }; // TracedBuffer is a class to keep track of timestamps for a specific buffer in @@ -148,9 +148,9 @@ class TracedBufferList { friend class TracedBufferList; gpr_timespec last_timestamp_; TracedBuffer* next_ = nullptr; - uint32_t seq_no_; /* The sequence number for the last byte in the buffer */ - void* arg_; /* The arg to pass to timestamps_callback */ - Timestamps ts_; /* The timestamps corresponding to this buffer */ + uint32_t seq_no_; // The sequence number for the last byte in the buffer + void* arg_; // The arg to pass to timestamps_callback + Timestamps ts_; // The timestamps corresponding to this buffer }; grpc_core::Mutex mu_; // TracedBuffers are ordered by sequence number and would need to be processed @@ -161,7 +161,7 @@ class TracedBufferList { TracedBuffer* tail_ = nullptr; }; -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE // TracedBufferList implementation is a no-op for this platform. class TracedBufferList { public: @@ -172,7 +172,7 @@ class TracedBufferList { int Size() { return 0; } void Shutdown(void* /*remaining*/, absl::Status /*shutdown_err*/) {} }; -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE // Sets the callback function to call when timestamps for a write are collected. // This is expected to be called atmost once. @@ -182,4 +182,4 @@ void TcpSetWriteTimestampsCallback( } // namespace experimental } // namespace grpc_event_engine -#endif /* GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TRACED_BUFFER_LIST_H */ +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_TRACED_BUFFER_LIST_H diff --git a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h index 3eab8ae9b1c..acab67f1696 100644 --- a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h +++ b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix.h @@ -12,33 +12,33 @@ // See the License for the specific language governing permissions and // limitations under the License. -/* - * WakeupFd abstracts the concept of a file descriptor for the purpose of - * waking up a thread in select()/poll()/epoll_wait()/etc. +// +// WakeupFd abstracts the concept of a file descriptor for the purpose of +// waking up a thread in select()/poll()/epoll_wait()/etc. - * The poll() family of system calls provide a way for a thread to block until - * there is activity on one (or more) of a set of file descriptors. An - * application may wish to wake up this thread to do non file related work. The - * typical way to do this is to add a pipe to the set of file descriptors, then - * write to the pipe to wake up the thread in poll(). - * - * Linux has a lighter weight eventfd specifically designed for this purpose. - * WakeupFd abstracts the difference between the two. - * - * Setup: - * 1. Call CreateWakeupFd() to crete an initialized WakeupFd. - * 2. Add the result of WakeupFd::ReadFd() to the set of monitored file - * descriptors for the poll() style API you are using. Monitor the file - * descriptor for readability. - * 3. To tear down, call WakeupFd::Destroy(). This closes the underlying - * file descriptor. - * - * Usage: - * 1. To wake up a polling thread, call WakeupFd::Wakeup() on a wakeup_fd - * it is monitoring. - * 2. If the polling thread was awakened by a WakeupFd event, call - * WakeupFd::Consume() on it. - */ +// The poll() family of system calls provide a way for a thread to block until +// there is activity on one (or more) of a set of file descriptors. An +// application may wish to wake up this thread to do non file related work. The +// typical way to do this is to add a pipe to the set of file descriptors, then +// write to the pipe to wake up the thread in poll(). +// +// Linux has a lighter weight eventfd specifically designed for this purpose. +// WakeupFd abstracts the difference between the two. +// +// Setup: +// 1. Call CreateWakeupFd() to crete an initialized WakeupFd. +// 2. Add the result of WakeupFd::ReadFd() to the set of monitored file +// descriptors for the poll() style API you are using. Monitor the file +// descriptor for readability. +// 3. To tear down, call WakeupFd::Destroy(). This closes the underlying +// file descriptor. +// +// Usage: +// 1. To wake up a polling thread, call WakeupFd::Wakeup() on a wakeup_fd +// it is monitoring. +// 2. If the polling thread was awakened by a WakeupFd event, call +// WakeupFd::Consume() on it. +// #ifndef GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_WAKEUP_FD_POSIX_H #define GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_WAKEUP_FD_POSIX_H diff --git a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc index 90878c1da33..d00e34714a9 100644 --- a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc +++ b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.cc @@ -53,7 +53,7 @@ absl::StatusOr> CreateWakeupFd() { return g_wakeup_fd_fn(); } -#else /* GRPC_POSIX_WAKEUP_FD */ +#else // GRPC_POSIX_WAKEUP_FD bool SupportsWakeupFd() { return false; } @@ -61,7 +61,7 @@ absl::StatusOr> CreateWakeupFd() { return absl::NotFoundError("Wakeup-fd is not supported on this system"); } -#endif /* GRPC_POSIX_WAKEUP_FD */ +#endif // GRPC_POSIX_WAKEUP_FD } // namespace experimental } // namespace grpc_event_engine diff --git a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h index 36a8459d92b..6cda988470e 100644 --- a/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h +++ b/src/core/lib/event_engine/posix_engine/wakeup_fd_posix_default.h @@ -34,4 +34,4 @@ absl::StatusOr> CreateWakeupFd(); } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_WAKEUP_FD_POSIX_DEFAULT_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_POSIX_ENGINE_WAKEUP_FD_POSIX_DEFAULT_H diff --git a/src/core/lib/event_engine/socket_notifier.h b/src/core/lib/event_engine/socket_notifier.h index 6aee66022d8..c346e9d7fe9 100644 --- a/src/core/lib/event_engine/socket_notifier.h +++ b/src/core/lib/event_engine/socket_notifier.h @@ -52,4 +52,4 @@ class SocketNotifier { } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_SOCKET_NOTIFIER_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_SOCKET_NOTIFIER_H diff --git a/src/core/lib/event_engine/thread_pool.cc b/src/core/lib/event_engine/thread_pool.cc index fc77f58eea7..184a89be8a6 100644 --- a/src/core/lib/event_engine/thread_pool.cc +++ b/src/core/lib/event_engine/thread_pool.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/event_engine/thread_pool.h b/src/core/lib/event_engine/thread_pool.h index a67714e78d4..e607a7aeb5f 100644 --- a/src/core/lib/event_engine/thread_pool.h +++ b/src/core/lib/event_engine/thread_pool.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_EVENT_ENGINE_THREAD_POOL_H #define GRPC_CORE_LIB_EVENT_ENGINE_THREAD_POOL_H diff --git a/src/core/lib/event_engine/time_util.h b/src/core/lib/event_engine/time_util.h index 82b23ef3946..0fdbc45fcee 100644 --- a/src/core/lib/event_engine/time_util.h +++ b/src/core/lib/event_engine/time_util.h @@ -29,4 +29,4 @@ size_t Milliseconds(EventEngine::Duration d); } // namespace experimental } // namespace grpc_event_engine -#endif // GRPC_CORE_LIB_EVENT_ENGINE_TIME_UTIL_H \ No newline at end of file +#endif // GRPC_CORE_LIB_EVENT_ENGINE_TIME_UTIL_H diff --git a/src/core/lib/event_engine/windows/iocp.cc b/src/core/lib/event_engine/windows/iocp.cc index ebd77802fa5..23fe4969eb0 100644 --- a/src/core/lib/event_engine/windows/iocp.cc +++ b/src/core/lib/event_engine/windows/iocp.cc @@ -135,14 +135,14 @@ DWORD IOCP::GetDefaultSocketFlags() { DWORD IOCP::WSASocketFlagsInit() { DWORD wsa_socket_flags = WSA_FLAG_OVERLAPPED; - /* WSA_FLAG_NO_HANDLE_INHERIT may be not supported on the older Windows - versions, see - https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx - for details. */ + // WSA_FLAG_NO_HANDLE_INHERIT may be not supported on the older Windows + // versions, see + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx + // for details. SOCKET sock = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, NULL, 0, wsa_socket_flags | WSA_FLAG_NO_HANDLE_INHERIT); if (sock != INVALID_SOCKET) { - /* Windows 7, Windows 2008 R2 with SP1 or later */ + // Windows 7, Windows 2008 R2 with SP1 or later wsa_socket_flags |= WSA_FLAG_NO_HANDLE_INHERIT; closesocket(sock); } diff --git a/src/core/lib/event_engine/windows/win_socket.cc b/src/core/lib/event_engine/windows/win_socket.cc index d04d8ff19d9..4ae64aaf41a 100644 --- a/src/core/lib/event_engine/windows/win_socket.cc +++ b/src/core/lib/event_engine/windows/win_socket.cc @@ -24,8 +24,8 @@ #include "src/core/lib/iomgr/error.h" #if defined(__MSYS__) && defined(GPR_ARCH_64) -/* Nasty workaround for nasty bug when using the 64 bits msys compiler - in conjunction with Microsoft Windows headers. */ +// Nasty workaround for nasty bug when using the 64 bits msys compiler +// in conjunction with Microsoft Windows headers. #define GRPC_FIONBIO _IOW('f', 126, uint32_t) #else #define GRPC_FIONBIO FIONBIO diff --git a/src/core/lib/gpr/alloc.cc b/src/core/lib/gpr/alloc.cc index 4537fb91ddd..e7d94541e9f 100644 --- a/src/core/lib/gpr/alloc.cc +++ b/src/core/lib/gpr/alloc.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/gpr/alloc.h b/src/core/lib/gpr/alloc.h index 762b51bf663..231ee42a210 100644 --- a/src/core/lib/gpr/alloc.h +++ b/src/core/lib/gpr/alloc.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_GPR_ALLOC_H #define GRPC_CORE_LIB_GPR_ALLOC_H @@ -25,4 +25,4 @@ #define GPR_ROUND_UP_TO_ALIGNMENT_SIZE(x) \ (((x) + GPR_MAX_ALIGNMENT - 1u) & ~(GPR_MAX_ALIGNMENT - 1u)) -#endif /* GRPC_CORE_LIB_GPR_ALLOC_H */ +#endif // GRPC_CORE_LIB_GPR_ALLOC_H diff --git a/src/core/lib/gpr/atm.cc b/src/core/lib/gpr/atm.cc index c40e97ea771..73173539818 100644 --- a/src/core/lib/gpr/atm.cc +++ b/src/core/lib/gpr/atm.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/gpr/cpu_iphone.cc b/src/core/lib/gpr/cpu_iphone.cc index 94a724de711..26c3726fc13 100644 --- a/src/core/lib/gpr/cpu_iphone.cc +++ b/src/core/lib/gpr/cpu_iphone.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -33,12 +33,12 @@ unsigned gpr_cpu_num_cores(void) { return ncpu; } -/* Most code that's using this is using it to shard across work queues. So - unless profiling shows it's a problem or there appears a way to detect the - currently running CPU core, let's have it shard the default way. - Note that the interface in cpu.h lets gpr_cpu_num_cores return 0, but doing - it makes it impossible for gpr_cpu_current_cpu to satisfy its stated range, - and some code might be relying on it. */ +// Most code that's using this is using it to shard across work queues. So +// unless profiling shows it's a problem or there appears a way to detect the +// currently running CPU core, let's have it shard the default way. +// Note that the interface in cpu.h lets gpr_cpu_num_cores return 0, but doing +// it makes it impossible for gpr_cpu_current_cpu to satisfy its stated range, +// and some code might be relying on it. unsigned gpr_cpu_current_cpu(void) { return 0; } -#endif /* GPR_CPU_IPHONE */ +#endif // GPR_CPU_IPHONE diff --git a/src/core/lib/gpr/cpu_linux.cc b/src/core/lib/gpr/cpu_linux.cc index 8b38f217b1d..eee30a8112c 100644 --- a/src/core/lib/gpr/cpu_linux.cc +++ b/src/core/lib/gpr/cpu_linux.cc @@ -1,24 +1,24 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef _GNU_SOURCE #define _GNU_SOURCE -#endif /* _GNU_SOURCE */ +#endif // _GNU_SOURCE #include @@ -46,8 +46,8 @@ static void init_num_cpus() { return; } #endif - /* This must be signed. sysconf returns -1 when the number cannot be - determined */ + // This must be signed. sysconf returns -1 when the number cannot be + // determined ncpus = static_cast(sysconf(_SC_NPROCESSORS_CONF)); if (ncpus < 1) { gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1"); @@ -83,4 +83,4 @@ unsigned gpr_cpu_current_cpu(void) { #endif } -#endif /* GPR_CPU_LINUX */ +#endif // GPR_CPU_LINUX diff --git a/src/core/lib/gpr/cpu_posix.cc b/src/core/lib/gpr/cpu_posix.cc index 7a1d5460590..f1b23f2d554 100644 --- a/src/core/lib/gpr/cpu_posix.cc +++ b/src/core/lib/gpr/cpu_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -60,10 +60,10 @@ static void init_thread_id_key(void) { } unsigned gpr_cpu_current_cpu(void) { - /* NOTE: there's no way I know to return the actual cpu index portably... - most code that's using this is using it to shard across work queues though, - so here we use thread identity instead to achieve a similar though not - identical effect */ + // NOTE: there's no way I know to return the actual cpu index portably... + // most code that's using this is using it to shard across work queues though, + // so here we use thread identity instead to achieve a similar though not + // identical effect static gpr_once once = GPR_ONCE_INIT; gpr_once_init(&once, init_thread_id_key); @@ -80,4 +80,4 @@ unsigned gpr_cpu_current_cpu(void) { return (unsigned)grpc_core::HashPointer(thread_id, gpr_cpu_num_cores()); } -#endif /* GPR_CPU_POSIX */ +#endif // GPR_CPU_POSIX diff --git a/src/core/lib/gpr/cpu_windows.cc b/src/core/lib/gpr/cpu_windows.cc index 8d894534039..d31b379ada7 100644 --- a/src/core/lib/gpr/cpu_windows.cc +++ b/src/core/lib/gpr/cpu_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -30,4 +30,4 @@ unsigned gpr_cpu_num_cores(void) { unsigned gpr_cpu_current_cpu(void) { return GetCurrentProcessorNumber(); } -#endif /* GPR_WINDOWS */ +#endif // GPR_WINDOWS diff --git a/src/core/lib/gpr/log.cc b/src/core/lib/gpr/log.cc index 71de49f7a52..3e151a7337f 100644 --- a/src/core/lib/gpr/log.cc +++ b/src/core/lib/gpr/log.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/gpr/log_android.cc b/src/core/lib/gpr/log_android.cc index 11ffd64d604..38b84d7bcbb 100644 --- a/src/core/lib/gpr/log_android.cc +++ b/src/core/lib/gpr/log_android.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -42,7 +42,7 @@ static android_LogPriority severity_to_log_priority(gpr_log_severity severity) { void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { - /* Avoid message construction if gpr_log_message won't log */ + // Avoid message construction if gpr_log_message won't log if (gpr_should_log(severity) == 0) { return; } @@ -70,8 +70,8 @@ void gpr_default_log(gpr_log_func_args* args) { __android_log_write(severity_to_log_priority(args->severity), "GRPC", output); - /* allocated by asprintf => use free, not gpr_free */ + // allocated by asprintf => use free, not gpr_free free(output); } -#endif /* GPR_ANDROID */ +#endif // GPR_ANDROID diff --git a/src/core/lib/gpr/log_internal.h b/src/core/lib/gpr/log_internal.h index deec1518644..ecf4e325726 100644 --- a/src/core/lib/gpr/log_internal.h +++ b/src/core/lib/gpr/log_internal.h @@ -21,12 +21,12 @@ #include -/** abort() the process if x is zero, with rudimentary logging to prevent - circular dependencies with gpr_log. +/// abort() the process if x is zero, with rudimentary logging to prevent +/// circular dependencies with gpr_log. - Intended for internal invariants. If the error can be recovered from, - without the possibility of corruption, or might best be reflected via - an exception in a higher-level language, consider returning error code. */ +/// Intended for internal invariants. If the error can be recovered from, +/// without the possibility of corruption, or might best be reflected via +/// an exception in a higher-level language, consider returning error code. #define GPR_ASSERT_INTERNAL(x) \ do { \ if (GPR_UNLIKELY(!(x))) { \ diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc index e4d0cd59bdb..e5f8c871544 100644 --- a/src/core/lib/gpr/log_linux.cc +++ b/src/core/lib/gpr/log_linux.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef _POSIX_SOURCE #define _POSIX_SOURCE @@ -52,7 +52,7 @@ static long sys_gettid(void) { return syscall(__NR_gettid); } void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { - /* Avoid message construction if gpr_log_message won't log */ + // Avoid message construction if gpr_log_message won't log if (gpr_should_log(severity) == 0) { return; } @@ -65,7 +65,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity, } va_end(args); gpr_log_message(file, line, severity, message); - /* message has been allocated by vasprintf above, and needs free */ + // message has been allocated by vasprintf above, and needs free free(message); } @@ -110,4 +110,4 @@ void gpr_default_log(gpr_log_func_args* args) { } } -#endif /* GPR_LINUX_LOG */ +#endif // GPR_LINUX_LOG diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc index 2c28bddd757..3f9e1e23677 100644 --- a/src/core/lib/gpr/log_posix.cc +++ b/src/core/lib/gpr/log_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -43,7 +43,7 @@ static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); } void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { - /* Avoid message construction if gpr_log_message won't log */ + // Avoid message construction if gpr_log_message won't log if (gpr_should_log(severity) == 0) { return; } @@ -107,4 +107,4 @@ void gpr_default_log(gpr_log_func_args* args) { } } -#endif /* defined(GPR_POSIX_LOG) */ +#endif // defined(GPR_POSIX_LOG) diff --git a/src/core/lib/gpr/log_windows.cc b/src/core/lib/gpr/log_windows.cc index adb2e140e36..145186d2fe6 100644 --- a/src/core/lib/gpr/log_windows.cc +++ b/src/core/lib/gpr/log_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -36,7 +36,7 @@ int gpr_should_log_stacktrace(gpr_log_severity severity); void gpr_log(const char* file, int line, gpr_log_severity severity, const char* format, ...) { - /* Avoid message construction if gpr_log_message won't log */ + // Avoid message construction if gpr_log_message won't log if (gpr_should_log(severity) == 0) { return; } @@ -45,23 +45,23 @@ void gpr_log(const char* file, int line, gpr_log_severity severity, va_list args; int ret; - /* Determine the length. */ + // Determine the length. va_start(args, format); ret = _vscprintf(format, args); va_end(args); if (ret < 0) { message = NULL; } else { - /* Allocate a new buffer, with space for the NUL terminator. */ + // Allocate a new buffer, with space for the NUL terminator. size_t strp_buflen = (size_t)ret + 1; message = (char*)gpr_malloc(strp_buflen); - /* Print to the buffer. */ + // Print to the buffer. va_start(args, format); ret = vsnprintf_s(message, strp_buflen, _TRUNCATE, format, args); va_end(args); if ((size_t)ret != strp_buflen - 1) { - /* This should never happen. */ + // This should never happen. gpr_free(message); message = NULL; } @@ -71,7 +71,7 @@ void gpr_log(const char* file, int line, gpr_log_severity severity, gpr_free(message); } -/* Simple starter implementation */ +// Simple starter implementation void gpr_default_log(gpr_log_func_args* args) { const char* final_slash; const char* display_file; @@ -112,4 +112,4 @@ void gpr_default_log(gpr_log_func_args* args) { fflush(stderr); } -#endif /* GPR_WINDOWS_LOG */ +#endif // GPR_WINDOWS_LOG diff --git a/src/core/lib/gpr/spinlock.h b/src/core/lib/gpr/spinlock.h index 4a19f45babd..a34d827b2d4 100644 --- a/src/core/lib/gpr/spinlock.h +++ b/src/core/lib/gpr/spinlock.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPR_SPINLOCK_H #define GRPC_CORE_LIB_GPR_SPINLOCK_H @@ -50,4 +50,4 @@ struct gpr_spinlock { do { \ } while (!gpr_spinlock_trylock((lock))) -#endif /* GRPC_CORE_LIB_GPR_SPINLOCK_H */ +#endif // GRPC_CORE_LIB_GPR_SPINLOCK_H diff --git a/src/core/lib/gpr/string.cc b/src/core/lib/gpr/string.cc index 17b27e6f72b..d4e662d4d38 100644 --- a/src/core/lib/gpr/string.cc +++ b/src/core/lib/gpr/string.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -151,12 +151,12 @@ int gpr_parse_bytes_to_uint32(const char* buf, size_t len, uint32_t* result) { uint32_t new_val; size_t i; - if (len == 0) return 0; /* must have some bytes */ + if (len == 0) return 0; // must have some bytes for (i = 0; i < len; i++) { - if (buf[i] < '0' || buf[i] > '9') return 0; /* bad char */ + if (buf[i] < '0' || buf[i] > '9') return 0; // bad char new_val = 10 * out + static_cast(buf[i] - '0'); - if (new_val < out) return 0; /* overflow */ + if (new_val < out) return 0; // overflow out = new_val; } @@ -245,9 +245,9 @@ char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep, for (i = 0; i < nstrs; i++) { out_length += strlen(strs[i]); } - out_length += 1; /* null terminator */ + out_length += 1; // null terminator if (nstrs > 0) { - out_length += sep_len * (nstrs - 1); /* separators */ + out_length += sep_len * (nstrs - 1); // separators } out = static_cast(gpr_malloc(out_length)); out_length = 0; diff --git a/src/core/lib/gpr/string.h b/src/core/lib/gpr/string.h index e83aefad6ab..64fc8ce506e 100644 --- a/src/core/lib/gpr/string.h +++ b/src/core/lib/gpr/string.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPR_STRING_H #define GRPC_CORE_LIB_GPR_STRING_H @@ -28,85 +28,85 @@ #include -/* String utility functions */ +// String utility functions -/* Flags for gpr_dump function. */ +// Flags for gpr_dump function. #define GPR_DUMP_HEX 0x00000001 #define GPR_DUMP_ASCII 0x00000002 -/* Converts array buf, of length len, into a C string according to the flags. - Result should be freed with gpr_free() */ +// Converts array buf, of length len, into a C string according to the flags. +// Result should be freed with gpr_free() char* gpr_dump(const char* buf, size_t len, uint32_t flags); -/* Converts array buf, of length len, into a C string according to the flags. - The length of the returned buffer is stored in out_len. - Result should be freed with gpr_free() */ +// Converts array buf, of length len, into a C string according to the flags. +// The length of the returned buffer is stored in out_len. +// Result should be freed with gpr_free() char* gpr_dump_return_len(const char* buf, size_t len, uint32_t flags, size_t* out_len); -/* Parses an array of bytes into an integer (base 10). Returns 1 on success, - 0 on failure. */ +// Parses an array of bytes into an integer (base 10). Returns 1 on success, +// 0 on failure. int gpr_parse_bytes_to_uint32(const char* buf, size_t len, uint32_t* result); -/* Minimum buffer size for calling ltoa */ +// Minimum buffer size for calling ltoa #define GPR_LTOA_MIN_BUFSIZE (3 * sizeof(long)) -/* Convert a long to a string in base 10; returns the length of the - output string (or 0 on failure). - output must be at least GPR_LTOA_MIN_BUFSIZE bytes long. */ +// Convert a long to a string in base 10; returns the length of the +// output string (or 0 on failure). +// output must be at least GPR_LTOA_MIN_BUFSIZE bytes long. int gpr_ltoa(long value, char* output); -/* Minimum buffer size for calling int64toa */ +// Minimum buffer size for calling int64toa #define GPR_INT64TOA_MIN_BUFSIZE (3 * sizeof(int64_t)) -/* Convert an int64 to a string in base 10; returns the length of the -output string (or 0 on failure). -output must be at least GPR_INT64TOA_MIN_BUFSIZE bytes long. -NOTE: This function ensures sufficient bit width even on Win x64, -where long is 32bit is size.*/ +// Convert an int64 to a string in base 10; returns the length of the +// output string (or 0 on failure). +// output must be at least GPR_INT64TOA_MIN_BUFSIZE bytes long. +// NOTE: This function ensures sufficient bit width even on Win x64, +// where long is 32bit is size. int int64_ttoa(int64_t value, char* output); // Parses a non-negative number from a value string. Returns -1 on error. int gpr_parse_nonnegative_int(const char* value); -/* Reverse a run of bytes */ +// Reverse a run of bytes void gpr_reverse_bytes(char* str, int len); -/* Pad a string with flag characters. The given length specifies the minimum - field width. The input string is never truncated. */ +// Pad a string with flag characters. The given length specifies the minimum +// field width. The input string is never truncated. char* gpr_leftpad(const char* str, char flag, size_t length); -/* Join a set of strings, returning the resulting string. - Total combined length (excluding null terminator) is returned in final_length - if it is non-null. */ +// Join a set of strings, returning the resulting string. +// Total combined length (excluding null terminator) is returned in final_length +// if it is non-null. char* gpr_strjoin(const char** strs, size_t nstrs, size_t* final_length); -/* Join a set of strings using a separator, returning the resulting string. - Total combined length (excluding null terminator) is returned in final_length - if it is non-null. */ +// Join a set of strings using a separator, returning the resulting string. +// Total combined length (excluding null terminator) is returned in final_length +// if it is non-null. char* gpr_strjoin_sep(const char** strs, size_t nstrs, const char* sep, size_t* final_length); void gpr_string_split(const char* input, const char* sep, char*** strs, size_t* nstrs); -/* Returns a string that represents tm according to RFC-3339, and, - more specifically, follows: - https://developers.google.com/protocol-buffers/docs/proto3#json +// Returns a string that represents tm according to RFC-3339, and, +// more specifically, follows: +// https://developers.google.com/protocol-buffers/docs/proto3#json - Uses RFC 3339, where generated output will always be Z-normalized and uses - 0, 3, 6 or 9 fractional digits. */ +// Uses RFC 3339, where generated output will always be Z-normalized and uses +// 0, 3, 6 or 9 fractional digits. std::string gpr_format_timespec(gpr_timespec); -/** Case insensitive string comparison... return <0 if lower(a)0 if lower(a)>lower(b) */ +/// Case insensitive string comparison... return <0 if lower(a)0 if lower(a)>lower(b) int gpr_stricmp(const char* a, const char* b); int gpr_strincmp(const char* a, const char* b, size_t n); void* gpr_memrchr(const void* s, int c, size_t n); -/* Try to parse given string into a boolean value. - When parsed successfully, dst will have the value and returns true. - Otherwise, it returns false. */ +// Try to parse given string into a boolean value. +// When parsed successfully, dst will have the value and returns true. +// Otherwise, it returns false. bool gpr_parse_bool_value(const char* value, bool* dst); -#endif /* GRPC_CORE_LIB_GPR_STRING_H */ +#endif // GRPC_CORE_LIB_GPR_STRING_H diff --git a/src/core/lib/gpr/string_posix.cc b/src/core/lib/gpr/string_posix.cc index d32775fb3b4..51a16d33cba 100644 --- a/src/core/lib/gpr/string_posix.cc +++ b/src/core/lib/gpr/string_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -33,7 +33,7 @@ int gpr_asprintf(char** strp, const char* format, ...) { char buf[64]; size_t strp_buflen; - /* Use a constant-sized buffer to determine the length. */ + // Use a constant-sized buffer to determine the length. va_start(args, format); ret = vsnprintf(buf, sizeof(buf), format, args); va_end(args); @@ -42,20 +42,20 @@ int gpr_asprintf(char** strp, const char* format, ...) { return -1; } - /* Allocate a new buffer, with space for the NUL terminator. */ + // Allocate a new buffer, with space for the NUL terminator. strp_buflen = static_cast(ret) + 1; if ((*strp = static_cast(gpr_malloc(strp_buflen))) == nullptr) { - /* This shouldn't happen, because gpr_malloc() calls abort(). */ + // This shouldn't happen, because gpr_malloc() calls abort(). return -1; } - /* Return early if we have all the bytes. */ + // Return early if we have all the bytes. if (strp_buflen <= sizeof(buf)) { memcpy(*strp, buf, strp_buflen); return ret; } - /* Try again using the larger buffer. */ + // Try again using the larger buffer. va_start(args, format); ret = vsnprintf(*strp, strp_buflen, format, args); va_end(args); @@ -63,10 +63,10 @@ int gpr_asprintf(char** strp, const char* format, ...) { return ret; } - /* This should never happen. */ + // This should never happen. gpr_free(*strp); *strp = nullptr; return -1; } -#endif /* GPR_POSIX_STRING */ +#endif // GPR_POSIX_STRING diff --git a/src/core/lib/gpr/string_util_windows.cc b/src/core/lib/gpr/string_util_windows.cc index 9be48c94d0e..b56fdd17926 100644 --- a/src/core/lib/gpr/string_util_windows.cc +++ b/src/core/lib/gpr/string_util_windows.cc @@ -1,29 +1,29 @@ -/* - * - * Copyright 2016 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. - * - */ - -/* Posix code for gpr snprintf support. */ +// +// +// Copyright 2016 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. +// +// + +// Posix code for gpr snprintf support. #include #ifdef GPR_WINDOWS -/* Some platforms (namely msys) need wchar to be included BEFORE - anything else, especially strsafe.h. */ +// Some platforms (namely msys) need wchar to be included BEFORE +// anything else, especially strsafe.h. #include #include @@ -52,4 +52,4 @@ char* gpr_format_message(int messageid) { return gpr_strdup(message.c_str()); } -#endif /* GPR_WINDOWS */ +#endif // GPR_WINDOWS diff --git a/src/core/lib/gpr/string_windows.cc b/src/core/lib/gpr/string_windows.cc index 25bfd412e44..603303120b1 100644 --- a/src/core/lib/gpr/string_windows.cc +++ b/src/core/lib/gpr/string_windows.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* Windows code for gpr snprintf support. */ +// Windows code for gpr snprintf support. #include @@ -36,7 +36,7 @@ int gpr_asprintf(char** strp, const char* format, ...) { int ret; size_t strp_buflen; - /* Determine the length. */ + // Determine the length. va_start(args, format); ret = _vscprintf(format, args); va_end(args); @@ -45,14 +45,14 @@ int gpr_asprintf(char** strp, const char* format, ...) { return -1; } - /* Allocate a new buffer, with space for the NUL terminator. */ + // Allocate a new buffer, with space for the NUL terminator. strp_buflen = (size_t)ret + 1; if ((*strp = (char*)gpr_malloc(strp_buflen)) == NULL) { - /* This shouldn't happen, because gpr_malloc() calls abort(). */ + // This shouldn't happen, because gpr_malloc() calls abort(). return -1; } - /* Print to the buffer. */ + // Print to the buffer. va_start(args, format); ret = vsnprintf_s(*strp, strp_buflen, _TRUNCATE, format, args); va_end(args); @@ -60,10 +60,10 @@ int gpr_asprintf(char** strp, const char* format, ...) { return ret; } - /* This should never happen. */ + // This should never happen. gpr_free(*strp); *strp = NULL; return -1; } -#endif /* GPR_WINDOWS_STRING */ +#endif // GPR_WINDOWS_STRING diff --git a/src/core/lib/gpr/sync.cc b/src/core/lib/gpr/sync.cc index 28d506f7f90..446fe523751 100644 --- a/src/core/lib/gpr/sync.cc +++ b/src/core/lib/gpr/sync.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Generic implementation of synchronization primitives. */ +// +// +// 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 +// +// 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. +// +// + +// Generic implementation of synchronization primitives. #include @@ -26,17 +26,17 @@ #include #include -/* Number of mutexes to allocate for events, to avoid lock contention. - Should be a prime. */ +// Number of mutexes to allocate for events, to avoid lock contention. +// Should be a prime. enum { event_sync_partitions = 31 }; -/* Events are partitioned by address to avoid lock contention. */ +// Events are partitioned by address to avoid lock contention. static struct sync_array_s { gpr_mu mu; gpr_cv cv; } sync_array[event_sync_partitions]; -/* This routine is executed once on first use, via event_once */ +// This routine is executed once on first use, via event_once static gpr_once event_once = GPR_ONCE_INIT; static void event_initialize(void) { int i; @@ -46,7 +46,7 @@ static void event_initialize(void) { } } -/* Hash ev into an element of sync_array[]. */ +// Hash ev into an element of sync_array[]. static struct sync_array_s* hash(gpr_event* ev) { return &sync_array[reinterpret_cast(ev) % event_sync_partitions]; } @@ -119,6 +119,6 @@ void gpr_stats_inc(gpr_stats_counter* c, intptr_t inc) { } intptr_t gpr_stats_read(const gpr_stats_counter* c) { - /* don't need acquire-load, but we have no no-barrier load yet */ + // don't need acquire-load, but we have no no-barrier load yet return gpr_atm_acq_load(&c->value); } diff --git a/src/core/lib/gpr/sync_abseil.cc b/src/core/lib/gpr/sync_abseil.cc index 7057c3ea8d0..1c0a2950acc 100644 --- a/src/core/lib/gpr/sync_abseil.cc +++ b/src/core/lib/gpr/sync_abseil.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 @@ -55,7 +55,7 @@ int gpr_mu_trylock(gpr_mu* mu) { return reinterpret_cast(mu)->TryLock(); } -/*----------------------------------------*/ +//---------------------------------------- void gpr_cv_init(gpr_cv* cv) { static_assert(sizeof(gpr_cv) == sizeof(absl::CondVar), @@ -89,7 +89,7 @@ void gpr_cv_broadcast(gpr_cv* cv) { reinterpret_cast(cv)->SignalAll(); } -/*----------------------------------------*/ +//---------------------------------------- void gpr_once_init(gpr_once* once, void (*init_function)(void)) { static_assert(sizeof(gpr_once) == sizeof(absl::once_flag), @@ -97,4 +97,4 @@ void gpr_once_init(gpr_once* once, void (*init_function)(void)) { absl::call_once(*reinterpret_cast(once), init_function); } -#endif /* defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC) */ +#endif // defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC) diff --git a/src/core/lib/gpr/sync_posix.cc b/src/core/lib/gpr/sync_posix.cc index 978596058dc..e5ebf453185 100644 --- a/src/core/lib/gpr/sync_posix.cc +++ b/src/core/lib/gpr/sync_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -75,7 +75,7 @@ int gpr_mu_trylock(gpr_mu* mu) { return err == 0; } -/*----------------------------------------*/ +//---------------------------------------- void gpr_cv_init(gpr_cv* cv) { pthread_condattr_t attr; @@ -147,11 +147,11 @@ void gpr_cv_broadcast(gpr_cv* cv) { #endif } -/*----------------------------------------*/ +//---------------------------------------- void gpr_once_init(gpr_once* once, void (*init_function)(void)) { GPR_ASSERT(pthread_once(once, init_function) == 0); } -#endif /* defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \ - !defined(GPR_CUSTOM_SYNC) */ +#endif // defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \ + // !defined(GPR_CUSTOM_SYNC) diff --git a/src/core/lib/gpr/sync_windows.cc b/src/core/lib/gpr/sync_windows.cc index a6173c72e9a..cb24ad73c7f 100644 --- a/src/core/lib/gpr/sync_windows.cc +++ b/src/core/lib/gpr/sync_windows.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Win32 code for gpr synchronization support. */ +// +// +// 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 +// +// 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. +// +// + +// Win32 code for gpr synchronization support. #include @@ -48,21 +48,21 @@ void gpr_mu_unlock(gpr_mu* mu) { int gpr_mu_trylock(gpr_mu* mu) { int result = TryEnterCriticalSection(&mu->cs); if (result) { - if (mu->locked) { /* This thread already holds the lock. */ - LeaveCriticalSection(&mu->cs); /* Decrement lock count. */ - result = 0; /* Indicate failure */ + if (mu->locked) { // This thread already holds the lock. + LeaveCriticalSection(&mu->cs); // Decrement lock count. + result = 0; // Indicate failure } mu->locked = 1; } return result; } -/*----------------------------------------*/ +//---------------------------------------- void gpr_cv_init(gpr_cv* cv) { InitializeConditionVariable(cv); } void gpr_cv_destroy(gpr_cv* cv) { - /* Condition variables don't need destruction in Win32. */ + // Condition variables don't need destruction in Win32. } int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) { @@ -98,7 +98,7 @@ void gpr_cv_signal(gpr_cv* cv) { WakeConditionVariable(cv); } void gpr_cv_broadcast(gpr_cv* cv) { WakeAllConditionVariable(cv); } -/*----------------------------------------*/ +//---------------------------------------- static void* phony; struct run_once_func_arg { @@ -116,5 +116,5 @@ void gpr_once_init(gpr_once* once, void (*init_function)(void)) { InitOnceExecuteOnce(once, run_once_func, &arg, &phony); } -#endif /* defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \ - !defined(GPR_CUSTOM_SYNC) */ +#endif // defined(GPR_WINDOWS) && !defined(GPR_ABSEIL_SYNC) && \ + // !defined(GPR_CUSTOM_SYNC) diff --git a/src/core/lib/gpr/time.cc b/src/core/lib/gpr/time.cc index 222a25bbef2..3390e5c9be4 100644 --- a/src/core/lib/gpr/time.cc +++ b/src/core/lib/gpr/time.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Generic implementation of time calls. */ +// +// +// 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 +// +// 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. +// +// + +// Generic implementation of time calls. #include @@ -227,8 +227,8 @@ int32_t gpr_time_to_millis(gpr_timespec t) { } return 2147483647; } else if (t.tv_sec <= -2147483) { - /* TODO(ctiller): correct handling here (it's so far in the past do we - care?) */ + // TODO(ctiller): correct handling here (it's so far in the past do we + // care?) return -2147483647; } else { return static_cast(t.tv_sec * GPR_MS_PER_SEC + diff --git a/src/core/lib/gpr/time_posix.cc b/src/core/lib/gpr/time_posix.cc index 93421c8155b..9741ab7d508 100644 --- a/src/core/lib/gpr/time_posix.cc +++ b/src/core/lib/gpr/time_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -35,7 +35,7 @@ static struct timespec timespec_from_gpr(gpr_timespec gts) { struct timespec rv; if (sizeof(time_t) < sizeof(int64_t)) { - /* fine to assert, as this is only used in gpr_sleep_until */ + // fine to assert, as this is only used in gpr_sleep_until GPR_ASSERT(gts.tv_sec <= INT32_MAX && gts.tv_sec >= INT32_MIN); } rv.tv_sec = static_cast(gts.tv_sec); @@ -46,11 +46,11 @@ static struct timespec timespec_from_gpr(gpr_timespec gts) { #if _POSIX_TIMERS > 0 || defined(__OpenBSD__) static gpr_timespec gpr_from_timespec(struct timespec ts, gpr_clock_type clock_type) { - /* - * timespec.tv_sec can have smaller size than gpr_timespec.tv_sec, - * but we are only using this function to implement gpr_now - * so there's no need to handle "infinity" values. - */ + // + // timespec.tv_sec can have smaller size than gpr_timespec.tv_sec, + // but we are only using this function to implement gpr_now + // so there's no need to handle "infinity" values. + // gpr_timespec rv; rv.tv_sec = ts.tv_sec; rv.tv_nsec = static_cast(ts.tv_nsec); @@ -58,7 +58,7 @@ static gpr_timespec gpr_from_timespec(struct timespec ts, return rv; } -/** maps gpr_clock_type --> clockid_t for clock_gettime */ +/// maps gpr_clock_type --> clockid_t for clock_gettime static const clockid_t clockid_for_gpr_clock[] = {CLOCK_MONOTONIC, CLOCK_REALTIME}; @@ -73,7 +73,7 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) { return ret; } else { #if defined(GPR_BACKWARDS_COMPATIBILITY_MODE) && defined(__linux__) - /* avoid ABI problems by invoking syscalls directly */ + // avoid ABI problems by invoking syscalls directly syscall(SYS_clock_gettime, clockid_for_gpr_clock[clock_type], &now); #else clock_gettime(clockid_for_gpr_clock[clock_type], &now); @@ -82,7 +82,7 @@ static gpr_timespec now_impl(gpr_clock_type clock_type) { } } #else -/* For some reason Apple's OSes haven't implemented clock_gettime. */ +// For some reason Apple's OSes haven't implemented clock_gettime. #include #include @@ -161,8 +161,8 @@ void gpr_sleep_until(gpr_timespec until) { int ns_result; for (;;) { - /* We could simplify by using clock_nanosleep instead, but it might be - * slightly less portable. */ + // We could simplify by using clock_nanosleep instead, but it might be + // slightly less portable. now = gpr_now(until.clock_type); if (gpr_time_cmp(until, now) <= 0) { return; @@ -177,4 +177,4 @@ void gpr_sleep_until(gpr_timespec until) { } } -#endif /* GPR_POSIX_TIME */ +#endif // GPR_POSIX_TIME diff --git a/src/core/lib/gpr/time_precise.cc b/src/core/lib/gpr/time_precise.cc index 07a6c3469bf..e2cd07fab5d 100644 --- a/src/core/lib/gpr/time_precise.cc +++ b/src/core/lib/gpr/time_precise.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -53,7 +53,7 @@ static bool read_freq_from_kernel(double* freq) { close(fd); return ret; } -#endif /* GPR_LINUX */ +#endif // GPR_LINUX static double cycles_per_second = 0; static gpr_cycle_counter start_cycle; @@ -78,7 +78,7 @@ void gpr_precise_clock_init(void) { start_cycle = gpr_get_cycle_counter(); return; } -#endif /* GPR_LINUX */ +#endif // GPR_LINUX if (is_fake_clock()) { cycles_per_second = 1; @@ -163,5 +163,5 @@ gpr_timespec gpr_cycle_counter_sub(gpr_cycle_counter a, gpr_cycle_counter b) { return gpr_time_sub(gpr_cycle_counter_to_time(a), gpr_cycle_counter_to_time(b)); } -#endif /* GPR_CYCLE_COUNTER_FALLBACK */ -#endif /* !GPR_CYCLE_COUNTER_CUSTOM */ +#endif // GPR_CYCLE_COUNTER_FALLBACK +#endif // !GPR_CYCLE_COUNTER_CUSTOM diff --git a/src/core/lib/gpr/time_precise.h b/src/core/lib/gpr/time_precise.h index 767bab09028..53384f5c3a3 100644 --- a/src/core/lib/gpr/time_precise.h +++ b/src/core/lib/gpr/time_precise.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPR_TIME_PRECISE_H #define GRPC_CORE_LIB_GPR_TIME_PRECISE_H @@ -66,4 +66,4 @@ void gpr_precise_clock_now(gpr_timespec* clk); gpr_timespec gpr_cycle_counter_to_time(gpr_cycle_counter cycles); gpr_timespec gpr_cycle_counter_sub(gpr_cycle_counter a, gpr_cycle_counter b); -#endif /* GRPC_CORE_LIB_GPR_TIME_PRECISE_H */ +#endif // GRPC_CORE_LIB_GPR_TIME_PRECISE_H diff --git a/src/core/lib/gpr/time_windows.cc b/src/core/lib/gpr/time_windows.cc index 3058b48a87b..77bcbe8f2e4 100644 --- a/src/core/lib/gpr/time_windows.cc +++ b/src/core/lib/gpr/time_windows.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* Win32 code for gpr time support. */ +// Win32 code for gpr time support. #include @@ -86,8 +86,8 @@ void gpr_sleep_until(gpr_timespec until) { int64_t sleep_millis; for (;;) { - /* We could simplify by using clock_nanosleep instead, but it might be - * slightly less portable. */ + // We could simplify by using clock_nanosleep instead, but it might be + // slightly less portable. now = gpr_now(until.clock_type); if (gpr_time_cmp(until, now) <= 0) { return; @@ -101,4 +101,4 @@ void gpr_sleep_until(gpr_timespec until) { } } -#endif /* GPR_WINDOWS_TIME */ +#endif // GPR_WINDOWS_TIME diff --git a/src/core/lib/gpr/tmpfile.h b/src/core/lib/gpr/tmpfile.h index 3ce3ff5e5d2..98fe3eca231 100644 --- a/src/core/lib/gpr/tmpfile.h +++ b/src/core/lib/gpr/tmpfile.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPR_TMPFILE_H #define GRPC_CORE_LIB_GPR_TMPFILE_H @@ -23,10 +23,10 @@ #include -/* Creates a temporary file from a prefix. - If tmp_filename is not NULL, *tmp_filename is assigned the name of the - created file and it is the responsibility of the caller to gpr_free it - unless an error occurs in which case it will be set to NULL. */ +// Creates a temporary file from a prefix. +// If tmp_filename is not NULL, *tmp_filename is assigned the name of the +// created file and it is the responsibility of the caller to gpr_free it +// unless an error occurs in which case it will be set to NULL. FILE* gpr_tmpfile(const char* prefix, char** tmp_filename); -#endif /* GRPC_CORE_LIB_GPR_TMPFILE_H */ +#endif // GRPC_CORE_LIB_GPR_TMPFILE_H diff --git a/src/core/lib/gpr/tmpfile_msys.cc b/src/core/lib/gpr/tmpfile_msys.cc index 76cd886f3a0..f77cbda2d75 100644 --- a/src/core/lib/gpr/tmpfile_msys.cc +++ b/src/core/lib/gpr/tmpfile_msys.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -39,12 +39,12 @@ FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { if (tmp_filename_out != NULL) *tmp_filename_out = NULL; - /* Generate a unique filename with our template + temporary path. */ + // Generate a unique filename with our template + temporary path. success = GetTempFileNameA(".", prefix, 0, tmp_filename); fprintf(stderr, "success = %d\n", success); if (success) { - /* Open a file there. */ + // Open a file there. result = fopen(tmp_filename, "wb+"); fprintf(stderr, "result = %p\n", result); } @@ -55,4 +55,4 @@ FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { return result; } -#endif /* GPR_MSYS_TMPFILE */ +#endif // GPR_MSYS_TMPFILE diff --git a/src/core/lib/gpr/tmpfile_posix.cc b/src/core/lib/gpr/tmpfile_posix.cc index d80f4f7a824..7eceb779922 100644 --- a/src/core/lib/gpr/tmpfile_posix.cc +++ b/src/core/lib/gpr/tmpfile_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -67,4 +67,4 @@ end: return result; } -#endif /* GPR_POSIX_TMPFILE */ +#endif // GPR_POSIX_TMPFILE diff --git a/src/core/lib/gpr/tmpfile_windows.cc b/src/core/lib/gpr/tmpfile_windows.cc index abb051a9d35..6f63991976d 100644 --- a/src/core/lib/gpr/tmpfile_windows.cc +++ b/src/core/lib/gpr/tmpfile_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -41,18 +41,18 @@ FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { if (tmp_filename_out != NULL) *tmp_filename_out = NULL; - /* Convert our prefix to TCHAR. */ + // Convert our prefix to TCHAR. grpc_core::TcharString template_string = grpc_core::CharToTchar(prefix); - /* Get the path to the best temporary folder available. */ + // Get the path to the best temporary folder available. status = GetTempPath(MAX_PATH, tmp_path); if (status == 0 || status > MAX_PATH) goto end; - /* Generate a unique filename with our template + temporary path. */ + // Generate a unique filename with our template + temporary path. success = GetTempFileName(tmp_path, template_string.c_str(), 0, tmp_filename); if (!success) goto end; - /* Open a file there. */ + // Open a file there. if (_tfopen_s(&result, tmp_filename, TEXT("wb+")) != 0) goto end; end: @@ -64,4 +64,4 @@ end: return result; } -#endif /* GPR_WINDOWS_TMPFILE */ +#endif // GPR_WINDOWS_TMPFILE diff --git a/src/core/lib/gpr/useful.h b/src/core/lib/gpr/useful.h index fae54d64d8c..dfe2852743c 100644 --- a/src/core/lib/gpr/useful.h +++ b/src/core/lib/gpr/useful.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPR_USEFUL_H #define GRPC_CORE_LIB_GPR_USEFUL_H @@ -26,7 +26,7 @@ #include "absl/strings/string_view.h" #include "absl/types/variant.h" -/** useful utilities that don't belong anywhere else */ +/// useful utilities that don't belong anywhere else namespace grpc_core { @@ -37,7 +37,7 @@ T Clamp(T val, T min, T max) { return val; } -/** rotl, rotr assume x is unsigned */ +/// rotl, rotr assume x is unsigned template constexpr T RotateLeft(T x, T n) { return ((x << n) | (x >> (sizeof(x) * 8 - n))); @@ -181,4 +181,4 @@ inline uint32_t RoundUpToPowerOf2(uint32_t v) { #define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) -#endif /* GRPC_CORE_LIB_GPR_USEFUL_H */ +#endif // GRPC_CORE_LIB_GPR_USEFUL_H diff --git a/src/core/lib/gpr/wrap_memcpy.cc b/src/core/lib/gpr/wrap_memcpy.cc index 51efc93aa61..0bbf703e613 100644 --- a/src/core/lib/gpr/wrap_memcpy.cc +++ b/src/core/lib/gpr/wrap_memcpy.cc @@ -1,30 +1,30 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include -/* Provide a wrapped memcpy for targets that need to be backwards - * compatible with older libc's. - * - * Enable by setting LDFLAGS=-Wl,-wrap,memcpy when linking. - */ +// Provide a wrapped memcpy for targets that need to be backwards +// compatible with older libc's. +// +// Enable by setting LDFLAGS=-Wl,-wrap,memcpy when linking. +// extern "C" { #ifdef __linux__ @@ -34,7 +34,7 @@ __asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); void* __wrap_memcpy(void* destination, const void* source, size_t num) { return memcpy(destination, source, num); } -#else /* !__x86_64__ */ +#else // !__x86_64__ void* __wrap_memcpy(void* destination, const void* source, size_t num) { return memmove(destination, source, num); } diff --git a/src/core/lib/gprpp/atomic_utils.h b/src/core/lib/gprpp/atomic_utils.h index c059ade62fc..b231774556d 100644 --- a/src/core/lib/gprpp/atomic_utils.h +++ b/src/core/lib/gprpp/atomic_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H #define GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H @@ -44,4 +44,4 @@ inline bool IncrementIfNonzero(std::atomic* p) { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H */ +#endif // GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H diff --git a/src/core/lib/gprpp/debug_location.h b/src/core/lib/gprpp/debug_location.h index 72a718cf93c..82611d5506f 100644 --- a/src/core/lib/gprpp/debug_location.h +++ b/src/core/lib/gprpp/debug_location.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H #define GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H @@ -84,4 +84,4 @@ class DebugLocation { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H */ +#endif // GRPC_CORE_LIB_GPRPP_DEBUG_LOCATION_H diff --git a/src/core/lib/gprpp/dual_ref_counted.h b/src/core/lib/gprpp/dual_ref_counted.h index 8d3f5825519..8627803c5c4 100644 --- a/src/core/lib/gprpp/dual_ref_counted.h +++ b/src/core/lib/gprpp/dual_ref_counted.h @@ -324,4 +324,4 @@ class DualRefCounted : public Orphanable { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H */ +#endif // GRPC_CORE_LIB_GPRPP_DUAL_REF_COUNTED_H diff --git a/src/core/lib/gprpp/env.h b/src/core/lib/gprpp/env.h index c332aa2dee2..750ac91cb69 100644 --- a/src/core/lib/gprpp/env.h +++ b/src/core/lib/gprpp/env.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_ENV_H #define GRPC_CORE_LIB_GPRPP_ENV_H @@ -30,13 +30,13 @@ namespace grpc_core { // Gets the environment variable value with the specified name. */ absl::optional GetEnv(const char* name); -/* Sets the environment with the specified name to the specified value. */ +// Sets the environment with the specified name to the specified value. void SetEnv(const char* name, const char* value); inline void SetEnv(const char* name, const std::string& value) { SetEnv(name, value.c_str()); } -/* Deletes the variable name from the environment. */ +// Deletes the variable name from the environment. void UnsetEnv(const char* name); template @@ -50,4 +50,4 @@ void SetOrUnsetEnv(const char* name, const absl::optional& value) { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_ENV_H */ +#endif // GRPC_CORE_LIB_GPRPP_ENV_H diff --git a/src/core/lib/gprpp/env_linux.cc b/src/core/lib/gprpp/env_linux.cc index 9ca479a6268..feca6a71e4c 100644 --- a/src/core/lib/gprpp/env_linux.cc +++ b/src/core/lib/gprpp/env_linux.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* for secure_getenv. */ +// for secure_getenv. #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif @@ -45,8 +45,8 @@ absl::optional GetEnv(const char* name) { #if defined(GPR_BACKWARDS_COMPATIBILITY_MODE) typedef char* (*getenv_type)(const char*); static getenv_type getenv_func = nullptr; - /* Check to see which getenv variant is supported (go from most - * to least secure) */ + // Check to see which getenv variant is supported (go from most + // to least secure) if (getenv_func == nullptr) { for (auto name : {"secure_getenv", "__secure_getenv", "getenv"}) { getenv_func = reinterpret_cast(dlsym(RTLD_DEFAULT, name)); @@ -77,4 +77,4 @@ void UnsetEnv(const char* name) { } // namespace grpc_core -#endif /* GPR_LINUX_ENV */ +#endif // GPR_LINUX_ENV diff --git a/src/core/lib/gprpp/env_posix.cc b/src/core/lib/gprpp/env_posix.cc index fc85a778001..4121e24c072 100644 --- a/src/core/lib/gprpp/env_posix.cc +++ b/src/core/lib/gprpp/env_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -44,4 +44,4 @@ void UnsetEnv(const char* name) { } // namespace grpc_core -#endif /* GPR_POSIX_ENV */ +#endif // GPR_POSIX_ENV diff --git a/src/core/lib/gprpp/env_windows.cc b/src/core/lib/gprpp/env_windows.cc index a588642f069..4390d202e01 100644 --- a/src/core/lib/gprpp/env_windows.cc +++ b/src/core/lib/gprpp/env_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -53,4 +53,4 @@ void UnsetEnv(const char* name) { } // namespace grpc_core -#endif /* GPR_WINDOWS_ENV */ +#endif // GPR_WINDOWS_ENV diff --git a/src/core/lib/gprpp/examine_stack.cc b/src/core/lib/gprpp/examine_stack.cc index 1c5d93aeb52..35ce21c5032 100644 --- a/src/core/lib/gprpp/examine_stack.cc +++ b/src/core/lib/gprpp/examine_stack.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 diff --git a/src/core/lib/gprpp/examine_stack.h b/src/core/lib/gprpp/examine_stack.h index 3f9c5db77b7..684213d1d6d 100644 --- a/src/core/lib/gprpp/examine_stack.h +++ b/src/core/lib/gprpp/examine_stack.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_EXAMINE_STACK_H #define GRPC_CORE_LIB_GPRPP_EXAMINE_STACK_H @@ -42,4 +42,4 @@ absl::optional GetCurrentStackTrace(); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_EXAMINE_STACK_H */ +#endif // GRPC_CORE_LIB_GPRPP_EXAMINE_STACK_H diff --git a/src/core/lib/gprpp/fork.cc b/src/core/lib/gprpp/fork.cc index 5fcfe51db78..55657ed69d6 100644 --- a/src/core/lib/gprpp/fork.cc +++ b/src/core/lib/gprpp/fork.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -27,10 +27,10 @@ #include "src/core/lib/gprpp/global_config_env.h" #include "src/core/lib/gprpp/no_destruct.h" -/* - * NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK - * AROUND VERY SPECIFIC USE CASES. - */ +// +// NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK +// AROUND VERY SPECIFIC USE CASES. +// #ifdef GRPC_ENABLE_FORK_SUPPORT #define GRPC_ENABLE_FORK_SUPPORT_DEFAULT true diff --git a/src/core/lib/gprpp/fork.h b/src/core/lib/gprpp/fork.h index 599176a7416..9015021f319 100644 --- a/src/core/lib/gprpp/fork.h +++ b/src/core/lib/gprpp/fork.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_FORK_H #define GRPC_CORE_LIB_GPRPP_FORK_H @@ -23,10 +23,10 @@ #include -/* - * NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK - * AROUND VERY SPECIFIC USE CASES. - */ +// +// NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK +// AROUND VERY SPECIFIC USE CASES. +// namespace grpc_core { @@ -92,4 +92,4 @@ class Fork { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_FORK_H */ +#endif // GRPC_CORE_LIB_GPRPP_FORK_H diff --git a/src/core/lib/gprpp/global_config.h b/src/core/lib/gprpp/global_config.h index 76ad8906b1f..9c3827a2b43 100644 --- a/src/core/lib/gprpp/global_config.h +++ b/src/core/lib/gprpp/global_config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H #define GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H @@ -90,4 +90,4 @@ #include "src/core/lib/gprpp/global_config_custom.h" // IWYU pragma: export #include "src/core/lib/gprpp/global_config_env.h" // IWYU pragma: export -#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H */ +#endif // GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H diff --git a/src/core/lib/gprpp/global_config_custom.h b/src/core/lib/gprpp/global_config_custom.h index 175677e07c7..adc5f356b28 100644 --- a/src/core/lib/gprpp/global_config_custom.h +++ b/src/core/lib/gprpp/global_config_custom.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H #define GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H @@ -26,4 +26,4 @@ // GPR_GLOBAL_CONFIG_DEFINE_INT32 // GPR_GLOBAL_CONFIG_DEFINE_STRING -#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H */ +#endif // GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_CUSTOM_H diff --git a/src/core/lib/gprpp/global_config_env.cc b/src/core/lib/gprpp/global_config_env.cc index 6e3caed2fb0..7ce76e3dfa5 100644 --- a/src/core/lib/gprpp/global_config_env.cc +++ b/src/core/lib/gprpp/global_config_env.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/src/core/lib/gprpp/global_config_env.h b/src/core/lib/gprpp/global_config_env.h index 4ea8097111d..c3f7884d09d 100644 --- a/src/core/lib/gprpp/global_config_env.h +++ b/src/core/lib/gprpp/global_config_env.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H #define GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H @@ -30,11 +30,11 @@ namespace grpc_core { typedef void (*GlobalConfigEnvErrorFunctionType)(const char* error_message); -/* - * Set global_config_env_error_function which is called when config system - * encounters errors such as parsing error. What the default function does - * is logging error message. - */ +// +// Set global_config_env_error_function which is called when config system +// encounters errors such as parsing error. What the default function does +// is logging error message. +// void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func); // Base class for all classes to access environment variables. @@ -130,4 +130,4 @@ class GlobalConfigEnvString : public GlobalConfigEnv { g_env_##name.Set(value); \ } -#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H */ +#endif // GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_ENV_H diff --git a/src/core/lib/gprpp/global_config_generic.h b/src/core/lib/gprpp/global_config_generic.h index 8d53f17e7b5..de75ab6e4ae 100644 --- a/src/core/lib/gprpp/global_config_generic.h +++ b/src/core/lib/gprpp/global_config_generic.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H #define GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H @@ -37,4 +37,4 @@ extern grpc_core::UniquePtr gpr_global_config_get_##name(); \ extern void gpr_global_config_set_##name(const char* value) -#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H */ +#endif // GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_GENERIC_H diff --git a/src/core/lib/gprpp/host_port.cc b/src/core/lib/gprpp/host_port.cc index a2b20a5e528..47404626f97 100644 --- a/src/core/lib/gprpp/host_port.cc +++ b/src/core/lib/gprpp/host_port.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -43,27 +43,27 @@ bool DoSplitHostPort(absl::string_view name, absl::string_view* host, absl::string_view* port, bool* has_port) { *has_port = false; if (!name.empty() && name[0] == '[') { - /* Parse a bracketed host, typically an IPv6 literal. */ + // Parse a bracketed host, typically an IPv6 literal. const size_t rbracket = name.find(']', 1); if (rbracket == absl::string_view::npos) { - /* Unmatched [ */ + // Unmatched [ return false; } if (rbracket == name.size() - 1) { - /* ] */ + // ] *port = absl::string_view(); } else if (name[rbracket + 1] == ':') { - /* ]: */ + // ]: *port = name.substr(rbracket + 2, name.size() - rbracket - 2); *has_port = true; } else { - /* ] */ + // ] return false; } *host = name.substr(1, rbracket - 1); if (host->find(':') == absl::string_view::npos) { - /* Require all bracketed hosts to contain a colon, because a hostname or - IPv4 address should never use brackets. */ + // Require all bracketed hosts to contain a colon, because a hostname or + // IPv4 address should never use brackets. *host = absl::string_view(); return false; } @@ -71,12 +71,12 @@ bool DoSplitHostPort(absl::string_view name, absl::string_view* host, size_t colon = name.find(':'); if (colon != absl::string_view::npos && name.find(':', colon + 1) == absl::string_view::npos) { - /* Exactly 1 colon. Split into host:port. */ + // Exactly 1 colon. Split into host:port. *host = name.substr(0, colon); *port = name.substr(colon + 1, name.size() - colon - 1); *has_port = true; } else { - /* 0 or 2+ colons. Bare hostname or IPv6 litearal. */ + // 0 or 2+ colons. Bare hostname or IPv6 litearal. *host = name; *port = absl::string_view(); } diff --git a/src/core/lib/gprpp/host_port.h b/src/core/lib/gprpp/host_port.h index 2d5933508c6..40855f0f4a2 100644 --- a/src/core/lib/gprpp/host_port.h +++ b/src/core/lib/gprpp/host_port.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_HOST_PORT_H #define GRPC_CORE_LIB_GPRPP_HOST_PORT_H @@ -33,19 +33,20 @@ namespace grpc_core { // brackets will not be added. std::string JoinHostPort(absl::string_view host, int port); -/** Given a name in the form "host:port" or "[ho:st]:port", split into hostname - and port number. +/// Given a name in the form "host:port" or "[ho:st]:port", split into hostname +/// and port number. - There are two variants of this method: - 1) absl::string_view output: port and host are returned as views on name. - 2) std::string output: port and host are copied into newly allocated strings. +/// There are two variants of this method: +/// 1) absl::string_view output: port and host are returned as views on name. +/// 2) std::string output: port and host are copied into newly allocated +/// strings. - Prefer variant (1) over (2), because no allocation or copy is performed in - variant (1). Use (2) only when interacting with C API that mandate - null-terminated strings. +/// Prefer variant (1) over (2), because no allocation or copy is performed in +/// variant (1). Use (2) only when interacting with C API that mandate +/// null-terminated strings. - Return true on success, false on failure. Guarantees *host and *port are - cleared on failure. */ +/// Return true on success, false on failure. Guarantees *host and *port are +/// cleared on failure. bool SplitHostPort(absl::string_view name, absl::string_view* host, absl::string_view* port); bool SplitHostPort(absl::string_view name, std::string* host, @@ -53,4 +54,4 @@ bool SplitHostPort(absl::string_view name, std::string* host, } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_HOST_PORT_H */ +#endif // GRPC_CORE_LIB_GPRPP_HOST_PORT_H diff --git a/src/core/lib/gprpp/manual_constructor.h b/src/core/lib/gprpp/manual_constructor.h index 0d4056daa73..f8064d3870a 100644 --- a/src/core/lib/gprpp/manual_constructor.h +++ b/src/core/lib/gprpp/manual_constructor.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_MANUAL_CONSTRUCTOR_H #define GRPC_CORE_LIB_GPRPP_MANUAL_CONSTRUCTOR_H diff --git a/src/core/lib/gprpp/memory.h b/src/core/lib/gprpp/memory.h index 668cc0bd076..6189b4c0f32 100644 --- a/src/core/lib/gprpp/memory.h +++ b/src/core/lib/gprpp/memory.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_MEMORY_H #define GRPC_CORE_LIB_GPRPP_MEMORY_H @@ -50,4 +50,4 @@ T* Zalloc() { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_MEMORY_H */ +#endif // GRPC_CORE_LIB_GPRPP_MEMORY_H diff --git a/src/core/lib/gprpp/mpscq.cc b/src/core/lib/gprpp/mpscq.cc index b5a1717341d..6daddd76d9e 100644 --- a/src/core/lib/gprpp/mpscq.cc +++ b/src/core/lib/gprpp/mpscq.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/gprpp/mpscq.h b/src/core/lib/gprpp/mpscq.h index 38e016c1cc8..d65aa18e732 100644 --- a/src/core/lib/gprpp/mpscq.h +++ b/src/core/lib/gprpp/mpscq.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_MPSCQ_H #define GRPC_CORE_LIB_GPRPP_MPSCQ_H @@ -96,4 +96,4 @@ class LockedMultiProducerSingleConsumerQueue { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_MPSCQ_H */ +#endif // GRPC_CORE_LIB_GPRPP_MPSCQ_H diff --git a/src/core/lib/gprpp/orphanable.h b/src/core/lib/gprpp/orphanable.h index 26ae460afd4..fc24d4902cd 100644 --- a/src/core/lib/gprpp/orphanable.h +++ b/src/core/lib/gprpp/orphanable.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_ORPHANABLE_H #define GRPC_CORE_LIB_GPRPP_ORPHANABLE_H @@ -119,4 +119,4 @@ class InternallyRefCounted : public Orphanable { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_ORPHANABLE_H */ +#endif // GRPC_CORE_LIB_GPRPP_ORPHANABLE_H diff --git a/src/core/lib/gprpp/ref_counted.h b/src/core/lib/gprpp/ref_counted.h index d5d56288cd8..f2d8971720d 100644 --- a/src/core/lib/gprpp/ref_counted.h +++ b/src/core/lib/gprpp/ref_counted.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_REF_COUNTED_H #define GRPC_CORE_LIB_GPRPP_REF_COUNTED_H @@ -346,4 +346,4 @@ class RefCounted : public Impl { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_H */ +#endif // GRPC_CORE_LIB_GPRPP_REF_COUNTED_H diff --git a/src/core/lib/gprpp/ref_counted_ptr.h b/src/core/lib/gprpp/ref_counted_ptr.h index b518ff4f6f0..6a66ad6e0e3 100644 --- a/src/core/lib/gprpp/ref_counted_ptr.h +++ b/src/core/lib/gprpp/ref_counted_ptr.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H #define GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H @@ -334,4 +334,4 @@ bool operator<(const WeakRefCountedPtr& p1, const WeakRefCountedPtr& p2) { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H */ +#endif // GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H diff --git a/src/core/lib/gprpp/sync.h b/src/core/lib/gprpp/sync.h index f54a0728009..9a6c3fd9cae 100644 --- a/src/core/lib/gprpp/sync.h +++ b/src/core/lib/gprpp/sync.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_SYNC_H #define GRPC_CORE_LIB_GPRPP_SYNC_H @@ -197,4 +197,4 @@ class ABSL_SCOPED_LOCKABLE LockableAndReleasableMutexLock { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_SYNC_H */ +#endif // GRPC_CORE_LIB_GPRPP_SYNC_H diff --git a/src/core/lib/gprpp/thd.h b/src/core/lib/gprpp/thd.h index 5990b0f17b8..6bf6069c4a6 100644 --- a/src/core/lib/gprpp/thd.h +++ b/src/core/lib/gprpp/thd.h @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_THD_H #define GRPC_CORE_LIB_GPRPP_THD_H -/** Internal thread interface. */ +/// Internal thread interface. #include @@ -168,4 +168,4 @@ class Thread { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_THD_H */ +#endif // GRPC_CORE_LIB_GPRPP_THD_H diff --git a/src/core/lib/gprpp/thd_posix.cc b/src/core/lib/gprpp/thd_posix.cc index a688873c7e3..cd55d4cd976 100644 --- a/src/core/lib/gprpp/thd_posix.cc +++ b/src/core/lib/gprpp/thd_posix.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Posix implementation for gpr threads. */ +// +// +// 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 +// +// 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. +// +// + +// Posix implementation for gpr threads. #include @@ -43,9 +43,9 @@ class ThreadInternalsPosix; struct thd_arg { ThreadInternalsPosix* thread; - void (*body)(void* arg); /* body of a thread */ - void* arg; /* argument to a thread */ - const char* name; /* name of thread. Can be nullptr. */ + void (*body)(void* arg); // body of a thread + void* arg; // argument to a thread + const char* name; // name of thread. Can be nullptr. bool joinable; bool tracked; }; @@ -78,8 +78,8 @@ class ThreadInternalsPosix : public internal::ThreadInternalsInterface { gpr_mu_init(&mu_); gpr_cv_init(&ready_); pthread_attr_t attr; - /* don't use gpr_malloc as we may cause an infinite recursion with - * the profiling code */ + // don't use gpr_malloc as we may cause an infinite recursion with + // the profiling code thd_arg* info = static_cast(malloc(sizeof(*info))); GPR_ASSERT(info != nullptr); info->thread = this; @@ -113,12 +113,12 @@ class ThreadInternalsPosix : public internal::ThreadInternalsInterface { free(v); if (arg.name != nullptr) { #if GPR_APPLE_PTHREAD_NAME - /* Apple supports 64 characters, and will - * truncate if it's longer. */ + // Apple supports 64 characters, and will + // truncate if it's longer. pthread_setname_np(arg.name); #elif GPR_LINUX_PTHREAD_NAME - /* Linux supports 16 characters max, and will - * error if it's longer. */ + // Linux supports 16 characters max, and will + // error if it's longer. char buf[16]; size_t buf_len = GPR_ARRAY_SIZE(buf) - 1; strncpy(buf, arg.name, buf_len); @@ -149,7 +149,7 @@ class ThreadInternalsPosix : public internal::ThreadInternalsInterface { GPR_ASSERT(pthread_attr_destroy(&attr) == 0); if (!(*success)) { - /* don't use gpr_free, as this was allocated using malloc (see above) */ + // don't use gpr_free, as this was allocated using malloc (see above) free(info); if (options.tracked()) { Fork::DecThreadCount(); @@ -207,4 +207,4 @@ gpr_thd_id gpr_thd_currentid(void) { return (gpr_thd_id)pthread_self(); } -#endif /* GPR_POSIX_SYNC */ +#endif // GPR_POSIX_SYNC diff --git a/src/core/lib/gprpp/thd_windows.cc b/src/core/lib/gprpp/thd_windows.cc index 5b48ec3d8e5..37784a60d53 100644 --- a/src/core/lib/gprpp/thd_windows.cc +++ b/src/core/lib/gprpp/thd_windows.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Windows implementation for gpr threads. */ +// +// +// 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 +// +// 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. +// +// + +// Windows implementation for gpr threads. #include @@ -37,10 +37,10 @@ namespace { class ThreadInternalsWindows; struct thd_info { ThreadInternalsWindows* thread; - void (*body)(void* arg); /* body of a thread */ - void* arg; /* argument to a thread */ - HANDLE join_event; /* the join event */ - bool joinable; /* whether it is joinable */ + void (*body)(void* arg); // body of a thread + void* arg; // argument to a thread + HANDLE join_event; // the join event + bool joinable; // whether it is joinable }; thread_local struct thd_info* g_thd_info; @@ -169,4 +169,4 @@ gpr_thd_id gpr_thd_currentid(void) { return reinterpret_cast(g_thd_info); } -#endif /* GPR_WINDOWS */ +#endif // GPR_WINDOWS diff --git a/src/core/lib/gprpp/time_averaged_stats.cc b/src/core/lib/gprpp/time_averaged_stats.cc index 9077c004221..ec0a091b857 100644 --- a/src/core/lib/gprpp/time_averaged_stats.cc +++ b/src/core/lib/gprpp/time_averaged_stats.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -34,16 +34,16 @@ void TimeAveragedStats::AddSample(double value) { } double TimeAveragedStats::UpdateAverage() { - /* Start with the current batch: */ + // Start with the current batch: double weighted_sum = batch_total_value_; double total_weight = batch_num_samples_; if (regress_weight_ > 0) { - /* Add in the regression towards init_avg_: */ + // Add in the regression towards init_avg_: weighted_sum += regress_weight_ * init_avg_; total_weight += regress_weight_; } if (persistence_factor_ > 0) { - /* Add in the persistence: */ + // Add in the persistence: const double prev_sample_weight = persistence_factor_ * aggregate_total_weight_; weighted_sum += prev_sample_weight * aggregate_weighted_avg_; diff --git a/src/core/lib/gprpp/time_averaged_stats.h b/src/core/lib/gprpp/time_averaged_stats.h index b228ad8909b..948648579a6 100644 --- a/src/core/lib/gprpp/time_averaged_stats.h +++ b/src/core/lib/gprpp/time_averaged_stats.h @@ -1,79 +1,79 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_GPRPP_TIME_AVERAGED_STATS_H #define GRPC_CORE_LIB_GPRPP_TIME_AVERAGED_STATS_H namespace grpc_core { -/* This tracks a time-decaying weighted average. It works by collecting - batches of samples and then mixing their average into a time-decaying - weighted mean. It is designed for batch operations where we do many adds - before updating the average. */ +// This tracks a time-decaying weighted average. It works by collecting +// batches of samples and then mixing their average into a time-decaying +// weighted mean. It is designed for batch operations where we do many adds +// before updating the average. class TimeAveragedStats { public: TimeAveragedStats(double init_avg, double regress_weight, double persistence_factor); - /* Add a sample to the current batch. */ + // Add a sample to the current batch. void AddSample(double value); - /* Complete a batch and compute the new estimate of the average sample - value. */ + // Complete a batch and compute the new estimate of the average sample + // value. double UpdateAverage(); double aggregate_weighted_avg() const { return aggregate_weighted_avg_; } double aggregate_total_weight() const { return aggregate_total_weight_; } private: - /* The initial average value. This is the reported average until the first - grpc_time_averaged_stats_update_average call. If a positive regress_weight - is used, we also regress towards this value on each update. */ + // The initial average value. This is the reported average until the first + // grpc_time_averaged_stats_update_average call. If a positive regress_weight + // is used, we also regress towards this value on each update. const double init_avg_; - /* The sample weight of "init_avg" that is mixed in with each call to - grpc_time_averaged_stats_update_average. If the calls to - grpc_time_averaged_stats_add_sample stop, this will cause the average to - regress back to the mean. This should be non-negative. Set it to 0 to - disable the bias. A value of 1 has the effect of adding in 1 bonus sample - with value init_avg to each sample period. */ + // The sample weight of "init_avg" that is mixed in with each call to + // grpc_time_averaged_stats_update_average. If the calls to + // grpc_time_averaged_stats_add_sample stop, this will cause the average to + // regress back to the mean. This should be non-negative. Set it to 0 to + // disable the bias. A value of 1 has the effect of adding in 1 bonus sample + // with value init_avg to each sample period. const double regress_weight_; - /* This determines the rate of decay of the time-averaging from one period - to the next by scaling the aggregate_total_weight of samples from prior - periods when combining with the latest period. It should be in the range - [0,1]. A higher value adapts more slowly. With a value of 0.5, if the - batches each have k samples, the samples_in_avg_ will grow to 2 k, so the - weighting of the time average will eventually be 1/3 new batch and 2/3 - old average. */ + // This determines the rate of decay of the time-averaging from one period + // to the next by scaling the aggregate_total_weight of samples from prior + // periods when combining with the latest period. It should be in the range + // [0,1]. A higher value adapts more slowly. With a value of 0.5, if the + // batches each have k samples, the samples_in_avg_ will grow to 2 k, so the + // weighting of the time average will eventually be 1/3 new batch and 2/3 + // old average. const double persistence_factor_; - /* The total value of samples since the last UpdateAverage(). */ + // The total value of samples since the last UpdateAverage(). double batch_total_value_ = 0; - /* The number of samples since the last UpdateAverage(). */ + // The number of samples since the last UpdateAverage(). double batch_num_samples_ = 0; - /* The time-decayed sum of batch_num_samples_ over previous batches. This is - the "weight" of the old aggregate_weighted_avg_ when updating the - average. */ + // The time-decayed sum of batch_num_samples_ over previous batches. This is + // the "weight" of the old aggregate_weighted_avg_ when updating the + // average. double aggregate_total_weight_ = 0; - /* A time-decayed average of the (batch_total_value_ / batch_num_samples_), - computed by decaying the samples_in_avg_ weight in the weighted average. */ + // A time-decayed average of the (batch_total_value_ / batch_num_samples_), + // computed by decaying the samples_in_avg_ weight in the weighted average. double aggregate_weighted_avg_ = init_avg_; }; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_GPRPP_TIME_AVERAGED_STATS_H */ +#endif // GRPC_CORE_LIB_GPRPP_TIME_AVERAGED_STATS_H diff --git a/src/core/lib/gprpp/unique_type_name.h b/src/core/lib/gprpp/unique_type_name.h index 884fe4147cf..24eacaf46c5 100644 --- a/src/core/lib/gprpp/unique_type_name.h +++ b/src/core/lib/gprpp/unique_type_name.h @@ -32,24 +32,24 @@ // a registry to avoid name collisions. // // Expected usage: -/* -// Interface has a virtual method that returns a UniqueTypeName. -class Interface { - public: - virtual ~Interface() = default; - virtual UniqueTypeName type() const = 0; -}; - -// Implementation uses a static factory instance to return the same -// UniqueTypeName for every instance. -class FooImplementation : public Interface { - public: - UniqueTypeName type() const override { - static UniqueTypeName::Factory kFactory("Foo"); - return kFactory.Create(); - } -}; -*/ +// +//// Interface has a virtual method that returns a UniqueTypeName. +// class Interface { +// public: +// virtual ~Interface() = default; +// virtual UniqueTypeName type() const = 0; +// }; + +//// Implementation uses a static factory instance to return the same +//// UniqueTypeName for every instance. +// class FooImplementation : public Interface { +// public: +// UniqueTypeName type() const override { +// static UniqueTypeName::Factory kFactory("Foo"); +// return kFactory.Create(); +// } +// }; +// namespace grpc_core { diff --git a/src/core/lib/handshaker/proxy_mapper.h b/src/core/lib/handshaker/proxy_mapper.h index 0d7c871e3b4..3a49bb32ac8 100644 --- a/src/core/lib/handshaker/proxy_mapper.h +++ b/src/core/lib/handshaker/proxy_mapper.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_H #define GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_H @@ -50,4 +50,4 @@ class ProxyMapperInterface { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_H */ +#endif // GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_H diff --git a/src/core/lib/handshaker/proxy_mapper_registry.cc b/src/core/lib/handshaker/proxy_mapper_registry.cc index 19ac28a240e..64748cdc335 100644 --- a/src/core/lib/handshaker/proxy_mapper_registry.cc +++ b/src/core/lib/handshaker/proxy_mapper_registry.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/handshaker/proxy_mapper_registry.h b/src/core/lib/handshaker/proxy_mapper_registry.h index f191b94a312..d125ed6549b 100644 --- a/src/core/lib/handshaker/proxy_mapper_registry.h +++ b/src/core/lib/handshaker/proxy_mapper_registry.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_REGISTRY_H #define GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_REGISTRY_H @@ -72,4 +72,4 @@ class ProxyMapperRegistry { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_REGISTRY_H */ +#endif // GRPC_CORE_LIB_HANDSHAKER_PROXY_MAPPER_REGISTRY_H diff --git a/src/core/lib/http/format_request.cc b/src/core/lib/http/format_request.cc index 641b883e36b..ec0862cb48f 100644 --- a/src/core/lib/http/format_request.cc +++ b/src/core/lib/http/format_request.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -47,7 +47,7 @@ static void fill_common_header(const grpc_http_request* request, buf->push_back("\r\n"); if (connection_close) buf->push_back("Connection: close\r\n"); buf->push_back("User-Agent: " GRPC_HTTPCLI_USER_AGENT "\r\n"); - /* user supplied headers */ + // user supplied headers for (size_t i = 0; i < request->hdr_count; i++) { buf->push_back(request->hdrs[i].key); buf->push_back(": "); diff --git a/src/core/lib/http/format_request.h b/src/core/lib/http/format_request.h index 5dccb1e0675..78f561f19f9 100644 --- a/src/core/lib/http/format_request.h +++ b/src/core/lib/http/format_request.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H #define GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H @@ -35,4 +35,4 @@ grpc_slice grpc_httpcli_format_connect_request(const grpc_http_request* request, const char* host, const char* path); -#endif /* GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H */ +#endif // GRPC_CORE_LIB_HTTP_FORMAT_REQUEST_H diff --git a/src/core/lib/http/httpcli.cc b/src/core/lib/http/httpcli.cc index 4f0638f6e17..46ee4b564eb 100644 --- a/src/core/lib/http/httpcli.cc +++ b/src/core/lib/http/httpcli.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/http/httpcli.h b/src/core/lib/http/httpcli.h index 00509055d62..a9189cdf5bb 100644 --- a/src/core/lib/http/httpcli.h +++ b/src/core/lib/http/httpcli.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_HTTP_HTTPCLI_H #define GRPC_CORE_LIB_HTTP_HTTPCLI_H @@ -54,10 +54,10 @@ #include "src/core/lib/transport/handshaker.h" #include "src/core/lib/uri/uri_parser.h" -/* User agent this library reports */ +// User agent this library reports #define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0" -/* override functions return 1 if they handled the request, 0 otherwise */ +// override functions return 1 if they handled the request, 0 otherwise typedef int (*grpc_httpcli_get_override)(const grpc_http_request* request, const char* host, const char* path, grpc_core::Timestamp deadline, @@ -268,4 +268,4 @@ class HttpRequest : public InternallyRefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_HTTP_HTTPCLI_H */ +#endif // GRPC_CORE_LIB_HTTP_HTTPCLI_H diff --git a/src/core/lib/http/httpcli_security_connector.cc b/src/core/lib/http/httpcli_security_connector.cc index b6efbf65c35..d99befef099 100644 --- a/src/core/lib/http/httpcli_security_connector.cc +++ b/src/core/lib/http/httpcli_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -110,7 +110,7 @@ class grpc_httpcli_ssl_channel_security_connector final grpc_closure* on_peer_checked) override { grpc_error_handle error; - /* Check the peer name. */ + // Check the peer name. if (secure_peer_name_ != nullptr && !tsi_ssl_peer_matches_name(&peer, secure_peer_name_)) { error = GRPC_ERROR_CREATE(absl::StrCat("Peer name ", secure_peer_name_, diff --git a/src/core/lib/http/parser.cc b/src/core/lib/http/parser.cc index 367dcf82066..274ccf1ca1e 100644 --- a/src/core/lib/http/parser.cc +++ b/src/core/lib/http/parser.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -85,7 +85,7 @@ static grpc_error_handle handle_response_line(grpc_http_parser* parser) { return GRPC_ERROR_CREATE("Expected ' '"); } - /* we don't really care about the status code message */ + // we don't really care about the status code message return absl::OkStatus(); } @@ -194,7 +194,7 @@ static grpc_error_handle add_header(grpc_http_parser* parser) { } GPR_ASSERT(cur >= beg); hdr.key = buf2str(beg, static_cast(cur - beg)); - cur++; /* skip : */ + cur++; // skip : while (cur != end && (*cur == ' ' || *cur == '\t')) { cur++; @@ -314,7 +314,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) { return absl::OkStatus(); } else { parser->http.response->chunk_length--; - /* fallback to the normal body appending code below */ + // fallback to the normal body appending code below } break; case GRPC_HTTP_CHUNKED_CONSUME_LF: @@ -324,7 +324,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) { parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_LENGTH; return absl::OkStatus(); case GRPC_HTTP_CHUNKED_PLAIN: - /* avoiding warning; just fallback to normal codepath */ + // avoiding warning; just fallback to normal codepath break; } body_length = &parser->http.response->body_length; diff --git a/src/core/lib/http/parser.h b/src/core/lib/http/parser.h index d3522e42441..4bdd89b2352 100644 --- a/src/core/lib/http/parser.h +++ b/src/core/lib/http/parser.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_HTTP_PARSER_H #define GRPC_CORE_LIB_HTTP_PARSER_H @@ -29,10 +29,10 @@ #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/error.h" -/* Maximum length of a header string of the form 'Key: Value\r\n' */ +// Maximum length of a header string of the form 'Key: Value\r\n' #define GRPC_HTTP_PARSER_MAX_HEADER_LENGTH 4096 -/* A single header to be passed in a request */ +// A single header to be passed in a request typedef struct grpc_http_header { char* key; char* value; @@ -65,32 +65,32 @@ typedef enum { GRPC_HTTP_REQUEST, } grpc_http_type; -/* A request */ +// A request typedef struct grpc_http_request { - /* Method of the request (e.g. GET, POST) */ + // Method of the request (e.g. GET, POST) char* method; - /* The path of the resource to fetch (only used for parsed requests) */ + // The path of the resource to fetch (only used for parsed requests) char* path; - /* HTTP version to use */ + // HTTP version to use grpc_http_version version; - /* Headers attached to the request */ + // Headers attached to the request size_t hdr_count; grpc_http_header* hdrs; - /* Body: length and contents; contents are NOT null-terminated */ + // Body: length and contents; contents are NOT null-terminated size_t body_length; char* body; } grpc_http_request; -/* A response */ +// A response typedef struct grpc_http_response { - /* HTTP status code */ + // HTTP status code int status = 0; - /* Headers: count and key/values */ + // Headers: count and key/values size_t hdr_count = 0; grpc_http_header* hdrs = nullptr; - /* Body: length and contents; contents are NOT null-terminated */ + // Body: length and contents; contents are NOT null-terminated size_t body_length = 0; - /* State of the chunked parser. Only valid for the response. */ + // State of the chunked parser. Only valid for the response. grpc_http_parser_chunked_state chunked_state = GRPC_HTTP_CHUNKED_PLAIN; size_t chunk_length = 0; char* body = nullptr; @@ -116,7 +116,7 @@ void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type, void* request_or_response); void grpc_http_parser_destroy(grpc_http_parser* parser); -/* Sets \a start_of_body to the offset in \a slice of the start of the body. */ +// Sets \a start_of_body to the offset in \a slice of the start of the body. grpc_error_handle grpc_http_parser_parse(grpc_http_parser* parser, const grpc_slice& slice, size_t* start_of_body); @@ -127,4 +127,4 @@ void grpc_http_response_destroy(grpc_http_response* response); extern grpc_core::TraceFlag grpc_http1_trace; -#endif /* GRPC_CORE_LIB_HTTP_PARSER_H */ +#endif // GRPC_CORE_LIB_HTTP_PARSER_H diff --git a/src/core/lib/iomgr/block_annotate.h b/src/core/lib/iomgr/block_annotate.h index a57873aabb2..e6f3b83b84d 100644 --- a/src/core/lib/iomgr/block_annotate.h +++ b/src/core/lib/iomgr/block_annotate.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H #define GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H @@ -22,9 +22,9 @@ void gpr_thd_start_blocking_region(); void gpr_thd_end_blocking_region(); -/* These annotations identify the beginning and end of regions where - the code may block for reasons other than synchronization functions. - These include poll, epoll, and getaddrinfo. */ +// These annotations identify the beginning and end of regions where +// the code may block for reasons other than synchronization functions. +// These include poll, epoll, and getaddrinfo. #ifdef GRPC_SCHEDULING_MARK_BLOCKING_REGION #define GRPC_SCHEDULING_START_BLOCKING_REGION \ @@ -54,4 +54,4 @@ void gpr_thd_end_blocking_region(); } while (0) #endif -#endif /* GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H */ +#endif // GRPC_CORE_LIB_IOMGR_BLOCK_ANNOTATE_H diff --git a/src/core/lib/iomgr/buffer_list.cc b/src/core/lib/iomgr/buffer_list.cc index ecc0b93fbf0..8da4c645752 100644 --- a/src/core/lib/iomgr/buffer_list.cc +++ b/src/core/lib/iomgr/buffer_list.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -308,9 +308,9 @@ void grpc_tcp_set_write_timestamps_callback( void (*fn)(void*, Timestamps*, grpc_error_handle error)) { g_timestamps_callback = fn; } -} /* namespace grpc_core */ +} // namespace grpc_core -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE namespace grpc_core { void grpc_tcp_set_write_timestamps_callback( @@ -323,4 +323,4 @@ void grpc_tcp_set_write_timestamps_callback( } } // namespace grpc_core -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE diff --git a/src/core/lib/iomgr/buffer_list.h b/src/core/lib/iomgr/buffer_list.h index b1f3bd30606..3b732df0a4d 100644 --- a/src/core/lib/iomgr/buffer_list.h +++ b/src/core/lib/iomgr/buffer_list.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_BUFFER_LIST_H #define GRPC_CORE_LIB_IOMGR_BUFFER_LIST_H @@ -34,58 +34,58 @@ namespace grpc_core { struct ConnectionMetrics { - /* Delivery rate in Bytes/s. */ + // Delivery rate in Bytes/s. absl::optional delivery_rate; - /* If the delivery rate is limited by the application, this is set to true. */ + // If the delivery rate is limited by the application, this is set to true. absl::optional is_delivery_rate_app_limited; - /* Total packets retransmitted. */ + // Total packets retransmitted. absl::optional packet_retx; - /* Total packets retransmitted spuriously. This metric is smaller than or - equal to packet_retx. */ + // Total packets retransmitted spuriously. This metric is smaller than or + // equal to packet_retx. absl::optional packet_spurious_retx; - /* Total packets sent. */ + // Total packets sent. absl::optional packet_sent; - /* Total packets delivered. */ + // Total packets delivered. absl::optional packet_delivered; - /* Total packets delivered with ECE marked. This metric is smaller than or - equal to packet_delivered. */ + // Total packets delivered with ECE marked. This metric is smaller than or + // equal to packet_delivered. absl::optional packet_delivered_ce; - /* Total bytes lost so far. */ + // Total bytes lost so far. absl::optional data_retx; - /* Total bytes sent so far. */ + // Total bytes sent so far. absl::optional data_sent; - /* Total bytes in write queue but not sent. */ + // Total bytes in write queue but not sent. absl::optional data_notsent; - /* Pacing rate of the connection in Bps */ + // Pacing rate of the connection in Bps absl::optional pacing_rate; - /* Minimum RTT observed in usec. */ + // Minimum RTT observed in usec. absl::optional min_rtt; - /* Smoothed RTT in usec */ + // Smoothed RTT in usec absl::optional srtt; - /* Send congestion window. */ + // Send congestion window. absl::optional congestion_window; - /* Slow start threshold in packets. */ + // Slow start threshold in packets. absl::optional snd_ssthresh; - /* Maximum degree of reordering (i.e., maximum number of packets reodered) - on the connection. */ + // Maximum degree of reordering (i.e., maximum number of packets reodered) + // on the connection. absl::optional reordering; - /* Represents the number of recurring retransmissions of the first sequence - that is not acknowledged yet. */ + // Represents the number of recurring retransmissions of the first sequence + // that is not acknowledged yet. absl::optional recurring_retrans; - /* The cumulative time (in usec) that the transport protocol was busy - sending data. */ + // The cumulative time (in usec) that the transport protocol was busy + // sending data. absl::optional busy_usec; - /* The cumulative time (in usec) that the transport protocol was limited by - the receive window size. */ + // The cumulative time (in usec) that the transport protocol was limited by + // the receive window size. absl::optional rwnd_limited_usec; - /* The cumulative time (in usec) that the transport protocol was limited by - the send buffer size. */ + // The cumulative time (in usec) that the transport protocol was limited by + // the send buffer size. absl::optional sndbuf_limited_usec; }; struct BufferTimestamp { gpr_timespec time; - ConnectionMetrics metrics; /* Metrics collected with this timestamp */ + ConnectionMetrics metrics; // Metrics collected with this timestamp }; struct Timestamps { @@ -94,11 +94,11 @@ struct Timestamps { BufferTimestamp sent_time; BufferTimestamp acked_time; - uint32_t byte_offset; /* byte offset relative to the start of the RPC */ + uint32_t byte_offset; // byte offset relative to the start of the RPC #ifdef GRPC_LINUX_ERRQUEUE - tcp_info info; /* tcp_info collected on sendmsg */ -#endif /* GRPC_LINUX_ERRQUEUE */ + tcp_info info; // tcp_info collected on sendmsg +#endif // GRPC_LINUX_ERRQUEUE }; // TracedBuffer is a class to keep track of timestamps for a specific buffer in @@ -149,9 +149,9 @@ class TracedBufferList { friend class TracedBufferList; gpr_timespec last_timestamp_; TracedBuffer* next_ = nullptr; - uint32_t seq_no_; /* The sequence number for the last byte in the buffer */ - void* arg_; /* The arg to pass to timestamps_callback */ - Timestamps ts_; /* The timestamps corresponding to this buffer */ + uint32_t seq_no_; // The sequence number for the last byte in the buffer + void* arg_; // The arg to pass to timestamps_callback + Timestamps ts_; // The timestamps corresponding to this buffer }; Mutex mu_; // TracedBuffers are ordered by sequence number and would need to be processed @@ -162,7 +162,7 @@ class TracedBufferList { TracedBuffer* tail_ = nullptr; }; -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE // TracedBufferList implementation is a no-op for this platform. class TracedBufferList { public: @@ -173,13 +173,13 @@ class TracedBufferList { int Size() { return 0; } void Shutdown(void* /*remaining*/, absl::Status /*shutdown_err*/) {} }; -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE -/** Sets the callback function to call when timestamps for a write are - * collected. The callback does not own a reference to error. */ +/// Sets the callback function to call when timestamps for a write are +/// collected. The callback does not own a reference to error. void grpc_tcp_set_write_timestamps_callback( void (*fn)(void*, Timestamps*, grpc_error_handle error)); -} /* namespace grpc_core */ +} // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_BUFFER_LIST_H */ +#endif // GRPC_CORE_LIB_IOMGR_BUFFER_LIST_H diff --git a/src/core/lib/iomgr/call_combiner.cc b/src/core/lib/iomgr/call_combiner.cc index 9e822a16237..7b3dcfcf9c0 100644 --- a/src/core/lib/iomgr/call_combiner.cc +++ b/src/core/lib/iomgr/call_combiner.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index 0043e25814a..372ff91b85b 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H #define GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H @@ -211,4 +211,4 @@ class CallCombinerClosureList { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H */ +#endif // GRPC_CORE_LIB_IOMGR_CALL_COMBINER_H diff --git a/src/core/lib/iomgr/cfstream_handle.cc b/src/core/lib/iomgr/cfstream_handle.cc index 58074e9d926..434a0199e8a 100644 --- a/src/core/lib/iomgr/cfstream_handle.cc +++ b/src/core/lib/iomgr/cfstream_handle.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -199,9 +199,9 @@ void CFStreamHandle::Unref(const char* file, int line, const char* reason) { #else -/* Creating a phony function so that the grpc_cfstream library will be - * non-empty. - */ +// Creating a phony function so that the grpc_cfstream library will be +// non-empty. +// void CFStreamPhony() {} #endif diff --git a/src/core/lib/iomgr/cfstream_handle.h b/src/core/lib/iomgr/cfstream_handle.h index 2358758f147..b0267170bdf 100644 --- a/src/core/lib/iomgr/cfstream_handle.h +++ b/src/core/lib/iomgr/cfstream_handle.h @@ -1,23 +1,23 @@ -/* - * - * Copyright 2018 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. - * - */ - -/* The CFStream handle acts as an event synchronization entity for - * read/write/open/error/eos events happening on CFStream streams. */ +// +// +// Copyright 2018 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. +// +// + +// The CFStream handle acts as an event synchronization entity for +// read/write/open/error/eos events happening on CFStream streams. #ifndef GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H #define GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H @@ -43,7 +43,7 @@ class CFStreamHandle : public GrpcLibraryInitHolder { public: static CFStreamHandle* CreateStreamHandle(CFReadStreamRef read_stream, CFWriteStreamRef write_stream); - /** Use CreateStreamHandle function instead of using this directly. */ + /// Use CreateStreamHandle function instead of using this directly. CFStreamHandle(CFReadStreamRef read_stream, CFWriteStreamRef write_stream); CFStreamHandle(const CFStreamHandle& ref) = delete; CFStreamHandle(CFStreamHandle&& ref) = delete; @@ -87,4 +87,4 @@ class CFStreamHandle : public GrpcLibraryInitHolder { #endif -#endif /* GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H */ +#endif // GRPC_CORE_LIB_IOMGR_CFSTREAM_HANDLE_H diff --git a/src/core/lib/iomgr/closure.h b/src/core/lib/iomgr/closure.h index 095021b2e63..04c45487c6d 100644 --- a/src/core/lib/iomgr/closure.h +++ b/src/core/lib/iomgr/closure.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_CLOSURE_H #define GRPC_CORE_LIB_IOMGR_CLOSURE_H @@ -42,19 +42,19 @@ typedef struct grpc_closure_list { grpc_closure* tail; } grpc_closure_list; -/** gRPC Callback definition. - * - * \param arg Arbitrary input. - * \param error absl::OkStatus() if no error occurred, otherwise some grpc_error - * describing what went wrong. - * Error contract: it is not the cb's job to unref this error; - * the closure scheduler will do that after the cb returns */ +/// gRPC Callback definition. +/// +///\param arg Arbitrary input. +///\param error absl::OkStatus() if no error occurred, otherwise some grpc_error +/// describing what went wrong. +/// Error contract: it is not the cb's job to unref this error; +/// the closure scheduler will do that after the cb returns typedef void (*grpc_iomgr_cb_func)(void* arg, grpc_error_handle error); -/** A closure over a grpc_iomgr_cb_func. */ +/// A closure over a grpc_iomgr_cb_func. struct grpc_closure { - /** Once queued, next indicates the next queued closure; before then, scratch - * space */ + /// Once queued, next indicates the next queued closure; before then, scratch + /// space union { grpc_closure* next; grpc_core::ManualConstructor< @@ -63,13 +63,13 @@ struct grpc_closure { uintptr_t scratch; } next_data; - /** Bound callback. */ + /// Bound callback. grpc_iomgr_cb_func cb; - /** Arguments to be passed to "cb". */ + /// Arguments to be passed to "cb". void* cb_arg; - /** Once queued, the result of the closure. Before then: scratch space */ + /// Once queued, the result of the closure. Before then: scratch space union { uintptr_t error; uintptr_t scratch; @@ -109,7 +109,7 @@ inline grpc_closure* grpc_closure_init(grpc_closure* closure, return closure; } -/** Initializes \a closure with \a cb and \a cb_arg. Returns \a closure. */ +/// Initializes \a closure with \a cb and \a cb_arg. Returns \a closure. #ifndef NDEBUG #define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler) \ grpc_closure_init(__FILE__, __LINE__, closure, cb, cb_arg) @@ -202,7 +202,7 @@ inline grpc_closure* grpc_closure_create(grpc_iomgr_cb_func cb, void* cb_arg) { return &wc->wrapper; } -/* Create a heap allocated closure: try to avoid except for very rare events */ +// Create a heap allocated closure: try to avoid except for very rare events #ifndef NDEBUG #define GRPC_CLOSURE_CREATE(cb, cb_arg, scheduler) \ grpc_closure_create(__FILE__, __LINE__, cb, cb_arg) @@ -218,8 +218,8 @@ inline void grpc_closure_list_init(grpc_closure_list* closure_list) { closure_list->head = closure_list->tail = nullptr; } -/** add \a closure to the end of \a list - Returns true if \a list becomes non-empty */ +/// add \a closure to the end of \a list +/// Returns true if \a list becomes non-empty inline bool grpc_closure_list_append(grpc_closure_list* closure_list, grpc_closure* closure) { if (closure == nullptr) { @@ -236,9 +236,9 @@ inline bool grpc_closure_list_append(grpc_closure_list* closure_list, return was_empty; } -/** add \a closure to the end of \a list - and set \a closure's result to \a error - Returns true if \a list becomes non-empty */ +/// add \a closure to the end of \a list +/// and set \a closure's result to \a error +/// Returns true if \a list becomes non-empty inline bool grpc_closure_list_append(grpc_closure_list* closure_list, grpc_closure* closure, grpc_error_handle error) { @@ -249,7 +249,7 @@ inline bool grpc_closure_list_append(grpc_closure_list* closure_list, return grpc_closure_list_append(closure_list, closure); } -/** force all success bits in \a list to false */ +/// force all success bits in \a list to false inline void grpc_closure_list_fail_all(grpc_closure_list* list, grpc_error_handle forced_failure) { for (grpc_closure* c = list->head; c != nullptr; c = c->next_data.next) { @@ -260,7 +260,7 @@ inline void grpc_closure_list_fail_all(grpc_closure_list* list, } } -/** append all closures from \a src to \a dst and empty \a src. */ +/// append all closures from \a src to \a dst and empty \a src. inline void grpc_closure_list_move(grpc_closure_list* src, grpc_closure_list* dst) { if (src->head == nullptr) { @@ -275,7 +275,7 @@ inline void grpc_closure_list_move(grpc_closure_list* src, src->head = src->tail = nullptr; } -/** return whether \a list is empty. */ +/// return whether \a list is empty. inline bool grpc_closure_list_empty(grpc_closure_list closure_list) { return closure_list.head == nullptr; } @@ -307,4 +307,4 @@ class Closure { }; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_CLOSURE_H */ +#endif // GRPC_CORE_LIB_IOMGR_CLOSURE_H diff --git a/src/core/lib/iomgr/combiner.cc b/src/core/lib/iomgr/combiner.cc index 1ad56dcf998..5c3b3b1bc86 100644 --- a/src/core/lib/iomgr/combiner.cc +++ b/src/core/lib/iomgr/combiner.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/iomgr/combiner.h b/src/core/lib/iomgr/combiner.h index 3b9ddfcec13..66654bdf863 100644 --- a/src/core/lib/iomgr/combiner.h +++ b/src/core/lib/iomgr/combiner.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_COMBINER_H #define GRPC_CORE_LIB_IOMGR_COMBINER_H @@ -86,4 +86,4 @@ bool grpc_combiner_continue_exec_ctx(); extern grpc_core::DebugOnlyTraceFlag grpc_combiner_trace; -#endif /* GRPC_CORE_LIB_IOMGR_COMBINER_H */ +#endif // GRPC_CORE_LIB_IOMGR_COMBINER_H diff --git a/src/core/lib/iomgr/dualstack_socket_posix.cc b/src/core/lib/iomgr/dualstack_socket_posix.cc index 2d7711339f5..37535d83f0d 100644 --- a/src/core/lib/iomgr/dualstack_socket_posix.cc +++ b/src/core/lib/iomgr/dualstack_socket_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 @@ -28,9 +28,9 @@ #ifndef GRPC_SET_SOCKET_DUALSTACK_CUSTOM -/* This should be 0 in production, but it may be enabled for testing or - debugging purposes, to simulate an environment where IPv6 sockets can't - also speak IPv4. */ +// This should be 0 in production, but it may be enabled for testing or +// debugging purposes, to simulate an environment where IPv6 sockets can't +// also speak IPv4. int grpc_forbid_dualstack_sockets_for_testing = 0; int grpc_set_socket_dualstack(int fd) { @@ -38,7 +38,7 @@ int grpc_set_socket_dualstack(int fd) { const int off = 0; return 0 == setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(off)); } else { - /* Force an IPv6-only socket, for testing purposes. */ + // Force an IPv6-only socket, for testing purposes. const int on = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)); return 0; diff --git a/src/core/lib/iomgr/dynamic_annotations.h b/src/core/lib/iomgr/dynamic_annotations.h index 713928023ae..c4ccf546d6e 100644 --- a/src/core/lib/iomgr/dynamic_annotations.h +++ b/src/core/lib/iomgr/dynamic_annotations.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_DYNAMIC_ANNOTATIONS_H #define GRPC_CORE_LIB_IOMGR_DYNAMIC_ANNOTATIONS_H @@ -53,7 +53,7 @@ void AnnotateRWLockReleased(const char* file, int line, } #endif -#else /* GRPC_TSAN_ENABLED */ +#else // GRPC_TSAN_ENABLED #define TSAN_ANNOTATE_HAPPENS_BEFORE(addr) #define TSAN_ANNOTATE_HAPPENS_AFTER(addr) @@ -62,6 +62,6 @@ void AnnotateRWLockReleased(const char* file, int line, #define TSAN_ANNOTATE_RWLOCK_ACQUIRED(addr, is_w) #define TSAN_ANNOTATE_RWLOCK_RELEASED(addr, is_w) -#endif /* GRPC_TSAN_ENABLED */ +#endif // GRPC_TSAN_ENABLED -#endif /* GRPC_CORE_LIB_IOMGR_DYNAMIC_ANNOTATIONS_H */ +#endif // GRPC_CORE_LIB_IOMGR_DYNAMIC_ANNOTATIONS_H diff --git a/src/core/lib/iomgr/endpoint.cc b/src/core/lib/iomgr/endpoint.cc index 75c7e459404..de44d00b11e 100644 --- a/src/core/lib/iomgr/endpoint.cc +++ b/src/core/lib/iomgr/endpoint.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/endpoint.h b/src/core/lib/iomgr/endpoint.h index 6f286758345..908720d85f1 100644 --- a/src/core/lib/iomgr/endpoint.h +++ b/src/core/lib/iomgr/endpoint.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_ENDPOINT_H #define GRPC_CORE_LIB_IOMGR_ENDPOINT_H @@ -30,8 +30,8 @@ #include "src/core/lib/iomgr/pollset.h" #include "src/core/lib/iomgr/pollset_set.h" -/* An endpoint caps a streaming channel between two communicating processes. - Examples may be: a tcp socket, , or some shared memory. */ +// An endpoint caps a streaming channel between two communicating processes. +// Examples may be: a tcp socket, , or some shared memory. typedef struct grpc_endpoint grpc_endpoint; typedef struct grpc_endpoint_vtable grpc_endpoint_vtable; @@ -52,11 +52,11 @@ struct grpc_endpoint_vtable { bool (*can_track_err)(grpc_endpoint* ep); }; -/* When data is available on the connection, calls the callback with slices. - Callback success indicates that the endpoint can accept more reads, failure - indicates the endpoint is closed. - Valid slices may be placed into \a slices even when the callback is - invoked with !error.ok(). */ +// When data is available on the connection, calls the callback with slices. +// Callback success indicates that the endpoint can accept more reads, failure +// indicates the endpoint is closed. +// Valid slices may be placed into \a slices even when the callback is +// invoked with !error.ok(). void grpc_endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, bool urgent, int min_progress_size); @@ -64,39 +64,39 @@ absl::string_view grpc_endpoint_get_peer(grpc_endpoint* ep); absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep); -/* Get the file descriptor used by \a ep. Return -1 if \a ep is not using an fd. - */ +// Get the file descriptor used by \a ep. Return -1 if \a ep is not using an fd. +// int grpc_endpoint_get_fd(grpc_endpoint* ep); -/* Write slices out to the socket. - - If the connection is ready for more data after the end of the call, it - returns GRPC_ENDPOINT_DONE. - Otherwise it returns GRPC_ENDPOINT_PENDING and calls cb when the - connection is ready for more data. - \a slices may be mutated at will by the endpoint until cb is called. - No guarantee is made to the content of slices after a write EXCEPT that - it is a valid slice buffer. - \a arg is platform specific. It is currently only used by TCP on linux - platforms as an argument that would be forwarded to the timestamps callback. - \a max_frame_size. A hint to the endpoint implementation to construct - frames which do not exceed the specified size. - */ +// Write slices out to the socket. + +// If the connection is ready for more data after the end of the call, it +// returns GRPC_ENDPOINT_DONE. +// Otherwise it returns GRPC_ENDPOINT_PENDING and calls cb when the +// connection is ready for more data. +// \a slices may be mutated at will by the endpoint until cb is called. +// No guarantee is made to the content of slices after a write EXCEPT that +// it is a valid slice buffer. +// \a arg is platform specific. It is currently only used by TCP on linux +// platforms as an argument that would be forwarded to the timestamps callback. +// \a max_frame_size. A hint to the endpoint implementation to construct +// frames which do not exceed the specified size. +// void grpc_endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, void* arg, int max_frame_size); -/* Causes any pending and future read/write callbacks to run immediately with - success==0 */ +// Causes any pending and future read/write callbacks to run immediately with +// success==0 void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why); void grpc_endpoint_destroy(grpc_endpoint* ep); -/* Add an endpoint to a pollset or pollset_set, so that when the pollset is - polled, events from this endpoint are considered */ +// Add an endpoint to a pollset or pollset_set, so that when the pollset is +// polled, events from this endpoint are considered void grpc_endpoint_add_to_pollset(grpc_endpoint* ep, grpc_pollset* pollset); void grpc_endpoint_add_to_pollset_set(grpc_endpoint* ep, grpc_pollset_set* pollset_set); -/* Delete an endpoint from a pollset_set */ +// Delete an endpoint from a pollset_set void grpc_endpoint_delete_from_pollset_set(grpc_endpoint* ep, grpc_pollset_set* pollset_set); @@ -106,4 +106,4 @@ struct grpc_endpoint { const grpc_endpoint_vtable* vtable; }; -#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_H */ +#endif // GRPC_CORE_LIB_IOMGR_ENDPOINT_H diff --git a/src/core/lib/iomgr/endpoint_cfstream.cc b/src/core/lib/iomgr/endpoint_cfstream.cc index 4f9bf91e8e5..3cb8c9e9863 100644 --- a/src/core/lib/iomgr/endpoint_cfstream.cc +++ b/src/core/lib/iomgr/endpoint_cfstream.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -373,4 +373,4 @@ grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream, return &ep_impl->base; } -#endif /* GRPC_CFSTREAM_ENDPOINT */ +#endif // GRPC_CFSTREAM_ENDPOINT diff --git a/src/core/lib/iomgr/endpoint_cfstream.h b/src/core/lib/iomgr/endpoint_cfstream.h index 6f2cf1c6e02..cca965f65a1 100644 --- a/src/core/lib/iomgr/endpoint_cfstream.h +++ b/src/core/lib/iomgr/endpoint_cfstream.h @@ -1,33 +1,33 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H #define GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H -/* - Low level TCP "bottom half" implementation, for use by transports built on - top of a TCP connection. +// +// Low level TCP "bottom half" implementation, for use by transports built on +// top of a TCP connection. - Note that this file does not (yet) include APIs for creating the socket in - the first place. +// Note that this file does not (yet) include APIs for creating the socket in +// the first place. - All calls passing slice transfer ownership of a slice refcount unless - otherwise specified. -*/ +// All calls passing slice transfer ownership of a slice refcount unless +// otherwise specified. +// #include @@ -44,6 +44,6 @@ grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream, const char* peer_string, CFStreamHandle* stream_sync); -#endif /* GRPC_CFSTREAM */ +#endif // GRPC_CFSTREAM -#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H */ +#endif // GRPC_CORE_LIB_IOMGR_ENDPOINT_CFSTREAM_H diff --git a/src/core/lib/iomgr/endpoint_pair.h b/src/core/lib/iomgr/endpoint_pair.h index 6150b5bb02b..682ee8699e6 100644 --- a/src/core/lib/iomgr/endpoint_pair.h +++ b/src/core/lib/iomgr/endpoint_pair.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H #define GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H @@ -31,4 +31,4 @@ struct grpc_endpoint_pair { grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name, grpc_channel_args* args); -#endif /* GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H */ +#endif // GRPC_CORE_LIB_IOMGR_ENDPOINT_PAIR_H diff --git a/src/core/lib/iomgr/endpoint_pair_posix.cc b/src/core/lib/iomgr/endpoint_pair_posix.cc index f67a3893555..41b9d2ac299 100644 --- a/src/core/lib/iomgr/endpoint_pair_posix.cc +++ b/src/core/lib/iomgr/endpoint_pair_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/iomgr/endpoint_pair_windows.cc b/src/core/lib/iomgr/endpoint_pair_windows.cc index 7ea1dcb3d5d..8ebfff1c53a 100644 --- a/src/core/lib/iomgr/endpoint_pair_windows.cc +++ b/src/core/lib/iomgr/endpoint_pair_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index 2f4ab3c53f0..f43809dccc2 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include "src/core/lib/iomgr/error.h" diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index f9cc88fb210..5502689948b 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_ERROR_H #define GRPC_CORE_LIB_IOMGR_ERROR_H @@ -164,4 +164,4 @@ class AtomicError { gpr_spinlock lock_ = GPR_SPINLOCK_STATIC_INITIALIZER; }; -#endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */ +#endif // GRPC_CORE_LIB_IOMGR_ERROR_H diff --git a/src/core/lib/iomgr/error_cfstream.cc b/src/core/lib/iomgr/error_cfstream.cc index 30a15cbf1c7..49f5b0aaddf 100644 --- a/src/core/lib/iomgr/error_cfstream.cc +++ b/src/core/lib/iomgr/error_cfstream.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -51,4 +51,4 @@ grpc_error_handle grpc_error_create_from_cferror(const char* file, int line, return StatusCreate(absl::StatusCode::kUnknown, error_msg, grpc_core::DebugLocation(file, line), {}); } -#endif /* GRPC_CFSTREAM */ +#endif // GRPC_CFSTREAM diff --git a/src/core/lib/iomgr/error_cfstream.h b/src/core/lib/iomgr/error_cfstream.h index 2d5b744c74e..8921057213a 100644 --- a/src/core/lib/iomgr/error_cfstream.h +++ b/src/core/lib/iomgr/error_cfstream.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H #define GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H @@ -26,6 +26,6 @@ static_cast((error)), (desc)) grpc_error_handle grpc_error_create_from_cferror(const char* file, int line, void* arg, const char* desc); -#endif /* GRPC_CFSTREAM */ +#endif // GRPC_CFSTREAM -#endif /* GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H */ +#endif // GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H diff --git a/src/core/lib/iomgr/ev_apple.cc b/src/core/lib/iomgr/ev_apple.cc index 32def8e1dd8..efc7639ac91 100644 --- a/src/core/lib/iomgr/ev_apple.cc +++ b/src/core/lib/iomgr/ev_apple.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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. +// +// /// Event engine based on Apple's CFRunLoop API family. If the CFRunLoop engine /// is enabled (see iomgr_posix_cfstream.cc), a global thread is started to diff --git a/src/core/lib/iomgr/ev_apple.h b/src/core/lib/iomgr/ev_apple.h index 6397ed4cf06..8847d4de302 100644 --- a/src/core/lib/iomgr/ev_apple.h +++ b/src/core/lib/iomgr/ev_apple.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EV_APPLE_H #define GRPC_CORE_LIB_IOMGR_EV_APPLE_H diff --git a/src/core/lib/iomgr/ev_epoll1_linux.cc b/src/core/lib/iomgr/ev_epoll1_linux.cc index 7388cc2d7ce..772f6ed342a 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.cc +++ b/src/core/lib/iomgr/ev_epoll1_linux.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -22,8 +22,8 @@ #include "src/core/lib/iomgr/port.h" -/* This polling engine is only relevant on linux kernels supporting epoll - epoll_create() or epoll_create1() */ +// This polling engine is only relevant on linux kernels supporting epoll +// epoll_create() or epoll_create1() #ifdef GRPC_LINUX_EPOLL #include #include @@ -61,36 +61,36 @@ static grpc_wakeup_fd global_wakeup_fd; -/******************************************************************************* - * Singleton epoll set related fields - */ +//****************************************************************************** +// Singleton epoll set related fields +// #define MAX_EPOLL_EVENTS 100 #define MAX_EPOLL_EVENTS_HANDLED_PER_ITERATION 1 -/* NOTE ON SYNCHRONIZATION: - * - Fields in this struct are only modified by the designated poller. Hence - * there is no need for any locks to protect the struct. - * - num_events and cursor fields have to be of atomic type to provide memory - * visibility guarantees only. i.e In case of multiple pollers, the designated - * polling thread keeps changing; the thread that wrote these values may be - * different from the thread reading the values - */ +// NOTE ON SYNCHRONIZATION: +// - Fields in this struct are only modified by the designated poller. Hence +// there is no need for any locks to protect the struct. +// - num_events and cursor fields have to be of atomic type to provide memory +// visibility guarantees only. i.e In case of multiple pollers, the designated +// polling thread keeps changing; the thread that wrote these values may be +// different from the thread reading the values +// typedef struct epoll_set { int epfd; - /* The epoll_events after the last call to epoll_wait() */ + // The epoll_events after the last call to epoll_wait() struct epoll_event events[MAX_EPOLL_EVENTS]; - /* The number of epoll_events after the last call to epoll_wait() */ + // The number of epoll_events after the last call to epoll_wait() gpr_atm num_events; - /* Index of the first event in epoll_events that has to be processed. This - * field is only valid if num_events > 0 */ + // Index of the first event in epoll_events that has to be processed. This + // field is only valid if num_events > 0 gpr_atm cursor; } epoll_set; -/* The global singleton epoll set */ +// The global singleton epoll set static epoll_set g_epoll_set; static int epoll_create_and_cloexec() { @@ -111,7 +111,7 @@ static int epoll_create_and_cloexec() { return fd; } -/* Must be called *only* once */ +// Must be called *only* once static bool epoll_set_init() { g_epoll_set.epfd = epoll_create_and_cloexec(); if (g_epoll_set.epfd < 0) { @@ -124,7 +124,7 @@ static bool epoll_set_init() { return true; } -/* epoll_set_init() MUST be called before calling this. */ +// epoll_set_init() MUST be called before calling this. static void epoll_set_shutdown() { if (g_epoll_set.epfd >= 0) { close(g_epoll_set.epfd); @@ -132,11 +132,11 @@ static void epoll_set_shutdown() { } } -/******************************************************************************* - * Fd Declarations - */ +//****************************************************************************** +// Fd Declarations +// -/* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ +// Only used when GRPC_ENABLE_FORK_SUPPORT=1 struct grpc_fork_fd_list { grpc_fd* fd; grpc_fd* next; @@ -154,16 +154,16 @@ struct grpc_fd { grpc_iomgr_object iomgr_object; - /* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ + // Only used when GRPC_ENABLE_FORK_SUPPORT=1 grpc_fork_fd_list* fork_fd_list; }; static void fd_global_init(void); static void fd_global_shutdown(void); -/******************************************************************************* - * Pollset Declarations - */ +//****************************************************************************** +// Pollset Declarations +// typedef enum { UNKICKED, KICKED, DESIGNATED_POLLER } kick_state; @@ -214,31 +214,31 @@ struct grpc_pollset { grpc_pollset_worker* root_worker; bool kicked_without_poller; - /* Set to true if the pollset is observed to have no workers available to - poll */ + // Set to true if the pollset is observed to have no workers available to + // poll bool seen_inactive; - bool shutting_down; /* Is the pollset shutting down ? */ - grpc_closure* shutdown_closure; /* Called after shutdown is complete */ + bool shutting_down; // Is the pollset shutting down ? + grpc_closure* shutdown_closure; // Called after shutdown is complete - /* Number of workers who are *about-to* attach themselves to the pollset - * worker list */ + // Number of workers who are *about-to* attach themselves to the pollset + // worker list int begin_refs; grpc_pollset* next; grpc_pollset* prev; }; -/******************************************************************************* - * Pollset-set Declarations - */ +//****************************************************************************** +// Pollset-set Declarations +// struct grpc_pollset_set { char unused; }; -/******************************************************************************* - * Common helpers - */ +//****************************************************************************** +// Common helpers +// static bool append_error(grpc_error_handle* composite, grpc_error_handle error, const char* desc) { @@ -250,32 +250,32 @@ static bool append_error(grpc_error_handle* composite, grpc_error_handle error, return false; } -/******************************************************************************* - * Fd Definitions - */ - -/* We need to keep a freelist not because of any concerns of malloc performance - * but instead so that implementations with multiple threads in (for example) - * epoll_wait deal with the race between pollset removal and incoming poll - * notifications. - * - * The problem is that the poller ultimately holds a reference to this - * object, so it is very difficult to know when is safe to free it, at least - * without some expensive synchronization. - * - * If we keep the object freelisted, in the worst case losing this race just - * becomes a spurious read notification on a reused fd. - */ - -/* The alarm system needs to be able to wakeup 'some poller' sometimes - * (specifically when a new alarm needs to be triggered earlier than the next - * alarm 'epoch'). This wakeup_fd gives us something to alert on when such a - * case occurs. */ +//****************************************************************************** +// Fd Definitions +// + +// We need to keep a freelist not because of any concerns of malloc performance +// but instead so that implementations with multiple threads in (for example) +// epoll_wait deal with the race between pollset removal and incoming poll +// notifications. +// +// The problem is that the poller ultimately holds a reference to this +// object, so it is very difficult to know when is safe to free it, at least +// without some expensive synchronization. +// +// If we keep the object freelisted, in the worst case losing this race just +// becomes a spurious read notification on a reused fd. +// + +// The alarm system needs to be able to wakeup 'some poller' sometimes +// (specifically when a new alarm needs to be triggered earlier than the next +// alarm 'epoch'). This wakeup_fd gives us something to alert on when such a +// case occurs. static grpc_fd* fd_freelist = nullptr; static gpr_mu fd_freelist_mu; -/* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ +// Only used when GRPC_ENABLE_FORK_SUPPORT=1 static grpc_fd* fork_fd_list_head = nullptr; static gpr_mu fork_fd_list_mu; @@ -362,11 +362,11 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) { struct epoll_event ev; ev.events = static_cast(EPOLLIN | EPOLLOUT | EPOLLET); - /* Use the least significant bit of ev.data.ptr to store track_err. We expect - * the addresses to be word aligned. We need to store track_err to avoid - * synchronization issues when accessing it after receiving an event. - * Accessing fd would be a data race there because the fd might have been - * returned to the free list at that point. */ + // Use the least significant bit of ev.data.ptr to store track_err. We expect + // the addresses to be word aligned. We need to store track_err to avoid + // synchronization issues when accessing it after receiving an event. + // Accessing fd would be a data race there because the fd might have been + // returned to the free list at that point. ev.data.ptr = reinterpret_cast(reinterpret_cast(new_fd) | (track_err ? 1 : 0)); if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_ADD, fd, &ev) != 0) { @@ -379,16 +379,16 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) { static int fd_wrapped_fd(grpc_fd* fd) { return fd->fd; } -/* if 'releasing_fd' is true, it means that we are going to detach the internal - * fd from grpc_fd structure (i.e which means we should not be calling - * shutdown() syscall on that fd) */ +// if 'releasing_fd' is true, it means that we are going to detach the internal +// fd from grpc_fd structure (i.e which means we should not be calling +// shutdown() syscall on that fd) static void fd_shutdown_internal(grpc_fd* fd, grpc_error_handle why, bool releasing_fd) { if (fd->read_closure->SetShutdown(why)) { if (!releasing_fd) { shutdown(fd->fd, SHUT_RDWR); } else { - /* we need a phony event for earlier linux versions. */ + // we need a phony event for earlier linux versions. epoll_event phony_event; if (epoll_ctl(g_epoll_set.epfd, EPOLL_CTL_DEL, fd->fd, &phony_event) != 0) { @@ -401,7 +401,7 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error_handle why, } } -/* Might be called multiple times */ +// Might be called multiple times static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) { fd_shutdown_internal(fd, why, false); } @@ -415,8 +415,8 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, fd_shutdown_internal(fd, GRPC_ERROR_CREATE(reason), is_release_fd); } - /* If release_fd is not NULL, we should be relinquishing control of the file - descriptor fd->fd (but we still own the grpc_fd structure). */ + // If release_fd is not NULL, we should be relinquishing control of the file + // descriptor fd->fd (but we still own the grpc_fd structure). if (is_release_fd) { *release_fd = fd->fd; } else { @@ -459,20 +459,20 @@ static void fd_become_writable(grpc_fd* fd) { fd->write_closure->SetReady(); } static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); } -/******************************************************************************* - * Pollset Definitions - */ +//****************************************************************************** +// Pollset Definitions +// static thread_local grpc_pollset* g_current_thread_pollset; static thread_local grpc_pollset_worker* g_current_thread_worker; -/* The designated poller */ +// The designated poller static gpr_atm g_active_poller; static pollset_neighborhood* g_neighborhoods; static size_t g_num_neighborhoods; -/* Return true if first in list */ +// Return true if first in list static bool worker_insert(grpc_pollset* pollset, grpc_pollset_worker* worker) { if (pollset->root_worker == nullptr) { pollset->root_worker = worker; @@ -487,7 +487,7 @@ static bool worker_insert(grpc_pollset* pollset, grpc_pollset_worker* worker) { } } -/* Return true if last in list */ +// Return true if last in list typedef enum { EMPTIED, NEW_ROOT, REMOVED } worker_remove_result; static worker_remove_result worker_remove(grpc_pollset* pollset, @@ -644,14 +644,14 @@ static int poll_deadline_to_millis_timeout(grpc_core::Timestamp millis) { } } -/* Process the epoll events found by do_epoll_wait() function. - - g_epoll_set.cursor points to the index of the first event to be processed - - This function then processes up-to MAX_EPOLL_EVENTS_PER_ITERATION and - updates the g_epoll_set.cursor +// Process the epoll events found by do_epoll_wait() function. +// - g_epoll_set.cursor points to the index of the first event to be processed +// - This function then processes up-to MAX_EPOLL_EVENTS_PER_ITERATION and +// updates the g_epoll_set.cursor - NOTE ON SYNCRHONIZATION: Similar to do_epoll_wait(), this function is only - called by g_active_poller thread. So there is no need for synchronization - when accessing fields in g_epoll_set */ +// NOTE ON SYNCRHONIZATION: Similar to do_epoll_wait(), this function is only +// called by g_active_poller thread. So there is no need for synchronization +// when accessing fields in g_epoll_set static grpc_error_handle process_epoll_events(grpc_pollset* /*pollset*/) { static const char* err_desc = "process_events"; grpc_error_handle error; @@ -694,13 +694,13 @@ static grpc_error_handle process_epoll_events(grpc_pollset* /*pollset*/) { return error; } -/* Do epoll_wait and store the events in g_epoll_set.events field. This does not - "process" any of the events yet; that is done in process_epoll_events(). - *See process_epoll_events() function for more details. +// Do epoll_wait and store the events in g_epoll_set.events field. This does not +// "process" any of the events yet; that is done in process_epoll_events(). +// *See process_epoll_events() function for more details. - NOTE ON SYNCHRONIZATION: At any point of time, only the g_active_poller - (i.e the designated poller thread) will be calling this function. So there is - no need for any synchronization when accesing fields in g_epoll_set */ +// NOTE ON SYNCHRONIZATION: At any point of time, only the g_active_poller +// (i.e the designated poller thread) will be calling this function. So there is +// no need for any synchronization when accesing fields in g_epoll_set static grpc_error_handle do_epoll_wait(grpc_pollset* ps, grpc_core::Timestamp deadline) { int r; @@ -769,20 +769,20 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, goto retry_lock_neighborhood; } - /* In the brief time we released the pollset locks above, the worker MAY - have been kicked. In this case, the worker should get out of this - pollset ASAP and hence this should neither add the pollset to - neighborhood nor mark the pollset as active. + // In the brief time we released the pollset locks above, the worker MAY + // have been kicked. In this case, the worker should get out of this + // pollset ASAP and hence this should neither add the pollset to + // neighborhood nor mark the pollset as active. - On a side note, the only way a worker's kick state could have changed - at this point is if it were "kicked specifically". Since the worker has - not added itself to the pollset yet (by calling worker_insert()), it is - not visible in the "kick any" path yet */ + // On a side note, the only way a worker's kick state could have changed + // at this point is if it were "kicked specifically". Since the worker has + // not added itself to the pollset yet (by calling worker_insert()), it is + // not visible in the "kick any" path yet if (worker->state == UNKICKED) { pollset->seen_inactive = false; if (neighborhood->active_root == nullptr) { neighborhood->active_root = pollset->next = pollset->prev = pollset; - /* Make this the designated poller if there isn't one already */ + // Make this the designated poller if there isn't one already if (worker->state == UNKICKED && gpr_atm_no_barrier_cas(&g_active_poller, 0, reinterpret_cast(worker))) { @@ -818,8 +818,8 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, if (gpr_cv_wait(&worker->cv, &pollset->mu, deadline.as_timespec(GPR_CLOCK_MONOTONIC)) && worker->state == UNKICKED) { - /* If gpr_cv_wait returns true (i.e a timeout), pretend that the worker - received a kick */ + // If gpr_cv_wait returns true (i.e a timeout), pretend that the worker + // received a kick SET_KICK_STATE(worker, KICKED); } } @@ -834,14 +834,14 @@ static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, pollset->shutting_down, pollset->kicked_without_poller); } - /* We release pollset lock in this function at a couple of places: - * 1. Briefly when assigning pollset to a neighborhood - * 2. When doing gpr_cv_wait() - * It is possible that 'kicked_without_poller' was set to true during (1) and - * 'shutting_down' is set to true during (1) or (2). If either of them is - * true, this worker cannot do polling */ - /* TODO(sreek): Perhaps there is a better way to handle kicked_without_poller - * case; especially when the worker is the DESIGNATED_POLLER */ + // We release pollset lock in this function at a couple of places: + // 1. Briefly when assigning pollset to a neighborhood + // 2. When doing gpr_cv_wait() + // It is possible that 'kicked_without_poller' was set to true during (1) and + // 'shutting_down' is set to true during (1) or (2). If either of them is + // true, this worker cannot do polling + // TODO(sreek): Perhaps there is a better way to handle kicked_without_poller + // case; especially when the worker is the DESIGNATED_POLLER if (pollset->kicked_without_poller) { pollset->kicked_without_poller = false; @@ -919,7 +919,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, gpr_log(GPR_INFO, "PS:%p END_WORKER:%p", pollset, worker); } if (worker_hdl != nullptr) *worker_hdl = nullptr; - /* Make sure we appear kicked */ + // Make sure we appear kicked SET_KICK_STATE(worker, KICKED); grpc_closure_list_move(&worker->schedule_on_end_work, grpc_core::ExecCtx::Get()->closure_list()); @@ -986,10 +986,10 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker, GPR_ASSERT(gpr_atm_no_barrier_load(&g_active_poller) != (gpr_atm)worker); } -/* pollset->po.mu lock must be held by the caller before calling this. - The function pollset_work() may temporarily release the lock (pollset->po.mu) - during the course of its execution but it will always re-acquire the lock and - ensure that it is held by the time the function returns */ +// pollset->po.mu lock must be held by the caller before calling this. +// The function pollset_work() may temporarily release the lock (pollset->po.mu) +// during the course of its execution but it will always re-acquire the lock and +// ensure that it is held by the time the function returns static grpc_error_handle pollset_work(grpc_pollset* ps, grpc_pollset_worker** worker_hdl, grpc_core::Timestamp deadline) { @@ -1007,28 +1007,28 @@ static grpc_error_handle pollset_work(grpc_pollset* ps, GPR_ASSERT(!ps->shutting_down); GPR_ASSERT(!ps->seen_inactive); - gpr_mu_unlock(&ps->mu); /* unlock */ - /* This is the designated polling thread at this point and should ideally do - polling. However, if there are unprocessed events left from a previous - call to do_epoll_wait(), skip calling epoll_wait() in this iteration and - process the pending epoll events. - - The reason for decoupling do_epoll_wait and process_epoll_events is to - better distribute the work (i.e handling epoll events) across multiple - threads - - process_epoll_events() returns very quickly: It just queues the work on - exec_ctx but does not execute it (the actual exectution or more - accurately grpc_core::ExecCtx::Get()->Flush() happens in end_worker() - AFTER selecting a designated poller). So we are not waiting long periods - without a designated poller */ + gpr_mu_unlock(&ps->mu); // unlock + // This is the designated polling thread at this point and should ideally do + // polling. However, if there are unprocessed events left from a previous + // call to do_epoll_wait(), skip calling epoll_wait() in this iteration and + // process the pending epoll events. + + // The reason for decoupling do_epoll_wait and process_epoll_events is to + // better distribute the work (i.e handling epoll events) across multiple + // threads + + // process_epoll_events() returns very quickly: It just queues the work on + // exec_ctx but does not execute it (the actual exectution or more + // accurately grpc_core::ExecCtx::Get()->Flush() happens in end_worker() + // AFTER selecting a designated poller). So we are not waiting long periods + // without a designated poller if (gpr_atm_acq_load(&g_epoll_set.cursor) == gpr_atm_acq_load(&g_epoll_set.num_events)) { append_error(&error, do_epoll_wait(ps, deadline), err_desc); } append_error(&error, process_epoll_events(ps), err_desc); - gpr_mu_lock(&ps->mu); /* lock */ + gpr_mu_lock(&ps->mu); // lock g_current_thread_worker = nullptr; } else { @@ -1182,9 +1182,9 @@ done: static void pollset_add_fd(grpc_pollset* /*pollset*/, grpc_fd* /*fd*/) {} -/******************************************************************************* - * Pollset-set Definitions - */ +//****************************************************************************** +// Pollset-set Definitions +// static grpc_pollset_set* pollset_set_create(void) { return reinterpret_cast(static_cast(0xdeafbeef)); @@ -1208,9 +1208,9 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* /*bag*/, static void pollset_set_del_pollset_set(grpc_pollset_set* /*bag*/, grpc_pollset_set* /*item*/) {} -/******************************************************************************* - * Event engine binding - */ +//****************************************************************************** +// Event engine binding +// static bool is_any_background_poller_thread(void) { return false; } @@ -1275,9 +1275,9 @@ const grpc_event_engine_vtable grpc_ev_epoll1_posix = { add_closure_to_background_poller, }; -/* Called by the child process's post-fork handler to close open fds, including - * the global epoll fd. This allows gRPC to shutdown in the child process - * without interfering with connections or RPCs ongoing in the parent. */ +// Called by the child process's post-fork handler to close open fds, including +// the global epoll fd. This allows gRPC to shutdown in the child process +// without interfering with connections or RPCs ongoing in the parent. static void reset_event_manager_on_fork() { gpr_mu_lock(&fork_fd_list_mu); while (fork_fd_list_head != nullptr) { @@ -1290,9 +1290,9 @@ static void reset_event_manager_on_fork() { init_epoll1_linux(); } -/* It is possible that GLIBC has epoll but the underlying kernel doesn't. - * Create epoll_fd (epoll_set_init() takes care of that) to make sure epoll - * support is available */ +// It is possible that GLIBC has epoll but the underlying kernel doesn't. +// Create epoll_fd (epoll_set_init() takes care of that) to make sure epoll +// support is available static bool init_epoll1_linux() { if (!grpc_has_wakeup_fd()) { gpr_log(GPR_ERROR, "Skipping epoll1 because of no wakeup fd."); @@ -1319,7 +1319,7 @@ static bool init_epoll1_linux() { return true; } -#else /* defined(GRPC_LINUX_EPOLL) */ +#else // defined(GRPC_LINUX_EPOLL) #if defined(GRPC_POSIX_SOCKET_EV_EPOLL1) #include "src/core/lib/iomgr/ev_epoll1_linux.h" const grpc_event_engine_vtable grpc_ev_epoll1_posix = { @@ -1363,5 +1363,5 @@ const grpc_event_engine_vtable grpc_ev_epoll1_posix = { nullptr, nullptr, }; -#endif /* defined(GRPC_POSIX_SOCKET_EV_EPOLL1) */ -#endif /* !defined(GRPC_LINUX_EPOLL) */ +#endif // defined(GRPC_POSIX_SOCKET_EV_EPOLL1) +#endif // !defined(GRPC_LINUX_EPOLL) diff --git a/src/core/lib/iomgr/ev_epoll1_linux.h b/src/core/lib/iomgr/ev_epoll1_linux.h index a3e0fefb5f4..a83ffae2af9 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.h +++ b/src/core/lib/iomgr/ev_epoll1_linux.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H #define GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H @@ -28,4 +28,4 @@ extern const grpc_event_engine_vtable grpc_ev_epoll1_posix; -#endif /* GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H */ +#endif // GRPC_CORE_LIB_IOMGR_EV_EPOLL1_LINUX_H diff --git a/src/core/lib/iomgr/ev_poll_posix.cc b/src/core/lib/iomgr/ev_poll_posix.cc index 70b6abae931..58affbb8d29 100644 --- a/src/core/lib/iomgr/ev_poll_posix.cc +++ b/src/core/lib/iomgr/ev_poll_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -50,9 +50,9 @@ #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker*)1) -/******************************************************************************* - * FD declarations - */ +//****************************************************************************** +// FD declarations +// typedef struct grpc_fd_watcher { struct grpc_fd_watcher* next; struct grpc_fd_watcher* prev; @@ -63,10 +63,10 @@ typedef struct grpc_fd_watcher { typedef struct grpc_cached_wakeup_fd grpc_cached_wakeup_fd; -/* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ +// Only used when GRPC_ENABLE_FORK_SUPPORT=1 struct grpc_fork_fd_list { - /* Only one of fd or cached_wakeup_fd will be set. The unused field will be - set to nullptr. */ + // Only one of fd or cached_wakeup_fd will be set. The unused field will be + // set to nullptr. grpc_fd* fd; grpc_cached_wakeup_fd* cached_wakeup_fd; @@ -76,11 +76,11 @@ struct grpc_fork_fd_list { struct grpc_fd { int fd; - /* refst format: - bit0: 1=active/0=orphaned - bit1-n: refcount - meaning that mostly we ref by two to avoid altering the orphaned bit, - and just unref by 1 when we're ready to flag the object as orphaned */ + // refst format: + // bit0: 1=active/0=orphaned + // bit1-n: refcount + // meaning that mostly we ref by two to avoid altering the orphaned bit, + // and just unref by 1 when we're ready to flag the object as orphaned gpr_atm refst; gpr_mu mu; @@ -90,28 +90,28 @@ struct grpc_fd { gpr_atm pollhup; grpc_error_handle shutdown_error; - /* The watcher list. + // The watcher list. - The following watcher related fields are protected by watcher_mu. + // The following watcher related fields are protected by watcher_mu. - An fd_watcher is an ephemeral object created when an fd wants to - begin polling, and destroyed after the poll. + // An fd_watcher is an ephemeral object created when an fd wants to + // begin polling, and destroyed after the poll. - It denotes the fd's interest in whether to read poll or write poll - or both or neither on this fd. + // It denotes the fd's interest in whether to read poll or write poll + // or both or neither on this fd. - If a watcher is asked to poll for reads or writes, the read_watcher - or write_watcher fields are set respectively. A watcher may be asked - to poll for both, in which case both fields will be set. + // If a watcher is asked to poll for reads or writes, the read_watcher + // or write_watcher fields are set respectively. A watcher may be asked + // to poll for both, in which case both fields will be set. - read_watcher and write_watcher may be NULL if no watcher has been - asked to poll for reads or writes. + // read_watcher and write_watcher may be NULL if no watcher has been + // asked to poll for reads or writes. - If an fd_watcher is not asked to poll for reads or writes, it's added - to a linked list of inactive watchers, rooted at inactive_watcher_root. - If at a later time there becomes need of a poller to poll, one of - the inactive pollers may be kicked out of their poll loops to take - that responsibility. */ + // If an fd_watcher is not asked to poll for reads or writes, it's added + // to a linked list of inactive watchers, rooted at inactive_watcher_root. + // If at a later time there becomes need of a poller to poll, one of + // the inactive pollers may be kicked out of their poll loops to take + // that responsibility. grpc_fd_watcher inactive_watcher_root; grpc_fd_watcher* read_watcher; grpc_fd_watcher* write_watcher; @@ -123,38 +123,38 @@ struct grpc_fd { grpc_iomgr_object iomgr_object; - /* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ + // Only used when GRPC_ENABLE_FORK_SUPPORT=1 grpc_fork_fd_list* fork_fd_list; }; -/* True when GRPC_ENABLE_FORK_SUPPORT=1. */ +// True when GRPC_ENABLE_FORK_SUPPORT=1. static bool track_fds_for_fork = false; -/* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ +// Only used when GRPC_ENABLE_FORK_SUPPORT=1 static grpc_fork_fd_list* fork_fd_list_head = nullptr; static gpr_mu fork_fd_list_mu; -/* Begin polling on an fd. - Registers that the given pollset is interested in this fd - so that if read - or writability interest changes, the pollset can be kicked to pick up that - new interest. - Return value is: - (fd_needs_read? read_mask : 0) | (fd_needs_write? write_mask : 0) - i.e. a combination of read_mask and write_mask determined by the fd's current - interest in said events. - Polling strategies that do not need to alter their behavior depending on the - fd's current interest (such as epoll) do not need to call this function. - MUST NOT be called with a pollset lock taken */ +// Begin polling on an fd. +// Registers that the given pollset is interested in this fd - so that if read +// or writability interest changes, the pollset can be kicked to pick up that +// new interest. +// Return value is: +// (fd_needs_read? read_mask : 0) | (fd_needs_write? write_mask : 0) +// i.e. a combination of read_mask and write_mask determined by the fd's current +// interest in said events. +// Polling strategies that do not need to alter their behavior depending on the +// fd's current interest (such as epoll) do not need to call this function. +// MUST NOT be called with a pollset lock taken static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, grpc_pollset_worker* worker, uint32_t read_mask, uint32_t write_mask, grpc_fd_watcher* watcher); -/* Complete polling previously started with fd_begin_poll - MUST NOT be called with a pollset lock taken - if got_read or got_write are 1, also does the become_{readable,writable} as - appropriate. */ +// Complete polling previously started with fd_begin_poll +// MUST NOT be called with a pollset lock taken +// if got_read or got_write are 1, also does the become_{readable,writable} as +// appropriate. static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write); -/* Return 1 if this fd is orphaned, 0 otherwise */ +// Return 1 if this fd is orphaned, 0 otherwise static bool fd_is_orphaned(grpc_fd* fd); #ifndef NDEBUG @@ -173,15 +173,15 @@ static void fd_unref(grpc_fd* fd); #define CLOSURE_NOT_READY ((grpc_closure*)0) #define CLOSURE_READY ((grpc_closure*)1) -/******************************************************************************* - * pollset declarations - */ +//****************************************************************************** +// pollset declarations +// typedef struct grpc_cached_wakeup_fd { grpc_wakeup_fd fd; struct grpc_cached_wakeup_fd* next; - /* Only used when GRPC_ENABLE_FORK_SUPPORT=1 */ + // Only used when GRPC_ENABLE_FORK_SUPPORT=1 grpc_fork_fd_list* fork_fd_list; } grpc_cached_wakeup_fd; @@ -201,45 +201,45 @@ struct grpc_pollset { int kicked_without_pollers; grpc_closure* shutdown_done; int pollset_set_count; - /* all polled fds */ + // all polled fds size_t fd_count; size_t fd_capacity; grpc_fd** fds; - /* Local cache of eventfds for workers */ + // Local cache of eventfds for workers grpc_cached_wakeup_fd* local_wakeup_cache; }; -/* Add an fd to a pollset */ +// Add an fd to a pollset static void pollset_add_fd(grpc_pollset* pollset, struct grpc_fd* fd); static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd); -/* Convert a timespec to milliseconds: - - very small or negative poll times are clamped to zero to do a - non-blocking poll (which becomes spin polling) - - other small values are rounded up to one millisecond - - longer than a millisecond polls are rounded up to the next nearest - millisecond to avoid spinning - - infinite timeouts are converted to -1 */ +// Convert a timespec to milliseconds: +// - very small or negative poll times are clamped to zero to do a +// non-blocking poll (which becomes spin polling) +// - other small values are rounded up to one millisecond +// - longer than a millisecond polls are rounded up to the next nearest +// millisecond to avoid spinning +// - infinite timeouts are converted to -1 static int poll_deadline_to_millis_timeout(grpc_core::Timestamp deadline); -/* Allow kick to wakeup the currently polling worker */ +// Allow kick to wakeup the currently polling worker #define GRPC_POLLSET_CAN_KICK_SELF 1 -/* Force the wakee to repoll when awoken */ +// Force the wakee to repoll when awoken #define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2 -/* As per pollset_kick, with an extended set of flags (defined above) - -- mostly for fd_posix's use. */ +// As per pollset_kick, with an extended set of flags (defined above) +// -- mostly for fd_posix's use. static grpc_error_handle pollset_kick_ext(grpc_pollset* p, grpc_pollset_worker* specific_worker, uint32_t flags) GRPC_MUST_USE_RESULT; -/* Return 1 if the pollset has active threads in pollset_work (pollset must - * be locked) */ +// Return 1 if the pollset has active threads in pollset_work (pollset must +// be locked) static bool pollset_has_workers(grpc_pollset* pollset); -/******************************************************************************* - * pollset_set definitions - */ +//****************************************************************************** +// pollset_set definitions +// struct grpc_pollset_set { gpr_mu mu; @@ -257,9 +257,9 @@ struct grpc_pollset_set { grpc_fd** fds; }; -/******************************************************************************* - * functions to track opened fds. No-ops unless track_fds_for_fork is true. - */ +//****************************************************************************** +// functions to track opened fds. No-ops unless track_fds_for_fork is true. +// static void fork_fd_list_remove_node(grpc_fork_fd_list* node) { if (track_fds_for_fork) { @@ -309,9 +309,9 @@ static void fork_fd_list_add_wakeup_fd(grpc_cached_wakeup_fd* fd) { } } -/******************************************************************************* - * fd_posix.c - */ +//****************************************************************************** +// fd_posix.c +// #ifndef NDEBUG #define REF_BY(fd, n, reason) ref_by(fd, n, reason, __FILE__, __LINE__) @@ -461,17 +461,17 @@ static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, fd->released = true; } gpr_mu_lock(&fd->mu); - REF_BY(fd, 1, reason); /* remove active status, but keep referenced */ + REF_BY(fd, 1, reason); // remove active status, but keep referenced if (!has_watchers(fd)) { close_fd_locked(fd); } else { wake_all_watchers_locked(fd); } gpr_mu_unlock(&fd->mu); - UNREF_BY(fd, 2, reason); /* drop the reference */ + UNREF_BY(fd, 2, reason); // drop the reference } -/* increment refcount by two to avoid changing the orphan bit */ +// increment refcount by two to avoid changing the orphan bit #ifndef NDEBUG static void fd_ref(grpc_fd* fd, const char* reason, const char* file, int line) { @@ -507,15 +507,15 @@ static void notify_on_locked(grpc_fd* fd, grpc_closure** st, grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE)); } else if (*st == CLOSURE_NOT_READY) { - /* not ready ==> switch to a waiting state by setting the closure */ + // not ready ==> switch to a waiting state by setting the closure *st = closure; } else if (*st == CLOSURE_READY) { - /* already ready ==> queue the closure to run immediately */ + // already ready ==> queue the closure to run immediately *st = CLOSURE_NOT_READY; grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, fd_shutdown_error(fd)); maybe_wake_one_watcher_locked(fd); } else { - /* upcallptr was set to a different closure. This is an error! */ + // upcallptr was set to a different closure. This is an error! gpr_log(GPR_ERROR, "User called a notify_on function with a previous callback still " "pending"); @@ -523,17 +523,17 @@ static void notify_on_locked(grpc_fd* fd, grpc_closure** st, } } -/* returns 1 if state becomes not ready */ +// returns 1 if state becomes not ready static int set_ready_locked(grpc_fd* fd, grpc_closure** st) { if (*st == CLOSURE_READY) { - /* duplicate ready ==> ignore */ + // duplicate ready ==> ignore return 0; } else if (*st == CLOSURE_NOT_READY) { - /* not ready, and not waiting ==> flag ready */ + // not ready, and not waiting ==> flag ready *st = CLOSURE_READY; return 0; } else { - /* waiting ==> queue closure */ + // waiting ==> queue closure grpc_core::ExecCtx::Run(DEBUG_LOCATION, *st, fd_shutdown_error(fd)); *st = CLOSURE_NOT_READY; return 1; @@ -542,11 +542,11 @@ static int set_ready_locked(grpc_fd* fd, grpc_closure** st) { static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) { gpr_mu_lock(&fd->mu); - /* only shutdown once */ + // only shutdown once if (!fd->shutdown) { fd->shutdown = 1; fd->shutdown_error = why; - /* signal read/write closed to OS so that future operations fail */ + // signal read/write closed to OS so that future operations fail shutdown(fd->fd, SHUT_RDWR); set_ready_locked(fd, &fd->read_closure); set_ready_locked(fd, &fd->write_closure); @@ -604,13 +604,13 @@ static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, uint32_t mask = 0; grpc_closure* cur; int requested; - /* keep track of pollers that have requested our events, in case they change - */ + // keep track of pollers that have requested our events, in case they change + // GRPC_FD_REF(fd, "poll"); gpr_mu_lock(&fd->mu); - /* if we are shutdown, then don't add to the watcher set */ + // if we are shutdown, then don't add to the watcher set if (fd->shutdown) { watcher->pollset = nullptr; watcher->worker = nullptr; @@ -619,22 +619,22 @@ static uint32_t fd_begin_poll(grpc_fd* fd, grpc_pollset* pollset, return 0; } - /* if there is nobody polling for read, but we need to, then start doing so */ + // if there is nobody polling for read, but we need to, then start doing so cur = fd->read_closure; requested = cur != CLOSURE_READY; if (read_mask && fd->read_watcher == nullptr && requested) { fd->read_watcher = watcher; mask |= read_mask; } - /* if there is nobody polling for write, but we need to, then start doing so - */ + // if there is nobody polling for write, but we need to, then start doing so + // cur = fd->write_closure; requested = cur != CLOSURE_READY; if (write_mask && fd->write_watcher == nullptr && requested) { fd->write_watcher = watcher; mask |= write_mask; } - /* if not polling, remember this watcher in case we need someone to later */ + // if not polling, remember this watcher in case we need someone to later if (mask == 0 && worker != nullptr) { watcher->next = &fd->inactive_watcher_root; watcher->prev = watcher->next->prev; @@ -665,7 +665,7 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) { } if (watcher == fd->read_watcher) { - /* remove read watcher, kick if we still need a read */ + // remove read watcher, kick if we still need a read was_polling = 1; if (!got_read) { kick = 1; @@ -673,7 +673,7 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) { fd->read_watcher = nullptr; } if (watcher == fd->write_watcher) { - /* remove write watcher, kick if we still need a write */ + // remove write watcher, kick if we still need a write was_polling = 1; if (!got_write) { kick = 1; @@ -681,7 +681,7 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) { fd->write_watcher = nullptr; } if (!was_polling && watcher->worker != nullptr) { - /* remove from inactive list */ + // remove from inactive list watcher->next->prev = watcher->prev; watcher->prev->next = watcher->next; } @@ -706,9 +706,9 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) { GRPC_FD_UNREF(fd, "poll"); } -/******************************************************************************* - * pollset_posix.c - */ +//****************************************************************************** +// pollset_posix.c +// static thread_local grpc_pollset* g_current_thread_poller; static thread_local grpc_pollset_worker* g_current_thread_worker; @@ -766,7 +766,7 @@ static grpc_error_handle pollset_kick_ext(grpc_pollset* p, uint32_t flags) { grpc_error_handle error; - /* pollset->mu already held */ + // pollset->mu already held if (specific_worker != nullptr) { if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) { GPR_ASSERT((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) == 0); @@ -824,11 +824,11 @@ static grpc_error_handle pollset_kick(grpc_pollset* p, return pollset_kick_ext(p, specific_worker, 0); } -/* global state management */ +// global state management static grpc_error_handle pollset_global_init(void) { return absl::OkStatus(); } -/* main interface */ +// main interface static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { gpr_mu_init(&pollset->mu); @@ -861,7 +861,7 @@ static void pollset_destroy(grpc_pollset* pollset) { static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) { gpr_mu_lock(&pollset->mu); size_t i; - /* TODO(ctiller): this is O(num_fds^2); maybe switch to a hash set here */ + // TODO(ctiller): this is O(num_fds^2); maybe switch to a hash set here for (i = 0; i < pollset->fd_count; i++) { if (pollset->fds[i] == fd) goto exit; } @@ -904,17 +904,17 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, if (worker_hdl) *worker_hdl = &worker; grpc_error_handle error; - /* Avoid malloc for small number of elements. */ + // Avoid malloc for small number of elements. enum { inline_elements = 96 }; struct pollfd pollfd_space[inline_elements]; struct grpc_fd_watcher watcher_space[inline_elements]; - /* pollset->mu already held */ + // pollset->mu already held int added_worker = 0; int locked = 1; int queued_work = 0; int keep_polling = 0; - /* this must happen before we (potentially) drop pollset->mu */ + // this must happen before we (potentially) drop pollset->mu worker.next = worker.prev = nullptr; worker.reevaluate_polling_on_wakeup = 0; if (pollset->local_wakeup_cache != nullptr) { @@ -931,13 +931,13 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } } worker.kicked_specifically = 0; - /* If we're shutting down then we don't execute any extended work */ + // If we're shutting down then we don't execute any extended work if (pollset->shutting_down) { goto done; } - /* Start polling, and keep doing so while we're being asked to - re-evaluate our pollers (this allows poll() based pollers to - ensure they don't miss wakeups) */ + // Start polling, and keep doing so while we're being asked to + // re-evaluate our pollers (this allows poll() based pollers to + // ensure they don't miss wakeups) keep_polling = 1; g_current_thread_poller = pollset; while (keep_polling) { @@ -965,7 +965,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, pfds = pollfd_space; watchers = watcher_space; } else { - /* Allocate one buffer to hold both pfds and watchers arrays */ + // Allocate one buffer to hold both pfds and watchers arrays const size_t pfd_size = sizeof(*pfds) * (pollset->fd_count + 2); const size_t watch_size = sizeof(*watchers) * (pollset->fd_count + 2); void* buf = gpr_malloc(pfd_size + watch_size); @@ -1004,8 +1004,8 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } } - /* TODO(vpai): Consider first doing a 0 timeout poll here to avoid - even going into the blocking annotation if possible */ + // TODO(vpai): Consider first doing a 0 timeout poll here to avoid + // even going into the blocking annotation if possible GRPC_SCHEDULING_START_BLOCKING_REGION; r = grpc_poll_function(pfds, pfd_count, timeout); GRPC_SCHEDULING_END_BLOCKING_REGION; @@ -1053,9 +1053,9 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, pfds[i].fd, (pfds[i].revents & POLLIN_CHECK) != 0, (pfds[i].revents & POLLOUT_CHECK) != 0, pfds[i].revents); } - /* This is a mitigation to prevent poll() from spinning on a - ** POLLHUP https://github.com/grpc/grpc/pull/13665 - */ + // This is a mitigation to prevent poll() from spinning on a + //* POLLHUP https://github.com/grpc/grpc/pull/13665 + // if (pfds[i].revents & POLLHUP) { gpr_atm_no_barrier_store(&watchers[i].fd->pollhup, 1); } @@ -1066,7 +1066,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } if (pfds != pollfd_space) { - /* pfds and watchers are in the same memory block pointed to by pfds */ + // pfds and watchers are in the same memory block pointed to by pfds gpr_free(pfds); } @@ -1074,25 +1074,25 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, } else { pollset->kicked_without_pollers = 0; } - /* Finished execution - start cleaning up. - Note that we may arrive here from outside the enclosing while() loop. - In that case we won't loop though as we haven't added worker to the - worker list, which means nobody could ask us to re-evaluate polling). */ + // Finished execution - start cleaning up. + // Note that we may arrive here from outside the enclosing while() loop. + // In that case we won't loop though as we haven't added worker to the + // worker list, which means nobody could ask us to re-evaluate polling). done: if (!locked) { queued_work |= grpc_core::ExecCtx::Get()->Flush(); gpr_mu_lock(&pollset->mu); locked = 1; } - /* If we're forced to re-evaluate polling (via pollset_kick with - GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) then we land here and force - a loop */ + // If we're forced to re-evaluate polling (via pollset_kick with + // GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) then we land here and force + // a loop if (worker.reevaluate_polling_on_wakeup && error.ok()) { worker.reevaluate_polling_on_wakeup = 0; pollset->kicked_without_pollers = 0; if (queued_work || worker.kicked_specifically) { - /* If there's queued work on the list, then set the deadline to be - immediate so we get back out of the polling loop quickly */ + // If there's queued work on the list, then set the deadline to be + // immediate so we get back out of the polling loop quickly deadline = grpc_core::Timestamp(); } keep_polling = 1; @@ -1103,10 +1103,10 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, remove_worker(pollset, &worker); g_current_thread_worker = nullptr; } - /* release wakeup fd to the local pool */ + // release wakeup fd to the local pool worker.wakeup_fd->next = pollset->local_wakeup_cache; pollset->local_wakeup_cache = worker.wakeup_fd; - /* check shutdown conditions */ + // check shutdown conditions if (pollset->shutting_down) { if (pollset_has_workers(pollset)) { (void)pollset_kick(pollset, nullptr); @@ -1115,10 +1115,10 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, gpr_mu_unlock(&pollset->mu); finish_shutdown(pollset); grpc_core::ExecCtx::Get()->Flush(); - /* Continuing to access pollset here is safe -- it is the caller's - * responsibility to not destroy when it has outstanding calls to - * pollset_work. - * TODO(dklempner): Can we refactor the shutdown logic to avoid this? */ + // Continuing to access pollset here is safe -- it is the caller's + // responsibility to not destroy when it has outstanding calls to + // pollset_work. + // TODO(dklempner): Can we refactor the shutdown logic to avoid this? gpr_mu_lock(&pollset->mu); } } @@ -1147,9 +1147,9 @@ static int poll_deadline_to_millis_timeout(grpc_core::Timestamp deadline) { return static_cast(n); } -/******************************************************************************* - * pollset_set_posix.c - */ +//****************************************************************************** +// pollset_set_posix.c +// static grpc_pollset_set* pollset_set_create(void) { grpc_pollset_set* pollset_set = @@ -1168,7 +1168,7 @@ static void pollset_set_destroy(grpc_pollset_set* pollset_set) { grpc_pollset* pollset = pollset_set->pollsets[i]; gpr_mu_lock(&pollset->mu); pollset->pollset_set_count--; - /* check shutdown */ + // check shutdown if (pollset->shutting_down && !pollset->called_shutdown && !pollset_has_observers(pollset)) { pollset->called_shutdown = 1; @@ -1226,7 +1226,7 @@ static void pollset_set_del_pollset(grpc_pollset_set* pollset_set, gpr_mu_unlock(&pollset_set->mu); gpr_mu_lock(&pollset->mu); pollset->pollset_set_count--; - /* check shutdown */ + // check shutdown if (pollset->shutting_down && !pollset->called_shutdown && !pollset_has_observers(pollset)) { pollset->called_shutdown = 1; @@ -1314,9 +1314,9 @@ static void pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) { gpr_mu_unlock(&pollset_set->mu); } -/******************************************************************************* - * event engine binding - */ +//****************************************************************************** +// event engine binding +// static bool is_any_background_poller_thread(void) { return false; } @@ -1327,9 +1327,9 @@ static bool add_closure_to_background_poller(grpc_closure* /*closure*/, return false; } -/* Called by the child process's post-fork handler to close open fds, including - * worker wakeup fds. This allows gRPC to shutdown in the child process without - * interfering with connections or RPCs ongoing in the parent. */ +// Called by the child process's post-fork handler to close open fds, including +// worker wakeup fds. This allows gRPC to shutdown in the child process without +// interfering with connections or RPCs ongoing in the parent. static void reset_event_manager_on_fork() { gpr_mu_lock(&fork_fd_list_mu); while (fork_fd_list_head != nullptr) { @@ -1384,7 +1384,7 @@ const grpc_event_engine_vtable grpc_ev_poll_posix = { is_any_background_poller_thread, /* name = */ "poll", - /* check_engine_available = */ + // check_engine_available = [](bool) { if (!grpc_has_wakeup_fd()) { gpr_log(GPR_ERROR, "Skipping poll because of no wakeup fd."); @@ -1441,4 +1441,4 @@ const grpc_event_engine_vtable grpc_ev_none_posix = []() { return v; }(); -#endif /* GRPC_POSIX_SOCKET_EV_POLL */ +#endif // GRPC_POSIX_SOCKET_EV_POLL diff --git a/src/core/lib/iomgr/ev_poll_posix.h b/src/core/lib/iomgr/ev_poll_posix.h index 57050a97084..bd27316d353 100644 --- a/src/core/lib/iomgr/ev_poll_posix.h +++ b/src/core/lib/iomgr/ev_poll_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H #define GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H @@ -26,4 +26,4 @@ extern const grpc_event_engine_vtable grpc_ev_poll_posix; extern const grpc_event_engine_vtable grpc_ev_none_posix; -#endif /* GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_EV_POLL_POSIX_H diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index da3e0db3654..9ddbeeb45c6 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -45,9 +45,9 @@ GPR_GLOBAL_CONFIG_DEFINE_STRING( "order first -> last.") grpc_core::DebugOnlyTraceFlag grpc_polling_trace( - false, "polling"); /* Disabled by default */ + false, "polling"); // Disabled by default -/* Traces fd create/close operations */ +// Traces fd create/close operations grpc_core::DebugOnlyTraceFlag grpc_fd_trace(false, "fd_trace"); grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount(false, "fd_refcount"); grpc_core::DebugOnlyTraceFlag grpc_polling_api_trace(false, "polling_api"); @@ -62,8 +62,8 @@ grpc_core::DebugOnlyTraceFlag grpc_polling_api_trace(false, "polling_api"); #define GRPC_POLLING_API_TRACE(...) #endif // NDEBUG -/** Default poll() function - a pointer so that it can be overridden by some - * tests */ +/// Default poll() function - a pointer so that it can be overridden by some +/// tests #ifndef GPR_AIX grpc_poll_function_type grpc_poll_function = poll; #else @@ -144,7 +144,7 @@ static void try_engine(const char* engine) { } } -/* Call this before calling grpc_event_engine_init() */ +// Call this before calling grpc_event_engine_init() void grpc_register_event_engine_factory(const grpc_event_engine_vtable* vtable, bool add_at_head) { const grpc_event_engine_vtable** first_null = nullptr; @@ -164,8 +164,8 @@ void grpc_register_event_engine_factory(const grpc_event_engine_vtable* vtable, *(add_at_head ? first_null : last_null) = vtable; } -/*If grpc_event_engine_init() has been called, returns the poll_strategy_name. - * Otherwise, returns nullptr. */ +// If grpc_event_engine_init() has been called, returns the poll_strategy_name. +// Otherwise, returns nullptr. const char* grpc_get_poll_strategy_name() { return g_event_engine->name; } void grpc_event_engine_init(void) { @@ -198,7 +198,7 @@ void grpc_event_engine_init(void) { void grpc_event_engine_shutdown(void) { g_event_engine->shutdown_engine(); } bool grpc_event_engine_can_track_errors(void) { - /* Only track errors if platform supports errqueue. */ + // Only track errors if platform supports errqueue. return grpc_core::KernelSupportsErrqueue() && g_event_engine->can_track_err; } diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index b12942dd2c4..bcb9c5be4ac 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EV_POSIX_H #define GRPC_CORE_LIB_IOMGR_EV_POSIX_H @@ -32,9 +32,8 @@ GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_poll_strategy); -extern grpc_core::DebugOnlyTraceFlag grpc_fd_trace; /* Disabled by default */ -extern grpc_core::DebugOnlyTraceFlag - grpc_polling_trace; /* Disabled by default */ +extern grpc_core::DebugOnlyTraceFlag grpc_fd_trace; // Disabled by default +extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; // Disabled by default #define GRPC_FD_TRACE(format, ...) \ if (GRPC_TRACE_FLAG_ENABLED(grpc_fd_trace)) { \ @@ -94,116 +93,116 @@ typedef struct grpc_event_engine_vtable { grpc_error_handle error); } grpc_event_engine_vtable; -/* register a new event engine factory */ +// register a new event engine factory void grpc_register_event_engine_factory(const grpc_event_engine_vtable* vtable, bool add_at_head); void grpc_event_engine_init(void); void grpc_event_engine_shutdown(void); -/* Return the name of the poll strategy */ +// Return the name of the poll strategy const char* grpc_get_poll_strategy_name(); -/* Returns true if polling engine can track errors separately, false otherwise. - * If this is true, fd can be created with track_err set. After this, error - * events will be reported using fd_notify_on_error. If it is not set, errors - * will continue to be reported through fd_notify_on_read and - * fd_notify_on_write. - */ +// Returns true if polling engine can track errors separately, false otherwise. +// If this is true, fd can be created with track_err set. After this, error +// events will be reported using fd_notify_on_error. If it is not set, errors +// will continue to be reported through fd_notify_on_read and +// fd_notify_on_write. +// bool grpc_event_engine_can_track_errors(); -/* Returns true if polling engine runs in the background, false otherwise. - * Currently only 'epollbg' runs in the background. - */ +// Returns true if polling engine runs in the background, false otherwise. +// Currently only 'epollbg' runs in the background. +// bool grpc_event_engine_run_in_background(); -/* Create a wrapped file descriptor. - Requires fd is a non-blocking file descriptor. - \a track_err if true means that error events would be tracked separately - using grpc_fd_notify_on_error. Currently, valid only for linux systems. - This takes ownership of closing fd. */ +// Create a wrapped file descriptor. +// Requires fd is a non-blocking file descriptor. +// \a track_err if true means that error events would be tracked separately +// using grpc_fd_notify_on_error. Currently, valid only for linux systems. +// This takes ownership of closing fd. grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err); -/* Return the wrapped fd, or -1 if it has been released or closed. */ +// Return the wrapped fd, or -1 if it has been released or closed. int grpc_fd_wrapped_fd(grpc_fd* fd); -/* Releases fd to be asynchronously destroyed. - on_done is called when the underlying file descriptor is definitely close()d. - If on_done is NULL, no callback will be made. - If release_fd is not NULL, it's set to fd and fd will not be closed. - Requires: *fd initialized; no outstanding notify_on_read or - notify_on_write. - MUST NOT be called with a pollset lock taken */ +// Releases fd to be asynchronously destroyed. +// on_done is called when the underlying file descriptor is definitely close()d. +// If on_done is NULL, no callback will be made. +// If release_fd is not NULL, it's set to fd and fd will not be closed. +// Requires: *fd initialized; no outstanding notify_on_read or +// notify_on_write. +// MUST NOT be called with a pollset lock taken void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, const char* reason); -/* Has grpc_fd_shutdown been called on an fd? */ +// Has grpc_fd_shutdown been called on an fd? bool grpc_fd_is_shutdown(grpc_fd* fd); -/* Cause any current and future callbacks to fail. */ +// Cause any current and future callbacks to fail. void grpc_fd_shutdown(grpc_fd* fd, grpc_error_handle why); -/* Register read interest, causing read_cb to be called once when fd becomes - readable, on deadline specified by deadline, or on shutdown triggered by - grpc_fd_shutdown. - read_cb will be called with read_cb_arg when *fd becomes readable. - read_cb is Called with status of GRPC_CALLBACK_SUCCESS if readable, - GRPC_CALLBACK_TIMED_OUT if the call timed out, - and CANCELLED if the call was cancelled. - - Requires:This method must not be called before the read_cb for any previous - call runs. Edge triggered events are used whenever they are supported by the - underlying platform. This means that users must drain fd in read_cb before - calling notify_on_read again. Users are also expected to handle spurious - events, i.e read_cb is called while nothing can be readable from fd */ +// Register read interest, causing read_cb to be called once when fd becomes +// readable, on deadline specified by deadline, or on shutdown triggered by +// grpc_fd_shutdown. +// read_cb will be called with read_cb_arg when *fd becomes readable. +// read_cb is Called with status of GRPC_CALLBACK_SUCCESS if readable, +// GRPC_CALLBACK_TIMED_OUT if the call timed out, +// and CANCELLED if the call was cancelled. + +// Requires:This method must not be called before the read_cb for any previous +// call runs. Edge triggered events are used whenever they are supported by the +// underlying platform. This means that users must drain fd in read_cb before +// calling notify_on_read again. Users are also expected to handle spurious +// events, i.e read_cb is called while nothing can be readable from fd void grpc_fd_notify_on_read(grpc_fd* fd, grpc_closure* closure); -/* Exactly the same semantics as above, except based on writable events. */ +// Exactly the same semantics as above, except based on writable events. void grpc_fd_notify_on_write(grpc_fd* fd, grpc_closure* closure); -/* Exactly the same semantics as above, except based on error events. track_err - * needs to have been set on grpc_fd_create */ +// Exactly the same semantics as above, except based on error events. track_err +// needs to have been set on grpc_fd_create void grpc_fd_notify_on_error(grpc_fd* fd, grpc_closure* closure); -/* Forcibly set the fd to be readable, resulting in the closure registered with - * grpc_fd_notify_on_read being invoked. - */ +// Forcibly set the fd to be readable, resulting in the closure registered with +// grpc_fd_notify_on_read being invoked. +// void grpc_fd_set_readable(grpc_fd* fd); -/* Forcibly set the fd to be writable, resulting in the closure registered with - * grpc_fd_notify_on_write being invoked. - */ +// Forcibly set the fd to be writable, resulting in the closure registered with +// grpc_fd_notify_on_write being invoked. +// void grpc_fd_set_writable(grpc_fd* fd); -/* Forcibly set the fd to have errored, resulting in the closure registered with - * grpc_fd_notify_on_error being invoked. - */ +// Forcibly set the fd to have errored, resulting in the closure registered with +// grpc_fd_notify_on_error being invoked. +// void grpc_fd_set_error(grpc_fd* fd); -/* pollset_posix functions */ +// pollset_posix functions -/* Add an fd to a pollset */ +// Add an fd to a pollset void grpc_pollset_add_fd(grpc_pollset* pollset, struct grpc_fd* fd); -/* pollset_set_posix functions */ +// pollset_set_posix functions void grpc_pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd); void grpc_pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd); -/* Returns true if the caller is a worker thread for any background poller. */ +// Returns true if the caller is a worker thread for any background poller. bool grpc_is_any_background_poller_thread(); -/* Returns true if the closure is registered into the background poller. Note - * that the closure may or may not run yet when this function returns, and the - * closure should not be blocking or long-running. */ +// Returns true if the closure is registered into the background poller. Note +// that the closure may or may not run yet when this function returns, and the +// closure should not be blocking or long-running. bool grpc_add_closure_to_background_poller(grpc_closure* closure, grpc_error_handle error); -/* Shut down all the closures registered in the background poller. */ +// Shut down all the closures registered in the background poller. void grpc_shutdown_background_closure(); -/* override to allow tests to hook poll() usage */ +// override to allow tests to hook poll() usage typedef int (*grpc_poll_function_type)(struct pollfd*, nfds_t, int); extern grpc_poll_function_type grpc_poll_function; -#endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_EV_POSIX_H diff --git a/src/core/lib/iomgr/ev_windows.cc b/src/core/lib/iomgr/ev_windows.cc index e3f5715a873..8dcd3c1f957 100644 --- a/src/core/lib/iomgr/ev_windows.cc +++ b/src/core/lib/iomgr/ev_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -25,6 +25,6 @@ #include "src/core/lib/debug/trace.h" grpc_core::DebugOnlyTraceFlag grpc_polling_trace( - false, "polling"); /* Disabled by default */ + false, "polling"); // Disabled by default #endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc index 74f8043bfd6..2d7805896b1 100644 --- a/src/core/lib/iomgr/exec_ctx.cc +++ b/src/core/lib/iomgr/exec_ctx.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/exec_ctx.h b/src/core/lib/iomgr/exec_ctx.h index 0108c6fe281..2813e8150fe 100644 --- a/src/core/lib/iomgr/exec_ctx.h +++ b/src/core/lib/iomgr/exec_ctx.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EXEC_CTX_H #define GRPC_CORE_LIB_IOMGR_EXEC_CTX_H @@ -35,74 +35,74 @@ #include "src/core/lib/gprpp/time.h" #include "src/core/lib/iomgr/closure.h" -/** A combiner represents a list of work to be executed later. - Forward declared here to avoid a circular dependency with combiner.h. */ +/// A combiner represents a list of work to be executed later. +/// Forward declared here to avoid a circular dependency with combiner.h. typedef struct grpc_combiner grpc_combiner; -/* This exec_ctx is ready to return: either pre-populated, or cached as soon as - the finish_check returns true */ +// This exec_ctx is ready to return: either pre-populated, or cached as soon as +// the finish_check returns true #define GRPC_EXEC_CTX_FLAG_IS_FINISHED 1 -/* The exec_ctx's thread is (potentially) owned by a call or channel: care - should be given to not delete said call/channel from this exec_ctx */ +// The exec_ctx's thread is (potentially) owned by a call or channel: care +// should be given to not delete said call/channel from this exec_ctx #define GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP 2 -/* This exec ctx was initialized by an internal thread, and should not - be counted by fork handlers */ +// This exec ctx was initialized by an internal thread, and should not +// be counted by fork handlers #define GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD 4 -/* This application callback exec ctx was initialized by an internal thread, and - should not be counted by fork handlers */ +// This application callback exec ctx was initialized by an internal thread, and +// should not be counted by fork handlers #define GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD 1 namespace grpc_core { class Combiner; -/** Execution context. - * A bag of data that collects information along a callstack. - * It is created on the stack at core entry points (public API or iomgr), and - * stored internally as a thread-local variable. - * - * Generally, to create an exec_ctx instance, add the following line at the top - * of the public API entry point or at the start of a thread's work function : - * - * ExecCtx exec_ctx; - * - * Access the created ExecCtx instance using : - * ExecCtx::Get() - * - * Specific responsibilities (this may grow in the future): - * - track a list of core work that needs to be delayed until the base of the - * call stack (this provides a convenient mechanism to run callbacks - * without worrying about locking issues) - * - provide a decision maker (via IsReadyToFinish) that provides a - * signal as to whether a borrowed thread should continue to do work or - * should actively try to finish up and get this thread back to its owner - * - * CONVENTIONS: - * - Instance of this must ALWAYS be constructed on the stack, never - * heap allocated. - * - Do not pass exec_ctx as a parameter to a function. Always access it using - * ExecCtx::Get(). - * - NOTE: In the future, the convention is likely to change to allow only one - * ExecCtx on a thread's stack at the same time. The TODO below - * discusses this plan in more detail. - * - * TODO(yashykt): Only allow one "active" ExecCtx on a thread at the same time. - * Stage 1: If a new one is created on the stack, it should just - * pass-through to the underlying ExecCtx deeper in the thread's - * stack. - * Stage 2: Assert if a 2nd one is ever created on the stack - * since that implies a core re-entry outside of application - * callbacks. - */ +/// Execution context. +/// A bag of data that collects information along a callstack. +/// It is created on the stack at core entry points (public API or iomgr), and +/// stored internally as a thread-local variable. +/// +/// Generally, to create an exec_ctx instance, add the following line at the top +/// of the public API entry point or at the start of a thread's work function : +/// +/// ExecCtx exec_ctx; +/// +/// Access the created ExecCtx instance using : +/// ExecCtx::Get() +/// +/// Specific responsibilities (this may grow in the future): +/// - track a list of core work that needs to be delayed until the base of the +/// call stack (this provides a convenient mechanism to run callbacks +/// without worrying about locking issues) +/// - provide a decision maker (via IsReadyToFinish) that provides a +/// signal as to whether a borrowed thread should continue to do work or +/// should actively try to finish up and get this thread back to its owner +/// +/// CONVENTIONS: +/// - Instance of this must ALWAYS be constructed on the stack, never +/// heap allocated. +/// - Do not pass exec_ctx as a parameter to a function. Always access it using +/// ExecCtx::Get(). +/// - NOTE: In the future, the convention is likely to change to allow only one +/// ExecCtx on a thread's stack at the same time. The TODO below +/// discusses this plan in more detail. +/// +/// TODO(yashykt): Only allow one "active" ExecCtx on a thread at the same time. +/// Stage 1: If a new one is created on the stack, it should just +/// pass-through to the underlying ExecCtx deeper in the thread's +/// stack. +/// Stage 2: Assert if a 2nd one is ever created on the stack +/// since that implies a core re-entry outside of application +/// callbacks. +/// class ExecCtx { public: - /** Default Constructor */ + /// Default Constructor ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) { Fork::IncExecCtxCount(); Set(this); } - /** Parameterised Constructor */ + /// Parameterised Constructor explicit ExecCtx(uintptr_t fl) : flags_(fl) { if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) { Fork::IncExecCtxCount(); @@ -110,7 +110,7 @@ class ExecCtx { Set(this); } - /** Destructor */ + /// Destructor virtual ~ExecCtx() { flags_ |= GRPC_EXEC_CTX_FLAG_IS_FINISHED; Flush(); @@ -120,7 +120,7 @@ class ExecCtx { } } - /** Disallow copy and assignment operators */ + /// Disallow copy and assignment operators ExecCtx(const ExecCtx&) = delete; ExecCtx& operator=(const ExecCtx&) = delete; @@ -132,37 +132,37 @@ class ExecCtx { } struct CombinerData { - /* currently active combiner: updated only via combiner.c */ + // currently active combiner: updated only via combiner.c Combiner* active_combiner; - /* last active combiner in the active combiner list */ + // last active combiner in the active combiner list Combiner* last_combiner; }; - /** Only to be used by grpc-combiner code */ + /// Only to be used by grpc-combiner code CombinerData* combiner_data() { return &combiner_data_; } - /** Return pointer to grpc_closure_list */ + /// Return pointer to grpc_closure_list grpc_closure_list* closure_list() { return &closure_list_; } - /** Return flags */ + /// Return flags uintptr_t flags() { return flags_; } - /** Checks if there is work to be done */ + /// Checks if there is work to be done bool HasWork() { return combiner_data_.active_combiner != nullptr || !grpc_closure_list_empty(closure_list_); } - /** Flush any work that has been enqueued onto this grpc_exec_ctx. - * Caller must guarantee that no interfering locks are held. - * Returns true if work was performed, false otherwise. - */ + /// Flush any work that has been enqueued onto this grpc_exec_ctx. + /// Caller must guarantee that no interfering locks are held. + /// Returns true if work was performed, false otherwise. + /// bool Flush(); - /** Returns true if we'd like to leave this execution context as soon as - * possible: useful for deciding whether to do something more or not - * depending on outside context. - */ + /// Returns true if we'd like to leave this execution context as soon as + /// possible: useful for deciding whether to do something more or not + /// depending on outside context. + /// bool IsReadyToFinish() { if ((flags_ & GRPC_EXEC_CTX_FLAG_IS_FINISHED) == 0) { if (CheckReadyToFinish()) { @@ -184,7 +184,7 @@ class ExecCtx { } void TestOnlySetNow(Timestamp now) { time_cache_.TestOnlySetNow(now); } - /** Gets pointer to current exec_ctx. */ + /// Gets pointer to current exec_ctx. static ExecCtx* Get() { return exec_ctx_; } static void Run(const DebugLocation& location, grpc_closure* closure, @@ -193,14 +193,14 @@ class ExecCtx { static void RunList(const DebugLocation& location, grpc_closure_list* list); protected: - /** Check if ready to finish. */ + /// Check if ready to finish. virtual bool CheckReadyToFinish() { return false; } - /** Disallow delete on ExecCtx. */ + /// Disallow delete on ExecCtx. static void operator delete(void* /* p */) { abort(); } private: - /** Set exec_ctx_ to exec_ctx. */ + /// Set exec_ctx_ to exec_ctx. static void Set(ExecCtx* exec_ctx) { exec_ctx_ = exec_ctx; } grpc_closure_list closure_list_ = GRPC_CLOSURE_LIST_INIT; @@ -214,59 +214,59 @@ class ExecCtx { ExecCtx* last_exec_ctx_ = Get(); }; -/** Application-callback execution context. - * A bag of data that collects information along a callstack. - * It is created on the stack at core entry points, and stored internally - * as a thread-local variable. - * - * There are three key differences between this structure and ExecCtx: - * 1. ApplicationCallbackExecCtx builds a list of application-level - * callbacks, but ExecCtx builds a list of internal callbacks to invoke. - * 2. ApplicationCallbackExecCtx invokes its callbacks only at destruction; - * there is no explicit Flush method. - * 3. If more than one ApplicationCallbackExecCtx is created on the thread's - * stack, only the one closest to the base of the stack is actually - * active and this is the only one that enqueues application callbacks. - * (Unlike ExecCtx, it is not feasible to prevent multiple of these on the - * stack since the executing application callback may itself enter core. - * However, the new one created will just pass callbacks through to the - * base one and those will not be executed until the return to the - * destructor of the base one, preventing unlimited stack growth.) - * - * This structure exists because application callbacks may themselves cause a - * core re-entry (e.g., through a public API call) and if that call in turn - * causes another application-callback, there could be arbitrarily growing - * stacks of core re-entries. Instead, any application callbacks instead should - * not be invoked until other core work is done and other application callbacks - * have completed. To accomplish this, any application callback should be - * enqueued using ApplicationCallbackExecCtx::Enqueue . - * - * CONVENTIONS: - * - Instances of this must ALWAYS be constructed on the stack, never - * heap allocated. - * - Instances of this are generally constructed before ExecCtx when needed. - * The only exception is for ExecCtx's that are explicitly flushed and - * that survive beyond the scope of the function that can cause application - * callbacks to be invoked (e.g., in the timer thread). - * - * Generally, core entry points that may trigger application-level callbacks - * will have the following declarations: - * - * ApplicationCallbackExecCtx callback_exec_ctx; - * ExecCtx exec_ctx; - * - * This ordering is important to make sure that the ApplicationCallbackExecCtx - * is destroyed after the ExecCtx (to prevent the re-entry problem described - * above, as well as making sure that ExecCtx core callbacks are invoked first) - * - */ +/// Application-callback execution context. +/// A bag of data that collects information along a callstack. +/// It is created on the stack at core entry points, and stored internally +/// as a thread-local variable. +/// +/// There are three key differences between this structure and ExecCtx: +/// 1. ApplicationCallbackExecCtx builds a list of application-level +/// callbacks, but ExecCtx builds a list of internal callbacks to invoke. +/// 2. ApplicationCallbackExecCtx invokes its callbacks only at destruction; +/// there is no explicit Flush method. +/// 3. If more than one ApplicationCallbackExecCtx is created on the thread's +/// stack, only the one closest to the base of the stack is actually +/// active and this is the only one that enqueues application callbacks. +/// (Unlike ExecCtx, it is not feasible to prevent multiple of these on the +/// stack since the executing application callback may itself enter core. +/// However, the new one created will just pass callbacks through to the +/// base one and those will not be executed until the return to the +/// destructor of the base one, preventing unlimited stack growth.) +/// +/// This structure exists because application callbacks may themselves cause a +/// core re-entry (e.g., through a public API call) and if that call in turn +/// causes another application-callback, there could be arbitrarily growing +/// stacks of core re-entries. Instead, any application callbacks instead should +/// not be invoked until other core work is done and other application callbacks +/// have completed. To accomplish this, any application callback should be +/// enqueued using ApplicationCallbackExecCtx::Enqueue . +/// +/// CONVENTIONS: +/// - Instances of this must ALWAYS be constructed on the stack, never +/// heap allocated. +/// - Instances of this are generally constructed before ExecCtx when needed. +/// The only exception is for ExecCtx's that are explicitly flushed and +/// that survive beyond the scope of the function that can cause application +/// callbacks to be invoked (e.g., in the timer thread). +/// +/// Generally, core entry points that may trigger application-level callbacks +/// will have the following declarations: +/// +/// ApplicationCallbackExecCtx callback_exec_ctx; +/// ExecCtx exec_ctx; +/// +/// This ordering is important to make sure that the ApplicationCallbackExecCtx +/// is destroyed after the ExecCtx (to prevent the re-entry problem described +/// above, as well as making sure that ExecCtx core callbacks are invoked first) +/// +/// class ApplicationCallbackExecCtx { public: - /** Default Constructor */ + /// Default Constructor ApplicationCallbackExecCtx() { Set(this, flags_); } - /** Parameterised Constructor */ + /// Parameterised Constructor explicit ApplicationCallbackExecCtx(uintptr_t fl) : flags_(fl) { Set(this, flags_); } @@ -330,4 +330,4 @@ class ApplicationCallbackExecCtx { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_EXEC_CTX_H */ +#endif // GRPC_CORE_LIB_IOMGR_EXEC_CTX_H diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index fd6ac7035f6..73dcbeb7c7e 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -175,8 +175,8 @@ void Executor::SetThreading(bool threading) { gpr_mu_unlock(&thd_state_[i].mu); } - /* Ensure no thread is adding a new thread. Once this is past, then no - * thread will try to add a new one either (since shutdown is true) */ + // Ensure no thread is adding a new thread. Once this is past, then no + // thread will try to add a new one either (since shutdown is true) gpr_spinlock_lock(&adding_thread_lock_); gpr_spinlock_unlock(&adding_thread_lock_); diff --git a/src/core/lib/iomgr/executor.h b/src/core/lib/iomgr/executor.h index 91a45ef2fbe..519b1fe352d 100644 --- a/src/core/lib/iomgr/executor.h +++ b/src/core/lib/iomgr/executor.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_EXECUTOR_H #define GRPC_CORE_LIB_IOMGR_EXECUTOR_H @@ -58,18 +58,18 @@ class Executor { void Init(); - /** Is the executor multi-threaded? */ + /// Is the executor multi-threaded? bool IsThreaded() const; - /* Enable/disable threading - must be called after Init and Shutdown(). Never - * call SetThreading(false) in the middle of an application */ + // Enable/disable threading - must be called after Init and Shutdown(). Never + // call SetThreading(false) in the middle of an application void SetThreading(bool threading); - /** Shutdown the executor, running all pending work as part of the call */ + /// Shutdown the executor, running all pending work as part of the call void Shutdown(); - /** Enqueue the closure onto the executor. is_short is true if the closure is - * a short job (i.e expected to not block and complete quickly) */ + /// Enqueue the closure onto the executor. is_short is true if the closure is + /// a short job (i.e expected to not block and complete quickly) void Enqueue(grpc_closure* closure, grpc_error_handle error, bool is_short); // TODO(sreek): Currently we have two executors (available globally): The @@ -116,4 +116,4 @@ class Executor { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_EXECUTOR_H */ +#endif // GRPC_CORE_LIB_IOMGR_EXECUTOR_H diff --git a/src/core/lib/iomgr/fork_posix.cc b/src/core/lib/iomgr/fork_posix.cc index 533852395bf..b308d5cdcb1 100644 --- a/src/core/lib/iomgr/fork_posix.cc +++ b/src/core/lib/iomgr/fork_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -40,10 +40,10 @@ #include "src/core/lib/iomgr/wakeup_fd_posix.h" #include "src/core/lib/surface/init_internally.h" -/* - * NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK - * AROUND VERY SPECIFIC USE CASES. - */ +// +// NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK +// AROUND VERY SPECIFIC USE CASES. +// namespace { bool skipped_handler = true; diff --git a/src/core/lib/iomgr/fork_windows.cc b/src/core/lib/iomgr/fork_windows.cc index 798f671bdff..d8e73ed87c4 100644 --- a/src/core/lib/iomgr/fork_windows.cc +++ b/src/core/lib/iomgr/fork_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -25,10 +25,10 @@ #include #include -/* - * NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK - * AROUND VERY SPECIFIC USE CASES. - */ +// +// NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK +// AROUND VERY SPECIFIC USE CASES. +// void grpc_prefork() { gpr_log(GPR_ERROR, "Forking not supported on Windows"); } diff --git a/src/core/lib/iomgr/gethostname.h b/src/core/lib/iomgr/gethostname.h index 9f10b4afa78..f3d7452a2d8 100644 --- a/src/core/lib/iomgr/gethostname.h +++ b/src/core/lib/iomgr/gethostname.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H #define GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H @@ -23,4 +23,4 @@ // Caller takes ownership of result. char* grpc_gethostname(); -#endif /* GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H */ +#endif // GRPC_CORE_LIB_IOMGR_GETHOSTNAME_H diff --git a/src/core/lib/iomgr/gethostname_fallback.cc b/src/core/lib/iomgr/gethostname_fallback.cc index 65ae818723a..3c3282ab9f8 100644 --- a/src/core/lib/iomgr/gethostname_fallback.cc +++ b/src/core/lib/iomgr/gethostname_fallback.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/iomgr/gethostname_host_name_max.cc b/src/core/lib/iomgr/gethostname_host_name_max.cc index 79f5daa8f32..98e933018f9 100644 --- a/src/core/lib/iomgr/gethostname_host_name_max.cc +++ b/src/core/lib/iomgr/gethostname_host_name_max.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/iomgr/gethostname_sysconf.cc b/src/core/lib/iomgr/gethostname_sysconf.cc index 92c5de3338e..24769a51f92 100644 --- a/src/core/lib/iomgr/gethostname_sysconf.cc +++ b/src/core/lib/iomgr/gethostname_sysconf.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/iomgr/grpc_if_nametoindex.h b/src/core/lib/iomgr/grpc_if_nametoindex.h index ed9612dcb93..1327825361f 100644 --- a/src/core/lib/iomgr/grpc_if_nametoindex.h +++ b/src/core/lib/iomgr/grpc_if_nametoindex.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H #define GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H @@ -23,8 +23,8 @@ #include -/* Returns the interface index corresponding to the interface "name" provided. - * Returns non-zero upon success, and zero upon failure. */ +// Returns the interface index corresponding to the interface "name" provided. +// Returns non-zero upon success, and zero upon failure. uint32_t grpc_if_nametoindex(char* name); -#endif /* GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H */ +#endif // GRPC_CORE_LIB_IOMGR_GRPC_IF_NAMETOINDEX_H diff --git a/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc b/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc index 8916eac984e..a5ca75bddfe 100644 --- a/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc +++ b/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -38,5 +38,5 @@ uint32_t grpc_if_nametoindex(char* name) { return out; } -#endif /* GRPC_IF_NAMETOINDEX == 1 && \ - defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) */ +#endif // GRPC_IF_NAMETOINDEX == 1 && \ + // defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) diff --git a/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc b/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc index 63062433e6b..06bfe207f9e 100644 --- a/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc +++ b/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -34,5 +34,5 @@ uint32_t grpc_if_nametoindex(char* name) { return 0; } -#endif /* GRPC_IF_NAMETOINDEX == 0 || \ - !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) */ +#endif // GRPC_IF_NAMETOINDEX == 0 || \ + // !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX) diff --git a/src/core/lib/iomgr/internal_errqueue.h b/src/core/lib/iomgr/internal_errqueue.h index 5a3fe05ff52..83179070068 100644 --- a/src/core/lib/iomgr/internal_errqueue.h +++ b/src/core/lib/iomgr/internal_errqueue.h @@ -1,26 +1,26 @@ -/* - * - * Copyright 2018 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. - * - */ - -/* This file contains constants defined in and - * so as to allow collecting network timestamps in the - * kernel. This file allows tcp_posix.cc to compile on platforms that do not - * have and . - */ +// +// +// Copyright 2018 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. +// +// + +// This file contains constants defined in and +// so as to allow collecting network timestamps in the +// kernel. This file allows tcp_posix.cc to compile on platforms that do not +// have and . +// #ifndef GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H #define GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H @@ -39,31 +39,31 @@ #include #include #include -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE namespace grpc_core { #ifdef GRPC_LINUX_ERRQUEUE -/* Redefining scm_timestamping in the same way that defines - * it, so that code compiles on systems that don't have it. */ +// Redefining scm_timestamping in the same way that defines +// it, so that code compiles on systems that don't have it. struct scm_timestamping { struct timespec ts[3]; }; -/* Also redefine timestamp types */ -/* The timestamp type for when the driver passed skb to NIC, or HW. */ +// Also redefine timestamp types +// The timestamp type for when the driver passed skb to NIC, or HW. constexpr int SCM_TSTAMP_SND = 0; -/* The timestamp type for when data entered the packet scheduler. */ +// The timestamp type for when data entered the packet scheduler. constexpr int SCM_TSTAMP_SCHED = 1; -/* The timestamp type for when data acknowledged by peer. */ +// The timestamp type for when data acknowledged by peer. constexpr int SCM_TSTAMP_ACK = 2; -/* Control message type containing OPT_STATS */ +// Control message type containing OPT_STATS #ifndef SCM_TIMESTAMPING_OPT_STATS #define SCM_TIMESTAMPING_OPT_STATS 54 #endif -/* Redefine required constants from */ +// Redefine required constants from constexpr uint32_t SOF_TIMESTAMPING_TX_SOFTWARE = 1u << 1; constexpr uint32_t SOF_TIMESTAMPING_SOFTWARE = 1u << 4; constexpr uint32_t SOF_TIMESTAMPING_OPT_ID = 1u << 7; @@ -79,34 +79,34 @@ constexpr uint32_t kTimestampingRecordingOptions = SOF_TIMESTAMPING_TX_SCHED | SOF_TIMESTAMPING_TX_SOFTWARE | SOF_TIMESTAMPING_TX_ACK; -/* Netlink attribute types used for TCP opt stats. */ +// Netlink attribute types used for TCP opt stats. enum TCPOptStats { TCP_NLA_PAD, - TCP_NLA_BUSY, /* Time (usec) busy sending data. */ - TCP_NLA_RWND_LIMITED, /* Time (usec) limited by receive window. */ - TCP_NLA_SNDBUF_LIMITED, /* Time (usec) limited by send buffer. */ - TCP_NLA_DATA_SEGS_OUT, /* Data pkts sent including retransmission. */ - TCP_NLA_TOTAL_RETRANS, /* Data pkts retransmitted. */ - TCP_NLA_PACING_RATE, /* Pacing rate in Bps. */ - TCP_NLA_DELIVERY_RATE, /* Delivery rate in Bps. */ - TCP_NLA_SND_CWND, /* Sending congestion window. */ - TCP_NLA_REORDERING, /* Reordering metric. */ - TCP_NLA_MIN_RTT, /* minimum RTT. */ - TCP_NLA_RECUR_RETRANS, /* Recurring retransmits for the current pkt. */ - TCP_NLA_DELIVERY_RATE_APP_LMT, /* Delivery rate application limited? */ - TCP_NLA_SNDQ_SIZE, /* Data (bytes) pending in send queue */ - TCP_NLA_CA_STATE, /* ca_state of socket */ - TCP_NLA_SND_SSTHRESH, /* Slow start size threshold */ - TCP_NLA_DELIVERED, /* Data pkts delivered incl. out-of-order */ - TCP_NLA_DELIVERED_CE, /* Like above but only ones w/ CE marks */ - TCP_NLA_BYTES_SENT, /* Data bytes sent including retransmission */ - TCP_NLA_BYTES_RETRANS, /* Data bytes retransmitted */ - TCP_NLA_DSACK_DUPS, /* DSACK blocks received */ - TCP_NLA_REORD_SEEN, /* reordering events seen */ - TCP_NLA_SRTT, /* smoothed RTT in usecs */ + TCP_NLA_BUSY, // Time (usec) busy sending data. + TCP_NLA_RWND_LIMITED, // Time (usec) limited by receive window. + TCP_NLA_SNDBUF_LIMITED, // Time (usec) limited by send buffer. + TCP_NLA_DATA_SEGS_OUT, // Data pkts sent including retransmission. + TCP_NLA_TOTAL_RETRANS, // Data pkts retransmitted. + TCP_NLA_PACING_RATE, // Pacing rate in Bps. + TCP_NLA_DELIVERY_RATE, // Delivery rate in Bps. + TCP_NLA_SND_CWND, // Sending congestion window. + TCP_NLA_REORDERING, // Reordering metric. + TCP_NLA_MIN_RTT, // minimum RTT. + TCP_NLA_RECUR_RETRANS, // Recurring retransmits for the current pkt. + TCP_NLA_DELIVERY_RATE_APP_LMT, // Delivery rate application limited? + TCP_NLA_SNDQ_SIZE, // Data (bytes) pending in send queue + TCP_NLA_CA_STATE, // ca_state of socket + TCP_NLA_SND_SSTHRESH, // Slow start size threshold + TCP_NLA_DELIVERED, // Data pkts delivered incl. out-of-order + TCP_NLA_DELIVERED_CE, // Like above but only ones w/ CE marks + TCP_NLA_BYTES_SENT, // Data bytes sent including retransmission + TCP_NLA_BYTES_RETRANS, // Data bytes retransmitted + TCP_NLA_DSACK_DUPS, // DSACK blocks received + TCP_NLA_REORD_SEEN, // reordering events seen + TCP_NLA_SRTT, // smoothed RTT in usecs }; -/* tcp_info from from linux/tcp.h */ +// tcp_info from from linux/tcp.h struct tcp_info { uint8_t tcpi_state; uint8_t tcpi_ca_state; @@ -125,12 +125,12 @@ struct tcp_info { uint32_t tcpi_lost; uint32_t tcpi_retrans; uint32_t tcpi_fackets; - /* Times. */ + // Times. uint32_t tcpi_last_data_sent; - uint32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ + uint32_t tcpi_last_ack_sent; // Not remembered, sorry. uint32_t tcpi_last_data_recv; uint32_t tcpi_last_ack_recv; - /* Metrics. */ + // Metrics. uint32_t tcpi_pmtu; uint32_t tcpi_rcv_ssthresh; uint32_t tcpi_rtt; @@ -144,43 +144,43 @@ struct tcp_info { uint32_t tcpi_total_retrans; uint64_t tcpi_pacing_rate; uint64_t tcpi_max_pacing_rate; - uint64_t tcpi_bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked */ - uint64_t tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */ + uint64_t tcpi_bytes_acked; // RFC4898 tcpEStatsAppHCThruOctetsAcked + uint64_t tcpi_bytes_received; // RFC4898 tcpEStatsAppHCThruOctetsReceived - uint32_t tcpi_segs_out; /* RFC4898 tcpEStatsPerfSegsOut */ - uint32_t tcpi_segs_in; /* RFC4898 tcpEStatsPerfSegsIn */ + uint32_t tcpi_segs_out; // RFC4898 tcpEStatsPerfSegsOut + uint32_t tcpi_segs_in; // RFC4898 tcpEStatsPerfSegsIn uint32_t tcpi_notsent_bytes; uint32_t tcpi_min_rtt; - uint32_t tcpi_data_segs_in; /* RFC4898 tcpEStatsDataSegsIn */ - uint32_t tcpi_data_segs_out; /* RFC4898 tcpEStatsDataSegsOut */ + uint32_t tcpi_data_segs_in; // RFC4898 tcpEStatsDataSegsIn + uint32_t tcpi_data_segs_out; // RFC4898 tcpEStatsDataSegsOut uint64_t tcpi_delivery_rate; - uint64_t tcpi_busy_time; /* Time (usec) busy sending data */ - uint64_t tcpi_rwnd_limited; /* Time (usec) limited by receive window */ - uint64_t tcpi_sndbuf_limited; /* Time (usec) limited by send buffer */ + uint64_t tcpi_busy_time; // Time (usec) busy sending data + uint64_t tcpi_rwnd_limited; // Time (usec) limited by receive window + uint64_t tcpi_sndbuf_limited; // Time (usec) limited by send buffer uint32_t tcpi_delivered; uint32_t tcpi_delivered_ce; - uint64_t tcpi_bytes_sent; /* RFC4898 tcpEStatsPerfHCDataOctetsOut */ - uint64_t tcpi_bytes_retrans; /* RFC4898 tcpEStatsPerfOctetsRetrans */ - uint32_t tcpi_dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups */ - uint32_t tcpi_reord_seen; /* reordering events seen */ - socklen_t length; /* Length of struct returned by kernel */ + uint64_t tcpi_bytes_sent; // RFC4898 tcpEStatsPerfHCDataOctetsOut + uint64_t tcpi_bytes_retrans; // RFC4898 tcpEStatsPerfOctetsRetrans + uint32_t tcpi_dsack_dups; // RFC4898 tcpEStatsStackDSACKDups + uint32_t tcpi_reord_seen; // reordering events seen + socklen_t length; // Length of struct returned by kernel }; #ifndef TCP_INFO #define TCP_INFO 11 #endif -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE -/* Returns true if kernel is capable of supporting errqueue and timestamping. - * Currently allowing only linux kernels above 4.0.0 - */ +// Returns true if kernel is capable of supporting errqueue and timestamping. +// Currently allowing only linux kernels above 4.0.0 +// bool KernelSupportsErrqueue(); -} /* namespace grpc_core */ +} // namespace grpc_core -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP -#endif /* GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H */ +#endif // GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H diff --git a/src/core/lib/iomgr/iocp_windows.cc b/src/core/lib/iomgr/iocp_windows.cc index 4236b713a22..70eccba9fd4 100644 --- a/src/core/lib/iomgr/iocp_windows.cc +++ b/src/core/lib/iomgr/iocp_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -75,7 +75,7 @@ grpc_iocp_work_status grpc_iocp_work(grpc_core::Timestamp deadline) { if (overlapped == &g_iocp_custom_overlap) { gpr_atm_full_fetch_add(&g_custom_events, -1); if (completion_key == (ULONG_PTR)&g_iocp_kick_token) { - /* We were awoken from a kick. */ + // We were awoken from a kick. return GRPC_IOCP_WORK_KICK; } gpr_log(GPR_ERROR, "Unknown custom completion key."); @@ -155,4 +155,4 @@ void grpc_iocp_add_socket(grpc_winsocket* socket) { GPR_ASSERT(ret == g_iocp); } -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/iocp_windows.h b/src/core/lib/iomgr/iocp_windows.h index b8e3fb81a46..4a5db1749de 100644 --- a/src/core/lib/iomgr/iocp_windows.h +++ b/src/core/lib/iomgr/iocp_windows.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H @@ -45,4 +45,4 @@ void grpc_iocp_add_socket(grpc_winsocket*); #endif -#endif /* GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_IOCP_WINDOWS_H diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc index dfbc26faf82..99508dd3899 100644 --- a/src/core/lib/iomgr/iomgr.cc +++ b/src/core/lib/iomgr/iomgr.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -157,7 +157,7 @@ void grpc_iomgr_shutdown() { grpc_core::Executor::ShutdownAll(); } - /* ensure all threads have left g_mu */ + // ensure all threads have left g_mu gpr_mu_lock(&g_mu); gpr_mu_unlock(&g_mu); diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h index 190942bbeed..2b39b96ce30 100644 --- a/src/core/lib/iomgr/iomgr.h +++ b/src/core/lib/iomgr/iomgr.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_IOMGR_H #define GRPC_CORE_LIB_IOMGR_IOMGR_H @@ -26,35 +26,35 @@ #include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/port.h" -/** Initializes the iomgr. */ +/// Initializes the iomgr. void grpc_iomgr_init(); -/** Starts any background threads for iomgr. */ +/// Starts any background threads for iomgr. void grpc_iomgr_start(); -/** Signals the intention to shutdown the iomgr. Expects to be able to flush - * exec_ctx. */ +/// Signals the intention to shutdown the iomgr. Expects to be able to flush +/// exec_ctx. void grpc_iomgr_shutdown(); -/** Signals the intention to shutdown all the closures registered in the - * background poller. */ +/// Signals the intention to shutdown all the closures registered in the +/// background poller. void grpc_iomgr_shutdown_background_closure(); -/* Returns true if polling engine runs in the background, false otherwise. - * Currently only 'epollbg' runs in the background. - */ +// Returns true if polling engine runs in the background, false otherwise. +// Currently only 'epollbg' runs in the background. +// bool grpc_iomgr_run_in_background(); -/** Returns true if the caller is a worker thread for any background poller. */ +/// Returns true if the caller is a worker thread for any background poller. bool grpc_iomgr_is_any_background_poller_thread(); -/** Returns true if the closure is registered into the background poller. Note - * that the closure may or may not run yet when this function returns, and the - * closure should not be blocking or long-running. */ +/// Returns true if the closure is registered into the background poller. Note +/// that the closure may or may not run yet when this function returns, and the +/// closure should not be blocking or long-running. bool grpc_iomgr_add_closure_to_background_poller(grpc_closure* closure, grpc_error_handle error); -/* Exposed only for testing */ +// Exposed only for testing size_t grpc_iomgr_count_objects_for_testing(); -#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_H */ +#endif // GRPC_CORE_LIB_IOMGR_IOMGR_H diff --git a/src/core/lib/iomgr/iomgr_internal.cc b/src/core/lib/iomgr/iomgr_internal.cc index 87ec71ad577..2fc03cff807 100644 --- a/src/core/lib/iomgr/iomgr_internal.cc +++ b/src/core/lib/iomgr/iomgr_internal.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/iomgr_internal.h b/src/core/lib/iomgr/iomgr_internal.h index b9e7eacbc90..b35eef89d80 100644 --- a/src/core/lib/iomgr/iomgr_internal.h +++ b/src/core/lib/iomgr/iomgr_internal.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H #define GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H @@ -52,23 +52,23 @@ void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable); void grpc_set_default_iomgr_platform(); void grpc_iomgr_platform_init(void); -/** flush any globally queued work from iomgr */ +/// flush any globally queued work from iomgr void grpc_iomgr_platform_flush(void); -/** tear down all platform specific global iomgr structures */ +/// tear down all platform specific global iomgr structures void grpc_iomgr_platform_shutdown(void); -/** shut down all the closures registered in the background poller */ +/// shut down all the closures registered in the background poller void grpc_iomgr_platform_shutdown_background_closure(void); -/** return true if the caller is a worker thread for any background poller */ +/// return true if the caller is a worker thread for any background poller bool grpc_iomgr_platform_is_any_background_poller_thread(void); -/** Return true if the closure is registered into the background poller. Note - * that the closure may or may not run yet when this function returns, and the - * closure should not be blocking or long-running. */ +/// Return true if the closure is registered into the background poller. Note +/// that the closure may or may not run yet when this function returns, and the +/// closure should not be blocking or long-running. bool grpc_iomgr_platform_add_closure_to_background_poller( grpc_closure* closure, grpc_error_handle error); bool grpc_iomgr_abort_on_leaks(void); -#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */ +#endif // GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H diff --git a/src/core/lib/iomgr/iomgr_posix.cc b/src/core/lib/iomgr/iomgr_posix.cc index b61eebe648c..1c810ba36b2 100644 --- a/src/core/lib/iomgr/iomgr_posix.cc +++ b/src/core/lib/iomgr/iomgr_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -88,4 +88,4 @@ bool grpc_iomgr_run_in_background() { return grpc_event_engine_run_in_background(); } -#endif /* GRPC_POSIX_SOCKET_IOMGR */ +#endif // GRPC_POSIX_SOCKET_IOMGR diff --git a/src/core/lib/iomgr/iomgr_posix_cfstream.cc b/src/core/lib/iomgr/iomgr_posix_cfstream.cc index 26691b2a2c0..ddb514000fe 100644 --- a/src/core/lib/iomgr/iomgr_posix_cfstream.cc +++ b/src/core/lib/iomgr/iomgr_posix_cfstream.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// /// CFStream is build-enabled on iOS by default and disabled by default on other /// platforms (see port_platform.h). To enable CFStream build on another @@ -199,4 +199,4 @@ bool grpc_iomgr_run_in_background() { } } -#endif /* GRPC_CFSTREAM_IOMGR */ +#endif // GRPC_CFSTREAM_IOMGR diff --git a/src/core/lib/iomgr/iomgr_windows.cc b/src/core/lib/iomgr/iomgr_windows.cc index fe17b67b41c..bd8db0e0301 100644 --- a/src/core/lib/iomgr/iomgr_windows.cc +++ b/src/core/lib/iomgr/iomgr_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -41,9 +41,9 @@ extern grpc_timer_vtable grpc_generic_timer_vtable; extern grpc_pollset_vtable grpc_windows_pollset_vtable; extern grpc_pollset_set_vtable grpc_windows_pollset_set_vtable; -/* Windows' io manager is going to be fully designed using IO completion - ports. All of what we're doing here is basically make sure that - Windows sockets are initialized in and out. */ +// Windows' io manager is going to be fully designed using IO completion +// ports. All of what we're doing here is basically make sure that +// Windows sockets are initialized in and out. static void winsock_init(void) { WSADATA wsaData; @@ -103,4 +103,4 @@ void grpc_set_default_iomgr_platform() { bool grpc_iomgr_run_in_background() { return false; } -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/load_file.cc b/src/core/lib/iomgr/load_file.cc index e292df9d190..01538804f57 100644 --- a/src/core/lib/iomgr/load_file.cc +++ b/src/core/lib/iomgr/load_file.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -46,7 +46,7 @@ grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator, goto end; } fseek(file, 0, SEEK_END); - /* Converting to size_t on the assumption that it will not fail */ + // Converting to size_t on the assumption that it will not fail contents_size = static_cast(ftell(file)); fseek(file, 0, SEEK_SET); contents = static_cast( diff --git a/src/core/lib/iomgr/load_file.h b/src/core/lib/iomgr/load_file.h index a0206e21a35..3ff52ad2eee 100644 --- a/src/core/lib/iomgr/load_file.h +++ b/src/core/lib/iomgr/load_file.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_LOAD_FILE_H #define GRPC_CORE_LIB_IOMGR_LOAD_FILE_H @@ -27,9 +27,9 @@ #include "src/core/lib/iomgr/error.h" -/* Loads the content of a file into a slice. add_null_terminator will add - a NULL terminator if non-zero. */ +// Loads the content of a file into a slice. add_null_terminator will add +// a NULL terminator if non-zero. grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator, grpc_slice* output); -#endif /* GRPC_CORE_LIB_IOMGR_LOAD_FILE_H */ +#endif // GRPC_CORE_LIB_IOMGR_LOAD_FILE_H diff --git a/src/core/lib/iomgr/lockfree_event.cc b/src/core/lib/iomgr/lockfree_event.cc index 9b576cb42ac..62d994a3c6b 100644 --- a/src/core/lib/iomgr/lockfree_event.cc +++ b/src/core/lib/iomgr/lockfree_event.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -27,48 +27,48 @@ extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; -/* 'state' holds the to call when the fd is readable or writable respectively. - It can contain one of the following values: - kClosureReady : The fd has an I/O event of interest but there is no - closure yet to execute +// 'state' holds the to call when the fd is readable or writable respectively. +// It can contain one of the following values: +// kClosureReady : The fd has an I/O event of interest but there is no +// closure yet to execute - kClosureNotReady : The fd has no I/O event of interest +// kClosureNotReady : The fd has no I/O event of interest - closure ptr : The closure to be executed when the fd has an I/O - event of interest +// closure ptr : The closure to be executed when the fd has an I/O +// event of interest - shutdown_error | kShutdownBit : - 'shutdown_error' field ORed with kShutdownBit. - This indicates that the fd is shutdown. Since all - memory allocations are word-aligned, the lower two - bits of the shutdown_error pointer are always 0. So - it is safe to OR these with kShutdownBit +// shutdown_error | kShutdownBit : +// 'shutdown_error' field ORed with kShutdownBit. +// This indicates that the fd is shutdown. Since all +// memory allocations are word-aligned, the lower two +// bits of the shutdown_error pointer are always 0. So +// it is safe to OR these with kShutdownBit - Valid state transitions: +// Valid state transitions: - <-----3------ kClosureNotReady -----1-------> kClosureReady - | | ^ | ^ | | - | | | | | | | - | +--------------4----------+ 6 +---------2---------------+ | - | | | - | v | - +-----5-------> [shutdown_error | kShutdownBit] <-------7---------+ +// <-----3------ kClosureNotReady -----1-------> kClosureReady +// | | ^ | ^ | | +// | | | | | | | +// | +--------------4----------+ 6 +---------2---------------+ | +// | | | +// | v | +// +-----5-------> [shutdown_error | kShutdownBit] <-------7---------+ - For 1, 4 : See SetReady() function - For 2, 3 : See NotifyOn() function - For 5,6,7: See SetShutdown() function */ +// For 1, 4 : See SetReady() function +// For 2, 3 : See NotifyOn() function +// For 5,6,7: See SetShutdown() function namespace grpc_core { LockfreeEvent::LockfreeEvent() { InitEvent(); } void LockfreeEvent::InitEvent() { - /* Perform an atomic store to start the state machine. + // Perform an atomic store to start the state machine. - Note carefully that LockfreeEvent *MAY* be used whilst in a destroyed - state, while a file descriptor is on a freelist. In such a state it may - be SetReady'd, and so we need to perform an atomic operation here to - ensure no races */ + // Note carefully that LockfreeEvent *MAY* be used whilst in a destroyed + // state, while a file descriptor is on a freelist. In such a state it may + // be SetReady'd, and so we need to perform an atomic operation here to + // ensure no races gpr_atm_no_barrier_store(&state_, kClosureNotReady); } @@ -81,19 +81,19 @@ void LockfreeEvent::DestroyEvent() { } else { GPR_ASSERT(curr == kClosureNotReady || curr == kClosureReady); } - /* we CAS in a shutdown, no error value here. If this event is interacted - with post-deletion (see the note in the constructor) we want the bit - pattern to prevent error retention in a deleted object */ + // we CAS in a shutdown, no error value here. If this event is interacted + // with post-deletion (see the note in the constructor) we want the bit + // pattern to prevent error retention in a deleted object } while (!gpr_atm_no_barrier_cas(&state_, curr, kShutdownBit /* shutdown, no error */)); } void LockfreeEvent::NotifyOn(grpc_closure* closure) { while (true) { - /* This load needs to be an acquire load because this can be a shutdown - * error that we might need to reference. Adding acquire semantics makes - * sure that the shutdown error has been initialized properly before us - * referencing it. */ + // This load needs to be an acquire load because this can be a shutdown + // error that we might need to reference. Adding acquire semantics makes + // sure that the shutdown error has been initialized properly before us + // referencing it. gpr_atm curr = gpr_atm_acq_load(&state_); if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) { gpr_log(GPR_DEBUG, @@ -102,42 +102,42 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) { } switch (curr) { case kClosureNotReady: { - /* kClosureNotReady -> . + // kClosureNotReady -> . - We're guaranteed by API that there's an acquire barrier before here, - so there's no need to double-dip and this can be a release-only. + // We're guaranteed by API that there's an acquire barrier before here, + // so there's no need to double-dip and this can be a release-only. - The release itself pairs with the acquire half of a set_ready full - barrier. */ + // The release itself pairs with the acquire half of a set_ready full + // barrier. if (gpr_atm_rel_cas(&state_, kClosureNotReady, reinterpret_cast(closure))) { - return; /* Successful. Return */ + return; // Successful. Return } - break; /* retry */ + break; // retry } case kClosureReady: { - /* Change the state to kClosureNotReady. Schedule the closure if - successful. If not, the state most likely transitioned to shutdown. - We should retry. - - This can be a no-barrier cas since the state is being transitioned to - kClosureNotReady; set_ready and set_shutdown do not schedule any - closure when transitioning out of CLOSURE_NO_READY state (i.e there - is no other code that needs to 'happen-after' this) */ + // Change the state to kClosureNotReady. Schedule the closure if + // successful. If not, the state most likely transitioned to shutdown. + // We should retry. + + // This can be a no-barrier cas since the state is being transitioned to + // kClosureNotReady; set_ready and set_shutdown do not schedule any + // closure when transitioning out of CLOSURE_NO_READY state (i.e there + // is no other code that needs to 'happen-after' this) if (gpr_atm_no_barrier_cas(&state_, kClosureReady, kClosureNotReady)) { ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus()); - return; /* Successful. Return */ + return; // Successful. Return } - break; /* retry */ + break; // retry } default: { - /* 'curr' is either a closure or the fd is shutdown(in which case 'curr' - contains a pointer to the shutdown-error). If the fd is shutdown, - schedule the closure with the shutdown error */ + // 'curr' is either a closure or the fd is shutdown(in which case 'curr' + // contains a pointer to the shutdown-error). If the fd is shutdown, + // schedule the closure with the shutdown error if ((curr & kShutdownBit) > 0) { grpc_error_handle shutdown_err = internal::StatusGetFromHeapPtr(curr & ~kShutdownBit); @@ -147,7 +147,7 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) { return; } - /* There is already a closure!. This indicates a bug in the code */ + // There is already a closure!. This indicates a bug in the code gpr_log(GPR_ERROR, "LockfreeEvent::NotifyOn: notify_on called with a previous " "callback still pending"); @@ -173,27 +173,27 @@ bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) { switch (curr) { case kClosureReady: case kClosureNotReady: - /* Need a full barrier here so that the initial load in notify_on - doesn't need a barrier */ + // Need a full barrier here so that the initial load in notify_on + // doesn't need a barrier if (gpr_atm_full_cas(&state_, curr, new_state)) { - return true; /* early out */ + return true; // early out } - break; /* retry */ + break; // retry default: { - /* 'curr' is either a closure or the fd is already shutdown */ + // 'curr' is either a closure or the fd is already shutdown - /* If fd is already shutdown, we are done */ + // If fd is already shutdown, we are done if ((curr & kShutdownBit) > 0) { internal::StatusFreeHeapPtr(status_ptr); return false; } - /* Fd is not shutdown. Schedule the closure and move the state to - shutdown state. - Needs an acquire to pair with setting the closure (and get a - happens-after on that edge), and a release to pair with anything - loading the shutdown state. */ + // Fd is not shutdown. Schedule the closure and move the state to + // shutdown state. + // Needs an acquire to pair with setting the closure (and get a + // happens-after on that edge), and a release to pair with anything + // loading the shutdown state. if (gpr_atm_full_cas(&state_, curr, new_state)) { ExecCtx::Run( DEBUG_LOCATION, reinterpret_cast(curr), @@ -201,8 +201,8 @@ bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) { return true; } - /* 'curr' was a closure but now changed to a different state. We will - have to retry */ + // 'curr' was a closure but now changed to a different state. We will + // have to retry break; } } @@ -222,36 +222,36 @@ void LockfreeEvent::SetReady() { switch (curr) { case kClosureReady: { - /* Already ready. We are done here */ + // Already ready. We are done here return; } case kClosureNotReady: { - /* No barrier required as we're transitioning to a state that does not - involve a closure */ + // No barrier required as we're transitioning to a state that does not + // involve a closure if (gpr_atm_no_barrier_cas(&state_, kClosureNotReady, kClosureReady)) { - return; /* early out */ + return; // early out } - break; /* retry */ + break; // retry } default: { - /* 'curr' is either a closure or the fd is shutdown */ + // 'curr' is either a closure or the fd is shutdown if ((curr & kShutdownBit) > 0) { - /* The fd is shutdown. Do nothing */ + // The fd is shutdown. Do nothing return; } - /* Full cas: acquire pairs with this cas' release in the event of a - spurious set_ready; release pairs with this or the acquire in - notify_on (or set_shutdown) */ + // Full cas: acquire pairs with this cas' release in the event of a + // spurious set_ready; release pairs with this or the acquire in + // notify_on (or set_shutdown) else if (gpr_atm_full_cas(&state_, curr, kClosureNotReady)) { ExecCtx::Run(DEBUG_LOCATION, reinterpret_cast(curr), absl::OkStatus()); return; } - /* else the state changed again (only possible by either a racing - set_ready or set_shutdown functions. In both these cases, the closure - would have been scheduled for execution. So we are done here */ + // else the state changed again (only possible by either a racing + // set_ready or set_shutdown functions. In both these cases, the closure + // would have been scheduled for execution. So we are done here return; } } diff --git a/src/core/lib/iomgr/lockfree_event.h b/src/core/lib/iomgr/lockfree_event.h index 944f364b422..0cad3ed5499 100644 --- a/src/core/lib/iomgr/lockfree_event.h +++ b/src/core/lib/iomgr/lockfree_event.h @@ -1,25 +1,25 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H #define GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H -/* Lock free event notification for file descriptors */ +// Lock free event notification for file descriptors #include @@ -69,4 +69,4 @@ class LockfreeEvent { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H */ +#endif // GRPC_CORE_LIB_IOMGR_LOCKFREE_EVENT_H diff --git a/src/core/lib/iomgr/nameser.h b/src/core/lib/iomgr/nameser.h index 22a00cdab8b..c6f314f5f68 100644 --- a/src/core/lib/iomgr/nameser.h +++ b/src/core/lib/iomgr/nameser.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_NAMESER_H #define GRPC_CORE_LIB_IOMGR_NAMESER_H @@ -27,80 +27,80 @@ #include -#else /* GRPC_HAVE_ARPA_NAMESER */ +#else // GRPC_HAVE_ARPA_NAMESER typedef enum __ns_class { - ns_c_invalid = 0, /* Cookie. */ - ns_c_in = 1, /* Internet. */ - ns_c_2 = 2, /* unallocated/unsupported. */ - ns_c_chaos = 3, /* MIT Chaos-net. */ - ns_c_hs = 4, /* MIT Hesiod. */ - /* Query class values which do not appear in resource records */ - ns_c_none = 254, /* for prereq. sections in update requests */ - ns_c_any = 255, /* Wildcard match. */ + ns_c_invalid = 0, // Cookie. + ns_c_in = 1, // Internet. + ns_c_2 = 2, // unallocated/unsupported. + ns_c_chaos = 3, // MIT Chaos-net. + ns_c_hs = 4, // MIT Hesiod. + // Query class values which do not appear in resource records + ns_c_none = 254, // for prereq. sections in update requests + ns_c_any = 255, // Wildcard match. ns_c_max = 65536 } ns_class; typedef enum __ns_type { - ns_t_invalid = 0, /* Cookie. */ - ns_t_a = 1, /* Host address. */ - ns_t_ns = 2, /* Authoritative server. */ - ns_t_md = 3, /* Mail destination. */ - ns_t_mf = 4, /* Mail forwarder. */ - ns_t_cname = 5, /* Canonical name. */ - ns_t_soa = 6, /* Start of authority zone. */ - ns_t_mb = 7, /* Mailbox domain name. */ - ns_t_mg = 8, /* Mail group member. */ - ns_t_mr = 9, /* Mail rename name. */ - ns_t_null = 10, /* Null resource record. */ - ns_t_wks = 11, /* Well known service. */ - ns_t_ptr = 12, /* Domain name pointer. */ - ns_t_hinfo = 13, /* Host information. */ - ns_t_minfo = 14, /* Mailbox information. */ - ns_t_mx = 15, /* Mail routing information. */ - ns_t_txt = 16, /* Text strings. */ - ns_t_rp = 17, /* Responsible person. */ - ns_t_afsdb = 18, /* AFS cell database. */ - ns_t_x25 = 19, /* X_25 calling address. */ - ns_t_isdn = 20, /* ISDN calling address. */ - ns_t_rt = 21, /* Router. */ - ns_t_nsap = 22, /* NSAP address. */ - ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ - ns_t_sig = 24, /* Security signature. */ - ns_t_key = 25, /* Security key. */ - ns_t_px = 26, /* X.400 mail mapping. */ - ns_t_gpos = 27, /* Geographical position (withdrawn). */ - ns_t_aaaa = 28, /* Ip6 Address. */ - ns_t_loc = 29, /* Location Information. */ - ns_t_nxt = 30, /* Next domain (security). */ - ns_t_eid = 31, /* Endpoint identifier. */ - ns_t_nimloc = 32, /* Nimrod Locator. */ - ns_t_srv = 33, /* Server Selection. */ - ns_t_atma = 34, /* ATM Address */ - ns_t_naptr = 35, /* Naming Authority PoinTeR */ - ns_t_kx = 36, /* Key Exchange */ - ns_t_cert = 37, /* Certification record */ - ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ - ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ - ns_t_sink = 40, /* Kitchen sink (experimentatl) */ - ns_t_opt = 41, /* EDNS0 option (meta-RR) */ - ns_t_apl = 42, /* Address prefix list (RFC3123) */ - ns_t_ds = 43, /* Delegation Signer (RFC4034) */ - ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ - ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ - ns_t_nsec = 47, /* Next Secure (RFC4034) */ - ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ - ns_t_tkey = 249, /* Transaction key */ - ns_t_tsig = 250, /* Transaction signature. */ - ns_t_ixfr = 251, /* Incremental zone transfer. */ - ns_t_axfr = 252, /* Transfer zone of authority. */ - ns_t_mailb = 253, /* Transfer mailbox records. */ - ns_t_maila = 254, /* Transfer mail agent records. */ - ns_t_any = 255, /* Wildcard match. */ - ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ + ns_t_invalid = 0, // Cookie. + ns_t_a = 1, // Host address. + ns_t_ns = 2, // Authoritative server. + ns_t_md = 3, // Mail destination. + ns_t_mf = 4, // Mail forwarder. + ns_t_cname = 5, // Canonical name. + ns_t_soa = 6, // Start of authority zone. + ns_t_mb = 7, // Mailbox domain name. + ns_t_mg = 8, // Mail group member. + ns_t_mr = 9, // Mail rename name. + ns_t_null = 10, // Null resource record. + ns_t_wks = 11, // Well known service. + ns_t_ptr = 12, // Domain name pointer. + ns_t_hinfo = 13, // Host information. + ns_t_minfo = 14, // Mailbox information. + ns_t_mx = 15, // Mail routing information. + ns_t_txt = 16, // Text strings. + ns_t_rp = 17, // Responsible person. + ns_t_afsdb = 18, // AFS cell database. + ns_t_x25 = 19, // X_25 calling address. + ns_t_isdn = 20, // ISDN calling address. + ns_t_rt = 21, // Router. + ns_t_nsap = 22, // NSAP address. + ns_t_nsap_ptr = 23, // Reverse NSAP lookup (deprecated). + ns_t_sig = 24, // Security signature. + ns_t_key = 25, // Security key. + ns_t_px = 26, // X.400 mail mapping. + ns_t_gpos = 27, // Geographical position (withdrawn). + ns_t_aaaa = 28, // Ip6 Address. + ns_t_loc = 29, // Location Information. + ns_t_nxt = 30, // Next domain (security). + ns_t_eid = 31, // Endpoint identifier. + ns_t_nimloc = 32, // Nimrod Locator. + ns_t_srv = 33, // Server Selection. + ns_t_atma = 34, // ATM Address + ns_t_naptr = 35, // Naming Authority PoinTeR + ns_t_kx = 36, // Key Exchange + ns_t_cert = 37, // Certification record + ns_t_a6 = 38, // IPv6 address (deprecates AAAA) + ns_t_dname = 39, // Non-terminal DNAME (for IPv6) + ns_t_sink = 40, // Kitchen sink (experimentatl) + ns_t_opt = 41, // EDNS0 option (meta-RR) + ns_t_apl = 42, // Address prefix list (RFC3123) + ns_t_ds = 43, // Delegation Signer (RFC4034) + ns_t_sshfp = 44, // SSH Key Fingerprint (RFC4255) + ns_t_rrsig = 46, // Resource Record Signature (RFC4034) + ns_t_nsec = 47, // Next Secure (RFC4034) + ns_t_dnskey = 48, // DNS Public Key (RFC4034) + ns_t_tkey = 249, // Transaction key + ns_t_tsig = 250, // Transaction signature. + ns_t_ixfr = 251, // Incremental zone transfer. + ns_t_axfr = 252, // Transfer zone of authority. + ns_t_mailb = 253, // Transfer mailbox records. + ns_t_maila = 254, // Transfer mail agent records. + ns_t_any = 255, // Wildcard match. + ns_t_zxfr = 256, // BIND-specific, nonstandard. ns_t_max = 65536 } ns_type; -#endif /* GRPC_HAVE_ARPA_NAMESER */ +#endif // GRPC_HAVE_ARPA_NAMESER -#endif /* GRPC_CORE_LIB_IOMGR_NAMESER_H */ +#endif // GRPC_CORE_LIB_IOMGR_NAMESER_H diff --git a/src/core/lib/iomgr/polling_entity.cc b/src/core/lib/iomgr/polling_entity.cc index 0c1788a6938..445f26606d0 100644 --- a/src/core/lib/iomgr/polling_entity.cc +++ b/src/core/lib/iomgr/polling_entity.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/iomgr/polling_entity.h b/src/core/lib/iomgr/polling_entity.h index e177176d614..e0c2fb89c0a 100644 --- a/src/core/lib/iomgr/polling_entity.h +++ b/src/core/lib/iomgr/polling_entity.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H #define GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H @@ -31,9 +31,9 @@ typedef enum grpc_pollset_tag { GRPC_POLLS_POLLSET_SET } grpc_pollset_tag; -/* A grpc_polling_entity is a pollset-or-pollset_set container. It allows - * functions that accept a pollset XOR a pollset_set to do so through an - * abstract interface. No ownership is taken. */ +// A grpc_polling_entity is a pollset-or-pollset_set container. It allows +// functions that accept a pollset XOR a pollset_set to do so through an +// abstract interface. No ownership is taken. struct grpc_polling_entity { union { @@ -48,21 +48,21 @@ grpc_polling_entity grpc_polling_entity_create_from_pollset_set( grpc_polling_entity grpc_polling_entity_create_from_pollset( grpc_pollset* pollset); -/** If \a pollent contains a pollset, return it. Otherwise, return NULL */ +/// If \a pollent contains a pollset, return it. Otherwise, return NULL grpc_pollset* grpc_polling_entity_pollset(grpc_polling_entity* pollent); -/** If \a pollent contains a pollset_set, return it. Otherwise, return NULL */ +/// If \a pollent contains a pollset_set, return it. Otherwise, return NULL grpc_pollset_set* grpc_polling_entity_pollset_set(grpc_polling_entity* pollent); bool grpc_polling_entity_is_empty(const grpc_polling_entity* pollent); -/** Add the pollset or pollset_set in \a pollent to the destination pollset_set - * \a * pss_dst */ +/// Add the pollset or pollset_set in \a pollent to the destination pollset_set +///\a * pss_dst void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent, grpc_pollset_set* pss_dst); -/** Delete the pollset or pollset_set in \a pollent from the destination - * pollset_set \a * pss_dst */ +/// Delete the pollset or pollset_set in \a pollent from the destination +/// pollset_set \a * pss_dst void grpc_polling_entity_del_from_pollset_set(grpc_polling_entity* pollent, grpc_pollset_set* pss_dst); @@ -71,4 +71,4 @@ template <> struct ContextType {}; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */ +#endif // GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H diff --git a/src/core/lib/iomgr/pollset.cc b/src/core/lib/iomgr/pollset.cc index ae9ab6cf6e6..64a75372849 100644 --- a/src/core/lib/iomgr/pollset.cc +++ b/src/core/lib/iomgr/pollset.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/pollset.h b/src/core/lib/iomgr/pollset.h index 8d58847aed4..e2aa62e7a8d 100644 --- a/src/core/lib/iomgr/pollset.h +++ b/src/core/lib/iomgr/pollset.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_H #define GRPC_CORE_LIB_IOMGR_POLLSET_H @@ -29,12 +29,12 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_fd_refcount; -/* A grpc_pollset is a set of file descriptors that a higher level item is - interested in. For example: - - a server will typically keep a pollset containing all connected channels, - so that it can find new calls to service - - a completion queue might keep a pollset with an entry for each transport - that is servicing a call that it's tracking */ +// A grpc_pollset is a set of file descriptors that a higher level item is +// interested in. For example: +// - a server will typically keep a pollset containing all connected channels, +// so that it can find new calls to service +// - a completion queue might keep a pollset with an entry for each transport +// that is servicing a call that it's tracking typedef struct grpc_pollset_worker grpc_pollset_worker; @@ -57,43 +57,43 @@ void grpc_pollset_global_init(void); void grpc_pollset_global_shutdown(void); size_t grpc_pollset_size(void); -/* Initialize a pollset: assumes *pollset contains all zeros */ +// Initialize a pollset: assumes *pollset contains all zeros void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu); -/* Begin shutting down the pollset, and call closure when done. - * pollset's mutex must be held */ +// Begin shutting down the pollset, and call closure when done. +// pollset's mutex must be held void grpc_pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure); void grpc_pollset_destroy(grpc_pollset* pollset); -/* Do some work on a pollset. - May involve invoking asynchronous callbacks, or actually polling file - descriptors. - Requires pollset's mutex locked. - May unlock its mutex during its execution. - - worker is a (platform-specific) handle that can be used to wake up - from grpc_pollset_work before any events are received and before the timeout - has expired. It is both initialized and destroyed by grpc_pollset_work. - Initialization of worker is guaranteed to occur BEFORE the - pollset's mutex is released for the first time by grpc_pollset_work - and it is guaranteed that it will not be released by grpc_pollset_work - AFTER worker has been destroyed. - - It's legal for worker to be NULL: in that case, this specific thread can not - be directly woken with a kick, but maybe be indirectly (with a kick against - the pollset as a whole). - - Tries not to block past deadline. - May call grpc_closure_list_run on grpc_closure_list, without holding the - pollset - lock */ +// Do some work on a pollset. +// May involve invoking asynchronous callbacks, or actually polling file +// descriptors. +// Requires pollset's mutex locked. +// May unlock its mutex during its execution. + +// worker is a (platform-specific) handle that can be used to wake up +// from grpc_pollset_work before any events are received and before the timeout +// has expired. It is both initialized and destroyed by grpc_pollset_work. +// Initialization of worker is guaranteed to occur BEFORE the +// pollset's mutex is released for the first time by grpc_pollset_work +// and it is guaranteed that it will not be released by grpc_pollset_work +// AFTER worker has been destroyed. + +// It's legal for worker to be NULL: in that case, this specific thread can not +// be directly woken with a kick, but maybe be indirectly (with a kick against +// the pollset as a whole). + +// Tries not to block past deadline. +// May call grpc_closure_list_run on grpc_closure_list, without holding the +// pollset +// lock grpc_error_handle grpc_pollset_work( grpc_pollset* pollset, grpc_pollset_worker** worker, grpc_core::Timestamp deadline) GRPC_MUST_USE_RESULT; -/* Break one polling thread out of polling work for this pollset. - If specific_worker is non-NULL, then kick that worker. */ +// Break one polling thread out of polling work for this pollset. +// If specific_worker is non-NULL, then kick that worker. grpc_error_handle grpc_pollset_kick(grpc_pollset* pollset, grpc_pollset_worker* specific_worker) GRPC_MUST_USE_RESULT; -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_H */ +#endif // GRPC_CORE_LIB_IOMGR_POLLSET_H diff --git a/src/core/lib/iomgr/pollset_set.cc b/src/core/lib/iomgr/pollset_set.cc index 42a647a7376..95efc8380f7 100644 --- a/src/core/lib/iomgr/pollset_set.cc +++ b/src/core/lib/iomgr/pollset_set.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/pollset_set.h b/src/core/lib/iomgr/pollset_set.h index abc1189f246..d236b389ecd 100644 --- a/src/core/lib/iomgr/pollset_set.h +++ b/src/core/lib/iomgr/pollset_set.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_SET_H #define GRPC_CORE_LIB_IOMGR_POLLSET_SET_H @@ -23,10 +23,10 @@ #include "src/core/lib/iomgr/iomgr_fwd.h" -/* A grpc_pollset_set is a set of pollsets that are interested in an - action. Adding a pollset to a pollset_set automatically adds any - fd's (etc) that have been registered with the set_set to that pollset. - Registering fd's automatically adds them to all current pollsets. */ +// A grpc_pollset_set is a set of pollsets that are interested in an +// action. Adding a pollset to a pollset_set automatically adds any +// fd's (etc) that have been registered with the set_set to that pollset. +// Registering fd's automatically adds them to all current pollsets. typedef struct grpc_pollset_set_vtable { grpc_pollset_set* (*create)(void); @@ -50,4 +50,4 @@ void grpc_pollset_set_add_pollset_set(grpc_pollset_set* bag, void grpc_pollset_set_del_pollset_set(grpc_pollset_set* bag, grpc_pollset_set* item); -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_H */ +#endif // GRPC_CORE_LIB_IOMGR_POLLSET_SET_H diff --git a/src/core/lib/iomgr/pollset_set_windows.cc b/src/core/lib/iomgr/pollset_set_windows.cc index 1b105a2453b..dc28d520d6d 100644 --- a/src/core/lib/iomgr/pollset_set_windows.cc +++ b/src/core/lib/iomgr/pollset_set_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -49,4 +49,4 @@ grpc_pollset_set_vtable grpc_windows_pollset_set_vtable = { pollset_set_add_pollset, pollset_set_del_pollset, pollset_set_add_pollset_set, pollset_set_del_pollset_set}; -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/pollset_set_windows.h b/src/core/lib/iomgr/pollset_set_windows.h index 5ac9d1823bd..1718ce7d97f 100644 --- a/src/core/lib/iomgr/pollset_set_windows.h +++ b/src/core/lib/iomgr/pollset_set_windows.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_SET_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_POLLSET_SET_WINDOWS_H @@ -23,4 +23,4 @@ #include "src/core/lib/iomgr/pollset_set.h" -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_SET_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_POLLSET_SET_WINDOWS_H diff --git a/src/core/lib/iomgr/pollset_windows.cc b/src/core/lib/iomgr/pollset_windows.cc index 795285549df..447e3857812 100644 --- a/src/core/lib/iomgr/pollset_windows.cc +++ b/src/core/lib/iomgr/pollset_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -82,10 +82,10 @@ static void push_front_worker(grpc_pollset_worker* root, static size_t pollset_size(void) { return sizeof(grpc_pollset); } -/* There isn't really any such thing as a pollset under Windows, due to the - nature of the IO completion ports. We're still going to provide a minimal - set of features for the sake of the rest of grpc. But grpc_pollset_work - won't actually do any polling, and return as quickly as possible. */ +// There isn't really any such thing as a pollset under Windows, due to the +// nature of the IO completion ports. We're still going to provide a minimal +// set of features for the sake of the rest of grpc. But grpc_pollset_work +// won't actually do any polling, and return as quickly as possible. static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { *mu = &grpc_polling_mu; @@ -123,7 +123,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, if (!pollset->kicked_without_pollers && !pollset->shutting_down) { if (g_active_poller == NULL) { grpc_pollset_worker* next_worker; - /* become poller */ + // become poller pollset->is_iocp_worker = 1; g_active_poller = &worker; gpr_mu_unlock(&grpc_polling_mu); @@ -132,11 +132,11 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset, gpr_mu_lock(&grpc_polling_mu); pollset->is_iocp_worker = 0; g_active_poller = NULL; - /* try to get a worker from this pollsets worker list */ + // try to get a worker from this pollsets worker list next_worker = pop_front_worker(&pollset->root_worker, GRPC_POLLSET_WORKER_LINK_POLLSET); if (next_worker == NULL) { - /* try to get a worker from the global list */ + // try to get a worker from the global list next_worker = pop_front_worker(&g_global_root_worker, GRPC_POLLSET_WORKER_LINK_GLOBAL); } @@ -240,4 +240,4 @@ grpc_pollset_vtable grpc_windows_pollset_vtable = { pollset_destroy, pollset_work, pollset_kick, pollset_size}; -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/pollset_windows.h b/src/core/lib/iomgr/pollset_windows.h index e89758c6941..54de6c7c623 100644 --- a/src/core/lib/iomgr/pollset_windows.h +++ b/src/core/lib/iomgr/pollset_windows.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H @@ -28,10 +28,10 @@ #ifdef GRPC_WINSOCK_SOCKET #include "src/core/lib/iomgr/socket_windows.h" -/* There isn't really any such thing as a pollset under Windows, due to the - nature of the IO completion ports. A Windows "pollset" is merely a mutex - used to synchronize with the IOCP, and workers are condition variables - used to block threads until work is ready. */ +// There isn't really any such thing as a pollset under Windows, due to the +// nature of the IO completion ports. A Windows "pollset" is merely a mutex +// used to synchronize with the IOCP, and workers are condition variables +// used to block threads until work is ready. typedef enum { GRPC_POLLSET_WORKER_LINK_POLLSET = 0, @@ -67,4 +67,4 @@ void grpc_pollset_global_shutdown(void); #endif -#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_POLLSET_WINDOWS_H diff --git a/src/core/lib/iomgr/port.h b/src/core/lib/iomgr/port.h index 65015b6ba53..743bc1ef51e 100644 --- a/src/core/lib/iomgr/port.h +++ b/src/core/lib/iomgr/port.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_PORT_H #define GRPC_CORE_LIB_IOMGR_PORT_H @@ -23,8 +23,8 @@ // IWYU pragma: no_include // IWYU pragma: no_include -/* This needs to be separate from the other conditions because it needs to - * apply to custom sockets too */ +// This needs to be separate from the other conditions because it needs to +// apply to custom sockets too #ifdef GPR_WINDOWS #define GRPC_ARES_RESOLVE_LOCALHOST_MANUALLY 1 #endif @@ -48,14 +48,14 @@ #define GRPC_HAVE_IP_PKTINFO 1 #define GRPC_HAVE_MSG_NOSIGNAL 1 #define GRPC_HAVE_UNIX_SOCKET 1 -/* Linux has TCP_INQ support since 4.18, but it is safe to set - the socket option on older kernels. */ +// Linux has TCP_INQ support since 4.18, but it is safe to set +// the socket option on older kernels. #define GRPC_HAVE_TCP_INQ 1 #ifdef LINUX_VERSION_CODE #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) #define GRPC_LINUX_ERRQUEUE 1 -#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) */ -#endif /* LINUX_VERSION_CODE */ +#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) +#endif // LINUX_VERSION_CODE #define GRPC_LINUX_MULTIPOLL_WITH_EPOLL 1 #define GRPC_POSIX_FORK 1 #define GRPC_POSIX_HOST_NAME_MAX 1 @@ -73,12 +73,12 @@ #define GRPC_LINUX_SOCKETUTILS 1 #endif #if !(__GLIBC_PREREQ(2, 18)) -/* - * TCP_USER_TIMEOUT wasn't imported to glibc until 2.18. Use Linux system - * header instead. - */ +// +// TCP_USER_TIMEOUT wasn't imported to glibc until 2.18. Use Linux system +// header instead. +// #define GRPC_LINUX_TCP_H 1 -#endif /* __GLIBC_PREREQ(2, 17) */ +#endif // __GLIBC_PREREQ(2, 17) #endif #ifndef __GLIBC__ #define GRPC_LINUX_EPOLL 1 @@ -235,4 +235,4 @@ #define GRPC_GETHOSTNAME_FALLBACK 1 #endif -#endif /* GRPC_CORE_LIB_IOMGR_PORT_H */ +#endif // GRPC_CORE_LIB_IOMGR_PORT_H diff --git a/src/core/lib/iomgr/python_util.h b/src/core/lib/iomgr/python_util.h index 2df411ef662..e4cb1048998 100644 --- a/src/core/lib/iomgr/python_util.h +++ b/src/core/lib/iomgr/python_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_PYTHON_UTIL_H #define GRPC_CORE_LIB_IOMGR_PYTHON_UTIL_H diff --git a/src/core/lib/iomgr/resolve_address.cc b/src/core/lib/iomgr/resolve_address.cc index 3c87223eb01..eb040249c36 100644 --- a/src/core/lib/iomgr/resolve_address.cc +++ b/src/core/lib/iomgr/resolve_address.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include "src/core/lib/iomgr/resolve_address.h" diff --git a/src/core/lib/iomgr/resolve_address.h b/src/core/lib/iomgr/resolve_address.h index 8654f27702d..069446e423c 100644 --- a/src/core/lib/iomgr/resolve_address.h +++ b/src/core/lib/iomgr/resolve_address.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H #define GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H @@ -113,4 +113,4 @@ std::shared_ptr GetDNSResolver(); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */ +#endif // GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H diff --git a/src/core/lib/iomgr/resolve_address_impl.h b/src/core/lib/iomgr/resolve_address_impl.h index fa8ed6f1c3e..3f9f1e21fc8 100644 --- a/src/core/lib/iomgr/resolve_address_impl.h +++ b/src/core/lib/iomgr/resolve_address_impl.h @@ -56,4 +56,4 @@ class DNSCallbackExecCtxScheduler { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_IMPL_H */ +#endif // GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_IMPL_H diff --git a/src/core/lib/iomgr/resolve_address_posix.cc b/src/core/lib/iomgr/resolve_address_posix.cc index 516e2545eae..9d7f5374c83 100644 --- a/src/core/lib/iomgr/resolve_address_posix.cc +++ b/src/core/lib/iomgr/resolve_address_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -119,9 +119,9 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name, } // Call getaddrinfo memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */ - hints.ai_socktype = SOCK_STREAM; /* stream socket */ - hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */ + hints.ai_family = AF_UNSPEC; // ipv4 or ipv6 + hints.ai_socktype = SOCK_STREAM; // stream socket + hints.ai_flags = AI_PASSIVE; // for wildcard IP address GRPC_SCHEDULING_START_BLOCKING_REGION; s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result); GRPC_SCHEDULING_END_BLOCKING_REGION; diff --git a/src/core/lib/iomgr/resolve_address_windows.cc b/src/core/lib/iomgr/resolve_address_windows.cc index dfda9177bcb..19467f1903f 100644 --- a/src/core/lib/iomgr/resolve_address_windows.cc +++ b/src/core/lib/iomgr/resolve_address_windows.cc @@ -123,9 +123,9 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name, // Call getaddrinfo memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */ - hints.ai_socktype = SOCK_STREAM; /* stream socket */ - hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */ + hints.ai_family = AF_UNSPEC; // ipv4 or ipv6 + hints.ai_socktype = SOCK_STREAM; // stream socket + hints.ai_flags = AI_PASSIVE; // for wildcard IP address GRPC_SCHEDULING_START_BLOCKING_REGION; s = getaddrinfo(host.c_str(), port.c_str(), &hints, &result); diff --git a/src/core/lib/iomgr/resolved_address.h b/src/core/lib/iomgr/resolved_address.h index 9ca8c262998..0b788e2cc8d 100644 --- a/src/core/lib/iomgr/resolved_address.h +++ b/src/core/lib/iomgr/resolved_address.h @@ -36,4 +36,4 @@ struct grpc_resolved_address { socklen_t len; }; -#endif /* GRPC_CORE_LIB_IOMGR_RESOLVED_ADDRESS_H */ +#endif // GRPC_CORE_LIB_IOMGR_RESOLVED_ADDRESS_H diff --git a/src/core/lib/iomgr/sockaddr.h b/src/core/lib/iomgr/sockaddr.h index 7d10ab31895..0ac72037544 100644 --- a/src/core/lib/iomgr/sockaddr.h +++ b/src/core/lib/iomgr/sockaddr.h @@ -1,24 +1,24 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This header transitively includes other headers that care about include - * order, so it should be included first. As a consequence, it should not be - * included in any other header. */ +// This header transitively includes other headers that care about include +// order, so it should be included first. As a consequence, it should not be +// included in any other header. #ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_H #define GRPC_CORE_LIB_IOMGR_SOCKADDR_H @@ -29,4 +29,4 @@ #include "src/core/lib/iomgr/sockaddr_posix.h" // IWYU pragma: export #include "src/core/lib/iomgr/sockaddr_windows.h" // IWYU pragma: export -#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKADDR_H diff --git a/src/core/lib/iomgr/sockaddr_posix.h b/src/core/lib/iomgr/sockaddr_posix.h index 4909806aae7..075c79322ba 100644 --- a/src/core/lib/iomgr/sockaddr_posix.h +++ b/src/core/lib/iomgr/sockaddr_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H #define GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H @@ -54,4 +54,4 @@ typedef struct in6_addr grpc_in6_addr; #endif -#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKADDR_POSIX_H diff --git a/src/core/lib/iomgr/sockaddr_utils_posix.cc b/src/core/lib/iomgr/sockaddr_utils_posix.cc index 8936d6e5f73..4fed986316b 100644 --- a/src/core/lib/iomgr/sockaddr_utils_posix.cc +++ b/src/core/lib/iomgr/sockaddr_utils_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/sockaddr_windows.h b/src/core/lib/iomgr/sockaddr_windows.h index 45aacbf76e0..c367ec12e76 100644 --- a/src/core/lib/iomgr/sockaddr_windows.h +++ b/src/core/lib/iomgr/sockaddr_windows.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H @@ -54,4 +54,4 @@ typedef struct in6_addr grpc_in6_addr; #endif -#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H diff --git a/src/core/lib/iomgr/socket_factory_posix.cc b/src/core/lib/iomgr/socket_factory_posix.cc index 569c7ef4a92..0b511356a97 100644 --- a/src/core/lib/iomgr/socket_factory_posix.cc +++ b/src/core/lib/iomgr/socket_factory_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/iomgr/socket_factory_posix.h b/src/core/lib/iomgr/socket_factory_posix.h index eb14f093762..09e9f71b421 100644 --- a/src/core/lib/iomgr/socket_factory_posix.h +++ b/src/core/lib/iomgr/socket_factory_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKET_FACTORY_POSIX_H #define GRPC_CORE_LIB_IOMGR_SOCKET_FACTORY_POSIX_H @@ -26,44 +26,44 @@ #include "src/core/lib/iomgr/resolve_address.h" -/** The virtual table of grpc_socket_factory */ +/// The virtual table of grpc_socket_factory struct grpc_socket_factory_vtable { - /** Replacement for socket(2) */ + /// Replacement for socket(2) int (*socket)(grpc_socket_factory* factory, int domain, int type, int protocol); - /** Replacement for bind(2) */ + /// Replacement for bind(2) int (*bind)(grpc_socket_factory* factory, int sockfd, const grpc_resolved_address* addr); - /** Compare socket factory \a a and \a b */ + /// Compare socket factory \a a and \a b int (*compare)(grpc_socket_factory* a, grpc_socket_factory* b); - /** Destroys the socket factory instance */ + /// Destroys the socket factory instance void (*destroy)(grpc_socket_factory* factory); }; -/** The Socket Factory interface allows changes on socket options */ +/// The Socket Factory interface allows changes on socket options struct grpc_socket_factory { const grpc_socket_factory_vtable* vtable; gpr_refcount refcount; }; -/** called by concrete implementations to initialize the base struct */ +/// called by concrete implementations to initialize the base struct void grpc_socket_factory_init(grpc_socket_factory* factory, const grpc_socket_factory_vtable* vtable); -/** Wrap \a factory as a grpc_arg */ +/// Wrap \a factory as a grpc_arg grpc_arg grpc_socket_factory_to_arg(grpc_socket_factory* factory); -/** Perform the equivalent of a socket(2) operation using \a factory */ +/// Perform the equivalent of a socket(2) operation using \a factory int grpc_socket_factory_socket(grpc_socket_factory* factory, int domain, int type, int protocol); -/** Perform the equivalent of a bind(2) operation using \a factory */ +/// Perform the equivalent of a bind(2) operation using \a factory int grpc_socket_factory_bind(grpc_socket_factory* factory, int sockfd, const grpc_resolved_address* addr); -/** Compare if \a a and \a b are the same factory or have same settings */ +/// Compare if \a a and \a b are the same factory or have same settings int grpc_socket_factory_compare(grpc_socket_factory* a, grpc_socket_factory* b); grpc_socket_factory* grpc_socket_factory_ref(grpc_socket_factory* factory); void grpc_socket_factory_unref(grpc_socket_factory* factory); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_FACTORY_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKET_FACTORY_POSIX_H diff --git a/src/core/lib/iomgr/socket_mutator.cc b/src/core/lib/iomgr/socket_mutator.cc index 882ba7a88e4..d0ba2887d53 100644 --- a/src/core/lib/iomgr/socket_mutator.cc +++ b/src/core/lib/iomgr/socket_mutator.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/socket_mutator.h b/src/core/lib/iomgr/socket_mutator.h index 81f6d5fbba5..95500438dc2 100644 --- a/src/core/lib/iomgr/socket_mutator.h +++ b/src/core/lib/iomgr/socket_mutator.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKET_MUTATOR_H #define GRPC_CORE_LIB_IOMGR_SOCKET_MUTATOR_H @@ -26,59 +26,59 @@ #include #include -/** How is an fd to be used? */ +/// How is an fd to be used? typedef enum { - /** Used for client connection */ + /// Used for client connection GRPC_FD_CLIENT_CONNECTION_USAGE, - /** Used for server listening */ + /// Used for server listening GRPC_FD_SERVER_LISTENER_USAGE, - /** Used for server connection */ + /// Used for server connection GRPC_FD_SERVER_CONNECTION_USAGE, } grpc_fd_usage; -/** Information about an fd to mutate */ +/// Information about an fd to mutate typedef struct { - /** File descriptor to mutate */ + /// File descriptor to mutate int fd; - /** How the fd will be used */ + /// How the fd will be used grpc_fd_usage usage; } grpc_mutate_socket_info; -/** The virtual table of grpc_socket_mutator */ +/// The virtual table of grpc_socket_mutator struct grpc_socket_mutator_vtable { - /** Mutates the socket options of \a fd -- deprecated, prefer mutate_fd_2 */ + /// Mutates the socket options of \a fd -- deprecated, prefer mutate_fd_2 bool (*mutate_fd)(int fd, grpc_socket_mutator* mutator); - /** Compare socket mutator \a a and \a b */ + /// Compare socket mutator \a a and \a b int (*compare)(grpc_socket_mutator* a, grpc_socket_mutator* b); - /** Destroys the socket mutator instance */ + /// Destroys the socket mutator instance void (*destroy)(grpc_socket_mutator* mutator); - /** Mutates the socket options of the fd in \a info - if set takes preference - * to mutate_fd */ + /// Mutates the socket options of the fd in \a info - if set takes preference + /// to mutate_fd bool (*mutate_fd_2)(const grpc_mutate_socket_info* info, grpc_socket_mutator* mutator); }; -/** The Socket Mutator interface allows changes on socket options */ +/// The Socket Mutator interface allows changes on socket options struct grpc_socket_mutator { const grpc_socket_mutator_vtable* vtable; gpr_refcount refcount; }; -/** called by concrete implementations to initialize the base struct */ +/// called by concrete implementations to initialize the base struct void grpc_socket_mutator_init(grpc_socket_mutator* mutator, const grpc_socket_mutator_vtable* vtable); -/** Wrap \a mutator as a grpc_arg */ +/// Wrap \a mutator as a grpc_arg grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator* mutator); -/** Perform the file descriptor mutation operation of \a mutator on \a fd */ +/// Perform the file descriptor mutation operation of \a mutator on \a fd bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd, grpc_fd_usage usage); -/** Compare if \a a and \a b are the same mutator or have same settings */ +/// Compare if \a a and \a b are the same mutator or have same settings int grpc_socket_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b); grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator); void grpc_socket_mutator_unref(grpc_socket_mutator* mutator); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_MUTATOR_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKET_MUTATOR_H diff --git a/src/core/lib/iomgr/socket_utils.h b/src/core/lib/iomgr/socket_utils.h index 14bb081e935..381acb3f873 100644 --- a/src/core/lib/iomgr/socket_utils.h +++ b/src/core/lib/iomgr/socket_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H #define GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H @@ -26,22 +26,22 @@ // TODO(juanlishen): The following functions might be simple enough to implement // ourselves, so that they don't cause any portability hassle. -/* A wrapper for htons on POSIX and Windows */ +// A wrapper for htons on POSIX and Windows uint16_t grpc_htons(uint16_t hostshort); -/* A wrapper for ntohs on POSIX and WINDOWS */ +// A wrapper for ntohs on POSIX and WINDOWS uint16_t grpc_ntohs(uint16_t netshort); -/* A wrapper for htonl on POSIX and Windows */ +// A wrapper for htonl on POSIX and Windows uint32_t grpc_htonl(uint32_t hostlong); -/* A wrapper for ntohl on POSIX and WINDOWS */ +// A wrapper for ntohl on POSIX and WINDOWS uint32_t grpc_ntohl(uint32_t netlong); -/* A wrapper for inet_pton on POSIX and WINDOWS */ +// A wrapper for inet_pton on POSIX and WINDOWS int grpc_inet_pton(int af, const char* src, void* dst); -/* A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems */ +// A wrapper for inet_ntop on POSIX systems and InetNtop on Windows systems const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_H diff --git a/src/core/lib/iomgr/socket_utils_common_posix.cc b/src/core/lib/iomgr/socket_utils_common_posix.cc index b93b5e2bef6..eff77511a38 100644 --- a/src/core/lib/iomgr/socket_utils_common_posix.cc +++ b/src/core/lib/iomgr/socket_utils_common_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -53,7 +53,7 @@ #include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/iomgr/sockaddr.h" -/* set a socket to use zerocopy */ +// set a socket to use zerocopy grpc_error_handle grpc_set_socket_zerocopy(int fd) { #ifdef GRPC_LINUX_ERRQUEUE const int enable = 1; @@ -68,7 +68,7 @@ grpc_error_handle grpc_set_socket_zerocopy(int fd) { #endif } -/* set a socket to non blocking mode */ +// set a socket to non blocking mode grpc_error_handle grpc_set_socket_nonblocking(int fd, int non_blocking) { int oldflags = fcntl(fd, F_GETFL, 0); if (oldflags < 0) { @@ -149,7 +149,7 @@ grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) { : GRPC_OS_ERROR(errno, "setsockopt(SO_RCVBUF)"); } -/* set a socket to close on exec */ +// set a socket to close on exec grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec) { int oldflags = fcntl(fd, F_GETFD, 0); if (oldflags < 0) { @@ -169,7 +169,7 @@ grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec) { return absl::OkStatus(); } -/* set a socket to reuse old addresses */ +// set a socket to reuse old addresses grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse) { int val = (reuse != 0); int newval; @@ -187,7 +187,7 @@ grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse) { return absl::OkStatus(); } -/* set a socket to reuse old addresses */ +// set a socket to reuse old addresses grpc_error_handle grpc_set_socket_reuse_port(int fd, int reuse) { #ifndef SO_REUSEPORT return GRPC_ERROR_CREATE("SO_REUSEPORT unavailable on compiling system"); @@ -215,8 +215,8 @@ static int g_support_so_reuseport = false; void probe_so_reuseport_once(void) { int s = socket(AF_INET, SOCK_STREAM, 0); if (s < 0) { - /* This might be an ipv6-only environment in which case 'socket(AF_INET,..)' - call would fail. Try creating IPv6 socket in that case */ + // This might be an ipv6-only environment in which case 'socket(AF_INET,..)' + // call would fail. Try creating IPv6 socket in that case s = socket(AF_INET6, SOCK_STREAM, 0); } if (s >= 0) { @@ -231,7 +231,7 @@ bool grpc_is_socket_reuse_port_supported() { return g_support_so_reuseport; } -/* disable nagle */ +// disable nagle grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency) { int val = (low_latency != 0); int newval; @@ -248,11 +248,11 @@ grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency) { return absl::OkStatus(); } -/* The default values for TCP_USER_TIMEOUT are currently configured to be in - * line with the default values of KEEPALIVE_TIMEOUT as proposed in - * https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md */ -#define DEFAULT_CLIENT_TCP_USER_TIMEOUT_MS 20000 /* 20 seconds */ -#define DEFAULT_SERVER_TCP_USER_TIMEOUT_MS 20000 /* 20 seconds */ +// The default values for TCP_USER_TIMEOUT are currently configured to be in +// line with the default values of KEEPALIVE_TIMEOUT as proposed in +// https://github.com/grpc/proposal/blob/master/A18-tcp-user-timeout.md +#define DEFAULT_CLIENT_TCP_USER_TIMEOUT_MS 20000 // 20 seconds +#define DEFAULT_SERVER_TCP_USER_TIMEOUT_MS 20000 // 20 seconds static int g_default_client_tcp_user_timeout_ms = DEFAULT_CLIENT_TCP_USER_TIMEOUT_MS; @@ -296,7 +296,7 @@ void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client) { } } -/* Set TCP_USER_TIMEOUT */ +// Set TCP_USER_TIMEOUT grpc_error_handle grpc_set_socket_tcp_user_timeout( int fd, const grpc_core::PosixTcpOptions& options, bool is_client) { // Use conditionally-important parameter to avoid warning @@ -356,7 +356,7 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout( return absl::OkStatus(); } if (newval != timeout) { - /* Do not fail on failing to set TCP_USER_TIMEOUT for now. */ + // Do not fail on failing to set TCP_USER_TIMEOUT for now. gpr_log(GPR_ERROR, "Failed to set TCP_USER_TIMEOUT"); return absl::OkStatus(); } @@ -370,7 +370,7 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout( return absl::OkStatus(); } -/* set a socket using a grpc_socket_mutator */ +// set a socket using a grpc_socket_mutator grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage, grpc_socket_mutator* mutator) { GPR_ASSERT(mutator); @@ -400,7 +400,7 @@ static void probe_ipv6_once(void) { grpc_sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; - addr.sin6_addr.s6_addr[15] = 1; /* [::1]:0 */ + addr.sin6_addr.s6_addr[15] = 1; // [::1]:0 if (bind(fd, reinterpret_cast(&addr), sizeof(addr)) == 0) { g_ipv6_loopback_available = 1; } else { @@ -454,17 +454,17 @@ grpc_error_handle grpc_create_dualstack_socket_using_factory( *newfd = -1; errno = EAFNOSUPPORT; } - /* Check if we've got a valid dualstack socket. */ + // Check if we've got a valid dualstack socket. if (*newfd >= 0 && grpc_set_socket_dualstack(*newfd)) { *dsmode = GRPC_DSMODE_DUALSTACK; return absl::OkStatus(); } - /* If this isn't an IPv4 address, then return whatever we've got. */ + // If this isn't an IPv4 address, then return whatever we've got. if (!grpc_sockaddr_is_v4mapped(resolved_addr, nullptr)) { *dsmode = GRPC_DSMODE_IPV6; return error_for_fd(*newfd, resolved_addr); } - /* Fall back to AF_INET. */ + // Fall back to AF_INET. if (*newfd >= 0) { close(*newfd); } diff --git a/src/core/lib/iomgr/socket_utils_linux.cc b/src/core/lib/iomgr/socket_utils_linux.cc index ef5d975b579..64fd83e0514 100644 --- a/src/core/lib/iomgr/socket_utils_linux.cc +++ b/src/core/lib/iomgr/socket_utils_linux.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/iomgr/socket_utils_posix.cc b/src/core/lib/iomgr/socket_utils_posix.cc index a03fc8deb2c..c4a9361d3ea 100644 --- a/src/core/lib/iomgr/socket_utils_posix.cc +++ b/src/core/lib/iomgr/socket_utils_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -110,7 +110,7 @@ PosixTcpOptions TcpOptionsFromEndpointConfig(const EndpointConfig& config) { return options; } -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP #ifdef GRPC_POSIX_SOCKETUTILS @@ -138,4 +138,4 @@ close_and_error: return -1; } -#endif /* GRPC_POSIX_SOCKETUTILS */ +#endif // GRPC_POSIX_SOCKETUTILS diff --git a/src/core/lib/iomgr/socket_utils_posix.h b/src/core/lib/iomgr/socket_utils_posix.h index 21a3fe04668..f346154c59e 100644 --- a/src/core/lib/iomgr/socket_utils_posix.h +++ b/src/core/lib/iomgr/socket_utils_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H #define GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H @@ -37,7 +37,7 @@ #ifndef SO_EE_ORIGIN_ZEROCOPY #define SO_EE_ORIGIN_ZEROCOPY 5 #endif -#endif /* ifdef GRPC_LINUX_ERRQUEUE */ +#endif // ifdef GRPC_LINUX_ERRQUEUE namespace grpc_core { @@ -131,125 +131,125 @@ struct PosixTcpOptions { grpc_core::PosixTcpOptions TcpOptionsFromEndpointConfig( const grpc_event_engine::experimental::EndpointConfig& config); -/* a wrapper for accept or accept4 */ +// a wrapper for accept or accept4 int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock, int cloexec); -/* set a socket to use zerocopy */ +// set a socket to use zerocopy grpc_error_handle grpc_set_socket_zerocopy(int fd); -/* set a socket to non blocking mode */ +// set a socket to non blocking mode grpc_error_handle grpc_set_socket_nonblocking(int fd, int non_blocking); -/* set a socket to close on exec */ +// set a socket to close on exec grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec); -/* set a socket to reuse old addresses */ +// set a socket to reuse old addresses grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse); -/* return true if SO_REUSEPORT is supported */ +// return true if SO_REUSEPORT is supported bool grpc_is_socket_reuse_port_supported(); -/* disable nagle */ +// disable nagle grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency); -/* set SO_REUSEPORT */ +// set SO_REUSEPORT grpc_error_handle grpc_set_socket_reuse_port(int fd, int reuse); -/* Configure the default values for TCP_USER_TIMEOUT */ +// Configure the default values for TCP_USER_TIMEOUT void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client); -/* Set TCP_USER_TIMEOUT */ +// Set TCP_USER_TIMEOUT grpc_error_handle grpc_set_socket_tcp_user_timeout( int fd, const grpc_core::PosixTcpOptions& options, bool is_client); -/* Returns true if this system can create AF_INET6 sockets bound to ::1. - The value is probed once, and cached for the life of the process. +// Returns true if this system can create AF_INET6 sockets bound to ::1. +// The value is probed once, and cached for the life of the process. - This is more restrictive than checking for socket(AF_INET6) to succeed, - because Linux with "net.ipv6.conf.all.disable_ipv6 = 1" is able to create - and bind IPv6 sockets, but cannot connect to a getsockname() of [::]:port - without a valid loopback interface. Rather than expose this half-broken - state to library users, we turn off IPv6 sockets. */ +// This is more restrictive than checking for socket(AF_INET6) to succeed, +// because Linux with "net.ipv6.conf.all.disable_ipv6 = 1" is able to create +// and bind IPv6 sockets, but cannot connect to a getsockname() of [::]:port +// without a valid loopback interface. Rather than expose this half-broken +// state to library users, we turn off IPv6 sockets. int grpc_ipv6_loopback_available(void); -/* Tries to set SO_NOSIGPIPE if available on this platform. - If SO_NO_SIGPIPE is not available, returns 1. */ +// Tries to set SO_NOSIGPIPE if available on this platform. +// If SO_NO_SIGPIPE is not available, returns 1. grpc_error_handle grpc_set_socket_no_sigpipe_if_possible(int fd); -/* Tries to set IP_PKTINFO if available on this platform. - If IP_PKTINFO is not available, returns 1. */ +// Tries to set IP_PKTINFO if available on this platform. +// If IP_PKTINFO is not available, returns 1. grpc_error_handle grpc_set_socket_ip_pktinfo_if_possible(int fd); -/* Tries to set IPV6_RECVPKTINFO if available on this platform. - If IPV6_RECVPKTINFO is not available, returns 1. */ +// Tries to set IPV6_RECVPKTINFO if available on this platform. +// If IPV6_RECVPKTINFO is not available, returns 1. grpc_error_handle grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd); -/* Tries to set the socket's send buffer to given size. */ +// Tries to set the socket's send buffer to given size. grpc_error_handle grpc_set_socket_sndbuf(int fd, int buffer_size_bytes); -/* Tries to set the socket's receive buffer to given size. */ +// Tries to set the socket's receive buffer to given size. grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes); -/* Tries to set the socket using a grpc_socket_mutator */ +// Tries to set the socket using a grpc_socket_mutator grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage, grpc_socket_mutator* mutator); -/* Extracts the first socket mutator from config if any and applies on the fd. - */ +// Extracts the first socket mutator from config if any and applies on the fd. +// grpc_error_handle grpc_apply_socket_mutator_in_args( int fd, grpc_fd_usage usage, const grpc_core::PosixTcpOptions& options); -/* An enum to keep track of IPv4/IPv6 socket modes. +// An enum to keep track of IPv4/IPv6 socket modes. - Currently, this information is only used when a socket is first created, but - in the future we may wish to store it alongside the fd. This would let calls - like sendto() know which family to use without asking the kernel first. */ +// Currently, this information is only used when a socket is first created, but +// in the future we may wish to store it alongside the fd. This would let calls +// like sendto() know which family to use without asking the kernel first. typedef enum grpc_dualstack_mode { - /* Uninitialized, or a non-IP socket. */ + // Uninitialized, or a non-IP socket. GRPC_DSMODE_NONE, - /* AF_INET only. */ + // AF_INET only. GRPC_DSMODE_IPV4, - /* AF_INET6 only, because IPV6_V6ONLY could not be cleared. */ + // AF_INET6 only, because IPV6_V6ONLY could not be cleared. GRPC_DSMODE_IPV6, - /* AF_INET6, which also supports ::ffff-mapped IPv4 addresses. */ + // AF_INET6, which also supports ::ffff-mapped IPv4 addresses. GRPC_DSMODE_DUALSTACK } grpc_dualstack_mode; -/* Only tests should use this flag. */ +// Only tests should use this flag. extern int grpc_forbid_dualstack_sockets_for_testing; -/* Tries to set the socket to dualstack. Returns 1 on success. */ +// Tries to set the socket to dualstack. Returns 1 on success. int grpc_set_socket_dualstack(int fd); -/* Creates a new socket for connecting to (or listening on) an address. +// Creates a new socket for connecting to (or listening on) an address. - If addr is AF_INET6, this creates an IPv6 socket first. If that fails, - and addr is within ::ffff:0.0.0.0/96, then it automatically falls back to - an IPv4 socket. +// If addr is AF_INET6, this creates an IPv6 socket first. If that fails, +// and addr is within ::ffff:0.0.0.0/96, then it automatically falls back to +// an IPv4 socket. - If addr is AF_INET, AF_UNIX, or anything else, then this is similar to - calling socket() directly. +// If addr is AF_INET, AF_UNIX, or anything else, then this is similar to +// calling socket() directly. - Returns an fd on success, otherwise returns -1 with errno set to the result - of a failed socket() call. +// Returns an fd on success, otherwise returns -1 with errno set to the result +// of a failed socket() call. - The *dsmode output indicates which address family was actually created. - The recommended way to use this is: - - First convert to IPv6 using grpc_sockaddr_to_v4mapped(). - - Create the socket. - - If *dsmode is IPV4, use grpc_sockaddr_is_v4mapped() to convert back to - IPv4, so that bind() or connect() see the correct family. - Also, it's important to distinguish between DUALSTACK and IPV6 when - listening on the [::] wildcard address. */ +// The *dsmode output indicates which address family was actually created. +// The recommended way to use this is: +// - First convert to IPv6 using grpc_sockaddr_to_v4mapped(). +// - Create the socket. +// - If *dsmode is IPV4, use grpc_sockaddr_is_v4mapped() to convert back to +// IPv4, so that bind() or connect() see the correct family. +// Also, it's important to distinguish between DUALSTACK and IPV6 when +// listening on the [::] wildcard address. grpc_error_handle grpc_create_dualstack_socket( const grpc_resolved_address* addr, int type, int protocol, grpc_dualstack_mode* dsmode, int* newfd); -/* Same as grpc_create_dualstack_socket(), but use the given socket factory (if - non-null) to create the socket, rather than calling socket() directly. */ +// Same as grpc_create_dualstack_socket(), but use the given socket factory (if +// non-null) to create the socket, rather than calling socket() directly. grpc_error_handle grpc_create_dualstack_socket_using_factory( grpc_socket_factory* factory, const grpc_resolved_address* addr, int type, int protocol, grpc_dualstack_mode* dsmode, int* newfd); -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKET_UTILS_POSIX_H diff --git a/src/core/lib/iomgr/socket_utils_windows.cc b/src/core/lib/iomgr/socket_utils_windows.cc index 4f483f0723d..71b95e915ac 100644 --- a/src/core/lib/iomgr/socket_utils_windows.cc +++ b/src/core/lib/iomgr/socket_utils_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -40,8 +40,8 @@ int grpc_inet_pton(int af, const char* src, void* dst) { } const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) { - /* Windows InetNtopA wants a mutable ip pointer */ + // Windows InetNtopA wants a mutable ip pointer return InetNtopA(af, (void*)src, dst, size); } -#endif /* GRPC_WINDOWS_SOCKETUTILS */ +#endif // GRPC_WINDOWS_SOCKETUTILS diff --git a/src/core/lib/iomgr/socket_windows.cc b/src/core/lib/iomgr/socket_windows.cc index bb8b6dfa2df..ba3eb1d0aee 100644 --- a/src/core/lib/iomgr/socket_windows.cc +++ b/src/core/lib/iomgr/socket_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -57,13 +57,13 @@ SOCKET grpc_winsocket_wrapped_socket(grpc_winsocket* socket) { return socket->socket; } -/* Schedule a shutdown of the socket operations. Will call the pending - operations to abort them. We need to do that this way because of the - various callsites of that function, which happens to be in various - mutex hold states, and that'd be unsafe to call them directly. */ +// Schedule a shutdown of the socket operations. Will call the pending +// operations to abort them. We need to do that this way because of the +// various callsites of that function, which happens to be in various +// mutex hold states, and that'd be unsafe to call them directly. void grpc_winsocket_shutdown(grpc_winsocket* winsocket) { - /* Grab the function pointer for DisconnectEx for that specific socket. - It may change depending on the interface. */ + // Grab the function pointer for DisconnectEx for that specific socket. + // It may change depending on the interface. int status; GUID guid = WSAID_DISCONNECTEX; LPFN_DISCONNECTEX DisconnectEx; @@ -113,10 +113,10 @@ void grpc_winsocket_destroy(grpc_winsocket* winsocket) { if (should_destroy) destroy(winsocket); } -/* Calling notify_on_read or write means either of two things: --) The IOCP already completed in the background, and we need to call -the callback now. --) The IOCP hasn't completed yet, and we're queuing it for later. */ +// Calling notify_on_read or write means either of two things: +//-) The IOCP already completed in the background, and we need to call +// the callback now. +//-) The IOCP hasn't completed yet, and we're queuing it for later. static void socket_notify_on_iocp(grpc_winsocket* socket, grpc_closure* closure, grpc_winsocket_callback_info* info) { GPR_ASSERT(info->closure == NULL); @@ -166,7 +166,7 @@ static void probe_ipv6_once(void) { grpc_sockaddr_in6 addr; memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; - addr.sin6_addr.s6_addr[15] = 1; /* [::1]:0 */ + addr.sin6_addr.s6_addr[15] = 1; // [::1]:0 if (bind(s, reinterpret_cast(&addr), sizeof(addr)) == 0) { g_ipv6_loopback_available = 1; } else { @@ -186,17 +186,17 @@ DWORD grpc_get_default_wsa_socket_flags() { return s_wsa_socket_flags; } void grpc_wsa_socket_flags_init() { s_wsa_socket_flags = WSA_FLAG_OVERLAPPED; - /* WSA_FLAG_NO_HANDLE_INHERIT may be not supported on the older Windows - versions, see - https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx - for details. */ + // WSA_FLAG_NO_HANDLE_INHERIT may be not supported on the older Windows + // versions, see + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx + // for details. SOCKET sock = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, NULL, 0, s_wsa_socket_flags | WSA_FLAG_NO_HANDLE_INHERIT); if (sock != INVALID_SOCKET) { - /* Windows 7, Windows 2008 R2 with SP1 or later */ + // Windows 7, Windows 2008 R2 with SP1 or later s_wsa_socket_flags |= WSA_FLAG_NO_HANDLE_INHERIT; closesocket(sock); } } -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/socket_windows.h b/src/core/lib/iomgr/socket_windows.h index de635f13a3b..3e6d0a7a939 100644 --- a/src/core/lib/iomgr/socket_windows.h +++ b/src/core/lib/iomgr/socket_windows.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H @@ -36,42 +36,42 @@ #define WSA_FLAG_NO_HANDLE_INHERIT 0x80 #endif -/* This holds the data for an outstanding read or write on a socket. - The mutex to protect the concurrent access to that data is the one - inside the winsocket wrapper. */ +// This holds the data for an outstanding read or write on a socket. +// The mutex to protect the concurrent access to that data is the one +// inside the winsocket wrapper. typedef struct grpc_winsocket_callback_info { - /* This is supposed to be a WSAOVERLAPPED, but in order to get that - definition, we need to include ws2tcpip.h, which needs to be included - from the top, otherwise it'll clash with a previous inclusion of - windows.h that in turns includes winsock.h. If anyone knows a way - to do it properly, feel free to send a patch. */ + // This is supposed to be a WSAOVERLAPPED, but in order to get that + // definition, we need to include ws2tcpip.h, which needs to be included + // from the top, otherwise it'll clash with a previous inclusion of + // windows.h that in turns includes winsock.h. If anyone knows a way + // to do it properly, feel free to send a patch. OVERLAPPED overlapped; - /* The callback information for the pending operation. May be empty if the - caller hasn't registered a callback yet. */ + // The callback information for the pending operation. May be empty if the + // caller hasn't registered a callback yet. grpc_closure* closure; - /* A boolean to describe if the IO Completion Port got a notification for - that operation. This will happen if the operation completed before the - called had time to register a callback. We could avoid that behavior - altogether by forcing the caller to always register its callback before - proceeding queue an operation, but it is frequent for an IO Completion - Port to trigger quickly. This way we avoid a context switch for calling - the callback. We also simplify the read / write operations to avoid having - to hold a mutex for a long amount of time. */ + // A boolean to describe if the IO Completion Port got a notification for + // that operation. This will happen if the operation completed before the + // called had time to register a callback. We could avoid that behavior + // altogether by forcing the caller to always register its callback before + // proceeding queue an operation, but it is frequent for an IO Completion + // Port to trigger quickly. This way we avoid a context switch for calling + // the callback. We also simplify the read / write operations to avoid having + // to hold a mutex for a long amount of time. int has_pending_iocp; - /* The results of the overlapped operation. */ + // The results of the overlapped operation. DWORD bytes_transferred; int wsa_error; } grpc_winsocket_callback_info; -/* This is a wrapper to a Windows socket. A socket can have one outstanding - read, and one outstanding write. Doing an asynchronous accept means waiting - for a read operation. Doing an asynchronous connect means waiting for a - write operation. These are completely arbitrary ties between the operation - and the kind of event, because we can have one overlapped per pending - operation, whichever its nature is. So we could have more dedicated pending - operation callbacks for connect and listen. But given the scope of listen - and accept, we don't need to go to that extent and waste memory. Also, this - is closer to what happens in posix world. */ +// This is a wrapper to a Windows socket. A socket can have one outstanding +// read, and one outstanding write. Doing an asynchronous accept means waiting +// for a read operation. Doing an asynchronous connect means waiting for a +// write operation. These are completely arbitrary ties between the operation +// and the kind of event, because we can have one overlapped per pending +// operation, whichever its nature is. So we could have more dedicated pending +// operation callbacks for connect and listen. But given the scope of listen +// and accept, we don't need to go to that extent and waste memory. Also, this +// is closer to what happens in posix world. typedef struct grpc_winsocket { SOCKET socket; bool destroy_called; @@ -82,25 +82,25 @@ typedef struct grpc_winsocket { gpr_mu state_mu; bool shutdown_called; - /* You can't add the same socket twice to the same IO Completion Port. - This prevents that. */ + // You can't add the same socket twice to the same IO Completion Port. + // This prevents that. int added_to_iocp; - /* A label for iomgr to track outstanding objects */ + // A label for iomgr to track outstanding objects grpc_iomgr_object iomgr_object; } grpc_winsocket; -/* Create a wrapped windows handle. This takes ownership of it, meaning that - it will be responsible for closing it. */ +// Create a wrapped windows handle. This takes ownership of it, meaning that +// it will be responsible for closing it. grpc_winsocket* grpc_winsocket_create(SOCKET socket, const char* name); SOCKET grpc_winsocket_wrapped_socket(grpc_winsocket* socket); -/* Initiate an asynchronous shutdown of the socket. Will call off any pending - operation to cancel them. */ +// Initiate an asynchronous shutdown of the socket. Will call off any pending +// operation to cancel them. void grpc_winsocket_shutdown(grpc_winsocket* socket); -/* Destroy a socket. Should only be called if there's no pending operation. */ +// Destroy a socket. Should only be called if there's no pending operation. void grpc_winsocket_destroy(grpc_winsocket* socket); void grpc_socket_notify_on_write(grpc_winsocket* winsocket, @@ -112,8 +112,8 @@ void grpc_socket_notify_on_read(grpc_winsocket* winsocket, void grpc_socket_become_ready(grpc_winsocket* winsocket, grpc_winsocket_callback_info* ci); -/* Returns true if this system can create AF_INET6 sockets bound to ::1. - The value is probed once, and cached for the life of the process. */ +// Returns true if this system can create AF_INET6 sockets bound to ::1. +// The value is probed once, and cached for the life of the process. int grpc_ipv6_loopback_available(void); void grpc_wsa_socket_flags_init(); @@ -122,4 +122,4 @@ DWORD grpc_get_default_wsa_socket_flags(); #endif -#endif /* GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_SOCKET_WINDOWS_H diff --git a/src/core/lib/iomgr/tcp_client.cc b/src/core/lib/iomgr/tcp_client.cc index 05511a4192c..0de5aea449b 100644 --- a/src/core/lib/iomgr/tcp_client.cc +++ b/src/core/lib/iomgr/tcp_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/tcp_client.h b/src/core/lib/iomgr/tcp_client.h index 0f305f4099d..d6353128102 100644 --- a/src/core/lib/iomgr/tcp_client.h +++ b/src/core/lib/iomgr/tcp_client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H #define GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H @@ -39,13 +39,13 @@ typedef struct grpc_tcp_client_vtable { bool (*cancel_connect)(int64_t connection_handle); } grpc_tcp_client_vtable; -/* Asynchronously connect to an address (specified as (addr, len)), and call - cb with arg and the completed connection when done (or call cb with arg and - NULL on failure). - interested_parties points to a set of pollsets that would be interested - in this connection being established (in order to continue their work). It - returns a handle to the connect operation which can be used to cancel the - connection attempt. */ +// Asynchronously connect to an address (specified as (addr, len)), and call +// cb with arg and the completed connection when done (or call cb with arg and +// NULL on failure). +// interested_parties points to a set of pollsets that would be interested +// in this connection being established (in order to continue their work). It +// returns a handle to the connect operation which can be used to cancel the +// connection attempt. int64_t grpc_tcp_client_connect( grpc_closure* on_connect, grpc_endpoint** endpoint, grpc_pollset_set* interested_parties, @@ -63,4 +63,4 @@ extern void grpc_tcp_client_global_init(); void grpc_set_tcp_client_impl(grpc_tcp_client_vtable* impl); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_CLIENT_H diff --git a/src/core/lib/iomgr/tcp_client_cfstream.cc b/src/core/lib/iomgr/tcp_client_cfstream.cc index 8adc0c66620..1ea3dc481b2 100644 --- a/src/core/lib/iomgr/tcp_client_cfstream.cc +++ b/src/core/lib/iomgr/tcp_client_cfstream.cc @@ -1,21 +1,21 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -204,4 +204,4 @@ static bool CFStreamClientCancelConnect(int64_t /*connection_handle*/) { grpc_tcp_client_vtable grpc_cfstream_client_vtable = { CFStreamClientConnect, CFStreamClientCancelConnect}; -#endif /* GRPC_CFSTREAM_CLIENT */ +#endif // GRPC_CFSTREAM_CLIENT diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index a109e25e494..bc8b1692613 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -213,31 +213,31 @@ static void on_writable(void* acp, grpc_error_handle error) { fd = nullptr; break; case ENOBUFS: - /* We will get one of these errors if we have run out of - memory in the kernel for the data structures allocated - when you connect a socket. If this happens it is very - likely that if we wait a little bit then try again the - connection will work (since other programs or this - program will close their network connections and free up - memory). This does _not_ indicate that there is anything - wrong with the server we are connecting to, this is a - local problem. - - If you are looking at this code, then chances are that - your program or another program on the same computer - opened too many network connections. The "easy" fix: - don't do that! */ + // We will get one of these errors if we have run out of + // memory in the kernel for the data structures allocated + // when you connect a socket. If this happens it is very + // likely that if we wait a little bit then try again the + // connection will work (since other programs or this + // program will close their network connections and free up + // memory). This does _not_ indicate that there is anything + // wrong with the server we are connecting to, this is a + // local problem. + + // If you are looking at this code, then chances are that + // your program or another program on the same computer + // opened too many network connections. The "easy" fix: + // don't do that! gpr_log(GPR_ERROR, "kernel out of buffers"); gpr_mu_unlock(&ac->mu); grpc_fd_notify_on_write(fd, &ac->write_closure); return; case ECONNREFUSED: - /* This error shouldn't happen for anything other than connect(). */ + // This error shouldn't happen for anything other than connect(). error = GRPC_OS_ERROR(so_error, "connect"); break; default: - /* We don't really know which syscall triggered the problem here, - so punt by reporting getsockopt(). */ + // We don't really know which syscall triggered the problem here, + // so punt by reporting getsockopt(). error = GRPC_OS_ERROR(so_error, "getsockopt(SO_ERROR)"); break; } @@ -291,10 +291,10 @@ grpc_error_handle grpc_tcp_client_prepare_fd( grpc_dualstack_mode dsmode; grpc_error_handle error; *fd = -1; - /* Use dualstack sockets where available. Set mapped to v6 or v4 mapped to - v6. */ + // Use dualstack sockets where available. Set mapped to v6 or v4 mapped to + // v6. if (!grpc_sockaddr_to_v4mapped(addr, mapped_addr)) { - /* addr is v4 mapped to v6 or v6. */ + // addr is v4 mapped to v6 or v6. memcpy(mapped_addr, addr, sizeof(*mapped_addr)); } error = @@ -303,7 +303,7 @@ grpc_error_handle grpc_tcp_client_prepare_fd( return error; } if (dsmode == GRPC_DSMODE_IPV4) { - /* Original addr is either v4 or v4 mapped to v6. Set mapped_addr to v4. */ + // Original addr is either v4 or v4 mapped to v6. Set mapped_addr to v4. if (!grpc_sockaddr_is_v4mapped(addr, mapped_addr)) { memcpy(mapped_addr, addr, sizeof(*mapped_addr)); } diff --git a/src/core/lib/iomgr/tcp_client_posix.h b/src/core/lib/iomgr/tcp_client_posix.h index ab2dd76f8b5..524fdc208a2 100644 --- a/src/core/lib/iomgr/tcp_client_posix.h +++ b/src/core/lib/iomgr/tcp_client_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H #define GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H @@ -26,47 +26,47 @@ #include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/tcp_client.h" -/* Create an endpoint from a connected grpc_fd. +// Create an endpoint from a connected grpc_fd. - fd: a connected FD. Ownership is taken. - config: may contain custom settings for the endpoint - addr_str: destination address in printable format - slice_allocator: ownership is taken by client. - Returns: a new endpoint -*/ +// fd: a connected FD. Ownership is taken. +// config: may contain custom settings for the endpoint +// addr_str: destination address in printable format +// slice_allocator: ownership is taken by client. +// Returns: a new endpoint +// grpc_endpoint* grpc_tcp_create_from_fd( grpc_fd* fd, const grpc_event_engine::experimental::EndpointConfig& config, absl::string_view addr_str); -/* Return a configured, unbound, unconnected TCP client fd. +// Return a configured, unbound, unconnected TCP client fd. - options: may contain custom settings for the fd - addr: the destination address - mapped_addr: out parameter. addr mapped to an address appropriate to the - type of socket FD created. For example, if addr is IPv4 and dual stack - sockets are available, mapped_addr will be an IPv4-mapped IPv6 address - fd: out parameter. The new FD - Returns: error, if any. Out parameters are not set on error -*/ +// options: may contain custom settings for the fd +// addr: the destination address +// mapped_addr: out parameter. addr mapped to an address appropriate to the +// type of socket FD created. For example, if addr is IPv4 and dual stack +// sockets are available, mapped_addr will be an IPv4-mapped IPv6 address +// fd: out parameter. The new FD +// Returns: error, if any. Out parameters are not set on error +// grpc_error_handle grpc_tcp_client_prepare_fd( const grpc_core::PosixTcpOptions& options, const grpc_resolved_address* addr, grpc_resolved_address* mapped_addr, int* fd); -/* Connect a configured TCP client fd. +// Connect a configured TCP client fd. - interested_parties: a set of pollsets that would be interested in this - connection being established (in order to continue their work - closure: called when complete. On success, *ep will be set. - fd: an FD returned from grpc_tcp_client_prepare_fd(). - options: may contain custom settings for the endpoint - deadline: connection deadline - ep: out parameter. Set before closure is called if successful -*/ +// interested_parties: a set of pollsets that would be interested in this +// connection being established (in order to continue their work +// closure: called when complete. On success, *ep will be set. +// fd: an FD returned from grpc_tcp_client_prepare_fd(). +// options: may contain custom settings for the endpoint +// deadline: connection deadline +// ep: out parameter. Set before closure is called if successful +// int64_t grpc_tcp_client_create_from_prepared_fd( grpc_pollset_set* interested_parties, grpc_closure* closure, const int fd, const grpc_core::PosixTcpOptions& options, const grpc_resolved_address* addr, grpc_core::Timestamp deadline, grpc_endpoint** ep); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_CLIENT_POSIX_H diff --git a/src/core/lib/iomgr/tcp_client_windows.cc b/src/core/lib/iomgr/tcp_client_windows.cc index 0fdd379ec84..f66f20c3875 100644 --- a/src/core/lib/iomgr/tcp_client_windows.cc +++ b/src/core/lib/iomgr/tcp_client_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -113,13 +113,13 @@ static void on_connect(void* acp, grpc_error_handle error) { } async_connect_unlock_and_cleanup(ac, socket); - /* If the connection was aborted, the callback was already called when - the deadline was met. */ + // If the connection was aborted, the callback was already called when + // the deadline was met. grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, error); } -/* Tries to issue one async connection, then schedules both an IOCP - notification request for the connection, and one timeout alert. */ +// Tries to issue one async connection, then schedules both an IOCP +// notification request for the connection, and one timeout alert. static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint, grpc_pollset_set* interested_parties, const EndpointConfig& config, @@ -147,7 +147,7 @@ static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint, *endpoint = NULL; - /* Use dualstack sockets where available. */ + // Use dualstack sockets where available. if (grpc_sockaddr_to_v4mapped(addr, &addr6_v4mapped)) { addr = &addr6_v4mapped; } @@ -164,8 +164,8 @@ static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint, goto failure; } - /* Grab the function pointer for ConnectEx for that specific socket. - It may change depending on the interface. */ + // Grab the function pointer for ConnectEx for that specific socket. + // It may change depending on the interface. status = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &ConnectEx, sizeof(ConnectEx), &ioctl_num_bytes, NULL, NULL); @@ -190,8 +190,8 @@ static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint, success = ConnectEx(sock, (grpc_sockaddr*)&addr->addr, (int)addr->len, NULL, 0, NULL, &info->overlapped); - /* It wouldn't be unusual to get a success immediately. But we'll still get - an IOCP notification, so let's ignore it. */ + // It wouldn't be unusual to get a success immediately. But we'll still get + // an IOCP notification, so let's ignore it. if (!success) { int last_error = WSAGetLastError(); if (last_error != ERROR_IO_PENDING) { @@ -236,4 +236,4 @@ static bool tcp_cancel_connect(int64_t /*connection_handle*/) { return false; } grpc_tcp_client_vtable grpc_windows_tcp_client_vtable = {tcp_connect, tcp_cancel_connect}; -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc index 4d49dd962f6..d6c3b46743f 100644 --- a/src/core/lib/iomgr/tcp_posix.cc +++ b/src/core/lib/iomgr/tcp_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -478,8 +478,8 @@ struct grpc_tcp { grpc_endpoint base; grpc_fd* em_fd; int fd; - /* Used by the endpoint read function to distinguish the very first read call - * from the rest */ + // Used by the endpoint read function to distinguish the very first read call + // from the rest bool is_first_read; bool has_posted_reclaimer ABSL_GUARDED_BY(read_mu) = false; double target_length; @@ -491,16 +491,16 @@ struct grpc_tcp { int max_read_chunk_size; int set_rcvlowat = 0; - /* garbage after the last read */ + // garbage after the last read grpc_slice_buffer last_read_buffer; grpc_core::Mutex read_mu; grpc_slice_buffer* incoming_buffer ABSL_GUARDED_BY(read_mu) = nullptr; - int inq; /* bytes pending on the socket from the last read. */ - bool inq_capable; /* cache whether kernel supports inq */ + int inq; // bytes pending on the socket from the last read. + bool inq_capable; // cache whether kernel supports inq grpc_slice_buffer* outgoing_buffer; - /* byte within outgoing_buffer->slices[0] to write next */ + // byte within outgoing_buffer->slices[0] to write next size_t outgoing_byte_idx; grpc_closure* read_cb; @@ -518,33 +518,33 @@ struct grpc_tcp { grpc_core::MemoryOwner memory_owner; grpc_core::MemoryAllocator::Reservation self_reservation; - grpc_core::TracedBufferList tb_list; /* List of traced buffers */ - - /* grpc_endpoint_write takes an argument which if non-null means that the - * transport layer wants the TCP layer to collect timestamps for this write. - * This arg is forwarded to the timestamps callback function when the ACK - * timestamp is received from the kernel. This arg is a (void *) which allows - * users of this API to pass in a pointer to any kind of structure. This - * structure could actually be a tag or any book-keeping object that the user - * can use to distinguish between different traced writes. The only - * requirement from the TCP endpoint layer is that this arg should be non-null - * if the user wants timestamps for the write. */ + grpc_core::TracedBufferList tb_list; // List of traced buffers + + // grpc_endpoint_write takes an argument which if non-null means that the + // transport layer wants the TCP layer to collect timestamps for this write. + // This arg is forwarded to the timestamps callback function when the ACK + // timestamp is received from the kernel. This arg is a (void *) which allows + // users of this API to pass in a pointer to any kind of structure. This + // structure could actually be a tag or any book-keeping object that the user + // can use to distinguish between different traced writes. The only + // requirement from the TCP endpoint layer is that this arg should be non-null + // if the user wants timestamps for the write. void* outgoing_buffer_arg; - /* A counter which starts at 0. It is initialized the first time the socket - * options for collecting timestamps are set, and is incremented with each - * byte sent. */ + // A counter which starts at 0. It is initialized the first time the socket + // options for collecting timestamps are set, and is incremented with each + // byte sent. int bytes_counter; - bool socket_ts_enabled; /* True if timestamping options are set on the socket - */ - bool ts_capable; /* Cache whether we can set timestamping options */ - gpr_atm stop_error_notification; /* Set to 1 if we do not want to be notified - on errors anymore */ + bool socket_ts_enabled; // True if timestamping options are set on the socket + // + bool ts_capable; // Cache whether we can set timestamping options + gpr_atm stop_error_notification; // Set to 1 if we do not want to be notified + // on errors anymore TcpZerocopySendCtx tcp_zerocopy_send_ctx; TcpZerocopySendRecord* current_zerocopy_send = nullptr; - int min_progress_size; /* A hint from upper layers specifying the minimum - number of bytes that need to be read to make - meaningful progress */ + int min_progress_size; // A hint from upper layers specifying the minimum + // number of bytes that need to be read to make + // meaningful progress }; struct backup_poller { @@ -590,7 +590,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) { grpc_pollset_work(BACKUP_POLLER_POLLSET(p), nullptr, deadline)); gpr_mu_unlock(p->pollset_mu); g_backup_poller_mu->Lock(); - /* last "uncovered" notification is the ref that keeps us polling */ + // last "uncovered" notification is the ref that keeps us polling if (g_uncovered_notifications_pending == 1) { GPR_ASSERT(g_backup_poller == p); g_backup_poller = nullptr; @@ -696,9 +696,9 @@ static void add_to_estimate(grpc_tcp* tcp, size_t bytes) { } static void finish_estimate(grpc_tcp* tcp) { - /* If we read >80% of the target buffer in one read loop, increase the size - of the target buffer to either the amount read, or twice its previous - value */ + // If we read >80% of the target buffer in one read loop, increase the size + // of the target buffer to either the amount read, or twice its previous + // value if (tcp->bytes_read_this_round > tcp->target_length * 0.8) { tcp->target_length = std::max(2 * tcp->target_length, tcp->bytes_read_this_round); @@ -715,8 +715,8 @@ static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error, grpc_error_set_int( grpc_error_set_int(src_error, grpc_core::StatusIntProperty::kFd, tcp->fd), - /* All tcp errors are marked with UNAVAILABLE so that application may - * choose to retry. */ + // All tcp errors are marked with UNAVAILABLE so that application may + // choose to retry. grpc_core::StatusIntProperty::kRpcStatus, GRPC_STATUS_UNAVAILABLE), grpc_core::StatusStrProperty::kTargetAddress, tcp->peer_string); } @@ -866,7 +866,7 @@ static void update_rcvlowat(grpc_tcp* tcp) tcp->set_rcvlowat = remaining; } -/* Returns true if data available to read or error other than EAGAIN. */ +// Returns true if data available to read or error other than EAGAIN. #define MAX_READ_IOVEC 64 static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) ABSL_EXCLUSIVE_LOCKS_REQUIRED(tcp->read_mu) { @@ -884,7 +884,7 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) CMSG_SPACE(sizeof(grpc_core::scm_timestamping)) + CMSG_SPACE(sizeof(int)); #else constexpr size_t cmsg_alloc_space = 24 /* CMSG_SPACE(sizeof(int)) */; -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE char cmsgbuf[cmsg_alloc_space]; for (size_t i = 0; i < iov_len; i++) { iov[i].iov_base = GRPC_SLICE_START_PTR(tcp->incoming_buffer->slices[i]); @@ -895,9 +895,9 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) GPR_DEBUG_ASSERT(tcp->min_progress_size > 0); do { - /* Assume there is something on the queue. If we receive TCP_INQ from - * kernel, we will update this value, otherwise, we have to assume there is - * always something to read until we get EAGAIN. */ + // Assume there is something on the queue. If we receive TCP_INQ from + // kernel, we will update this value, otherwise, we have to assume there is + // always something to read until we get EAGAIN. tcp->inq = 1; msg.msg_name = nullptr; @@ -924,8 +924,8 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) } while (read_bytes < 0 && errno == EINTR); if (read_bytes < 0 && errno == EAGAIN) { - /* NB: After calling call_read_cb a parallel call of the read handler may - * be running. */ + // NB: After calling call_read_cb a parallel call of the read handler may + // be running. if (total_read_bytes > 0) { break; } @@ -934,15 +934,15 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) return false; } - /* We have read something in previous reads. We need to deliver those - * bytes to the upper layer. */ + // We have read something in previous reads. We need to deliver those + // bytes to the upper layer. if (read_bytes <= 0 && total_read_bytes >= 1) { tcp->inq = 1; break; } if (read_bytes <= 0) { - /* 0 read size ==> end of stream */ + // 0 read size ==> end of stream grpc_slice_buffer_reset_and_unref(tcp->incoming_buffer); if (read_bytes == 0) { *error = tcp_annotate_error(absl::InternalError("Socket closed"), tcp); @@ -972,15 +972,15 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error) } } } -#endif /* GRPC_HAVE_TCP_INQ */ +#endif // GRPC_HAVE_TCP_INQ total_read_bytes += read_bytes; if (tcp->inq == 0 || total_read_bytes == tcp->incoming_buffer->length) { break; } - /* We had a partial read, and still have space to read more data. - * So, adjust IOVs and try to read more. */ + // We had a partial read, and still have space to read more data. + // So, adjust IOVs and try to read more. size_t remaining = read_bytes; size_t j = 0; for (size_t i = 0; i < iov_len; i++) { @@ -1117,7 +1117,7 @@ static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) { if (GPR_LIKELY(error.ok())) { maybe_make_read_slices(tcp); if (!tcp_do_read(tcp, &tcp_read_error)) { - /* We've consumed the edge, request a new one */ + // We've consumed the edge, request a new one update_rcvlowat(tcp); tcp->read_mu.Unlock(); notify_on_read(tcp); @@ -1153,54 +1153,54 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer, if (tcp->is_first_read) { update_rcvlowat(tcp); tcp->read_mu.Unlock(); - /* Endpoint read called for the very first time. Register read callback with - * the polling engine */ + // Endpoint read called for the very first time. Register read callback with + // the polling engine tcp->is_first_read = false; notify_on_read(tcp); } else if (!urgent && tcp->inq == 0) { update_rcvlowat(tcp); tcp->read_mu.Unlock(); - /* Upper layer asked to read more but we know there is no pending data - * to read from previous reads. So, wait for POLLIN. - */ + // Upper layer asked to read more but we know there is no pending data + // to read from previous reads. So, wait for POLLIN. + // notify_on_read(tcp); } else { tcp->read_mu.Unlock(); - /* Not the first time. We may or may not have more bytes available. In any - * case call tcp->read_done_closure (i.e tcp_handle_read()) which does the - * right thing (i.e calls tcp_do_read() which either reads the available - * bytes or calls notify_on_read() to be notified when new bytes become - * available */ + // Not the first time. We may or may not have more bytes available. In any + // case call tcp->read_done_closure (i.e tcp_handle_read()) which does the + // right thing (i.e calls tcp_do_read() which either reads the available + // bytes or calls notify_on_read() to be notified when new bytes become + // available grpc_core::Closure::Run(DEBUG_LOCATION, &tcp->read_done_closure, absl::OkStatus()); } } -/* A wrapper around sendmsg. It sends \a msg over \a fd and returns the number - * of bytes sent. */ +// A wrapper around sendmsg. It sends \a msg over \a fd and returns the number +// of bytes sent. ssize_t tcp_send(int fd, const struct msghdr* msg, int* saved_errno, int additional_flags = 0) { ssize_t sent_length; do { - /* TODO(klempner): Cork if this is a partial write */ + // TODO(klempner): Cork if this is a partial write grpc_core::global_stats().IncrementSyscallWrite(); sent_length = sendmsg(fd, msg, SENDMSG_FLAGS | additional_flags); } while (sent_length < 0 && (*saved_errno = errno) == EINTR); return sent_length; } -/** This is to be called if outgoing_buffer_arg is not null. On linux platforms, - * this will call sendmsg with socket options set to collect timestamps inside - * the kernel. On return, sent_length is set to the return value of the sendmsg - * call. Returns false if setting the socket options failed. This is not - * implemented for non-linux platforms currently, and crashes out. - */ +/// This is to be called if outgoing_buffer_arg is not null. On linux platforms, +/// this will call sendmsg with socket options set to collect timestamps inside +/// the kernel. On return, sent_length is set to the return value of the sendmsg +/// call. Returns false if setting the socket options failed. This is not +/// implemented for non-linux platforms currently, and crashes out. +/// static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg, size_t sending_length, ssize_t* sent_length, int* saved_errno, int additional_flags = 0); -/** The callback function to be invoked when we get an error on the socket. */ +/// The callback function to be invoked when we get an error on the socket. static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error_handle error); static TcpZerocopySendRecord* tcp_get_send_zerocopy_record( @@ -1255,7 +1255,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg, tcp->bytes_counter = -1; tcp->socket_ts_enabled = true; } - /* Set control message to indicate that you want timestamps. */ + // Set control message to indicate that you want timestamps. union { char cmsg_buf[CMSG_SPACE(sizeof(uint32_t))]; struct cmsghdr align; @@ -1269,10 +1269,10 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg, msg->msg_control = u.cmsg_buf; msg->msg_controllen = CMSG_SPACE(sizeof(uint32_t)); - /* If there was an error on sendmsg the logic in tcp_flush will handle it. */ + // If there was an error on sendmsg the logic in tcp_flush will handle it. ssize_t length = tcp_send(tcp->fd, msg, saved_errno, additional_flags); *sent_length = length; - /* Only save timestamps if all the bytes were taken by sendmsg. */ + // Only save timestamps if all the bytes were taken by sendmsg. if (sending_length == static_cast(length)) { tcp->tb_list.AddNewEntry(static_cast(tcp->bytes_counter + length), tcp->fd, tcp->outgoing_buffer_arg); @@ -1321,13 +1321,13 @@ static bool CmsgIsZeroCopy(const cmsghdr& cmsg) { return serr->ee_errno == 0 && serr->ee_origin == SO_EE_ORIGIN_ZEROCOPY; } -/** Reads \a cmsg to derive timestamps from the control messages. If a valid - * timestamp is found, the traced buffer list is updated with this timestamp. - * The caller of this function should be looping on the control messages found - * in \a msg. \a cmsg should point to the control message that the caller wants - * processed. - * On return, a pointer to a control message is returned. On the next iteration, - * CMSG_NXTHDR(msg, ret_val) should be passed as \a cmsg. */ +/// Reads \a cmsg to derive timestamps from the control messages. If a valid +/// timestamp is found, the traced buffer list is updated with this timestamp. +/// The caller of this function should be looping on the control messages found +/// in \a msg. \a cmsg should point to the control message that the caller wants +/// processed. +/// On return, a pointer to a control message is returned. On the next +/// iteration, CMSG_NXTHDR(msg, ret_val) should be passed as \a cmsg. struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, struct cmsghdr* cmsg) { auto next_cmsg = CMSG_NXTHDR(msg, cmsg); @@ -1339,7 +1339,7 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, return cmsg; } - /* Check if next_cmsg is an OPT_STATS msg */ + // Check if next_cmsg is an OPT_STATS msg if (next_cmsg->cmsg_level == SOL_SOCKET && next_cmsg->cmsg_type == SCM_TIMESTAMPING_OPT_STATS) { opt_stats = next_cmsg; @@ -1373,9 +1373,9 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg, return next_cmsg; } -/** For linux platforms, reads the socket's error queue and processes error - * messages from the queue. - */ +/// For linux platforms, reads the socket's error queue and processes error +/// messages from the queue. +/// static bool process_errors(grpc_tcp* tcp) { bool processed_err = false; struct iovec iov; @@ -1387,13 +1387,13 @@ static bool process_errors(grpc_tcp* tcp) { msg.msg_iov = &iov; msg.msg_iovlen = 0; msg.msg_flags = 0; - /* Allocate enough space so we don't need to keep increasing this as size - * of OPT_STATS increase */ + // Allocate enough space so we don't need to keep increasing this as size + // of OPT_STATS increase constexpr size_t cmsg_alloc_space = CMSG_SPACE(sizeof(grpc_core::scm_timestamping)) + CMSG_SPACE(sizeof(sock_extended_err) + sizeof(sockaddr_in)) + CMSG_SPACE(32 * NLA_ALIGN(NLA_HDRLEN + sizeof(uint64_t))); - /* Allocate aligned space for cmsgs received along with timestamps */ + // Allocate aligned space for cmsgs received along with timestamps union { char rbuf[cmsg_alloc_space]; struct cmsghdr align; @@ -1408,7 +1408,7 @@ static bool process_errors(grpc_tcp* tcp) { } while (r < 0 && saved_errno == EINTR); if (r == -1 && saved_errno == EAGAIN) { - return processed_err; /* No more errors to process */ + return processed_err; // No more errors to process } if (r == -1) { return processed_err; @@ -1418,7 +1418,7 @@ static bool process_errors(grpc_tcp* tcp) { } if (msg.msg_controllen == 0) { - /* There was no control message found. It was probably spurious. */ + // There was no control message found. It was probably spurious. return processed_err; } bool seen = false; @@ -1434,8 +1434,8 @@ static bool process_errors(grpc_tcp* tcp) { seen = true; processed_err = true; } else { - /* Got a control message that is not a timestamp or zerocopy. Don't know - * how to handle this. */ + // Got a control message that is not a timestamp or zerocopy. Don't know + // how to handle this. if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) { gpr_log(GPR_INFO, "unknown control message cmsg_level:%d cmsg_type:%d", @@ -1460,17 +1460,17 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, if (!error.ok() || static_cast(gpr_atm_acq_load(&tcp->stop_error_notification))) { - /* We aren't going to register to hear on error anymore, so it is safe to - * unref. */ + // We aren't going to register to hear on error anymore, so it is safe to + // unref. TCP_UNREF(tcp, "error-tracking"); return; } - /* We are still interested in collecting timestamps, so let's try reading - * them. */ + // We are still interested in collecting timestamps, so let's try reading + // them. bool processed = process_errors(tcp); - /* This might not a timestamps error. Set the read and write closures to be - * ready. */ + // This might not a timestamps error. Set the read and write closures to be + // ready. if (!processed) { grpc_fd_set_readable(tcp->em_fd); grpc_fd_set_writable(tcp->em_fd); @@ -1478,7 +1478,7 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_fd_notify_on_error(tcp->em_fd, &tcp->error_closure); } -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE static TcpZerocopySendRecord* tcp_get_send_zerocopy_record( grpc_tcp* /*tcp*/, grpc_slice_buffer* /*buf*/) { return nullptr; @@ -1501,10 +1501,10 @@ static void tcp_handle_error(void* /*arg*/ /* grpc_tcp */, gpr_log(GPR_ERROR, "Error handling is not supported for this platform"); GPR_ASSERT(0); } -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE -/* If outgoing_buffer_arg is filled, shuts down the list early, so that any - * release operations needed can be performed on the arg */ +// If outgoing_buffer_arg is filled, shuts down the list early, so that any +// release operations needed can be performed on the arg void tcp_shutdown_buffer_list(grpc_tcp* tcp) { if (tcp->outgoing_buffer_arg) { tcp->tb_list.Shutdown(tcp->outgoing_buffer_arg, @@ -1591,8 +1591,8 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record, if (!tcp->ts_capable || !tcp_write_with_timestamps(tcp, &msg, sending_length, &sent_length, &saved_errno, MSG_ZEROCOPY)) { - /* We could not set socket options to collect Fathom timestamps. - * Fallback on writing without timestamps. */ + // We could not set socket options to collect Fathom timestamps. + // Fallback on writing without timestamps. tcp->ts_capable = false; tcp_shutdown_buffer_list(tcp); } else { @@ -1703,8 +1703,8 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) { if (!tcp->ts_capable || !tcp_write_with_timestamps(tcp, &msg, sending_length, &sent_length, &saved_errno)) { - /* We could not set socket options to collect Fathom timestamps. - * Fallback on writing without timestamps. */ + // We could not set socket options to collect Fathom timestamps. + // Fallback on writing without timestamps. tcp->ts_capable = false; tcp_shutdown_buffer_list(tcp); } else { @@ -1962,7 +1962,7 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, tcp->release_fd = nullptr; tcp->target_length = static_cast(options.tcp_read_chunk_size); tcp->bytes_read_this_round = 0; - /* Will be set to false by the very first endpoint read function */ + // Will be set to false by the very first endpoint read function tcp->is_first_read = true; tcp->bytes_counter = -1; tcp->socket_ts_enabled = false; @@ -1982,7 +1982,7 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, } #endif } - /* paired with unref in grpc_tcp_destroy */ + // paired with unref in grpc_tcp_destroy new (&tcp->refcount) grpc_core::RefCount( 1, GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) ? "tcp" : nullptr); gpr_atm_no_barrier_store(&tcp->shutdown_count, 0); @@ -2000,7 +2000,7 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, tcp_drop_uncovered_then_handle_write, tcp, grpc_schedule_on_exec_ctx); } - /* Always assume there is something on the queue to read. */ + // Always assume there is something on the queue to read. tcp->inq = 1; #ifdef GRPC_HAVE_TCP_INQ int one = 1; @@ -2012,12 +2012,12 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd, } #else tcp->inq_capable = false; -#endif /* GRPC_HAVE_TCP_INQ */ - /* Start being notified on errors if event engine can track errors. */ +#endif // GRPC_HAVE_TCP_INQ + // Start being notified on errors if event engine can track errors. if (grpc_event_engine_can_track_errors()) { - /* Grab a ref to tcp so that we can safely access the tcp struct when - * processing errors. We unref when we no longer want to track errors - * separately. */ + // Grab a ref to tcp so that we can safely access the tcp struct when + // processing errors. We unref when we no longer want to track errors + // separately. TCP_REF(tcp, "error-tracking"); gpr_atm_rel_store(&tcp->stop_error_notification, 0); GRPC_CLOSURE_INIT(&tcp->error_closure, tcp_handle_error, tcp, @@ -2042,7 +2042,7 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd, tcp->release_fd_cb = done; grpc_slice_buffer_reset_and_unref(&tcp->last_read_buffer); if (grpc_event_engine_can_track_errors()) { - /* Stop errors notification. */ + // Stop errors notification. ZerocopyDisableAndWaitForRemaining(tcp); gpr_atm_no_barrier_store(&tcp->stop_error_notification, true); grpc_fd_set_error(tcp->em_fd); @@ -2057,4 +2057,4 @@ void grpc_tcp_posix_shutdown() { g_backup_poller_mu = nullptr; } -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP diff --git a/src/core/lib/iomgr/tcp_posix.h b/src/core/lib/iomgr/tcp_posix.h index 01b6ed39879..d94f519f0dc 100644 --- a/src/core/lib/iomgr/tcp_posix.h +++ b/src/core/lib/iomgr/tcp_posix.h @@ -1,33 +1,33 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_POSIX_H #define GRPC_CORE_LIB_IOMGR_TCP_POSIX_H -/* - Low level TCP "bottom half" implementation, for use by transports built on - top of a TCP connection. +// +// Low level TCP "bottom half" implementation, for use by transports built on +// top of a TCP connection. - Note that this file does not (yet) include APIs for creating the socket in - the first place. +// Note that this file does not (yet) include APIs for creating the socket in +// the first place. - All calls passing slice transfer ownership of a slice refcount unless - otherwise specified. -*/ +// All calls passing slice transfer ownership of a slice refcount unless +// otherwise specified. +// #include @@ -62,6 +62,6 @@ void grpc_tcp_posix_init(); void grpc_tcp_posix_shutdown(); -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP -#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_POSIX_H diff --git a/src/core/lib/iomgr/tcp_server.cc b/src/core/lib/iomgr/tcp_server.cc index 15e692d87c3..cfbdbc15c93 100644 --- a/src/core/lib/iomgr/tcp_server.cc +++ b/src/core/lib/iomgr/tcp_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h index 49e86dd3a48..1283b6c89a1 100644 --- a/src/core/lib/iomgr/tcp_server.h +++ b/src/core/lib/iomgr/tcp_server.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_SERVER_H #define GRPC_CORE_LIB_IOMGR_TCP_SERVER_H @@ -31,24 +31,24 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/resolve_address.h" -/* Forward decl of grpc_tcp_server */ +// Forward decl of grpc_tcp_server typedef struct grpc_tcp_server grpc_tcp_server; typedef struct grpc_tcp_server_acceptor { - /* grpc_tcp_server_cb functions share a ref on from_server that is valid - until the function returns. */ + // grpc_tcp_server_cb functions share a ref on from_server that is valid + // until the function returns. grpc_tcp_server* from_server; - /* Indices that may be passed to grpc_tcp_server_port_fd(). */ + // Indices that may be passed to grpc_tcp_server_port_fd(). unsigned port_index; unsigned fd_index; - /* Data when the connection is passed to tcp_server from external. */ + // Data when the connection is passed to tcp_server from external. bool external_connection; int listener_fd; grpc_byte_buffer* pending_data; } grpc_tcp_server_acceptor; -/* Called for newly connected TCP connections. - Takes ownership of acceptor. */ +// Called for newly connected TCP connections. +// Takes ownership of acceptor. typedef void (*grpc_tcp_server_cb)(void* arg, grpc_endpoint* ep, grpc_pollset* accepting_pollset, grpc_tcp_server_acceptor* acceptor); @@ -83,66 +83,66 @@ typedef struct grpc_tcp_server_vtable { void (*shutdown_listeners)(grpc_tcp_server* s); } grpc_tcp_server_vtable; -/* Create a server, initially not bound to any ports. The caller owns one ref. - If shutdown_complete is not NULL, it will be used by - grpc_tcp_server_unref() when the ref count reaches zero. - Takes ownership of the slice_allocator_factory. */ +// Create a server, initially not bound to any ports. The caller owns one ref. +// If shutdown_complete is not NULL, it will be used by +// grpc_tcp_server_unref() when the ref count reaches zero. +// Takes ownership of the slice_allocator_factory. grpc_error_handle grpc_tcp_server_create( grpc_closure* shutdown_complete, const grpc_event_engine::experimental::EndpointConfig& config, grpc_tcp_server_cb on_accept_cb, void* cb_arg, grpc_tcp_server** server); -/* Start listening to bound ports */ +// Start listening to bound ports void grpc_tcp_server_start(grpc_tcp_server* server, const std::vector* pollsets); -/* Add a port to the server, returning the newly allocated port on success, or - -1 on failure. +// Add a port to the server, returning the newly allocated port on success, or +// -1 on failure. - The :: and 0.0.0.0 wildcard addresses are treated identically, accepting - both IPv4 and IPv6 connections, but :: is the preferred style. This usually - creates one socket, but possibly two on systems which support IPv6, - but not dualstack sockets. */ -/* TODO(ctiller): deprecate this, and make grpc_tcp_server_add_ports to handle - all of the multiple socket port matching logic in one place */ +// The :: and 0.0.0.0 wildcard addresses are treated identically, accepting +// both IPv4 and IPv6 connections, but :: is the preferred style. This usually +// creates one socket, but possibly two on systems which support IPv6, +// but not dualstack sockets. +// TODO(ctiller): deprecate this, and make grpc_tcp_server_add_ports to handle +// all of the multiple socket port matching logic in one place grpc_error_handle grpc_tcp_server_add_port(grpc_tcp_server* s, const grpc_resolved_address* addr, int* out_port); -/* Create and return a TcpServerFdHandler so that it can be used by upper layer - to hand over an externally connected fd to the grpc server. */ +// Create and return a TcpServerFdHandler so that it can be used by upper layer +// to hand over an externally connected fd to the grpc server. grpc_core::TcpServerFdHandler* grpc_tcp_server_create_fd_handler( grpc_tcp_server* s); -/* Number of fds at the given port_index, or 0 if port_index is out of - bounds. */ +// Number of fds at the given port_index, or 0 if port_index is out of +// bounds. unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server* s, unsigned port_index); -/* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth - (port_index) call to add_port() on this server, or -1 if the indices are out - of bounds. The file descriptor remains owned by the server, and will be - cleaned up when the ref count reaches zero. */ +// Returns the file descriptor of the Mth (fd_index) listening socket of the Nth +// (port_index) call to add_port() on this server, or -1 if the indices are out +// of bounds. The file descriptor remains owned by the server, and will be +// cleaned up when the ref count reaches zero. int grpc_tcp_server_port_fd(grpc_tcp_server* s, unsigned port_index, unsigned fd_index); -/* Ref s and return s. */ +// Ref s and return s. grpc_tcp_server* grpc_tcp_server_ref(grpc_tcp_server* s); -/* shutdown_starting is called when ref count has reached zero and the server is - about to be destroyed. The server will be deleted after it returns. Calling - grpc_tcp_server_ref() from it has no effect. */ +// shutdown_starting is called when ref count has reached zero and the server is +// about to be destroyed. The server will be deleted after it returns. Calling +// grpc_tcp_server_ref() from it has no effect. void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server* s, grpc_closure* shutdown_starting); -/* If the refcount drops to zero, enqueue calls on exec_ctx to - shutdown_listeners and delete s. */ +// If the refcount drops to zero, enqueue calls on exec_ctx to +// shutdown_listeners and delete s. void grpc_tcp_server_unref(grpc_tcp_server* s); -/* Shutdown the fds of listeners. */ +// Shutdown the fds of listeners. void grpc_tcp_server_shutdown_listeners(grpc_tcp_server* s); void grpc_tcp_server_global_init(); void grpc_set_tcp_server_impl(grpc_tcp_server_vtable* impl); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_SERVER_H diff --git a/src/core/lib/iomgr/tcp_server_posix.cc b/src/core/lib/iomgr/tcp_server_posix.cc index b4229469336..c4066259dfb 100644 --- a/src/core/lib/iomgr/tcp_server_posix.cc +++ b/src/core/lib/iomgr/tcp_server_posix.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* FIXME: "posix" files shouldn't be depending on _GNU_SOURCE */ +// +// +// 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 +// +// 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. +// +// + +// FIXME: "posix" files shouldn't be depending on _GNU_SOURCE #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif @@ -137,11 +137,11 @@ static void destroyed_port(void* server, grpc_error_handle /*error*/) { } } -/* called when all listening endpoints have been shutdown, so no further - events will be received on them - at this point it's safe to destroy - things */ +// called when all listening endpoints have been shutdown, so no further +// events will be received on them - at this point it's safe to destroy +// things static void deactivated_all_ports(grpc_tcp_server* s) { - /* delete ALL the things */ + // delete ALL the things gpr_mu_lock(&s->mu); GPR_ASSERT(s->shutdown); @@ -166,7 +166,7 @@ static void tcp_server_destroy(grpc_tcp_server* s) { gpr_mu_lock(&s->mu); GPR_ASSERT(!s->shutdown); s->shutdown = true; - /* shutdown all fd's */ + // shutdown all fd's if (s->active_ports) { grpc_tcp_listener* sp; for (sp = s->head; sp; sp = sp->next) { @@ -179,7 +179,7 @@ static void tcp_server_destroy(grpc_tcp_server* s) { } } -/* event manager callback when reads are ready */ +// event manager callback when reads are ready static void on_read(void* arg, grpc_error_handle err) { grpc_tcp_listener* sp = static_cast(arg); grpc_pollset* read_notifier_pollset; @@ -187,13 +187,13 @@ static void on_read(void* arg, grpc_error_handle err) { goto error; } - /* loop until accept4 returns EAGAIN, and then re-arm notification */ + // loop until accept4 returns EAGAIN, and then re-arm notification for (;;) { grpc_resolved_address addr; memset(&addr, 0, sizeof(addr)); addr.len = static_cast(sizeof(struct sockaddr_storage)); - /* Note: If we ever decide to return this address to the user, remember to - strip off the ::ffff:0.0.0.0/96 prefix first. */ + // Note: If we ever decide to return this address to the user, remember to + // strip off the ::ffff:0.0.0.0/96 prefix first. int fd = grpc_accept4(sp->fd, &addr, 1, 1); if (fd < 0) { if (errno == EINTR) { @@ -208,8 +208,8 @@ static void on_read(void* arg, grpc_error_handle err) { gpr_log(GPR_ERROR, "Failed accept4: %s", grpc_core::StrError(errno).c_str()); } else { - /* if we have shutdown listeners, accept4 could fail, and we - needn't notify users */ + // if we have shutdown listeners, accept4 could fail, and we + // needn't notify users } gpr_mu_unlock(&sp->server->mu); goto error; @@ -229,8 +229,8 @@ static void on_read(void* arg, grpc_error_handle err) { continue; } - /* For UNIX sockets, the accept call might not fill up the member sun_path - * of sockaddr_un, so explicitly call getsockname to get it. */ + // For UNIX sockets, the accept call might not fill up the member sun_path + // of sockaddr_un, so explicitly call getsockname to get it. if (grpc_is_unix_socket(&addr)) { memset(&addr, 0, sizeof(addr)); addr.len = static_cast(sizeof(struct sockaddr_storage)); @@ -297,7 +297,7 @@ error: } } -/* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */ +// Treat :: or 0.0.0.0 as a family-agnostic wildcard. static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s, unsigned port_index, int requested_port, @@ -318,7 +318,7 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s, } grpc_sockaddr_make_wildcards(requested_port, &wild4, &wild6); - /* Try listening on IPv6 first. */ + // Try listening on IPv6 first. if ((v6_err = grpc_tcp_server_add_addr(s, &wild6, port_index, fd_index, &dsmode, &sp)) == absl::OkStatus()) { ++fd_index; @@ -327,7 +327,7 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s, return absl::OkStatus(); } } - /* If we got a v6-only socket or nothing, try adding 0.0.0.0. */ + // If we got a v6-only socket or nothing, try adding 0.0.0.0. grpc_sockaddr_set_port(&wild4, requested_port); if ((v4_err = grpc_tcp_server_add_addr(s, &wild4, port_index, fd_index, &dsmode, &sp2)) == absl::OkStatus()) { @@ -389,8 +389,8 @@ static grpc_error_handle clone_port(grpc_tcp_listener* listener, sp = static_cast(gpr_malloc(sizeof(grpc_tcp_listener))); sp->next = listener->next; listener->next = sp; - /* sp (the new listener) is a sibling of 'listener' (the original - listener). */ + // sp (the new listener) is a sibling of 'listener' (the original + // listener). sp->is_sibling = 1; sp->sibling = listener->sibling; listener->sibling = sp; @@ -431,8 +431,8 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s, } grpc_unlink_if_unix_domain_socket(addr); - /* Check if this is a wildcard port, and if so, try to keep the port the same - as some previously created listener. */ + // Check if this is a wildcard port, and if so, try to keep the port the same + // as some previously created listener. if (requested_port == 0) { for (sp = s->head; sp; sp = sp->next) { sockname_temp.len = @@ -466,8 +466,8 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s, return err; } -/* Return listener at port_index or NULL. Should only be called with s->mu - locked. */ +// Return listener at port_index or NULL. Should only be called with s->mu +// locked. static grpc_tcp_listener* get_port_index(grpc_tcp_server* s, unsigned port_index) { unsigned num_ports = 0; @@ -569,7 +569,7 @@ static void tcp_server_unref(grpc_tcp_server* s) { static void tcp_server_shutdown_listeners(grpc_tcp_server* s) { gpr_mu_lock(&s->mu); s->shutdown_listeners = true; - /* shutdown all fd's */ + // shutdown all fd's if (s->active_ports) { grpc_tcp_listener* sp; for (sp = s->head; sp; sp = sp->next) { @@ -648,4 +648,4 @@ grpc_tcp_server_vtable grpc_posix_tcp_server_vtable = { tcp_server_ref, tcp_server_shutdown_starting_add, tcp_server_unref, tcp_server_shutdown_listeners}; -#endif /* GRPC_POSIX_SOCKET_TCP_SERVER */ +#endif // GRPC_POSIX_SOCKET_TCP_SERVER diff --git a/src/core/lib/iomgr/tcp_server_utils_posix.h b/src/core/lib/iomgr/tcp_server_utils_posix.h index 567205ed720..0e6c20270ab 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix.h +++ b/src/core/lib/iomgr/tcp_server_utils_posix.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H #define GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H @@ -27,7 +27,7 @@ #include "src/core/lib/iomgr/tcp_server.h" #include "src/core/lib/resource_quota/memory_quota.h" -/* one listening port */ +// one listening port typedef struct grpc_tcp_listener { int fd; grpc_fd* emfd; @@ -39,69 +39,69 @@ typedef struct grpc_tcp_listener { grpc_closure read_closure; grpc_closure destroyed_closure; struct grpc_tcp_listener* next; - /* sibling is a linked list of all listeners for a given port. add_port and - clone_port place all new listeners in the same sibling list. A member of - the 'sibling' list is also a member of the 'next' list. The head of each - sibling list has is_sibling==0, and subsequent members of sibling lists - have is_sibling==1. is_sibling allows separate sibling lists to be - identified while iterating through 'next'. */ + // sibling is a linked list of all listeners for a given port. add_port and + // clone_port place all new listeners in the same sibling list. A member of + // the 'sibling' list is also a member of the 'next' list. The head of each + // sibling list has is_sibling==0, and subsequent members of sibling lists + // have is_sibling==1. is_sibling allows separate sibling lists to be + // identified while iterating through 'next'. struct grpc_tcp_listener* sibling; int is_sibling; } grpc_tcp_listener; -/* the overall server */ +// the overall server struct grpc_tcp_server { gpr_refcount refs; - /* Called whenever accept() succeeds on a server port. */ + // Called whenever accept() succeeds on a server port. grpc_tcp_server_cb on_accept_cb = nullptr; void* on_accept_cb_arg = nullptr; gpr_mu mu; - /* active port count: how many ports are actually still listening */ + // active port count: how many ports are actually still listening size_t active_ports = 0; - /* destroyed port count: how many ports are completely destroyed */ + // destroyed port count: how many ports are completely destroyed size_t destroyed_ports = 0; - /* is this server shutting down? */ + // is this server shutting down? bool shutdown = false; - /* have listeners been shutdown? */ + // have listeners been shutdown? bool shutdown_listeners = false; - /* use SO_REUSEPORT */ + // use SO_REUSEPORT bool so_reuseport = false; - /* expand wildcard addresses to a list of all local addresses */ + // expand wildcard addresses to a list of all local addresses bool expand_wildcard_addrs = false; - /* linked list of server ports */ + // linked list of server ports grpc_tcp_listener* head = nullptr; grpc_tcp_listener* tail = nullptr; unsigned nports = 0; - /* List of closures passed to shutdown_starting_add(). */ + // List of closures passed to shutdown_starting_add(). grpc_closure_list shutdown_starting{nullptr, nullptr}; - /* shutdown callback */ + // shutdown callback grpc_closure* shutdown_complete = nullptr; - /* all pollsets interested in new connections. The object pointed at is not - * owned by this struct */ + // all pollsets interested in new connections. The object pointed at is not + // owned by this struct const std::vector* pollsets = nullptr; - /* next pollset to assign a channel to */ + // next pollset to assign a channel to gpr_atm next_pollset_to_assign = 0; - /* Contains config extracted from channel args for this server */ + // Contains config extracted from channel args for this server grpc_core::PosixTcpOptions options; - /* a handler for external connections, owned */ + // a handler for external connections, owned grpc_core::TcpServerFdHandler* fd_handler = nullptr; - /* used to create slice allocators for endpoints, owned */ + // used to create slice allocators for endpoints, owned grpc_core::MemoryQuotaRefPtr memory_quota; }; -/* If successful, add a listener to \a s for \a addr, set \a dsmode for the - socket, and return the \a listener. */ +// If successful, add a listener to \a s for \a addr, set \a dsmode for the +// socket, and return the \a listener. grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s, const grpc_resolved_address* addr, unsigned port_index, @@ -109,21 +109,21 @@ grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s, grpc_dualstack_mode* dsmode, grpc_tcp_listener** listener); -/* Get all addresses assigned to network interfaces on the machine and create a - listener for each. requested_port is the port to use for every listener, or 0 - to select one random port that will be used for every listener. Set *out_port - to the port selected. Return absl::OkStatus() only if all listeners were - added. */ +// Get all addresses assigned to network interfaces on the machine and create a +// listener for each. requested_port is the port to use for every listener, or 0 +// to select one random port that will be used for every listener. Set *out_port +// to the port selected. Return absl::OkStatus() only if all listeners were +// added. grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s, unsigned port_index, int requested_port, int* out_port); -/* Prepare a recently-created socket for listening. */ +// Prepare a recently-created socket for listening. grpc_error_handle grpc_tcp_server_prepare_socket( grpc_tcp_server*, int fd, const grpc_resolved_address* addr, bool so_reuseport, int* port); -/* Ruturn true if the platform supports ifaddrs */ +// Ruturn true if the platform supports ifaddrs bool grpc_tcp_server_have_ifaddrs(void); -#endif /* GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_SERVER_UTILS_POSIX_H diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc index 052dc58fbe2..b6b39f84512 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix_common.cc +++ b/src/core/lib/iomgr/tcp_server_utils_posix_common.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -47,13 +47,13 @@ static gpr_once s_init_max_accept_queue_size = GPR_ONCE_INIT; static int s_max_accept_queue_size; -/* get max listen queue size on linux */ +// get max listen queue size on linux static void init_max_accept_queue_size(void) { int n = SOMAXCONN; char buf[64]; FILE* fp = fopen("/proc/sys/net/core/somaxconn", "r"); if (fp == nullptr) { - /* 2.4 kernel. */ + // 2.4 kernel. s_max_accept_queue_size = SOMAXCONN; return; } @@ -124,8 +124,8 @@ static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, int fd, return err; } -/* If successful, add a listener to s for addr, set *dsmode for the socket, and - return the *listener. */ +// If successful, add a listener to s for addr, set *dsmode for the socket, and +// return the *listener. grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s, const grpc_resolved_address* addr, unsigned port_index, @@ -146,7 +146,7 @@ grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s, return add_socket_to_server(s, fd, addr, port_index, fd_index, listener); } -/* Prepare a recently-created socket for listening. */ +// Prepare a recently-created socket for listening. grpc_error_handle grpc_tcp_server_prepare_socket( grpc_tcp_server* s, int fd, const grpc_resolved_address* addr, bool so_reuseport, int* port) { @@ -163,7 +163,7 @@ grpc_error_handle grpc_tcp_server_prepare_socket( #ifdef GRPC_LINUX_ERRQUEUE err = grpc_set_socket_zerocopy(fd); if (!err.ok()) { - /* it's not fatal, so just log it. */ + // it's not fatal, so just log it. gpr_log(GPR_DEBUG, "Node does not support SO_ZEROCOPY, continuing."); } #endif @@ -220,4 +220,4 @@ error: return ret; } -#endif /* GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc index 8251b2148e3..159bea5e9ae 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc +++ b/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -40,7 +40,7 @@ #include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/tcp_server_utils_posix.h" -/* Return the listener in s with address addr or NULL. */ +// Return the listener in s with address addr or NULL. static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s, grpc_resolved_address* addr) { grpc_tcp_listener* l; @@ -57,7 +57,7 @@ static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s, return l; } -/* Bind to "::" to get a port number not used by any address. */ +// Bind to "::" to get a port number not used by any address. static grpc_error_handle get_unused_port(int* port) { grpc_resolved_address wild; grpc_sockaddr_make_wildcard6(0, &wild); @@ -98,10 +98,10 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s, grpc_tcp_listener* sp = nullptr; grpc_error_handle err; if (requested_port == 0) { - /* Note: There could be a race where some local addrs can listen on the - selected port and some can't. The sane way to handle this would be to - retry by recreating the whole grpc_tcp_server. Backing out individual - listeners and orphaning the FDs looks like too much trouble. */ + // Note: There could be a race where some local addrs can listen on the + // selected port and some can't. The sane way to handle this would be to + // retry by recreating the whole grpc_tcp_server. Backing out individual + // listeners and orphaning the FDs looks like too much trouble. if ((err = get_unused_port(&requested_port)) != absl::OkStatus()) { return err; } else if (requested_port <= 0) { @@ -128,7 +128,7 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s, } memcpy(addr.addr, ifa_it->ifa_addr, addr.len); if (!grpc_sockaddr_set_port(&addr, requested_port)) { - /* Should never happen, because we check sa_family above. */ + // Should never happen, because we check sa_family above. err = GRPC_ERROR_CREATE("Failed to set port"); break; } @@ -139,8 +139,8 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s, gpr_log(GPR_DEBUG, "Adding local addr from interface %s flags 0x%x to server: %s", ifa_name, ifa_it->ifa_flags, addr_str->c_str()); - /* We could have multiple interfaces with the same address (e.g., bonding), - so look for duplicates. */ + // We could have multiple interfaces with the same address (e.g., bonding), + // so look for duplicates. if (find_listener_with_addr(s, &addr) != nullptr) { gpr_log(GPR_DEBUG, "Skipping duplicate addr %s on interface %s", addr_str->c_str(), ifa_name); @@ -175,4 +175,4 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s, bool grpc_tcp_server_have_ifaddrs(void) { return true; } -#endif /* GRPC_HAVE_IFADDRS */ +#endif // GRPC_HAVE_IFADDRS diff --git a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc index b9f56466a91..d8b11129194 100644 --- a/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc +++ b/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -33,4 +33,4 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* /*s*/, bool grpc_tcp_server_have_ifaddrs(void) { return false; } -#endif /* defined(GRPC_POSIX_SOCKET) && !defined(GRPC_HAVE_IFADDRS) */ +#endif // defined(GRPC_POSIX_SOCKET) && !defined(GRPC_HAVE_IFADDRS) diff --git a/src/core/lib/iomgr/tcp_server_windows.cc b/src/core/lib/iomgr/tcp_server_windows.cc index f72bc9879c1..082ecb79464 100644 --- a/src/core/lib/iomgr/tcp_server_windows.cc +++ b/src/core/lib/iomgr/tcp_server_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -52,55 +52,55 @@ using ::grpc_event_engine::experimental::EndpointConfig; -/* one listening port */ +// one listening port typedef struct grpc_tcp_listener grpc_tcp_listener; struct grpc_tcp_listener { - /* This seemingly magic number comes from AcceptEx's documentation. each - address buffer needs to have at least 16 more bytes at their end. */ + // This seemingly magic number comes from AcceptEx's documentation. each + // address buffer needs to have at least 16 more bytes at their end. uint8_t addresses[(sizeof(grpc_sockaddr_in6) + 16) * 2]; - /* This will hold the socket for the next accept. */ + // This will hold the socket for the next accept. SOCKET new_socket; - /* The listener winsocket. */ + // The listener winsocket. grpc_winsocket* socket; - /* The actual TCP port number. */ + // The actual TCP port number. int port; unsigned port_index; grpc_tcp_server* server; - /* The cached AcceptEx for that port. */ + // The cached AcceptEx for that port. LPFN_ACCEPTEX AcceptEx; int shutting_down; int outstanding_calls; - /* closure for socket notification of accept being ready */ + // closure for socket notification of accept being ready grpc_closure on_accept; - /* linked list */ + // linked list struct grpc_tcp_listener* next; }; -/* the overall server */ +// the overall server struct grpc_tcp_server { gpr_refcount refs; - /* Called whenever accept() succeeds on a server port. */ + // Called whenever accept() succeeds on a server port. grpc_tcp_server_cb on_accept_cb; void* on_accept_cb_arg; gpr_mu mu; - /* active port count: how many ports are actually still listening */ + // active port count: how many ports are actually still listening int active_ports; - /* linked list of server ports */ + // linked list of server ports grpc_tcp_listener* head; grpc_tcp_listener* tail; - /* List of closures passed to shutdown_starting_add(). */ + // List of closures passed to shutdown_starting_add(). grpc_closure_list shutdown_starting; - /* shutdown callback */ + // shutdown callback grpc_closure* shutdown_complete; }; -/* Public function. Allocates the proper data structures to hold a - grpc_tcp_server. */ +// Public function. Allocates the proper data structures to hold a +// grpc_tcp_server. static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete, const EndpointConfig& config, grpc_tcp_server_cb on_accept_cb, @@ -124,9 +124,9 @@ static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete, static void destroy_server(void* arg, grpc_error_handle error) { grpc_tcp_server* s = (grpc_tcp_server*)arg; - /* Now that the accepts have been aborted, we can destroy the sockets. - The IOCP won't get notified on these, so we can flag them as already - closed by the system. */ + // Now that the accepts have been aborted, we can destroy the sockets. + // The IOCP won't get notified on these, so we can flag them as already + // closed by the system. while (s->head) { grpc_tcp_listener* sp = s->head; s->head = sp->next; @@ -166,8 +166,8 @@ static void tcp_server_shutdown_starting_add(grpc_tcp_server* s, static void tcp_server_destroy(grpc_tcp_server* s) { grpc_tcp_listener* sp; gpr_mu_lock(&s->mu); - /* First, shutdown all fd's. This will queue abortion calls for all - of the pending accepts due to the normal operation mechanism. */ + // First, shutdown all fd's. This will queue abortion calls for all + // of the pending accepts due to the normal operation mechanism. if (s->active_ports == 0) { finish_shutdown_locked(s); } else { @@ -189,7 +189,7 @@ static void tcp_server_unref(grpc_tcp_server* s) { } } -/* Prepare (bind) a recently-created socket for listening. */ +// Prepare (bind) a recently-created socket for listening. static grpc_error_handle prepare_socket(SOCKET sock, const grpc_resolved_address* addr, int* port) { @@ -246,8 +246,8 @@ static void decrement_active_ports_and_notify_locked(grpc_tcp_listener* sp) { } } -/* In order to do an async accept, we need to create a socket first which - will be the one assigned to the new incoming connection. */ +// In order to do an async accept, we need to create a socket first which +// will be the one assigned to the new incoming connection. static grpc_error_handle start_accept_locked(grpc_tcp_listener* port) { SOCKET sock = INVALID_SOCKET; BOOL success; @@ -269,13 +269,13 @@ static grpc_error_handle start_accept_locked(grpc_tcp_listener* port) { error = grpc_tcp_prepare_socket(sock); if (!error.ok()) goto failure; - /* Start the "accept" asynchronously. */ + // Start the "accept" asynchronously. success = port->AcceptEx(port->socket->socket, sock, port->addresses, 0, addrlen, addrlen, &bytes_received, &port->socket->read_info.overlapped); - /* It is possible to get an accept immediately without delay. However, we - will still get an IOCP notification for it. So let's just ignore it. */ + // It is possible to get an accept immediately without delay. However, we + // will still get an IOCP notification for it. So let's just ignore it. if (!success) { int last_error = WSAGetLastError(); if (last_error != ERROR_IO_PENDING) { @@ -284,8 +284,8 @@ static grpc_error_handle start_accept_locked(grpc_tcp_listener* port) { } } - /* We're ready to do the accept. Calling grpc_socket_notify_on_read may - immediately process an accept that happened in the meantime. */ + // We're ready to do the accept. Calling grpc_socket_notify_on_read may + // immediately process an accept that happened in the meantime. port->new_socket = sock; grpc_socket_notify_on_read(port->socket, &port->on_accept); port->outstanding_calls++; @@ -297,7 +297,7 @@ failure: return error; } -/* Event manager callback when reads are ready. */ +// Event manager callback when reads are ready. static void on_accept(void* arg, grpc_error_handle error) { grpc_tcp_listener* sp = (grpc_tcp_listener*)arg; SOCKET sock = sp->new_socket; @@ -313,9 +313,9 @@ static void on_accept(void* arg, grpc_error_handle error) { peer_name.len = sizeof(struct sockaddr_storage); - /* The general mechanism for shutting down is to queue abortion calls. While - this is necessary in the read/write case, it's useless for the accept - case. We only need to adjust the pending callback count */ + // The general mechanism for shutting down is to queue abortion calls. While + // this is necessary in the read/write case, it's useless for the accept + // case. We only need to adjust the pending callback count if (!error.ok()) { gpr_log(GPR_INFO, "Skipping on_accept due to error: %s", grpc_core::StatusToString(error).c_str()); @@ -323,8 +323,8 @@ static void on_accept(void* arg, grpc_error_handle error) { gpr_mu_unlock(&sp->server->mu); return; } - /* The IOCP notified us of a completed operation. Let's grab the results, - and act accordingly. */ + // The IOCP notified us of a completed operation. Let's grab the results, + // and act accordingly. transfered_bytes = 0; wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, &transfered_bytes, FALSE, &flags); @@ -369,8 +369,8 @@ static void on_accept(void* arg, grpc_error_handle error) { } } - /* The only time we should call our callback, is where we successfully - managed to accept a connection, and created an endpoint. */ + // The only time we should call our callback, is where we successfully + // managed to accept a connection, and created an endpoint. if (ep) { // Create acceptor. grpc_tcp_server_acceptor* acceptor = @@ -381,10 +381,10 @@ static void on_accept(void* arg, grpc_error_handle error) { acceptor->external_connection = false; sp->server->on_accept_cb(sp->server->on_accept_cb_arg, ep, NULL, acceptor); } - /* As we were notified from the IOCP of one and exactly one accept, - the former socked we created has now either been destroy or assigned - to the new connection. We need to create a new one for the next - connection. */ + // As we were notified from the IOCP of one and exactly one accept, + // the former socked we created has now either been destroy or assigned + // to the new connection. We need to create a new one for the next + // connection. GPR_ASSERT(GRPC_LOG_IF_ERROR("start_accept", start_accept_locked(sp))); if (0 == --sp->outstanding_calls) { decrement_active_ports_and_notify_locked(sp); @@ -404,8 +404,8 @@ static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, SOCKET sock, LPFN_ACCEPTEX AcceptEx; grpc_error_handle error; - /* We need to grab the AcceptEx pointer for that port, as it may be - interface-dependent. We'll cache it to avoid doing that again. */ + // We need to grab the AcceptEx pointer for that port, as it may be + // interface-dependent. We'll cache it to avoid doing that again. status = WSAIoctl(sock, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid), &AcceptEx, sizeof(AcceptEx), &ioctl_num_bytes, NULL, NULL); @@ -465,8 +465,8 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s, port_index = s->tail->port_index + 1; } - /* Check if this is a wildcard port, and if so, try to keep the port the same - as some previously created listener. */ + // Check if this is a wildcard port, and if so, try to keep the port the same + // as some previously created listener. if (grpc_sockaddr_get_port(addr) == 0) { for (sp = s->head; sp; sp = sp->next) { int sockname_temp_len = sizeof(struct sockaddr_storage); @@ -491,7 +491,7 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s, addr = &addr6_v4mapped; } - /* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */ + // Treat :: or 0.0.0.0 as a family-agnostic wildcard. if (grpc_sockaddr_is_wildcard(addr, port)) { grpc_sockaddr_make_wildcard6(*port, &wildcard); @@ -557,4 +557,4 @@ grpc_tcp_server_vtable grpc_windows_tcp_server_vtable = { tcp_server_port_fd_count, tcp_server_port_fd, tcp_server_ref, tcp_server_shutdown_starting_add, tcp_server_unref, tcp_server_shutdown_listeners}; -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/tcp_windows.cc b/src/core/lib/iomgr/tcp_windows.cc index b94c1954f3f..215aa1bbc11 100644 --- a/src/core/lib/iomgr/tcp_windows.cc +++ b/src/core/lib/iomgr/tcp_windows.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -44,8 +44,8 @@ #include "src/core/lib/slice/slice_string_helpers.h" #if defined(__MSYS__) && defined(GPR_ARCH_64) -/* Nasty workaround for nasty bug when using the 64 bits msys compiler - in conjunction with Microsoft Windows headers. */ +// Nasty workaround for nasty bug when using the 64 bits msys compiler +// in conjunction with Microsoft Windows headers. #define GRPC_FIONBIO _IOW('f', 126, uint32_t) #else #define GRPC_FIONBIO FIONBIO @@ -98,11 +98,11 @@ grpc_error_handle grpc_tcp_prepare_socket(SOCKET sock) { } typedef struct grpc_tcp { - /* This is our C++ class derivation emulation. */ + // This is our C++ class derivation emulation. grpc_endpoint base; - /* The one socket this endpoint is using. */ + // The one socket this endpoint is using. grpc_winsocket* socket; - /* Refcounting how many operations are in progress. */ + // Refcounting how many operations are in progress. gpr_refcount refcount; grpc_closure on_read; @@ -111,14 +111,14 @@ typedef struct grpc_tcp { grpc_closure* read_cb; grpc_closure* write_cb; - /* garbage after the last read */ + // garbage after the last read grpc_slice_buffer last_read_buffer; grpc_slice_buffer* write_slices; grpc_slice_buffer* read_slices; - /* The IO Completion Port runs from another thread. We need some mechanism - to protect ourselves when requesting a shutdown. */ + // The IO Completion Port runs from another thread. We need some mechanism + // to protect ourselves when requesting a shutdown. gpr_mu mu; int shutting_down; grpc_error_handle shutdown_error; @@ -172,7 +172,7 @@ static void tcp_unref(grpc_tcp* tcp) { static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); } #endif -/* Asynchronous callback from the IOCP, or the background thread. */ +// Asynchronous callback from the IOCP, or the background thread. static void on_read(void* tcpp, grpc_error_handle error) { grpc_tcp* tcp = (grpc_tcp*)tcpp; grpc_closure* cb = tcp->read_cb; @@ -280,19 +280,19 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, TCP_REF(tcp, "read"); - /* First let's try a synchronous, non-blocking read. */ + // First let's try a synchronous, non-blocking read. status = WSARecv(tcp->socket->socket, buffers, (DWORD)tcp->read_slices->count, &bytes_read, &flags, NULL, NULL); info->wsa_error = status == 0 ? 0 : WSAGetLastError(); - /* Did we get data immediately ? Yay. */ + // Did we get data immediately ? Yay. if (info->wsa_error != WSAEWOULDBLOCK) { info->bytes_transferred = bytes_read; grpc_core::ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, absl::OkStatus()); return; } - /* Otherwise, let's retry, by queuing a read. */ + // Otherwise, let's retry, by queuing a read. memset(&tcp->socket->read_info.overlapped, 0, sizeof(OVERLAPPED)); status = WSARecv(tcp->socket->socket, buffers, (DWORD)tcp->read_slices->count, &bytes_read, &flags, &info->overlapped, NULL); @@ -310,7 +310,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices, grpc_socket_notify_on_read(tcp->socket, &tcp->on_read); } -/* Asynchronous callback from the IOCP, or the background thread. */ +// Asynchronous callback from the IOCP, or the background thread. static void on_write(void* tcpp, grpc_error_handle error) { grpc_tcp* tcp = (grpc_tcp*)tcpp; grpc_winsocket* handle = tcp->socket; @@ -338,7 +338,7 @@ static void on_write(void* tcpp, grpc_error_handle error) { grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error); } -/* Initiates a write. */ +// Initiates a write. static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, grpc_closure* cb, void* arg, int /*max_frame_size*/) { grpc_tcp* tcp = (grpc_tcp*)ep; @@ -388,7 +388,7 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, buffers[i].buf = (char*)GRPC_SLICE_START_PTR(tcp->write_slices->slices[i]); } - /* First, let's try a synchronous, non-blocking write. */ + // First, let's try a synchronous, non-blocking write. status = WSASend(socket->socket, buffers, (DWORD)tcp->write_slices->count, &bytes_sent, 0, NULL, NULL); @@ -401,8 +401,8 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, return; } - /* The data was not completely delivered, we should send the rest of - them by doing an async write operation. */ + // The data was not completely delivered, we should send the rest of + // them by doing an async write operation. for (i = 0; i < tcp->write_slices->count; i++) { if (buffers[i].len > bytes_sent) { buffers[i].buf += bytes_sent; @@ -415,9 +415,9 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, } else { info->wsa_error = WSAGetLastError(); - /* We would kind of expect to get a WSAEWOULDBLOCK here, especially on a - busy connection that has its send queue filled up. But if we don't, then - we can avoid doing an async write operation at all. */ + // We would kind of expect to get a WSAEWOULDBLOCK here, especially on a + // busy connection that has its send queue filled up. But if we don't, then + // we can avoid doing an async write operation at all. if (info->wsa_error != WSAEWOULDBLOCK) { grpc_error_handle error = GRPC_WSA_ERROR(info->wsa_error, "WSASend"); grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error); @@ -428,8 +428,8 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, TCP_REF(tcp, "write"); - /* If we got a WSAEWOULDBLOCK earlier, then we need to re-do the same - operation, this time asynchronously. */ + // If we got a WSAEWOULDBLOCK earlier, then we need to re-do the same + // operation, this time asynchronously. memset(&socket->write_info.overlapped, 0, sizeof(OVERLAPPED)); status = WSASend(socket->socket, buffers + async_buffers_offset, (DWORD)(tcp->write_slices->count - async_buffers_offset), @@ -446,8 +446,8 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices, } } - /* As all is now setup, we can now ask for the IOCP notification. It may - trigger the callback immediately however, but no matter. */ + // As all is now setup, we can now ask for the IOCP notification. It may + // trigger the callback immediately however, but no matter. grpc_socket_notify_on_write(socket, &tcp->on_write); } @@ -468,17 +468,17 @@ static void win_add_to_pollset_set(grpc_endpoint* ep, grpc_pollset_set* pss) { static void win_delete_from_pollset_set(grpc_endpoint* ep, grpc_pollset_set* pss) {} -/* Initiates a shutdown of the TCP endpoint. This will queue abort callbacks - for the potential read and write operations. It is up to the caller to - guarantee this isn't called in parallel to a read or write request, so - we're not going to protect against these. However the IO Completion Port - callback will happen from another thread, so we need to protect against - concurrent access of the data structure in that regard. */ +// Initiates a shutdown of the TCP endpoint. This will queue abort callbacks +// for the potential read and write operations. It is up to the caller to +// guarantee this isn't called in parallel to a read or write request, so +// we're not going to protect against these. However the IO Completion Port +// callback will happen from another thread, so we need to protect against +// concurrent access of the data structure in that regard. static void win_shutdown(grpc_endpoint* ep, grpc_error_handle why) { grpc_tcp* tcp = (grpc_tcp*)ep; gpr_mu_lock(&tcp->mu); - /* At that point, what may happen is that we're already inside the IOCP - callback. See the comments in on_read and on_write. */ + // At that point, what may happen is that we're already inside the IOCP + // callback. See the comments in on_read and on_write. if (!tcp->shutting_down) { tcp->shutting_down = 1; tcp->shutdown_error = why; @@ -546,4 +546,4 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket, return &tcp->base; } -#endif /* GRPC_WINSOCK_SOCKET */ +#endif // GRPC_WINSOCK_SOCKET diff --git a/src/core/lib/iomgr/tcp_windows.h b/src/core/lib/iomgr/tcp_windows.h index 6916a8ffd17..0ad9a77dd1a 100644 --- a/src/core/lib/iomgr/tcp_windows.h +++ b/src/core/lib/iomgr/tcp_windows.h @@ -1,33 +1,33 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H #define GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H -/* - Low level TCP "bottom half" implementation, for use by transports built on - top of a TCP connection. +// +// Low level TCP "bottom half" implementation, for use by transports built on +// top of a TCP connection. - Note that this file does not (yet) include APIs for creating the socket in - the first place. +// Note that this file does not (yet) include APIs for creating the socket in +// the first place. - All calls passing slice transfer ownership of a slice refcount unless - otherwise specified. -*/ +// All calls passing slice transfer ownership of a slice refcount unless +// otherwise specified. +// #include @@ -37,9 +37,9 @@ #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/socket_windows.h" -/* Create a tcp endpoint given a winsock handle. - * Takes ownership of the handle. - */ +// Create a tcp endpoint given a winsock handle. +// Takes ownership of the handle. +// grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket, absl::string_view peer_string); @@ -49,4 +49,4 @@ grpc_error_handle grpc_tcp_set_non_block(SOCKET sock); #endif -#endif /* GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H */ +#endif // GRPC_CORE_LIB_IOMGR_TCP_WINDOWS_H diff --git a/src/core/lib/iomgr/timer.cc b/src/core/lib/iomgr/timer.cc index 39af4198b48..e2ec74a72fd 100644 --- a/src/core/lib/iomgr/timer.cc +++ b/src/core/lib/iomgr/timer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/iomgr/timer.h b/src/core/lib/iomgr/timer.h index 705e8131410..330d508dfc6 100644 --- a/src/core/lib/iomgr/timer.h +++ b/src/core/lib/iomgr/timer.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TIMER_H #define GRPC_CORE_LIB_IOMGR_TIMER_H @@ -62,75 +62,75 @@ typedef struct grpc_timer_vtable { void (*init)(grpc_timer* timer, grpc_core::Timestamp, grpc_closure* closure); void (*cancel)(grpc_timer* timer); - /* Internal API */ + // Internal API grpc_timer_check_result (*check)(grpc_core::Timestamp* next); void (*list_init)(); void (*list_shutdown)(void); void (*consume_kick)(void); } grpc_timer_vtable; -/* Initialize *timer. When expired or canceled, closure will be called with - error set to indicate if it expired (absl::OkStatus()) or was canceled - (absl::CancelledError()). *closure is guaranteed to be called exactly once, - and application code should check the error to determine how it was invoked. - The application callback is also responsible for maintaining information - about when to free up any user-level state. Behavior is undefined for a - deadline of grpc_core::Timestamp::InfFuture(). */ +// Initialize *timer. When expired or canceled, closure will be called with +// error set to indicate if it expired (absl::OkStatus()) or was canceled +// (absl::CancelledError()). *closure is guaranteed to be called exactly once, +// and application code should check the error to determine how it was invoked. +// The application callback is also responsible for maintaining information +// about when to free up any user-level state. Behavior is undefined for a +// deadline of grpc_core::Timestamp::InfFuture(). void grpc_timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, grpc_closure* closure); -/* Initialize *timer without setting it. This can later be passed through - the regular init or cancel */ +// Initialize *timer without setting it. This can later be passed through +// the regular init or cancel void grpc_timer_init_unset(grpc_timer* timer); -/* Note that there is no timer destroy function. This is because the - timer is a one-time occurrence with a guarantee that the callback will - be called exactly once, either at expiration or cancellation. Thus, all - the internal timer event management state is destroyed just before - that callback is invoked. If the user has additional state associated with - the timer, the user is responsible for determining when it is safe to - destroy that state. */ - -/* Cancel an *timer. - There are three cases: - 1. We normally cancel the timer - 2. The timer has already run - 3. We can't cancel the timer because it is "in flight". - - In all of these cases, the cancellation is still considered successful. - They are essentially distinguished in that the timer_cb will be run - exactly once from either the cancellation (with error absl::CancelledError()) - or from the activation (with error absl::OkStatus()). - - Note carefully that the callback function MAY occur in the same callstack - as grpc_timer_cancel. It's expected that most timers will be cancelled (their - primary use is to implement deadlines), and so this code is optimized such - that cancellation costs as little as possible. Making callbacks run inline - matches this aim. - - Requires: cancel() must happen after init() on a given timer */ +// Note that there is no timer destroy function. This is because the +// timer is a one-time occurrence with a guarantee that the callback will +// be called exactly once, either at expiration or cancellation. Thus, all +// the internal timer event management state is destroyed just before +// that callback is invoked. If the user has additional state associated with +// the timer, the user is responsible for determining when it is safe to +// destroy that state. + +// Cancel an *timer. +// There are three cases: +// 1. We normally cancel the timer +// 2. The timer has already run +// 3. We can't cancel the timer because it is "in flight". + +// In all of these cases, the cancellation is still considered successful. +// They are essentially distinguished in that the timer_cb will be run +// exactly once from either the cancellation (with error absl::CancelledError()) +// or from the activation (with error absl::OkStatus()). + +// Note carefully that the callback function MAY occur in the same callstack +// as grpc_timer_cancel. It's expected that most timers will be cancelled (their +// primary use is to implement deadlines), and so this code is optimized such +// that cancellation costs as little as possible. Making callbacks run inline +// matches this aim. + +// Requires: cancel() must happen after init() on a given timer void grpc_timer_cancel(grpc_timer* timer); -/* iomgr internal api for dealing with timers */ +// iomgr internal api for dealing with timers -/* Check for timers to be run, and run them. - Return true if timer callbacks were executed. - If next is non-null, TRY to update *next with the next running timer - IF that timer occurs before *next current value. - *next is never guaranteed to be updated on any given execution; however, - with high probability at least one thread in the system will see an update - at any time slice. */ +// Check for timers to be run, and run them. +// Return true if timer callbacks were executed. +// If next is non-null, TRY to update *next with the next running timer +// IF that timer occurs before *next current value. +// *next is never guaranteed to be updated on any given execution; however, +// with high probability at least one thread in the system will see an update +// at any time slice. grpc_timer_check_result grpc_timer_check(grpc_core::Timestamp* next); void grpc_timer_list_init(); void grpc_timer_list_shutdown(); -/* Consume a kick issued by grpc_kick_poller */ +// Consume a kick issued by grpc_kick_poller void grpc_timer_consume_kick(void); -/* the following must be implemented by each iomgr implementation */ +// the following must be implemented by each iomgr implementation void grpc_kick_poller(void); -/* Sets the timer implementation */ +// Sets the timer implementation void grpc_set_timer_impl(grpc_timer_vtable* vtable); -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_H */ +#endif // GRPC_CORE_LIB_IOMGR_TIMER_H diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc index 1967ffc580c..36ff009233a 100644 --- a/src/core/lib/iomgr/timer_generic.cc +++ b/src/core/lib/iomgr/timer_generic.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -49,48 +49,48 @@ grpc_core::TraceFlag grpc_timer_trace(false, "timer"); grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check"); -/* A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with - * deadlines earlier than 'queue_deadline_cap' are maintained in the heap and - * others are maintained in the list (unordered). This helps to keep the number - * of elements in the heap low. - * - * The 'queue_deadline_cap' gets recomputed periodically based on the timer - * stats maintained in 'stats' and the relevant timers are then moved from the - * 'list' to 'heap'. - */ +// A "timer shard". Contains a 'heap' and a 'list' of timers. All timers with +// deadlines earlier than 'queue_deadline_cap' are maintained in the heap and +// others are maintained in the list (unordered). This helps to keep the number +// of elements in the heap low. +// +// The 'queue_deadline_cap' gets recomputed periodically based on the timer +// stats maintained in 'stats' and the relevant timers are then moved from the +// 'list' to 'heap'. +// struct timer_shard { gpr_mu mu; grpc_core::ManualConstructor stats; - /* All and only timers with deadlines < this will be in the heap. */ + // All and only timers with deadlines < this will be in the heap. grpc_core::Timestamp queue_deadline_cap; - /* The deadline of the next timer due in this shard. */ + // The deadline of the next timer due in this shard. grpc_core::Timestamp min_deadline; - /* Index of this timer_shard in the g_shard_queue. */ + // Index of this timer_shard in the g_shard_queue. uint32_t shard_queue_index; - /* This holds all timers with deadlines < queue_deadline_cap. Timers in this - list have the top bit of their deadline set to 0. */ + // This holds all timers with deadlines < queue_deadline_cap. Timers in this + // list have the top bit of their deadline set to 0. grpc_timer_heap heap; - /* This holds timers whose deadline is >= queue_deadline_cap. */ + // This holds timers whose deadline is >= queue_deadline_cap. grpc_timer list; }; static size_t g_num_shards; -/* Array of timer shards. Whenever a timer (grpc_timer *) is added, its address - * is hashed to select the timer shard to add the timer to */ +// Array of timer shards. Whenever a timer (grpc_timer *) is added, its address +// is hashed to select the timer shard to add the timer to static timer_shard* g_shards; -/* Maintains a sorted list of timer shards (sorted by their min_deadline, i.e - * the deadline of the next timer in each shard). - * Access to this is protected by g_shared_mutables.mu */ +// Maintains a sorted list of timer shards (sorted by their min_deadline, i.e +// the deadline of the next timer in each shard). +// Access to this is protected by g_shared_mutables.mu static timer_shard** g_shard_queue; #ifndef NDEBUG -/* == DEBUG ONLY: hash table for duplicate timer detection == */ +// == DEBUG ONLY: hash table for duplicate timer detection == -#define NUM_HASH_BUCKETS 1009 /* Prime number close to 1000 */ +#define NUM_HASH_BUCKETS 1009 // Prime number close to 1000 -static gpr_mu g_hash_mu[NUM_HASH_BUCKETS]; /* One mutex per bucket */ +static gpr_mu g_hash_mu[NUM_HASH_BUCKETS]; // One mutex per bucket static grpc_timer* g_timer_ht[NUM_HASH_BUCKETS] = {nullptr}; static void init_timer_ht() { @@ -138,7 +138,7 @@ static void add_to_ht(grpc_timer* t) { abort(); } - /* Timer not present in the bucket. Insert at head of the list */ + // Timer not present in the bucket. Insert at head of the list t->hash_table_next = g_timer_ht[i]; g_timer_ht[i] = t; gpr_mu_unlock(&g_hash_mu[i]); @@ -178,10 +178,10 @@ static void remove_from_ht(grpc_timer* t) { t->hash_table_next = nullptr; } -/* If a timer is added to a timer shard (either heap or a list), it must - * be pending. A timer is added to hash table only-if it is added to the - * timer shard. - * Therefore, if timer->pending is false, it cannot be in hash table */ +// If a timer is added to a timer shard (either heap or a list), it must +// be pending. A timer is added to hash table only-if it is added to the +// timer shard. +// Therefore, if timer->pending is false, it cannot be in hash table static void validate_non_pending_timer(grpc_timer* t) { if (!t->pending && is_in_ht(t)) { grpc_closure* c = t->closure; @@ -211,19 +211,19 @@ static void validate_non_pending_timer(grpc_timer* t) { #endif -/* Thread local variable that stores the deadline of the next timer the thread - * has last-seen. This is an optimization to prevent the thread from checking - * shared_mutables.min_timer (which requires acquiring shared_mutables.mu lock, - * an expensive operation) */ +// Thread local variable that stores the deadline of the next timer the thread +// has last-seen. This is an optimization to prevent the thread from checking +// shared_mutables.min_timer (which requires acquiring shared_mutables.mu lock, +// an expensive operation) static thread_local int64_t g_last_seen_min_timer; struct shared_mutables { - /* The deadline of the next timer due across all timer shards */ + // The deadline of the next timer due across all timer shards grpc_core::Timestamp min_timer; - /* Allow only one run_some_expired_timers at once */ + // Allow only one run_some_expired_timers at once gpr_spinlock checker_mu; bool initialized; - /* Protects g_shard_queue (and the shared_mutables struct itself) */ + // Protects g_shard_queue (and the shared_mutables struct itself) gpr_mu mu; } GPR_ALIGN_STRUCT(GPR_CACHELINE_SIZE); @@ -288,7 +288,7 @@ static void timer_list_shutdown() { DESTROY_TIMER_HASH_TABLE(); } -/* returns true if the first element in the list */ +// returns true if the first element in the list static void list_join(grpc_timer* head, grpc_timer* timer) { timer->next = head; timer->prev = head->prev; @@ -360,7 +360,7 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, timer->pending = false; grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure, absl::OkStatus()); gpr_mu_unlock(&shard->mu); - /* early out */ + // early out return; } @@ -384,17 +384,17 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, } gpr_mu_unlock(&shard->mu); - /* Deadline may have decreased, we need to adjust the main queue. Note - that there is a potential racy unlocked region here. There could be a - reordering of multiple grpc_timer_init calls, at this point, but the < test - below should ensure that we err on the side of caution. There could - also be a race with grpc_timer_check, which might beat us to the lock. In - that case, it is possible that the timer that we added will have already - run by the time we hold the lock, but that too is a safe error. - Finally, it's possible that the grpc_timer_check that intervened failed to - trigger the new timer because the min_deadline hadn't yet been reduced. - In that case, the timer will simply have to wait for the next - grpc_timer_check. */ + // Deadline may have decreased, we need to adjust the main queue. Note + // that there is a potential racy unlocked region here. There could be a + // reordering of multiple grpc_timer_init calls, at this point, but the < test + // below should ensure that we err on the side of caution. There could + // also be a race with grpc_timer_check, which might beat us to the lock. In + // that case, it is possible that the timer that we added will have already + // run by the time we hold the lock, but that too is a safe error. + // Finally, it's possible that the grpc_timer_check that intervened failed to + // trigger the new timer because the min_deadline hadn't yet been reduced. + // In that case, the timer will simply have to wait for the next + // grpc_timer_check. if (is_first_timer) { gpr_mu_lock(&g_shared_mutables.mu); if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) { @@ -427,13 +427,13 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline, } static void timer_consume_kick(void) { - /* Force re-evaluation of last seen min */ + // Force re-evaluation of last seen min g_last_seen_min_timer = 0; } static void timer_cancel(grpc_timer* timer) { if (!g_shared_mutables.initialized) { - /* must have already been cancelled, also the shard mutex is invalid */ + // must have already been cancelled, also the shard mutex is invalid return; } @@ -461,13 +461,13 @@ static void timer_cancel(grpc_timer* timer) { gpr_mu_unlock(&shard->mu); } -/* Rebalances the timer shard by computing a new 'queue_deadline_cap' and moving - all relevant timers in shard->list (i.e timers with deadlines earlier than - 'queue_deadline_cap') into into shard->heap. - Returns 'true' if shard->heap has at least ONE element - REQUIRES: shard->mu locked */ +// Rebalances the timer shard by computing a new 'queue_deadline_cap' and moving +// all relevant timers in shard->list (i.e timers with deadlines earlier than +// 'queue_deadline_cap') into into shard->heap. +// Returns 'true' if shard->heap has at least ONE element +// REQUIRES: shard->mu locked static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { - /* Compute the new queue window width and bound by the limits: */ + // Compute the new queue window width and bound by the limits: double computed_deadline_delta = shard->stats->UpdateAverage() * ADD_DEADLINE_SCALE; double deadline_delta = @@ -475,7 +475,7 @@ static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { MAX_QUEUE_WINDOW_DURATION); grpc_timer *timer, *next; - /* Compute the new cap and put all timers under it into the queue: */ + // Compute the new cap and put all timers under it into the queue: shard->queue_deadline_cap = std::max(now, shard->queue_deadline_cap) + grpc_core::Duration::FromSecondsAsDouble(deadline_delta); @@ -503,9 +503,9 @@ static bool refill_heap(timer_shard* shard, grpc_core::Timestamp now) { return !grpc_timer_heap_is_empty(&shard->heap); } -/* This pops the next non-cancelled timer with deadline <= now from the - queue, or returns NULL if there isn't one. - REQUIRES: shard->mu locked */ +// This pops the next non-cancelled timer with deadline <= now from the +// queue, or returns NULL if there isn't one. +// REQUIRES: shard->mu locked static grpc_timer* pop_one(timer_shard* shard, grpc_core::Timestamp now) { grpc_timer* timer; for (;;) { @@ -539,7 +539,7 @@ static grpc_timer* pop_one(timer_shard* shard, grpc_core::Timestamp now) { } } -/* REQUIRES: shard->mu unlocked */ +// REQUIRES: shard->mu unlocked static size_t pop_timers(timer_shard* shard, grpc_core::Timestamp now, grpc_core::Timestamp* new_min_deadline, grpc_error_handle error) { @@ -604,9 +604,9 @@ static grpc_timer_check_result run_some_expired_timers( g_shard_queue[0]->min_deadline == now)) { grpc_core::Timestamp new_min_deadline; - /* For efficiency, we pop as many available timers as we can from the - shard. This may violate perfect timer deadline ordering, but that - shouldn't be a big deal because we don't make ordering guarantees. */ + // For efficiency, we pop as many available timers as we can from the + // shard. This may violate perfect timer deadline ordering, but that + // shouldn't be a big deal because we don't make ordering guarantees. if (pop_timers(g_shard_queue[0], now, &new_min_deadline, error) > 0) { result = GRPC_TIMERS_FIRED; } @@ -623,11 +623,11 @@ static grpc_timer_check_result run_some_expired_timers( now.milliseconds_after_process_epoch()); } - /* An grpc_timer_init() on the shard could intervene here, adding a new - timer that is earlier than new_min_deadline. However, - grpc_timer_init() will block on the mutex before it can call - set_min_deadline, so this one will complete first and then the Addtimer - will reduce the min_deadline (perhaps unnecessarily). */ + // An grpc_timer_init() on the shard could intervene here, adding a new + // timer that is earlier than new_min_deadline. However, + // grpc_timer_init() will block on the mutex before it can call + // set_min_deadline, so this one will complete first and then the Addtimer + // will reduce the min_deadline (perhaps unnecessarily). g_shard_queue[0]->min_deadline = new_min_deadline; note_deadline_change(g_shard_queue[0]); } @@ -661,8 +661,8 @@ static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) { // prelude grpc_core::Timestamp now = grpc_core::Timestamp::Now(); - /* fetch from a thread-local first: this avoids contention on a globally - mutable cacheline in the common case */ + // fetch from a thread-local first: this avoids contention on a globally + // mutable cacheline in the common case grpc_core::Timestamp min_timer = grpc_core::Timestamp::FromMillisecondsAfterProcessEpoch( g_last_seen_min_timer); diff --git a/src/core/lib/iomgr/timer_generic.h b/src/core/lib/iomgr/timer_generic.h index 2ac002b6f37..e43a74d7c53 100644 --- a/src/core/lib/iomgr/timer_generic.h +++ b/src/core/lib/iomgr/timer_generic.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H #define GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H @@ -27,7 +27,7 @@ struct grpc_timer { gpr_atm deadline; - uint32_t heap_index; /* INVALID_HEAP_INDEX if not in heap */ + uint32_t heap_index; // INVALID_HEAP_INDEX if not in heap bool pending; struct grpc_timer* next; struct grpc_timer* prev; @@ -37,4 +37,4 @@ struct grpc_timer { #endif }; -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H */ +#endif // GRPC_CORE_LIB_IOMGR_TIMER_GENERIC_H diff --git a/src/core/lib/iomgr/timer_heap.cc b/src/core/lib/iomgr/timer_heap.cc index 604bfe1b31c..8b346e77a1e 100644 --- a/src/core/lib/iomgr/timer_heap.cc +++ b/src/core/lib/iomgr/timer_heap.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -27,11 +27,11 @@ #include "src/core/lib/gpr/useful.h" #include "src/core/lib/iomgr/port.h" -/* Adjusts a heap so as to move a hole at position i closer to the root, - until a suitable position is found for element t. Then, copies t into that - position. This functor is called each time immediately after modifying a - value in the underlying container, with the offset of the modified element as - its argument. */ +// Adjusts a heap so as to move a hole at position i closer to the root, +// until a suitable position is found for element t. Then, copies t into that +// position. This functor is called each time immediately after modifying a +// value in the underlying container, with the offset of the modified element as +// its argument. static void adjust_upwards(grpc_timer** first, uint32_t i, grpc_timer* t) { while (i > 0) { uint32_t parent = static_cast((static_cast(i) - 1) / 2); @@ -44,9 +44,9 @@ static void adjust_upwards(grpc_timer** first, uint32_t i, grpc_timer* t) { t->heap_index = i; } -/* Adjusts a heap so as to move a hole at position i farther away from the root, - until a suitable position is found for element t. Then, copies t into that - position. */ +// Adjusts a heap so as to move a hole at position i farther away from the root, +// until a suitable position is found for element t. Then, copies t into that +// position. static void adjust_downwards(grpc_timer** first, uint32_t i, uint32_t length, grpc_timer* t) { for (;;) { diff --git a/src/core/lib/iomgr/timer_heap.h b/src/core/lib/iomgr/timer_heap.h index 2b08c651086..c05af85d3eb 100644 --- a/src/core/lib/iomgr/timer_heap.h +++ b/src/core/lib/iomgr/timer_heap.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H #define GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H @@ -28,7 +28,7 @@ struct grpc_timer_heap { uint32_t timer_count; uint32_t timer_capacity; }; -/* return true if the new timer is the first timer in the heap */ +// return true if the new timer is the first timer in the heap bool grpc_timer_heap_add(grpc_timer_heap* heap, grpc_timer* timer); void grpc_timer_heap_init(grpc_timer_heap* heap); @@ -40,4 +40,4 @@ void grpc_timer_heap_pop(grpc_timer_heap* heap); bool grpc_timer_heap_is_empty(grpc_timer_heap* heap); -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H */ +#endif // GRPC_CORE_LIB_IOMGR_TIMER_HEAP_H diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc index 49b3bbedb54..5b7fb54b481 100644 --- a/src/core/lib/iomgr/timer_manager.cc +++ b/src/core/lib/iomgr/timer_manager.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -172,11 +172,11 @@ static bool wait_until(grpc_core::Timestamp next) { // g_timed_waiter_generation uint64_t my_timed_waiter_generation = g_timed_waiter_generation - 1; - /* If there's no timed waiter, we should become one: that waiter waits only - until the next timer should expire. All other timer threads wait forever - unless their 'next' is earlier than the current timed-waiter's deadline - (in which case the thread with earlier 'next' takes over as the new timed - waiter) */ + // If there's no timed waiter, we should become one: that waiter waits only + // until the next timer should expire. All other timer threads wait forever + // unless their 'next' is earlier than the current timed-waiter's deadline + // (in which case the thread with earlier 'next' takes over as the new timed + // waiter) if (next != grpc_core::Timestamp::InfFuture()) { if (!g_has_timed_waiter || (next < g_timed_waiter_deadline)) { my_timed_waiter_generation = ++g_timed_waiter_generation; @@ -237,15 +237,15 @@ static void timer_main_loop() { run_some_timers(); break; case GRPC_TIMERS_NOT_CHECKED: - /* This case only happens under contention, meaning more than one timer - manager thread checked timers concurrently. + // This case only happens under contention, meaning more than one timer + // manager thread checked timers concurrently. - If that happens, we're guaranteed that some other thread has just - checked timers, and this will avalanche into some other thread seeing - empty timers and doing a timed sleep. + // If that happens, we're guaranteed that some other thread has just + // checked timers, and this will avalanche into some other thread seeing + // empty timers and doing a timed sleep. - Consequently, we can just sleep forever here and be happy at some - saved wakeup cycles. */ + // Consequently, we can just sleep forever here and be happy at some + // saved wakeup cycles. if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) { gpr_log(GPR_INFO, "timers not checked: expect another thread to"); } diff --git a/src/core/lib/iomgr/timer_manager.h b/src/core/lib/iomgr/timer_manager.h index d407cbbc2b7..9c18d0bbf29 100644 --- a/src/core/lib/iomgr/timer_manager.h +++ b/src/core/lib/iomgr/timer_manager.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H #define GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H @@ -23,19 +23,19 @@ #include -/* Timer Manager tries to keep only one thread waiting for the next timeout at - all times, and thus effectively preventing the thundering herd problem. */ +// Timer Manager tries to keep only one thread waiting for the next timeout at +// all times, and thus effectively preventing the thundering herd problem. void grpc_timer_manager_init(void); void grpc_timer_manager_shutdown(void); -/* enable/disable threading - must be called after grpc_timer_manager_init and - * before grpc_timer_manager_shutdown */ +// enable/disable threading - must be called after grpc_timer_manager_init and +// before grpc_timer_manager_shutdown void grpc_timer_manager_set_threading(bool enabled); -/* explicitly perform one tick of the timer system - for when threading is - * disabled */ +// explicitly perform one tick of the timer system - for when threading is +// disabled void grpc_timer_manager_tick(void); -/* get global counter that tracks timer wakeups */ +// get global counter that tracks timer wakeups uint64_t grpc_timer_manager_get_wakeups_testonly(void); -#endif /* GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H */ +#endif // GRPC_CORE_LIB_IOMGR_TIMER_MANAGER_H diff --git a/src/core/lib/iomgr/unix_sockets_posix.cc b/src/core/lib/iomgr/unix_sockets_posix.cc index 439e1247fc0..ca798e45be2 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.cc +++ b/src/core/lib/iomgr/unix_sockets_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include "src/core/lib/iomgr/port.h" diff --git a/src/core/lib/iomgr/unix_sockets_posix.h b/src/core/lib/iomgr/unix_sockets_posix.h index 701b836da1c..b37c8641f70 100644 --- a/src/core/lib/iomgr/unix_sockets_posix.h +++ b/src/core/lib/iomgr/unix_sockets_posix.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H #define GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H @@ -43,4 +43,4 @@ int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr); void grpc_unlink_if_unix_domain_socket( const grpc_resolved_address* resolved_addr); -#endif /* GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_UNIX_SOCKETS_POSIX_H diff --git a/src/core/lib/iomgr/unix_sockets_posix_noop.cc b/src/core/lib/iomgr/unix_sockets_posix_noop.cc index 492d04ac09a..5e78a9fab97 100644 --- a/src/core/lib/iomgr/unix_sockets_posix_noop.cc +++ b/src/core/lib/iomgr/unix_sockets_posix_noop.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/iomgr/wakeup_fd_eventfd.cc b/src/core/lib/iomgr/wakeup_fd_eventfd.cc index cdf1eba97a7..e4f31f88d30 100644 --- a/src/core/lib/iomgr/wakeup_fd_eventfd.cc +++ b/src/core/lib/iomgr/wakeup_fd_eventfd.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -78,4 +78,4 @@ const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable = { eventfd_create, eventfd_consume, eventfd_wakeup, eventfd_destroy, eventfd_check_availability}; -#endif /* GRPC_LINUX_EVENTFD */ +#endif // GRPC_LINUX_EVENTFD diff --git a/src/core/lib/iomgr/wakeup_fd_nospecial.cc b/src/core/lib/iomgr/wakeup_fd_nospecial.cc index aff61eaa615..b8c95f1db33 100644 --- a/src/core/lib/iomgr/wakeup_fd_nospecial.cc +++ b/src/core/lib/iomgr/wakeup_fd_nospecial.cc @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* - * This is a phony file to provide an invalid specialized_wakeup_fd_vtable on - * systems without anything better than pipe. - */ +// +// +// 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 +// +// 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. +// +// + +// +// This is a phony file to provide an invalid specialized_wakeup_fd_vtable on +// systems without anything better than pipe. +// #include @@ -36,4 +36,4 @@ static int check_availability_invalid(void) { return 0; } const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable = { nullptr, nullptr, nullptr, nullptr, check_availability_invalid}; -#endif /* GRPC_POSIX_NO_SPECIAL_WAKEUP_FD */ +#endif // GRPC_POSIX_NO_SPECIAL_WAKEUP_FD diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.cc b/src/core/lib/iomgr/wakeup_fd_pipe.cc index 9ba89a295cc..c034a4e14ac 100644 --- a/src/core/lib/iomgr/wakeup_fd_pipe.cc +++ b/src/core/lib/iomgr/wakeup_fd_pipe.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -98,4 +98,4 @@ const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable = { pipe_init, pipe_consume, pipe_wakeup, pipe_destroy, pipe_check_availability}; -#endif /* GPR_POSIX_WAKUP_FD */ +#endif // GPR_POSIX_WAKUP_FD diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.h b/src/core/lib/iomgr/wakeup_fd_pipe.h index 17569763059..ad556a1ebbb 100644 --- a/src/core/lib/iomgr/wakeup_fd_pipe.h +++ b/src/core/lib/iomgr/wakeup_fd_pipe.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H #define GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H @@ -25,4 +25,4 @@ extern const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable; -#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H */ +#endif // GRPC_CORE_LIB_IOMGR_WAKEUP_FD_PIPE_H diff --git a/src/core/lib/iomgr/wakeup_fd_posix.cc b/src/core/lib/iomgr/wakeup_fd_posix.cc index 99e0e36dfff..615694d1570 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.cc +++ b/src/core/lib/iomgr/wakeup_fd_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -70,4 +70,4 @@ void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info) { wakeup_fd_vtable->destroy(fd_info); } -#endif /* GRPC_POSIX_WAKEUP_FD */ +#endif // GRPC_POSIX_WAKEUP_FD diff --git a/src/core/lib/iomgr/wakeup_fd_posix.h b/src/core/lib/iomgr/wakeup_fd_posix.h index 24c9995a9f7..c3fec5a0637 100644 --- a/src/core/lib/iomgr/wakeup_fd_posix.h +++ b/src/core/lib/iomgr/wakeup_fd_posix.h @@ -1,49 +1,49 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* - * wakeup_fd abstracts the concept of a file descriptor for the purpose of - * waking up a thread in select()/poll()/epoll_wait()/etc. +// +// wakeup_fd abstracts the concept of a file descriptor for the purpose of +// waking up a thread in select()/poll()/epoll_wait()/etc. - * The poll() family of system calls provide a way for a thread to block until - * there is activity on one (or more) of a set of file descriptors. An - * application may wish to wake up this thread to do non file related work. The - * typical way to do this is to add a pipe to the set of file descriptors, then - * write to the pipe to wake up the thread in poll(). - * - * Linux has a lighter weight eventfd specifically designed for this purpose. - * wakeup_fd abstracts the difference between the two. - * - * Setup: - * 1. Before calling anything, call global_init() at least once. - * 1. Call grpc_wakeup_fd_init() to set up a wakeup_fd. - * 2. Add the result of GRPC_WAKEUP_FD_FD to the set of monitored file - * descriptors for the poll() style API you are using. Monitor the file - * descriptor for readability. - * 3. To tear down, call grpc_wakeup_fd_destroy(). This closes the underlying - * file descriptor. - * - * Usage: - * 1. To wake up a polling thread, call grpc_wakeup_fd_wakeup() on a wakeup_fd - * it is monitoring. - * 2. If the polling thread was awakened by a wakeup_fd event, call - * grpc_wakeup_fd_consume_wakeup() on it. - */ +// The poll() family of system calls provide a way for a thread to block until +// there is activity on one (or more) of a set of file descriptors. An +// application may wish to wake up this thread to do non file related work. The +// typical way to do this is to add a pipe to the set of file descriptors, then +// write to the pipe to wake up the thread in poll(). +// +// Linux has a lighter weight eventfd specifically designed for this purpose. +// wakeup_fd abstracts the difference between the two. +// +// Setup: +// 1. Before calling anything, call global_init() at least once. +// 1. Call grpc_wakeup_fd_init() to set up a wakeup_fd. +// 2. Add the result of GRPC_WAKEUP_FD_FD to the set of monitored file +// descriptors for the poll() style API you are using. Monitor the file +// descriptor for readability. +// 3. To tear down, call grpc_wakeup_fd_destroy(). This closes the underlying +// file descriptor. +// +// Usage: +// 1. To wake up a polling thread, call grpc_wakeup_fd_wakeup() on a wakeup_fd +// it is monitoring. +// 2. If the polling thread was awakened by a wakeup_fd event, call +// grpc_wakeup_fd_consume_wakeup() on it. +// #ifndef GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H #define GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H @@ -54,8 +54,8 @@ void grpc_wakeup_fd_global_init(void); void grpc_wakeup_fd_global_destroy(void); -/* Force using the fallback implementation. This is intended for testing - * purposes only.*/ +// Force using the fallback implementation. This is intended for testing +// purposes only. void grpc_wakeup_fd_global_init_force_fallback(void); int grpc_has_wakeup_fd(void); @@ -67,7 +67,7 @@ typedef struct grpc_wakeup_fd_vtable { grpc_error_handle (*consume)(grpc_wakeup_fd* fd_info); grpc_error_handle (*wakeup)(grpc_wakeup_fd* fd_info); void (*destroy)(grpc_wakeup_fd* fd_info); - /* Must be called before calling any other functions */ + // Must be called before calling any other functions int (*check_availability)(void); } grpc_wakeup_fd_vtable; @@ -89,8 +89,8 @@ grpc_error_handle grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) GRPC_MUST_USE_RESULT; void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info); -/* Defined in some specialized implementation's .c file, or by - * wakeup_fd_nospecial.c if no such implementation exists. */ +// Defined in some specialized implementation's .c file, or by +// wakeup_fd_nospecial.c if no such implementation exists. extern const grpc_wakeup_fd_vtable grpc_specialized_wakeup_fd_vtable; -#endif /* GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H */ +#endif // GRPC_CORE_LIB_IOMGR_WAKEUP_FD_POSIX_H diff --git a/src/core/lib/json/json_reader.cc b/src/core/lib/json/json_reader.cc index 01ec75e403b..ee5430bf8ad 100644 --- a/src/core/lib/json/json_reader.cc +++ b/src/core/lib/json/json_reader.cc @@ -50,9 +50,9 @@ class JsonReader { private: enum class Status { - GRPC_JSON_DONE, /* The parser finished successfully. */ - GRPC_JSON_PARSE_ERROR, /* The parser found an error in the json stream. */ - GRPC_JSON_INTERNAL_ERROR /* The parser got an internal error. */ + GRPC_JSON_DONE, // The parser finished successfully. + GRPC_JSON_PARSE_ERROR, // The parser found an error in the json stream. + GRPC_JSON_INTERNAL_ERROR // The parser got an internal error. }; enum class State { @@ -86,10 +86,10 @@ class JsonReader { GRPC_JSON_STATE_END }; - /* The first non-unicode value is 0x110000. But let's pick - * a value high enough to start our error codes from. These - * values are safe to return from the read_char function. - */ + // The first non-unicode value is 0x110000. But let's pick + // a value high enough to start our error codes from. These + // values are safe to return from the read_char function. + // static constexpr uint32_t GRPC_JSON_READ_CHAR_EOF = 0x7ffffff0; explicit JsonReader(absl::string_view input) @@ -316,21 +316,21 @@ bool JsonReader::IsComplete() { state_ == State::GRPC_JSON_STATE_VALUE_END)); } -/* Call this function to start parsing the input. It will return the following: - * . GRPC_JSON_DONE if the input got eof, and the parsing finished - * successfully. - * . GRPC_JSON_PARSE_ERROR if the input was somehow invalid. - * . GRPC_JSON_INTERNAL_ERROR if the parser somehow ended into an invalid - * internal state. - */ +// Call this function to start parsing the input. It will return the following: +// . GRPC_JSON_DONE if the input got eof, and the parsing finished +// successfully. +// . GRPC_JSON_PARSE_ERROR if the input was somehow invalid. +// . GRPC_JSON_INTERNAL_ERROR if the parser somehow ended into an invalid +// internal state. +// JsonReader::Status JsonReader::Run() { uint32_t c; - /* This state-machine is a strict implementation of ECMA-404 */ + // This state-machine is a strict implementation of ECMA-404 while (true) { c = ReadChar(); switch (c) { - /* Let's process the error case first. */ + // Let's process the error case first. case GRPC_JSON_READ_CHAR_EOF: switch (state_) { case State::GRPC_JSON_STATE_VALUE_NUMBER: @@ -349,7 +349,7 @@ JsonReader::Status JsonReader::Run() { } return Status::GRPC_JSON_PARSE_ERROR; - /* Processing whitespaces. */ + // Processing whitespaces. case ' ': case '\t': case '\n': @@ -384,7 +384,7 @@ JsonReader::Status JsonReader::Run() { } break; - /* Value, object or array terminations. */ + // Value, object or array terminations. case ',': case '}': case ']': @@ -461,7 +461,7 @@ JsonReader::Status JsonReader::Run() { } break; - /* In-string escaping. */ + // In-string escaping. case '\\': switch (state_) { case State::GRPC_JSON_STATE_OBJECT_KEY_STRING: @@ -474,7 +474,7 @@ JsonReader::Status JsonReader::Run() { state_ = State::GRPC_JSON_STATE_STRING_ESCAPE; break; - /* This is the \\ case. */ + // This is the \\ case. case State::GRPC_JSON_STATE_STRING_ESCAPE: if (unicode_high_surrogate_ != 0) { return Status::GRPC_JSON_PARSE_ERROR; @@ -662,17 +662,17 @@ JsonReader::Status JsonReader::Run() { state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U4; break; case State::GRPC_JSON_STATE_STRING_ESCAPE_U4: - /* See grpc_json_writer_escape_string to have a description - * of what's going on here. - */ + // See grpc_json_writer_escape_string to have a description + // of what's going on here. + // if ((unicode_char_ & 0xfc00) == 0xd800) { - /* high surrogate utf-16 */ + // high surrogate utf-16 if (unicode_high_surrogate_ != 0) { return Status::GRPC_JSON_PARSE_ERROR; } unicode_high_surrogate_ = unicode_char_; } else if ((unicode_char_ & 0xfc00) == 0xdc00) { - /* low surrogate utf-16 */ + // low surrogate utf-16 uint32_t utf32; if (unicode_high_surrogate_ == 0) { return Status::GRPC_JSON_PARSE_ERROR; @@ -686,7 +686,7 @@ JsonReader::Status JsonReader::Run() { } unicode_high_surrogate_ = 0; } else { - /* anything else */ + // anything else if (unicode_high_surrogate_ != 0) { return Status::GRPC_JSON_PARSE_ERROR; } @@ -874,8 +874,8 @@ JsonReader::Status JsonReader::Run() { state_ = State::GRPC_JSON_STATE_VALUE_END; break; - /* All of the VALUE_END cases are handled in the specialized case - * above. */ + // All of the VALUE_END cases are handled in the specialized case + // above. case State::GRPC_JSON_STATE_VALUE_END: switch (c) { case ',': diff --git a/src/core/lib/json/json_writer.cc b/src/core/lib/json/json_writer.cc index 2964f88172a..fb0a070cade 100644 --- a/src/core/lib/json/json_writer.cc +++ b/src/core/lib/json/json_writer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -34,17 +34,17 @@ namespace grpc_core { namespace { -/* The idea of the writer is basically symmetrical of the reader. While the - * reader emits various calls to your code, the writer takes basically the - * same calls and emit json out of it. It doesn't try to make any check on - * the order of the calls you do on it. Meaning you can theorically force - * it to generate invalid json. - * - * Also, unlike the reader, the writer expects UTF-8 encoded input strings. - * These strings will be UTF-8 validated, and any invalid character will - * cut the conversion short, before any invalid UTF-8 sequence, thus forming - * a valid UTF-8 string overall. - */ +// The idea of the writer is basically symmetrical of the reader. While the +// reader emits various calls to your code, the writer takes basically the +// same calls and emit json out of it. It doesn't try to make any check on +// the order of the calls you do on it. Meaning you can theorically force +// it to generate invalid json. +// +// Also, unlike the reader, the writer expects UTF-8 encoded input strings. +// These strings will be UTF-8 validated, and any invalid character will +// cut the conversion short, before any invalid UTF-8 sequence, thus forming +// a valid UTF-8 string overall. +// class JsonWriter { public: static std::string Dump(const Json& value, int indent); @@ -76,15 +76,15 @@ class JsonWriter { std::string output_; }; -/* This function checks if there's enough space left in the output buffer, - * and will enlarge it if necessary. We're only allocating chunks of 256 - * bytes at a time (or multiples thereof). - */ +// This function checks if there's enough space left in the output buffer, +// and will enlarge it if necessary. We're only allocating chunks of 256 +// bytes at a time (or multiples thereof). +// void JsonWriter::OutputCheck(size_t needed) { size_t free_space = output_.capacity() - output_.size(); if (free_space >= needed) return; needed -= free_space; - /* Round up by 256 bytes. */ + // Round up by 256 bytes. needed = (needed + 0xff) & ~0xffU; output_.reserve(output_.capacity() + needed); } @@ -191,13 +191,13 @@ void JsonWriter::EscapeString(const std::string& string) { for (i = 0; i < extra; i++) { utf32 <<= 6; ++idx; - /* Breaks out and bail if we hit the end of the string. */ + // Breaks out and bail if we hit the end of the string. if (idx == string.size()) { valid = 0; break; } c = static_cast(string[idx]); - /* Breaks out and bail on any invalid UTF-8 sequence, including \0. */ + // Breaks out and bail on any invalid UTF-8 sequence, including \0. if ((c & 0xc0) != 0x80) { valid = 0; break; @@ -205,30 +205,30 @@ void JsonWriter::EscapeString(const std::string& string) { utf32 |= c & 0x3f; } if (!valid) break; - /* The range 0xd800 - 0xdfff is reserved by the surrogates ad vitam. - * Any other range is technically reserved for future usage, so if we - * don't want the software to break in the future, we have to allow - * anything else. The first non-unicode character is 0x110000. */ + // The range 0xd800 - 0xdfff is reserved by the surrogates ad vitam. + // Any other range is technically reserved for future usage, so if we + // don't want the software to break in the future, we have to allow + // anything else. The first non-unicode character is 0x110000. if (((utf32 >= 0xd800) && (utf32 <= 0xdfff)) || (utf32 >= 0x110000)) { break; } if (utf32 >= 0x10000) { - /* If utf32 contains a character that is above 0xffff, it needs to be - * broken down into a utf-16 surrogate pair. A surrogate pair is first - * a high surrogate, followed by a low surrogate. Each surrogate holds - * 10 bits of usable data, thus allowing a total of 20 bits of data. - * The high surrogate marker is 0xd800, while the low surrogate marker - * is 0xdc00. The low 10 bits of each will be the usable data. - * - * After re-combining the 20 bits of data, one has to add 0x10000 to - * the resulting value, in order to obtain the original character. - * This is obviously because the range 0x0000 - 0xffff can be written - * without any special trick. - * - * Since 0x10ffff is the highest allowed character, we're working in - * the range 0x00000 - 0xfffff after we decrement it by 0x10000. - * That range is exactly 20 bits. - */ + // If utf32 contains a character that is above 0xffff, it needs to be + // broken down into a utf-16 surrogate pair. A surrogate pair is first + // a high surrogate, followed by a low surrogate. Each surrogate holds + // 10 bits of usable data, thus allowing a total of 20 bits of data. + // The high surrogate marker is 0xd800, while the low surrogate marker + // is 0xdc00. The low 10 bits of each will be the usable data. + // + // After re-combining the 20 bits of data, one has to add 0x10000 to + // the resulting value, in order to obtain the original character. + // This is obviously because the range 0x0000 - 0xffff can be written + // without any special trick. + // + // Since 0x10ffff is the highest allowed character, we're working in + // the range 0x00000 - 0xfffff after we decrement it by 0x10000. + // That range is exactly 20 bits. + // utf32 -= 0x10000; EscapeUtf16(static_cast(0xd800 | (utf32 >> 10))); EscapeUtf16(static_cast(0xdc00 | (utf32 & 0x3ff))); diff --git a/src/core/lib/load_balancing/lb_policy.cc b/src/core/lib/load_balancing/lb_policy.cc index 8536f008265..0916fa0fa04 100644 --- a/src/core/lib/load_balancing/lb_policy.cc +++ b/src/core/lib/load_balancing/lb_policy.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/matchers/matchers.h b/src/core/lib/matchers/matchers.h index efb6e692c1d..adc5f58e88b 100644 --- a/src/core/lib/matchers/matchers.h +++ b/src/core/lib/matchers/matchers.h @@ -159,4 +159,4 @@ class HeaderMatcher { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_MATCHERS_MATCHERS_H */ +#endif // GRPC_CORE_LIB_MATCHERS_MATCHERS_H diff --git a/src/core/lib/promise/arena_promise.h b/src/core/lib/promise/arena_promise.h index 6b43b91ee16..5ab1db8686d 100644 --- a/src/core/lib/promise/arena_promise.h +++ b/src/core/lib/promise/arena_promise.h @@ -227,4 +227,4 @@ class ArenaPromise { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H */ +#endif // GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H diff --git a/src/core/lib/promise/detail/switch.h b/src/core/lib/promise/detail/switch.h index 84b119119b0..44c20f4539b 100644 --- a/src/core/lib/promise/detail/switch.h +++ b/src/core/lib/promise/detail/switch.h @@ -1,22 +1,22 @@ -/* - * Copyright 2021 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. - */ +// +// Copyright 2021 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. +// -/* - * Automatically generated by tools/codegen/core/gen_switch.py - */ +// +// Automatically generated by tools/codegen/core/gen_switch.py +// #ifndef GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H #define GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H diff --git a/src/core/lib/resolver/resolver.cc b/src/core/lib/resolver/resolver.cc index 1586f70f5fc..df303f3d337 100644 --- a/src/core/lib/resolver/resolver.cc +++ b/src/core/lib/resolver/resolver.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/resolver/server_address.cc b/src/core/lib/resolver/server_address.cc index 630049ed6bc..9065f0033e1 100644 --- a/src/core/lib/resolver/server_address.cc +++ b/src/core/lib/resolver/server_address.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/resolver/server_address.h b/src/core/lib/resolver/server_address.h index 0df037ae475..eeb07cb4a09 100644 --- a/src/core/lib/resolver/server_address.h +++ b/src/core/lib/resolver/server_address.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H #define GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H @@ -142,4 +142,4 @@ class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H */ +#endif // GRPC_CORE_LIB_RESOLVER_SERVER_ADDRESS_H diff --git a/src/core/lib/resource_quota/arena.cc b/src/core/lib/resource_quota/arena.cc index 4b7de4071ad..8f247f6e6c9 100644 --- a/src/core/lib/resource_quota/arena.cc +++ b/src/core/lib/resource_quota/arena.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/core/lib/resource_quota/arena.h b/src/core/lib/resource_quota/arena.h index fb3d97a65a4..1d9664d1516 100644 --- a/src/core/lib/resource_quota/arena.h +++ b/src/core/lib/resource_quota/arena.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// // \file Arena based allocator // Allows very fast allocation of memory, but that memory cannot be freed until @@ -249,4 +249,4 @@ struct ContextType {}; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H */ +#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_ARENA_H diff --git a/src/core/lib/security/authorization/cel_authorization_engine.h b/src/core/lib/security/authorization/cel_authorization_engine.h index 5f7ed45203d..ffadd43cde6 100644 --- a/src/core/lib/security/authorization/cel_authorization_engine.h +++ b/src/core/lib/security/authorization/cel_authorization_engine.h @@ -81,4 +81,4 @@ class CelAuthorizationEngine { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H */ +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H diff --git a/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h b/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h index 226e1ef35d4..1492a93e8ea 100644 --- a/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h +++ b/src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h @@ -40,4 +40,4 @@ inline std::unique_ptr CreateCelExpressionBuilder( } // namespace mock_cel } // namespace grpc_core -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H \ No newline at end of file +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H diff --git a/src/core/lib/security/authorization/mock_cel/cel_expression.h b/src/core/lib/security/authorization/mock_cel/cel_expression.h index 941f50d74ef..485d5bdc7f9 100644 --- a/src/core/lib/security/authorization/mock_cel/cel_expression.h +++ b/src/core/lib/security/authorization/mock_cel/cel_expression.h @@ -67,4 +67,4 @@ class CelExpressionBuilder { } // namespace mock_cel } // namespace grpc_core -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H \ No newline at end of file +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPRESSION_H diff --git a/src/core/lib/security/authorization/mock_cel/evaluator_core.h b/src/core/lib/security/authorization/mock_cel/evaluator_core.h index 20059bc2b50..c532722960a 100644 --- a/src/core/lib/security/authorization/mock_cel/evaluator_core.h +++ b/src/core/lib/security/authorization/mock_cel/evaluator_core.h @@ -63,4 +63,4 @@ class CelExpressionFlatImpl : public CelExpression { } // namespace mock_cel } // namespace grpc_core -#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H \ No newline at end of file +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_EVALUATOR_CORE_H diff --git a/src/core/lib/security/authorization/rbac_policy.h b/src/core/lib/security/authorization/rbac_policy.h index 52af3569296..7fd49be2cde 100644 --- a/src/core/lib/security/authorization/rbac_policy.h +++ b/src/core/lib/security/authorization/rbac_policy.h @@ -175,4 +175,4 @@ struct Rbac { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H */ +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_POLICY_H diff --git a/src/core/lib/security/authorization/rbac_translator.h b/src/core/lib/security/authorization/rbac_translator.h index fbe7095198e..c0f1f3c3ba1 100644 --- a/src/core/lib/security/authorization/rbac_translator.h +++ b/src/core/lib/security/authorization/rbac_translator.h @@ -41,4 +41,4 @@ absl::StatusOr GenerateRbacPolicies( } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_TRANSLATOR_H */ +#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_RBAC_TRANSLATOR_H diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc index 54405cd4278..c81b8aeba7f 100644 --- a/src/core/lib/security/context/security_context.cc +++ b/src/core/lib/security/context/security_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -41,7 +41,7 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount( false, "auth_context_refcount"); -/* --- grpc_call --- */ +// --- grpc_call --- grpc_call_error grpc_call_set_credentials(grpc_call* call, grpc_call_credentials* creds) { @@ -97,7 +97,7 @@ void grpc_auth_context_release(grpc_auth_context* context) { context->Unref(DEBUG_LOCATION, "grpc_auth_context_unref"); } -/* --- grpc_client_security_context --- */ +// --- grpc_client_security_context --- grpc_client_security_context::~grpc_client_security_context() { auth_context.reset(DEBUG_LOCATION, "client_security_context"); if (extension.instance != nullptr && extension.destroy != nullptr) { @@ -117,7 +117,7 @@ void grpc_client_security_context_destroy(void* ctx) { c->~grpc_client_security_context(); } -/* --- grpc_server_security_context --- */ +// --- grpc_server_security_context --- grpc_server_security_context::~grpc_server_security_context() { auth_context.reset(DEBUG_LOCATION, "server_security_context"); if (extension.instance != nullptr && extension.destroy != nullptr) { @@ -136,7 +136,7 @@ void grpc_server_security_context_destroy(void* ctx) { c->~grpc_server_security_context(); } -/* --- grpc_auth_context --- */ +// --- grpc_auth_context --- static grpc_auth_property_iterator empty_iterator = {nullptr, 0, nullptr}; @@ -198,7 +198,7 @@ const grpc_auth_property* grpc_auth_property_iterator_next( return prop; } } - /* We could not find the name, try another round. */ + // We could not find the name, try another round. return grpc_auth_property_iterator_next(it); } } diff --git a/src/core/lib/security/context/security_context.h b/src/core/lib/security/context/security_context.h index f859240ea3f..e12fba9755e 100644 --- a/src/core/lib/security/context/security_context.h +++ b/src/core/lib/security/context/security_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CONTEXT_SECURITY_CONTEXT_H #define GRPC_CORE_LIB_SECURITY_CONTEXT_SECURITY_CONTEXT_H @@ -42,11 +42,11 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount; -/* --- grpc_auth_context --- +// --- grpc_auth_context --- - High level authentication context object. Can optionally be chained. */ +// High level authentication context object. Can optionally be chained. -/* Property names are always NULL terminated. */ +// Property names are always NULL terminated. struct grpc_auth_property_array { grpc_auth_property* array = nullptr; @@ -126,19 +126,19 @@ struct grpc_auth_context std::unique_ptr extension_; }; -/* --- grpc_security_context_extension --- +// --- grpc_security_context_extension --- - Extension to the security context that may be set in a filter and accessed - later by a higher level method on a grpc_call object. */ +// Extension to the security context that may be set in a filter and accessed +// later by a higher level method on a grpc_call object. struct grpc_security_context_extension { void* instance = nullptr; void (*destroy)(void*) = nullptr; }; -/* --- grpc_client_security_context --- +// --- grpc_client_security_context --- - Internal client-side security context. */ +// Internal client-side security context. struct grpc_client_security_context { explicit grpc_client_security_context( @@ -155,9 +155,9 @@ grpc_client_security_context* grpc_client_security_context_create( grpc_core::Arena* arena, grpc_call_credentials* creds); void grpc_client_security_context_destroy(void* ctx); -/* --- grpc_server_security_context --- +// --- grpc_server_security_context --- - Internal server-side security context. */ +// Internal server-side security context. struct grpc_server_security_context { grpc_server_security_context() = default; @@ -171,11 +171,11 @@ grpc_server_security_context* grpc_server_security_context_create( grpc_core::Arena* arena); void grpc_server_security_context_destroy(void* ctx); -/* --- Channel args for auth context --- */ +// --- Channel args for auth context --- grpc_arg grpc_auth_context_to_arg(grpc_auth_context* c); grpc_auth_context* grpc_auth_context_from_arg(const grpc_arg* arg); grpc_auth_context* grpc_find_auth_context_in_args( const grpc_channel_args* args); -#endif /* GRPC_CORE_LIB_SECURITY_CONTEXT_SECURITY_CONTEXT_H */ +#endif // GRPC_CORE_LIB_SECURITY_CONTEXT_SECURITY_CONTEXT_H diff --git a/src/core/lib/security/credentials/alts/alts_credentials.cc b/src/core/lib/security/credentials/alts/alts_credentials.cc index ffc2006852b..947b4abc9ac 100644 --- a/src/core/lib/security/credentials/alts/alts_credentials.cc +++ b/src/core/lib/security/credentials/alts/alts_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/credentials/alts/alts_credentials.h b/src/core/lib/security/credentials/alts/alts_credentials.h index 87e65515689..f3e66b11ddc 100644 --- a/src/core/lib/security/credentials/alts/alts_credentials.h +++ b/src/core/lib/security/credentials/alts/alts_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_ALTS_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_ALTS_CREDENTIALS_H @@ -31,7 +31,7 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" -/* Main struct for grpc ALTS channel credential. */ +// Main struct for grpc ALTS channel credential. class grpc_alts_credentials final : public grpc_channel_credentials { public: grpc_alts_credentials(const grpc_alts_credentials_options* options, @@ -60,7 +60,7 @@ class grpc_alts_credentials final : public grpc_channel_credentials { char* handshaker_service_url_; }; -/* Main struct for grpc ALTS server credential. */ +// Main struct for grpc ALTS server credential. class grpc_alts_server_credentials final : public grpc_server_credentials { public: grpc_alts_server_credentials(const grpc_alts_credentials_options* options, @@ -81,43 +81,43 @@ class grpc_alts_server_credentials final : public grpc_server_credentials { char* handshaker_service_url_; }; -/** - * This method creates an ALTS channel credential object with customized - * information provided by caller. - * - * - options: grpc ALTS credentials options instance for client. - * - handshaker_service_url: address of ALTS handshaker service in the format of - * "host:port". If it's nullptr, the address of default metadata server will - * be used. - * - enable_untrusted_alts: a boolean flag used to enable ALTS in untrusted - * mode. This mode can be enabled when we are sure ALTS is running on GCP or - * for testing purpose. - * - * It returns nullptr if the flag is disabled AND ALTS is not running on GCP. - * Otherwise, it returns the created credential object. - */ +/// +/// This method creates an ALTS channel credential object with customized +/// information provided by caller. +/// +///- options: grpc ALTS credentials options instance for client. +///- handshaker_service_url: address of ALTS handshaker service in the format of +/// "host:port". If it's nullptr, the address of default metadata server will +/// be used. +///- enable_untrusted_alts: a boolean flag used to enable ALTS in untrusted +/// mode. This mode can be enabled when we are sure ALTS is running on GCP or +/// for testing purpose. +/// +/// It returns nullptr if the flag is disabled AND ALTS is not running on GCP. +/// Otherwise, it returns the created credential object. +/// grpc_channel_credentials* grpc_alts_credentials_create_customized( const grpc_alts_credentials_options* options, const char* handshaker_service_url, bool enable_untrusted_alts); -/** - * This method creates an ALTS server credential object with customized - * information provided by caller. - * - * - options: grpc ALTS credentials options instance for server. - * - handshaker_service_url: address of ALTS handshaker service in the format of - * "host:port". If it's nullptr, the address of default metadata server will - * be used. - * - enable_untrusted_alts: a boolean flag used to enable ALTS in untrusted - * mode. This mode can be enabled when we are sure ALTS is running on GCP or - * for testing purpose. - * - * It returns nullptr if the flag is disabled and ALTS is not running on GCP. - * Otherwise, it returns the created credential object. - */ +/// +/// This method creates an ALTS server credential object with customized +/// information provided by caller. +/// +///- options: grpc ALTS credentials options instance for server. +///- handshaker_service_url: address of ALTS handshaker service in the format of +/// "host:port". If it's nullptr, the address of default metadata server will +/// be used. +///- enable_untrusted_alts: a boolean flag used to enable ALTS in untrusted +/// mode. This mode can be enabled when we are sure ALTS is running on GCP or +/// for testing purpose. +/// +/// It returns nullptr if the flag is disabled and ALTS is not running on GCP. +/// Otherwise, it returns the created credential object. +/// grpc_server_credentials* grpc_alts_server_credentials_create_customized( const grpc_alts_credentials_options* options, const char* handshaker_service_url, bool enable_untrusted_alts); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_ALTS_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_ALTS_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment.cc b/src/core/lib/security/credentials/alts/check_gcp_environment.cc index f3370a3c720..d3183ca00fc 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -35,11 +35,11 @@ static char* trim(const char* src) { } char* des = nullptr; size_t start = 0, end = strlen(src) - 1; - /* find the last character that is not a whitespace. */ + // find the last character that is not a whitespace. while (end != 0 && isspace(src[end])) { end--; } - /* find the first character that is not a whitespace. */ + // find the first character that is not a whitespace. while (start < strlen(src) && isspace(src[start])) { start++; } diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment.h b/src/core/lib/security/credentials/alts/check_gcp_environment.h index aea4cea6432..0f7518842c0 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment.h +++ b/src/core/lib/security/credentials/alts/check_gcp_environment.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_CHECK_GCP_ENVIRONMENT_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_CHECK_GCP_ENVIRONMENT_H @@ -22,36 +22,36 @@ namespace grpc_core { namespace internal { -/** - * This method is a helper function that reads a file containing system bios - * data. Exposed for testing only. - * - * - bios_file: a file containing BIOS data used to determine GCE tenancy - * information. - * - * It returns a buffer containing the data read from the file. - */ +/// +/// This method is a helper function that reads a file containing system bios +/// data. Exposed for testing only. +/// +///- bios_file: a file containing BIOS data used to determine GCE tenancy +/// information. +/// +/// It returns a buffer containing the data read from the file. +/// char* read_bios_file(const char* bios_file); -/** - * This method checks if system BIOS data contains Google-specific phrases. - * Exposed for testing only. - * - * - bios_data: a buffer containing system BIOS data. - * - * It returns true if the BIOS data contains Google-specific phrases, and false - * otherwise. - */ +/// +/// This method checks if system BIOS data contains Google-specific phrases. +/// Exposed for testing only. +/// +///- bios_data: a buffer containing system BIOS data. +/// +/// It returns true if the BIOS data contains Google-specific phrases, and false +/// otherwise. +/// bool check_bios_data(const char* bios_data); } // namespace internal } // namespace grpc_core -/** - * This method checks if a VM (Windows or Linux) is running within Google - * compute Engine (GCE) or not. It returns true if the VM is running in GCE and - * false otherwise. - */ +/// +/// This method checks if a VM (Windows or Linux) is running within Google +/// compute Engine (GCE) or not. It returns true if the VM is running in GCE and +/// false otherwise. +/// bool grpc_alts_is_running_on_gcp(); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_CHECK_GCP_ENVIRONMENT_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_CHECK_GCP_ENVIRONMENT_H diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc index 0c6f5561f5c..c4d767a3d2b 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc index cb4010253c1..6cb6d93e580 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc index 5d2bdc14dea..c9e492fe628 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc b/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc index c348c0380fa..3dfd949192b 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -87,7 +87,7 @@ static grpc_alts_credentials_options* alts_client_options_copy( grpc_alts_credentials_client_options_create(); auto new_client_options = reinterpret_cast(new_options); - /* Copy target service accounts. */ + // Copy target service accounts. target_service_account* prev = nullptr; auto node = (reinterpret_cast(options)) @@ -103,7 +103,7 @@ static grpc_alts_credentials_options* alts_client_options_copy( prev = new_node; node = node->next; } - /* Copy rpc protocol versions. */ + // Copy rpc protocol versions. grpc_gcp_rpc_protocol_versions_copy(&options->rpc_versions, &new_options->rpc_versions); return new_options; diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc index d4281715409..bd11e3f844f 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -29,7 +29,7 @@ grpc_alts_credentials_options* grpc_alts_credentials_options_copy( options->vtable->copy != nullptr) { return options->vtable->copy(options); } - /* An error occurred. */ + // An error occurred. gpr_log(GPR_ERROR, "Invalid arguments to grpc_alts_credentials_options_copy()"); return nullptr; diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h index 320af718bd3..c2f3ab82fa9 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_GRPC_ALTS_CREDENTIALS_OPTIONS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_GRPC_ALTS_CREDENTIALS_OPTIONS_H @@ -25,7 +25,7 @@ #include "src/core/tsi/alts/handshaker/transport_security_common_api.h" -/* V-table for grpc_alts_credentials_options */ +// V-table for grpc_alts_credentials_options typedef struct grpc_alts_credentials_options_vtable { grpc_alts_credentials_options* (*copy)( const grpc_alts_credentials_options* options); @@ -42,34 +42,33 @@ typedef struct target_service_account { char* data; } target_service_account; -/** - * Main struct for ALTS client credentials options. The options contain a - * a list of target service accounts (if specified) used for secure naming - * check. - */ +/// +/// Main struct for ALTS client credentials options. The options contain a +/// a list of target service accounts (if specified) used for secure naming +/// check. +/// typedef struct grpc_alts_credentials_client_options { grpc_alts_credentials_options base; target_service_account* target_account_list_head; } grpc_alts_credentials_client_options; -/** - * Main struct for ALTS server credentials options. The options currently - * do not contain any server-specific fields. - */ +/// +/// Main struct for ALTS server credentials options. The options currently +/// do not contain any server-specific fields. +/// typedef struct grpc_alts_credentials_server_options { grpc_alts_credentials_options base; } grpc_alts_credentials_server_options; -/** - * This method performs a deep copy on grpc_alts_credentials_options instance. - * - * - options: a grpc_alts_credentials_options instance that needs to be copied. - * - * It returns a new grpc_alts_credentials_options instance on success and NULL - * on failure. - */ +/// +/// This method performs a deep copy on grpc_alts_credentials_options instance. +/// +///- options: a grpc_alts_credentials_options instance that needs to be copied. +/// +/// It returns a new grpc_alts_credentials_options instance on success and NULL +/// on failure. +/// grpc_alts_credentials_options* grpc_alts_credentials_options_copy( const grpc_alts_credentials_options* options); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_GRPC_ALTS_CREDENTIALS_OPTIONS_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_ALTS_GRPC_ALTS_CREDENTIALS_OPTIONS_H diff --git a/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc b/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc index 7d7c43a29bd..63c6c5e8c72 100644 --- a/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc +++ b/src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -49,7 +49,7 @@ static grpc_alts_credentials_options* alts_server_options_copy( } grpc_alts_credentials_options* new_options = grpc_alts_credentials_server_options_create(); - /* Copy rpc protocol versions. */ + // Copy rpc protocol versions. grpc_gcp_rpc_protocol_versions_copy(&options->rpc_versions, &new_options->rpc_versions); return new_options; diff --git a/src/core/lib/security/credentials/call_creds_util.h b/src/core/lib/security/credentials/call_creds_util.h index 75b6e83c5f6..0eae80e05cc 100644 --- a/src/core/lib/security/credentials/call_creds_util.h +++ b/src/core/lib/security/credentials/call_creds_util.h @@ -40,4 +40,4 @@ grpc_auth_metadata_context MakePluginAuthMetadataContext( } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CALL_CREDS_UTIL_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_CALL_CREDS_UTIL_H diff --git a/src/core/lib/security/credentials/composite/composite_credentials.cc b/src/core/lib/security/credentials/composite/composite_credentials.cc index 32d3685e109..88e4870d4c3 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.cc +++ b/src/core/lib/security/credentials/composite/composite_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 @@ -44,7 +44,7 @@ grpc_core::UniqueTypeName grpc_composite_channel_credentials::type() const { return kFactory.Create(); } -/* -- Composite call credentials. -- */ +// -- Composite call credentials. -- grpc_core::ArenaPromise> grpc_composite_call_credentials::GetRequestMetadata( @@ -139,15 +139,15 @@ grpc_call_credentials* grpc_composite_call_credentials_create( .release(); } -/* -- Composite channel credentials. -- */ +// -- Composite channel credentials. -- grpc_core::RefCountedPtr grpc_composite_channel_credentials::create_security_connector( grpc_core::RefCountedPtr call_creds, const char* target, grpc_core::ChannelArgs* args) { GPR_ASSERT(inner_creds_ != nullptr && call_creds_ != nullptr); - /* If we are passed a call_creds, create a call composite to pass it - downstream. */ + // If we are passed a call_creds, create a call composite to pass it + // downstream. if (call_creds != nullptr) { return inner_creds_->create_security_connector( composite_call_credentials_create(call_creds_, std::move(call_creds)), diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h index 045216e9a4a..628f646abef 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.h +++ b/src/core/lib/security/credentials/composite/composite_credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H @@ -41,7 +41,7 @@ #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/transport/transport.h" -/* -- Composite channel credentials. -- */ +// -- Composite channel credentials. -- class grpc_composite_channel_credentials : public grpc_channel_credentials { public: @@ -88,7 +88,7 @@ class grpc_composite_channel_credentials : public grpc_channel_credentials { grpc_core::RefCountedPtr call_creds_; }; -/* -- Composite call credentials. -- */ +// -- Composite call credentials. -- class grpc_composite_call_credentials : public grpc_call_credentials { public: @@ -128,5 +128,4 @@ class grpc_composite_call_credentials : public grpc_call_credentials { CallCredentialsList inner_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_COMPOSITE_COMPOSITE_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/credentials.cc b/src/core/lib/security/credentials/credentials.cc index 986d8adf0ee..d977265a725 100644 --- a/src/core/lib/security/credentials/credentials.cc +++ b/src/core/lib/security/credentials/credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -31,7 +31,7 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/surface/api_trace.h" -/* -- Common. -- */ +// -- Common. -- void grpc_channel_credentials_release(grpc_channel_credentials* creds) { GRPC_API_TRACE("grpc_channel_credentials_release(creds=%p)", 1, (creds)); diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index 37b00683ecf..750e3841d46 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H @@ -43,7 +43,7 @@ #include "src/core/lib/slice/slice.h" #include "src/core/lib/transport/transport.h" -/* --- Constants. --- */ +// --- Constants. --- typedef enum { GRPC_CREDENTIALS_OK = 0, @@ -73,20 +73,20 @@ typedef enum { #define GRPC_REFRESH_TOKEN_POST_BODY_FORMAT_STRING \ "client_id=%s&client_secret=%s&refresh_token=%s&grant_type=refresh_token" -/* --- Google utils --- */ +// --- Google utils --- -/* It is the caller's responsibility to gpr_free the result if not NULL. */ +// It is the caller's responsibility to gpr_free the result if not NULL. std::string grpc_get_well_known_google_credentials_file_path(void); -/* Implementation function for the different platforms. */ +// Implementation function for the different platforms. std::string grpc_get_well_known_google_credentials_file_path_impl(void); -/* Override for testing only. Not thread-safe */ +// Override for testing only. Not thread-safe typedef std::string (*grpc_well_known_credentials_path_getter)(void); void grpc_override_well_known_credentials_path_getter( grpc_well_known_credentials_path_getter getter); -/* --- grpc_channel_credentials. --- */ +// --- grpc_channel_credentials. --- #define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.internal.channel_credentials" @@ -159,24 +159,24 @@ struct grpc_channel_credentials // args. For example, we'll want to expose it to LB policies by adding // methods on the helper API. -/* Util to encapsulate the channel credentials in a channel arg. */ +// Util to encapsulate the channel credentials in a channel arg. grpc_arg grpc_channel_credentials_to_arg(grpc_channel_credentials* credentials); -/* Util to get the channel credentials from a channel arg. */ +// Util to get the channel credentials from a channel arg. grpc_channel_credentials* grpc_channel_credentials_from_arg( const grpc_arg* arg); -/* Util to find the channel credentials from channel args. */ +// Util to find the channel credentials from channel args. grpc_channel_credentials* grpc_channel_credentials_find_in_args( const grpc_channel_args* args); -/* --- grpc_core::CredentialsMetadataArray. --- */ +// --- grpc_core::CredentialsMetadataArray. --- namespace grpc_core { using CredentialsMetadataArray = std::vector>; } -/* --- grpc_call_credentials. --- */ +// --- grpc_call_credentials. --- // This type is forward declared as a C struct and we cannot define it as a // class. Otherwise, compiler will complain about type mismatch due to @@ -241,12 +241,12 @@ struct grpc_call_credentials const grpc_security_level min_security_level_; }; -/* Metadata-only credentials with the specified key and value where - asynchronicity can be simulated for testing. */ +// Metadata-only credentials with the specified key and value where +// asynchronicity can be simulated for testing. grpc_call_credentials* grpc_md_only_test_credentials_create( const char* md_key, const char* md_value); -/* --- grpc_server_credentials. --- */ +// --- grpc_server_credentials. --- #define GRPC_SERVER_CREDENTIALS_ARG "grpc.internal.server_credentials" @@ -295,4 +295,4 @@ grpc_server_credentials* grpc_server_credentials_from_arg(const grpc_arg* arg); grpc_server_credentials* grpc_find_server_credentials_in_args( const grpc_channel_args* args); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/fake/fake_credentials.cc b/src/core/lib/security/credentials/fake/fake_credentials.cc index 64c181e588d..08d35e798e6 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.cc +++ b/src/core/lib/security/credentials/fake/fake_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -34,7 +34,7 @@ #include "src/core/lib/security/security_connector/security_connector.h" #include "src/core/lib/transport/metadata_batch.h" -/* -- Fake transport security credentials. -- */ +// -- Fake transport security credentials. -- namespace { @@ -90,7 +90,7 @@ grpc_arg grpc_fake_transport_expected_targets_arg(char* expected_targets) { expected_targets); } -/* -- Metadata-only test credentials. -- */ +// -- Metadata-only test credentials. -- grpc_core::ArenaPromise> grpc_md_only_test_credentials::GetRequestMetadata( diff --git a/src/core/lib/security/credentials/fake/fake_credentials.h b/src/core/lib/security/credentials/fake/fake_credentials.h index 733fdc1aad3..8723e9b85ae 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.h +++ b/src/core/lib/security/credentials/fake/fake_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H @@ -39,30 +39,30 @@ #define GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS \ "grpc.fake_security.expected_targets" -/* -- Fake transport security credentials. -- */ +// -- Fake transport security credentials. -- -/* Creates a fake transport security credentials object for testing. */ +// Creates a fake transport security credentials object for testing. grpc_channel_credentials* grpc_fake_transport_security_credentials_create(void); -/* Creates a fake server transport security credentials object for testing. */ +// Creates a fake server transport security credentials object for testing. grpc_server_credentials* grpc_fake_transport_security_server_credentials_create( void); -/* Used to verify the target names given to the fake transport security - * connector. - * - * The syntax of \a expected_targets by example: - * For LB channels: - * "backend_target_1,backend_target_2,...;lb_target_1,lb_target_2,..." - * For regular channels: - * "backend_taget_1,backend_target_2,..." - * - * That is to say, LB channels have a heading list of LB targets separated from - * the list of backend targets by a semicolon. For non-LB channels, only the - * latter is present. */ +// Used to verify the target names given to the fake transport security +// connector. +// +// The syntax of \a expected_targets by example: +// For LB channels: +// "backend_target_1,backend_target_2,...;lb_target_1,lb_target_2,..." +// For regular channels: +// "backend_taget_1,backend_target_2,..." +// +// That is to say, LB channels have a heading list of LB targets separated from +// the list of backend targets by a semicolon. For non-LB channels, only the +// latter is present. grpc_arg grpc_fake_transport_expected_targets_arg(char* expected_targets); -/* -- Metadata-only Test credentials. -- */ +// -- Metadata-only Test credentials. -- class grpc_md_only_test_credentials : public grpc_call_credentials { public: @@ -92,4 +92,4 @@ class grpc_md_only_test_credentials : public grpc_call_credentials { grpc_core::Slice value_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_FAKE_FAKE_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/google_default/credentials_generic.cc b/src/core/lib/security/credentials/google_default/credentials_generic.cc index b8e7c71daed..890fda1cb28 100644 --- a/src/core/lib/security/credentials/google_default/credentials_generic.cc +++ b/src/core/lib/security/credentials/google_default/credentials_generic.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc index be2ed2f2f48..bf80e9bb4c4 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -74,22 +74,22 @@ using grpc_core::Json; -/* -- Constants. -- */ +// -- Constants. -- #define GRPC_COMPUTE_ENGINE_DETECTION_HOST "metadata.google.internal." #define GRPC_GOOGLE_CREDENTIAL_CREATION_ERROR \ "Failed to create Google credentials" -/* -- Default credentials. -- */ +// -- Default credentials. -- -/* A sticky bit that will be set only if the result of metadata server detection - * is positive. We do not set the bit if the result is negative. Because it - * means the detection is done via network test that is unreliable and the - * unreliable result should not be referred by successive calls. */ +// A sticky bit that will be set only if the result of metadata server detection +// is positive. We do not set the bit if the result is negative. Because it +// means the detection is done via network test that is unreliable and the +// unreliable result should not be referred by successive calls. static int g_metadata_server_available = 0; static grpc_core::Mutex* g_state_mu; -/* Protect a metadata_server_detector instance that can be modified by more than - * one gRPC threads */ +// Protect a metadata_server_detector instance that can be modified by more than +// one gRPC threads static gpr_mu* g_polling_mu; static gpr_once g_once = GPR_ONCE_INIT; static grpc_core::internal::grpc_gce_tenancy_checker g_gce_tenancy_checker = @@ -135,7 +135,7 @@ grpc_google_default_channel_credentials::create_security_connector( const bool use_alts = is_grpclb_load_balancer || is_backend_from_grpclb_load_balancer || is_xds_non_cfe_cluster; - /* Return failure if ALTS is selected but not running on GCE. */ + // Return failure if ALTS is selected but not running on GCE. if (use_alts && alts_creds_ == nullptr) { gpr_log(GPR_ERROR, "ALTS is selected, but not running on GCE."); return nullptr; @@ -144,11 +144,11 @@ grpc_google_default_channel_credentials::create_security_connector( use_alts ? alts_creds_->create_security_connector(call_creds, target, args) : ssl_creds_->create_security_connector(call_creds, target, args); - /* grpclb-specific channel args are removed from the channel args set - * to ensure backends and fallback adresses will have the same set of channel - * args. By doing that, it guarantees the connections to backends will not be - * torn down and re-connected when switching in and out of fallback mode. - */ + // grpclb-specific channel args are removed from the channel args set + // to ensure backends and fallback adresses will have the same set of channel + // args. By doing that, it guarantees the connections to backends will not be + // torn down and re-connected when switching in and out of fallback mode. + // if (use_alts) { *args = args->Remove(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER) .Remove(GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER); @@ -174,8 +174,8 @@ static void on_metadata_server_detection_http_response( static_cast(user_data); if (error.ok() && detector->response.status == 200 && detector->response.hdr_count > 0) { - /* Internet providers can return a generic response to all requests, so - it is necessary to check that metadata header is present also. */ + // Internet providers can return a generic response to all requests, so + // it is necessary to check that metadata header is present also. size_t i; for (i = 0; i < detector->response.hdr_count; i++) { grpc_http_header* header = &detector->response.hdrs[i]; @@ -203,8 +203,8 @@ static int is_metadata_server_reachable() { metadata_server_detector detector; grpc_http_request request; grpc_closure destroy_closure; - /* The http call is local. If it takes more than one sec, it is for sure not - on compute engine. */ + // The http call is local. If it takes more than one sec, it is for sure not + // on compute engine. const auto max_detection_delay = grpc_core::Duration::Seconds(1); grpc_pollset* pollset = static_cast(gpr_zalloc(grpc_pollset_size())); @@ -227,8 +227,8 @@ static int is_metadata_server_reachable() { grpc_insecure_credentials_create())); http_request->Start(); grpc_core::ExecCtx::Get()->Flush(); - /* Block until we get the response. This is not ideal but this should only be - called once for the lifetime of the process by the default credentials. */ + // Block until we get the response. This is not ideal but this should only be + // called once for the lifetime of the process by the default credentials. gpr_mu_lock(g_polling_mu); while (!detector.is_done) { grpc_pollset_worker* worker = nullptr; @@ -305,7 +305,7 @@ bool ValidateExteralAccountCredentials(const Json& json) { } // namespace -/* Takes ownership of creds_path if not NULL. */ +// Takes ownership of creds_path if not NULL. static grpc_error_handle create_default_creds_from_path( const std::string& creds_path, grpc_core::RefCountedPtr* creds) { @@ -336,7 +336,7 @@ static grpc_error_handle create_default_creds_from_path( goto end; } - /* First, try an auth json key. */ + // First, try an auth json key. key = grpc_auth_json_key_create_from_json(json); if (grpc_auth_json_key_is_valid(&key)) { result = @@ -350,7 +350,7 @@ static grpc_error_handle create_default_creds_from_path( goto end; } - /* Then try a refresh token if the auth json key was invalid. */ + // Then try a refresh token if the auth json key was invalid. token = grpc_auth_refresh_token_create_from_json(json); if (grpc_auth_refresh_token_is_valid(&token)) { result = @@ -363,7 +363,7 @@ static grpc_error_handle create_default_creds_from_path( goto end; } - /* Finally try an external account credentials.*/ + // Finally try an external account credentials. if (!ValidateExteralAccountCredentials(json)) { error = GRPC_ERROR_CREATE("Invalid external account credentials format."); goto end; @@ -381,13 +381,13 @@ static void update_tenancy() { gpr_once_init(&g_once, init_default_credentials); grpc_core::MutexLock lock(g_state_mu); - /* Try a platform-provided hint for GCE. */ + // Try a platform-provided hint for GCE. if (!g_metadata_server_available) { g_metadata_server_available = g_gce_tenancy_checker(); } - /* TODO: Add a platform-provided hint for GAE. */ + // TODO(unknown): Add a platform-provided hint for GAE. - /* Do a network test for metadata server. */ + // Do a network test for metadata server. if (!g_metadata_server_available) { g_metadata_server_available = is_metadata_server_reachable(); } @@ -403,7 +403,7 @@ static grpc_core::RefCountedPtr make_default_call_creds( grpc_core::RefCountedPtr call_creds; grpc_error_handle err; - /* First, try the environment variable. */ + // First, try the environment variable. auto path_from_env = grpc_core::GetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR); if (path_from_env.has_value()) { err = create_default_creds_from_path(*path_from_env, &call_creds); @@ -411,7 +411,7 @@ static grpc_core::RefCountedPtr make_default_call_creds( *error = grpc_error_add_child(*error, err); } - /* Then the well-known file. */ + // Then the well-known file. err = create_default_creds_from_path( grpc_get_well_known_google_credentials_file_path(), &call_creds); if (err.ok()) return call_creds; @@ -447,7 +447,7 @@ grpc_channel_credentials* grpc_google_default_credentials_create( } if (call_creds != nullptr) { - /* Create google default credentials. */ + // Create google default credentials. grpc_channel_credentials* ssl_creds = grpc_ssl_credentials_create(nullptr, nullptr, nullptr, nullptr); GPR_ASSERT(ssl_creds != nullptr); @@ -487,7 +487,7 @@ void grpc_flush_cached_google_default_credentials(void) { } // namespace internal } // namespace grpc_core -/* -- Well known credentials path. -- */ +// -- Well known credentials path. -- static grpc_well_known_credentials_path_getter creds_path_getter = nullptr; diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.h b/src/core/lib/security/credentials/google_default/google_default_credentials.h index 17633f53c37..9c3a9b41648 100644 --- a/src/core/lib/security/credentials/google_default/google_default_credentials.h +++ b/src/core/lib/security/credentials/google_default/google_default_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H @@ -96,5 +96,4 @@ void grpc_flush_cached_google_default_credentials(void); } // namespace internal } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_GOOGLE_DEFAULT_GOOGLE_DEFAULT_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/iam/iam_credentials.cc b/src/core/lib/security/credentials/iam/iam_credentials.cc index 0d73c390eba..8b56c03f03f 100644 --- a/src/core/lib/security/credentials/iam/iam_credentials.cc +++ b/src/core/lib/security/credentials/iam/iam_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/security/credentials/iam/iam_credentials.h b/src/core/lib/security/credentials/iam/iam_credentials.h index f0c83af549e..051b70b29bd 100644 --- a/src/core/lib/security/credentials/iam/iam_credentials.h +++ b/src/core/lib/security/credentials/iam/iam_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H @@ -62,4 +62,4 @@ class grpc_google_iam_credentials : public grpc_call_credentials { const std::string debug_string_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_IAM_IAM_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/jwt/json_token.cc b/src/core/lib/security/credentials/jwt/json_token.cc index f3f370903dd..12b6161d024 100644 --- a/src/core/lib/security/credentials/jwt/json_token.cc +++ b/src/core/lib/security/credentials/jwt/json_token.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -45,9 +45,9 @@ using grpc_core::Json; -/* --- Constants. --- */ +// --- Constants. --- -/* 1 hour max. */ +// 1 hour max. gpr_timespec grpc_max_auth_token_lifetime() { gpr_timespec out; out.tv_sec = 3600; @@ -59,12 +59,12 @@ gpr_timespec grpc_max_auth_token_lifetime() { #define GRPC_JWT_RSA_SHA256_ALGORITHM "RS256" #define GRPC_JWT_TYPE "JWT" -/* --- Override for testing. --- */ +// --- Override for testing. --- static grpc_jwt_encode_and_sign_override g_jwt_encode_and_sign_override = nullptr; -/* --- grpc_auth_json_key. --- */ +// --- grpc_auth_json_key. --- int grpc_auth_json_key_is_valid(const grpc_auth_json_key* json_key) { return (json_key != nullptr) && @@ -160,7 +160,7 @@ void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key) { } } -/* --- jwt encoding and signature. --- */ +// --- jwt encoding and signature. --- static char* encoded_jwt_header(const char* key_id, const char* algorithm) { Json json = Json::Object{ @@ -191,7 +191,7 @@ static char* encoded_jwt_claim(const grpc_auth_json_key* json_key, if (scope != nullptr) { object["scope"] = scope; } else { - /* Unscoped JWTs need a sub field. */ + // Unscoped JWTs need a sub field. object["sub"] = json_key->client_email; } diff --git a/src/core/lib/security/credentials/jwt/json_token.h b/src/core/lib/security/credentials/jwt/json_token.h index 9c89d3e5be3..da3879cf6c6 100644 --- a/src/core/lib/security/credentials/jwt/json_token.h +++ b/src/core/lib/security/credentials/jwt/json_token.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H @@ -27,11 +27,11 @@ #include "src/core/lib/json/json.h" -/* --- Constants. --- */ +// --- Constants. --- #define GRPC_JWT_OAUTH2_AUDIENCE "https://oauth2.googleapis.com/token" -/* --- auth_json_key parsing. --- */ +// --- auth_json_key parsing. --- struct grpc_auth_json_key { const char* type; @@ -40,37 +40,37 @@ struct grpc_auth_json_key { char* client_email; RSA* private_key; }; -/* Returns 1 if the object is valid, 0 otherwise. */ +// Returns 1 if the object is valid, 0 otherwise. int grpc_auth_json_key_is_valid(const grpc_auth_json_key* json_key); -/* Creates a json_key object from string. Returns an invalid object if a parsing - error has been encountered. */ +// Creates a json_key object from string. Returns an invalid object if a parsing +// error has been encountered. grpc_auth_json_key grpc_auth_json_key_create_from_string( const char* json_string); -/* Creates a json_key object from parsed json. Returns an invalid object if a - parsing error has been encountered. */ +// Creates a json_key object from parsed json. Returns an invalid object if a +// parsing error has been encountered. grpc_auth_json_key grpc_auth_json_key_create_from_json( const grpc_core::Json& json); -/* Destructs the object. */ +// Destructs the object. void grpc_auth_json_key_destruct(grpc_auth_json_key* json_key); -/* --- json token encoding and signing. --- */ +// --- json token encoding and signing. --- -/* Caller is responsible for calling gpr_free on the returned value. May return - NULL on invalid input. The scope parameter may be NULL. */ +// Caller is responsible for calling gpr_free on the returned value. May return +// NULL on invalid input. The scope parameter may be NULL. char* grpc_jwt_encode_and_sign(const grpc_auth_json_key* json_key, const char* audience, gpr_timespec token_lifetime, const char* scope); -/* Override encode_and_sign function for testing. */ +// Override encode_and_sign function for testing. typedef char* (*grpc_jwt_encode_and_sign_override)( const grpc_auth_json_key* json_key, const char* audience, gpr_timespec token_lifetime, const char* scope); -/* Set a custom encode_and_sign override for testing. */ +// Set a custom encode_and_sign override for testing. void grpc_jwt_encode_and_sign_set_override( grpc_jwt_encode_and_sign_override func); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JSON_TOKEN_H diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc index 99534164f7f..bbe9a0eb73b 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.h b/src/core/lib/security/credentials/jwt/jwt_credentials.h index 88925df7c09..00b51f9ab7f 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.h +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H @@ -103,4 +103,4 @@ absl::StatusOr RemoveServiceNameFromJwtUri(absl::string_view uri); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/src/core/lib/security/credentials/jwt/jwt_verifier.cc index 26a0c11115c..eef5c027779 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -70,7 +70,7 @@ using grpc_core::Json; -/* --- Utils. --- */ +// --- Utils. --- const char* grpc_jwt_verifier_status_to_string( grpc_jwt_verifier_status status) { @@ -141,13 +141,13 @@ static gpr_timespec validate_time_field(const Json& json, const char* key) { return result; } -/* --- JOSE header. see http://tools.ietf.org/html/rfc7515#section-4 --- */ +// --- JOSE header. see http://tools.ietf.org/html/rfc7515#section-4 --- struct jose_header { const char* alg; const char* kid; const char* typ; - /* TODO(jboeuf): Add others as needed (jku, jwk, x5u, x5c and so on...). */ + // TODO(jboeuf): Add others as needed (jku, jwk, x5u, x5c and so on...). grpc_core::ManualConstructor json; }; static void jose_header_destroy(jose_header* h) { @@ -169,10 +169,10 @@ static jose_header* jose_header_from_json(Json json) { gpr_log(GPR_ERROR, "Missing alg field."); goto error; } - /* We only support RSA-1.5 signatures for now. - Beware of this if we add HMAC support: - https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ - */ + // We only support RSA-1.5 signatures for now. + // Beware of this if we add HMAC support: + // https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/ + // alg_value = it->second.string_value().c_str(); if (it->second.type() != Json::Type::STRING || strncmp(alg_value, "RS", 2) != 0 || @@ -201,10 +201,10 @@ error: return nullptr; } -/* --- JWT claims. see http://tools.ietf.org/html/rfc7519#section-4.1 */ +// --- JWT claims. see http://tools.ietf.org/html/rfc7519#section-4.1 struct grpc_jwt_claims { - /* Well known properties already parsed. */ + // Well known properties already parsed. const char* sub; const char* iss; const char* aud; @@ -268,7 +268,7 @@ grpc_jwt_claims* grpc_jwt_claims_from_json(Json json) { claims->nbf = gpr_inf_past(GPR_CLOCK_REALTIME); claims->exp = gpr_inf_future(GPR_CLOCK_REALTIME); - /* Per the spec, all fields are optional. */ + // Per the spec, all fields are optional. for (const auto& p : claims->json->object_value()) { if (p.first == "sub") { claims->sub = validate_string_field(p.second, "sub"); @@ -326,9 +326,9 @@ grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims, return GRPC_JWT_VERIFIER_TIME_CONSTRAINT_FAILURE; } - /* This should be probably up to the upper layer to decide but let's harcode - the 99% use case here for email issuers, where the JWT must be self - issued. */ + // This should be probably up to the upper layer to decide but let's harcode + // the 99% use case here for email issuers, where the JWT must be self + // issued. if (grpc_jwt_issuer_email_domain(claims->iss) != nullptr && claims->sub != nullptr && strcmp(claims->iss, claims->sub) != 0) { gpr_log(GPR_ERROR, @@ -351,12 +351,12 @@ grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims, return GRPC_JWT_VERIFIER_OK; } -/* --- verifier_cb_ctx object. --- */ +// --- verifier_cb_ctx object. --- typedef enum { HTTP_RESPONSE_OPENID = 0, HTTP_RESPONSE_KEYS, - HTTP_RESPONSE_COUNT /* must be last */ + HTTP_RESPONSE_COUNT // must be last } http_response_index; struct verifier_cb_ctx { @@ -372,7 +372,7 @@ struct verifier_cb_ctx { grpc_http_response responses[HTTP_RESPONSE_COUNT]; grpc_core::OrphanablePtr http_request; }; -/* Takes ownership of the header, claims and signature. */ +// Takes ownership of the header, claims and signature. static verifier_cb_ctx* verifier_cb_ctx_create( grpc_jwt_verifier* verifier, grpc_pollset* pollset, jose_header* header, grpc_jwt_claims* claims, const char* audience, const grpc_slice& signature, @@ -402,16 +402,16 @@ void verifier_cb_ctx_destroy(verifier_cb_ctx* ctx) { for (size_t i = 0; i < HTTP_RESPONSE_COUNT; i++) { grpc_http_response_destroy(&ctx->responses[i]); } - /* TODO: see what to do with claims... */ + // TODO(unknown): see what to do with claims... delete ctx; } -/* --- grpc_jwt_verifier object. --- */ +// --- grpc_jwt_verifier object. --- -/* Clock skew defaults to one minute. */ +// Clock skew defaults to one minute. gpr_timespec grpc_jwt_verifier_clock_skew = {60, 0, GPR_TIMESPAN}; -/* Max delay defaults to one minute. */ +// Max delay defaults to one minute. grpc_core::Duration grpc_jwt_verifier_max_delay = grpc_core::Duration::Minutes(1); @@ -421,7 +421,7 @@ struct email_key_mapping { }; struct grpc_jwt_verifier { email_key_mapping* mappings; - size_t num_mappings; /* Should be very few, linear search ok. */ + size_t num_mappings; // Should be very few, linear search ok. size_t allocated_mappings; }; @@ -495,10 +495,10 @@ static BIGNUM* bignum_from_base64(const char* b64) { // Provide compatibility across OpenSSL 1.02 and 1.1. static int RSA_set0_key(RSA* r, BIGNUM* n, BIGNUM* e, BIGNUM* d) { - /* If the fields n and e in r are NULL, the corresponding input - * parameters MUST be non-NULL for n and e. d may be - * left NULL (in case only the public key is used). - */ + // If the fields n and e in r are NULL, the corresponding input + // parameters MUST be non-NULL for n and e. d may be + // left NULL (in case only the public key is used). + // if ((r->n == nullptr && n == nullptr) || (r->e == nullptr && e == nullptr)) { return 0; } @@ -556,11 +556,11 @@ static EVP_PKEY* pkey_from_jwk(const Json& json, const char* kty) { gpr_log(GPR_ERROR, "Cannot set RSA key from inputs."); goto end; } - /* RSA_set0_key takes ownership on success. */ + // RSA_set0_key takes ownership on success. tmp_n = nullptr; tmp_e = nullptr; result = EVP_PKEY_new(); - EVP_PKEY_set1_RSA(result, rsa); /* uprefs rsa. */ + EVP_PKEY_set1_RSA(result, rsa); // uprefs rsa. end: RSA_free(rsa); @@ -571,12 +571,12 @@ end: static EVP_PKEY* find_verification_key(const Json& json, const char* header_alg, const char* header_kid) { - /* Try to parse the json as a JWK set: - https://tools.ietf.org/html/rfc7517#section-5. */ + // Try to parse the json as a JWK set: + // https://tools.ietf.org/html/rfc7517#section-5. const Json* jwt_keys = find_property_by_name(json, "keys"); if (jwt_keys == nullptr) { - /* Use the google proprietary format which is: - { : , : , ... } */ + // Use the google proprietary format which is: + // { : , : , ... } const Json* cur = find_property_by_name(json, header_kid); if (cur == nullptr) return nullptr; return extract_pkey_from_x509(cur->string_value().c_str()); @@ -586,8 +586,8 @@ static EVP_PKEY* find_verification_key(const Json& json, const char* header_alg, "Unexpected value type of keys property in jwks key set."); return nullptr; } - /* Key format is specified in: - https://tools.ietf.org/html/rfc7518#section-6. */ + // Key format is specified in: + // https://tools.ietf.org/html/rfc7518#section-6. for (const Json& jkey : jwt_keys->array_value()) { if (jkey.type() != Json::Type::OBJECT) continue; const char* alg = nullptr; @@ -623,7 +623,7 @@ static int verify_jwt_signature(EVP_PKEY* key, const char* alg, const EVP_MD* md = evp_md_from_alg(alg); int result = 0; - GPR_ASSERT(md != nullptr); /* Checked before. */ + GPR_ASSERT(md != nullptr); // Checked before. if (md_ctx == nullptr) { gpr_log(GPR_ERROR, "Could not create EVP_MD_CTX."); goto end; @@ -677,7 +677,7 @@ static void on_keys_retrieved(void* user_data, grpc_error_handle /*error*/) { status = grpc_jwt_claims_check(ctx->claims, ctx->audience); if (status == GRPC_JWT_VERIFIER_OK) { - /* Pass ownership. */ + // Pass ownership. claims = ctx->claims; ctx->claims = nullptr; } @@ -701,7 +701,7 @@ static void on_openid_config_retrieved(void* user_data, char* host; char* path; - /* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */ + // TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. if (json.type() == Json::Type::JSON_NULL) goto error; cur = find_property_by_name(json, "jwks_uri"); if (cur == nullptr) { @@ -723,9 +723,9 @@ static void on_openid_config_retrieved(void* user_data, *(host + (path - jwks_uri)) = '\0'; } - /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host - channel. This would allow us to cancel an authentication query when under - extreme memory pressure. */ + // TODO(ctiller): Carry the resource_quota in ctx and share it with the host + // channel. This would allow us to cancel an authentication query when under + // extreme memory pressure. uri = grpc_core::URI::Create("https", host, path, {} /* query params /*/, "" /* fragment */); if (!uri.ok()) { @@ -773,8 +773,8 @@ static void verifier_put_mapping(grpc_jwt_verifier* v, const char* email_domain, GPR_ASSERT(v->num_mappings <= v->allocated_mappings); } -/* Very non-sophisticated way to detect an email address. Should be good - enough for now... */ +// Very non-sophisticated way to detect an email address. Should be good +// enough for now... const char* grpc_jwt_issuer_email_domain(const char* issuer) { const char* at_sign = strchr(issuer, '@'); if (at_sign == nullptr) return nullptr; @@ -783,14 +783,14 @@ const char* grpc_jwt_issuer_email_domain(const char* issuer) { const char* dot = strrchr(email_domain, '.'); if (dot == nullptr || dot == email_domain) return email_domain; GPR_ASSERT(dot > email_domain); - /* There may be a subdomain, we just want the domain. */ + // There may be a subdomain, we just want the domain. dot = static_cast( gpr_memrchr(email_domain, '.', static_cast(dot - email_domain))); if (dot == nullptr) return email_domain; return dot + 1; } -/* Takes ownership of ctx. */ +// Takes ownership of ctx. static void retrieve_key_and_verify(verifier_cb_ctx* ctx) { const char* email_domain; grpc_closure* http_cb; @@ -815,11 +815,11 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) { goto error; } - /* This code relies on: - https://openid.net/specs/openid-connect-discovery-1_0.html - Nobody seems to implement the account/email/webfinger part 2. of the spec - so we will rely instead on email/url mappings if we detect such an issuer. - Part 4, on the other hand is implemented by both google and salesforce. */ + // This code relies on: + // https://openid.net/specs/openid-connect-discovery-1_0.html + // Nobody seems to implement the account/email/webfinger part 2. of the spec + // so we will rely instead on email/url mappings if we detect such an issuer. + // Part 4, on the other hand is implemented by both google and salesforce. email_domain = grpc_jwt_issuer_email_domain(iss); if (email_domain != nullptr) { email_key_mapping* mapping; @@ -854,9 +854,9 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) { rsp_idx = HTTP_RESPONSE_OPENID; } - /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host - channel. This would allow us to cancel an authentication query when under - extreme memory pressure. */ + // TODO(ctiller): Carry the resource_quota in ctx and share it with the host + // channel. This would allow us to cancel an authentication query when under + // extreme memory pressure. uri = grpc_core::URI::Create("https", host, path, {} /* query params */, "" /* fragment */); if (!uri.ok()) { @@ -926,13 +926,13 @@ grpc_jwt_verifier* grpc_jwt_verifier_create( size_t num_mappings) { grpc_jwt_verifier* v = grpc_core::Zalloc(); - /* We know at least of one mapping. */ + // We know at least of one mapping. v->allocated_mappings = 1 + num_mappings; v->mappings = static_cast( gpr_malloc(v->allocated_mappings * sizeof(email_key_mapping))); verifier_put_mapping(v, GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN, GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX); - /* User-Provided mappings. */ + // User-Provided mappings. if (mappings != nullptr) { size_t i; for (i = 0; i < num_mappings; i++) { diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.h b/src/core/lib/security/credentials/jwt/jwt_verifier.h index c917c09e633..85600400207 100644 --- a/src/core/lib/security/credentials/jwt/jwt_verifier.h +++ b/src/core/lib/security/credentials/jwt/jwt_verifier.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H @@ -29,14 +29,14 @@ #include "src/core/lib/iomgr/iomgr_fwd.h" #include "src/core/lib/json/json.h" -/* --- Constants. --- */ +// --- Constants. --- #define GRPC_OPENID_CONFIG_URL_SUFFIX "/.well-known/openid-configuration" #define GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN "gserviceaccount.com" #define GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX \ "www.googleapis.com/robot/v1/metadata/x509" -/* --- grpc_jwt_verifier_status. --- */ +// --- grpc_jwt_verifier_status. --- typedef enum { GRPC_JWT_VERIFIER_OK = 0, @@ -51,16 +51,16 @@ typedef enum { const char* grpc_jwt_verifier_status_to_string(grpc_jwt_verifier_status status); -/* --- grpc_jwt_claims. --- */ +// --- grpc_jwt_claims. --- typedef struct grpc_jwt_claims grpc_jwt_claims; void grpc_jwt_claims_destroy(grpc_jwt_claims* claims); -/* Returns the whole JSON tree of the claims. */ +// Returns the whole JSON tree of the claims. const grpc_core::Json* grpc_jwt_claims_json(const grpc_jwt_claims* claims); -/* Access to registered claims in https://tools.ietf.org/html/rfc7519#page-9 */ +// Access to registered claims in https://tools.ietf.org/html/rfc7519#page-9 const char* grpc_jwt_claims_subject(const grpc_jwt_claims* claims); const char* grpc_jwt_claims_issuer(const grpc_jwt_claims* claims); const char* grpc_jwt_claims_id(const grpc_jwt_claims* claims); @@ -69,56 +69,56 @@ gpr_timespec grpc_jwt_claims_issued_at(const grpc_jwt_claims* claims); gpr_timespec grpc_jwt_claims_expires_at(const grpc_jwt_claims* claims); gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims); -/* --- grpc_jwt_verifier. --- */ +// --- grpc_jwt_verifier. --- typedef struct grpc_jwt_verifier grpc_jwt_verifier; struct grpc_jwt_verifier_email_domain_key_url_mapping { - /* The email domain is the part after the @ sign. */ + // The email domain is the part after the @ sign. const char* email_domain; - /* The key url prefix will be used to get the public key from the issuer: - https:/// - Therefore the key_url_prefix must NOT contain https://. */ + // The key url prefix will be used to get the public key from the issuer: + // https:/// + // Therefore the key_url_prefix must NOT contain https://. const char* key_url_prefix; }; -/* Globals to control the verifier. Not thread-safe. */ +// Globals to control the verifier. Not thread-safe. extern gpr_timespec grpc_jwt_verifier_clock_skew; extern grpc_core::Duration grpc_jwt_verifier_max_delay; -/* The verifier can be created with some custom mappings to help with key - discovery in the case where the issuer is an email address. - mappings can be NULL in which case num_mappings MUST be 0. - A verifier object has one built-in mapping (unless overridden): - GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN -> - GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX.*/ +// The verifier can be created with some custom mappings to help with key +// discovery in the case where the issuer is an email address. +// mappings can be NULL in which case num_mappings MUST be 0. +// A verifier object has one built-in mapping (unless overridden): +// GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN -> +// GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX. grpc_jwt_verifier* grpc_jwt_verifier_create( const grpc_jwt_verifier_email_domain_key_url_mapping* mappings, size_t num_mappings); -/*The verifier must not be destroyed if there are still outstanding callbacks.*/ +// The verifier must not be destroyed if there are still outstanding callbacks. void grpc_jwt_verifier_destroy(grpc_jwt_verifier* verifier); -/* User provided callback that will be called when the verification of the JWT - is done (maybe in another thread). - It is the responsibility of the callee to call grpc_jwt_claims_destroy on - the claims. */ +// User provided callback that will be called when the verification of the JWT +// is done (maybe in another thread). +// It is the responsibility of the callee to call grpc_jwt_claims_destroy on +// the claims. typedef void (*grpc_jwt_verification_done_cb)(void* user_data, grpc_jwt_verifier_status status, grpc_jwt_claims* claims); -/* Verifies for the JWT for the given expected audience. */ +// Verifies for the JWT for the given expected audience. void grpc_jwt_verifier_verify(grpc_jwt_verifier* verifier, grpc_pollset* pollset, const char* jwt, const char* audience, grpc_jwt_verification_done_cb cb, void* user_data); -/* --- TESTING ONLY exposed functions. --- */ +// --- TESTING ONLY exposed functions. --- grpc_jwt_claims* grpc_jwt_claims_from_json(grpc_core::Json json); grpc_jwt_verifier_status grpc_jwt_claims_check(const grpc_jwt_claims* claims, const char* audience); const char* grpc_jwt_issuer_email_domain(const char* issuer); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_VERIFIER_H diff --git a/src/core/lib/security/credentials/local/local_credentials.cc b/src/core/lib/security/credentials/local/local_credentials.cc index babdb10598e..c4fa10eb9c9 100644 --- a/src/core/lib/security/credentials/local/local_credentials.cc +++ b/src/core/lib/security/credentials/local/local_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/credentials/local/local_credentials.h b/src/core/lib/security/credentials/local/local_credentials.h index b2d0216d72e..7572d7dd8e4 100644 --- a/src/core/lib/security/credentials/local/local_credentials.h +++ b/src/core/lib/security/credentials/local/local_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_LOCAL_LOCAL_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_LOCAL_LOCAL_CREDENTIALS_H @@ -32,7 +32,7 @@ #include "src/core/lib/security/credentials/credentials.h" #include "src/core/lib/security/security_connector/security_connector.h" -/* Main class for grpc local channel credential. */ +// Main class for grpc local channel credential. class grpc_local_credentials final : public grpc_channel_credentials { public: explicit grpc_local_credentials(grpc_local_connect_type connect_type); @@ -57,7 +57,7 @@ class grpc_local_credentials final : public grpc_channel_credentials { grpc_local_connect_type connect_type_; }; -/* Main class for grpc local server credential. */ +// Main class for grpc local server credential. class grpc_local_server_credentials final : public grpc_server_credentials { public: explicit grpc_local_server_credentials(grpc_local_connect_type connect_type); @@ -74,4 +74,4 @@ class grpc_local_server_credentials final : public grpc_server_credentials { grpc_local_connect_type connect_type_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_LOCAL_LOCAL_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_LOCAL_LOCAL_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc index c13b89236a9..3bc26a8b983 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -381,9 +381,9 @@ class grpc_compute_engine_token_fetcher_credentials memset(&request, 0, sizeof(grpc_http_request)); request.hdr_count = 1; request.hdrs = &header; - /* TODO(ctiller): Carry the memory quota in ctx and share it with the host - channel. This would allow us to cancel an authentication query when under - extreme memory pressure. */ + // TODO(ctiller): Carry the memory quota in ctx and share it with the host + // channel. This would allow us to cancel an authentication query when under + // extreme memory pressure. auto uri = grpc_core::URI::Create("http", GRPC_COMPUTE_ENGINE_METADATA_HOST, GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH, {} /* query params */, "" /* fragment */); @@ -447,9 +447,9 @@ void grpc_google_refresh_token_credentials::fetch_oauth2( request.hdrs = &header; request.body = const_cast(body.c_str()); request.body_length = body.size(); - /* TODO(ctiller): Carry the memory quota in ctx and share it with the host - channel. This would allow us to cancel an authentication query when under - extreme memory pressure. */ + // TODO(ctiller): Carry the memory quota in ctx and share it with the host + // channel. This would allow us to cancel an authentication query when under + // extreme memory pressure. auto uri = grpc_core::URI::Create("https", GRPC_GOOGLE_OAUTH2_SERVICE_HOST, GRPC_GOOGLE_OAUTH2_SERVICE_TOKEN_PATH, {} /* query params */, "" /* fragment */); @@ -577,9 +577,9 @@ class StsTokenFetcherCredentials const_cast("application/x-www-form-urlencoded")}; request.hdr_count = 1; request.hdrs = &header; - /* TODO(ctiller): Carry the memory quota in ctx and share it with the host - channel. This would allow us to cancel an authentication query when under - extreme memory pressure. */ + // TODO(ctiller): Carry the memory quota in ctx and share it with the host + // channel. This would allow us to cancel an authentication query when under + // extreme memory pressure. RefCountedPtr http_request_creds; if (sts_url_.scheme() == "http") { http_request_creds = RefCountedPtr( diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h index eb003cb6975..27144fa11f4 100644 --- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H @@ -217,4 +217,4 @@ absl::StatusOr ValidateStsCredentialsOptions( const grpc_sts_credentials_options* options); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_OAUTH2_OAUTH2_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc index c575f8c09f6..bdfdce011bf 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -119,7 +119,7 @@ grpc_plugin_credentials::PendingRequest::PollAsyncResult() { void grpc_plugin_credentials::PendingRequest::RequestMetadataReady( void* request, const grpc_metadata* md, size_t num_md, grpc_status_code status, const char* error_details) { - /* called from application code */ + // called from application code grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_FINISHED | GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP); diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.h b/src/core/lib/security/credentials/plugin/plugin_credentials.h index af38e9dd018..3551add5433 100644 --- a/src/core/lib/security/credentials/plugin/plugin_credentials.h +++ b/src/core/lib/security/credentials/plugin/plugin_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H @@ -122,4 +122,4 @@ struct grpc_plugin_credentials final : public grpc_call_credentials { grpc_metadata_credentials_plugin plugin_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_PLUGIN_PLUGIN_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/src/core/lib/security/credentials/ssl/ssl_credentials.cc index f798abdcdb0..86a220bf795 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.cc +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -118,8 +118,8 @@ void grpc_ssl_credentials::set_max_tls_version( config_.max_tls_version = max_tls_version; } -/* Deprecated in favor of grpc_ssl_credentials_create_ex. Will be removed - * once all of its call sites are migrated to grpc_ssl_credentials_create_ex. */ +// Deprecated in favor of grpc_ssl_credentials_create_ex. Will be removed +// once all of its call sites are migrated to grpc_ssl_credentials_create_ex. grpc_channel_credentials* grpc_ssl_credentials_create( const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair, const verify_peer_options* verify_options, void* reserved) { diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.h b/src/core/lib/security/credentials/ssl/ssl_credentials.h index 746bbebdfdc..cb16bd989af 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.h +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H @@ -128,4 +128,4 @@ tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs( const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs); -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_SSL_SSL_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc b/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc index d1609cab65f..f303353e9d5 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc @@ -319,7 +319,7 @@ void grpc_tls_certificate_distributor::CancelTlsCertificatesWatch( } }; -/** -- Wrapper APIs declared in grpc_security.h -- **/ +/// -- Wrapper APIs declared in grpc_security.h -- * grpc_tls_identity_pairs* grpc_tls_identity_pairs_create() { return new grpc_tls_identity_pairs(); diff --git a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc index 1744d762c04..f3c50692778 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc +++ b/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc @@ -432,7 +432,7 @@ absl::StatusOr PrivateKeyAndCertificateMatch( } // namespace grpc_core -/** -- Wrapper APIs declared in grpc_security.h -- **/ +/// -- Wrapper APIs declared in grpc_security.h -- * grpc_tls_certificate_provider* grpc_tls_certificate_provider_static_data_create( const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs) { diff --git a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc index 3f3be975d89..d2d54b66b1a 100644 --- a/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc +++ b/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -28,7 +28,7 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/tsi/ssl_transport_security.h" -/** -- Wrapper APIs declared in grpc_security.h -- **/ +/// -- Wrapper APIs declared in grpc_security.h -- * grpc_tls_credentials_options* grpc_tls_credentials_options_create() { grpc_core::ExecCtx exec_ctx; diff --git a/src/core/lib/security/credentials/tls/tls_credentials.cc b/src/core/lib/security/credentials/tls/tls_credentials.cc index dbbed5f64b0..10b5134b5e2 100644 --- a/src/core/lib/security/credentials/tls/tls_credentials.cc +++ b/src/core/lib/security/credentials/tls/tls_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -128,7 +128,7 @@ grpc_core::UniqueTypeName TlsServerCredentials::type() const { return kFactory.Create(); } -/** -- Wrapper APIs declared in grpc_security.h -- **/ +/// -- Wrapper APIs declared in grpc_security.h -- * grpc_channel_credentials* grpc_tls_credentials_create( grpc_tls_credentials_options* options) { diff --git a/src/core/lib/security/credentials/tls/tls_credentials.h b/src/core/lib/security/credentials/tls/tls_credentials.h index 881e1fb8504..62a74381cf8 100644 --- a/src/core/lib/security/credentials/tls/tls_credentials.h +++ b/src/core/lib/security/credentials/tls/tls_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H #define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H @@ -68,4 +68,4 @@ class TlsServerCredentials final : public grpc_server_credentials { grpc_core::RefCountedPtr options_; }; -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_CREDENTIALS_H diff --git a/src/core/lib/security/credentials/xds/xds_credentials.cc b/src/core/lib/security/credentials/xds/xds_credentials.cc index 9102a7dd7c1..7d0035a988a 100644 --- a/src/core/lib/security/credentials/xds/xds_credentials.cc +++ b/src/core/lib/security/credentials/xds/xds_credentials.cc @@ -99,7 +99,7 @@ bool XdsCertificateVerifier::Verify( absl::StatusCode::kUnauthenticated, "SANs from certificate did not match SANs from xDS control plane"); } - return true; /* synchronous check */ + return true; // synchronous check } void XdsCertificateVerifier::Cancel( diff --git a/src/core/lib/security/credentials/xds/xds_credentials.h b/src/core/lib/security/credentials/xds/xds_credentials.h index bfcb914ae4a..19445f547c6 100644 --- a/src/core/lib/security/credentials/xds/xds_credentials.h +++ b/src/core/lib/security/credentials/xds/xds_credentials.h @@ -111,4 +111,4 @@ bool TestOnlyXdsVerifySubjectAlternativeNames( } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H */ +#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_XDS_XDS_CREDENTIALS_H diff --git a/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/src/core/lib/security/security_connector/alts/alts_security_connector.cc index d7de12b0584..159e3c9c967 100644 --- a/src/core/lib/security/security_connector/alts/alts_security_connector.cc +++ b/src/core/lib/security/security_connector/alts/alts_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -194,7 +194,7 @@ RefCountedPtr grpc_alts_auth_context_from_tsi_peer( "Invalid arguments to grpc_alts_auth_context_from_tsi_peer()"); return nullptr; } - /* Validate certificate type. */ + // Validate certificate type. const tsi_peer_property* cert_type_prop = tsi_peer_get_property_by_name(peer, TSI_CERTIFICATE_TYPE_PEER_PROPERTY); if (cert_type_prop == nullptr || @@ -203,14 +203,14 @@ RefCountedPtr grpc_alts_auth_context_from_tsi_peer( gpr_log(GPR_ERROR, "Invalid or missing certificate type property."); return nullptr; } - /* Check if security level exists. */ + // Check if security level exists. const tsi_peer_property* security_level_prop = tsi_peer_get_property_by_name(peer, TSI_SECURITY_LEVEL_PEER_PROPERTY); if (security_level_prop == nullptr) { gpr_log(GPR_ERROR, "Missing security level property."); return nullptr; } - /* Validate RPC protocol versions. */ + // Validate RPC protocol versions. const tsi_peer_property* rpc_versions_prop = tsi_peer_get_property_by_name(peer, TSI_ALTS_RPC_VERSIONS); if (rpc_versions_prop == nullptr) { @@ -228,21 +228,21 @@ RefCountedPtr grpc_alts_auth_context_from_tsi_peer( gpr_log(GPR_ERROR, "Invalid peer rpc protocol versions."); return nullptr; } - /* TODO: Pass highest common rpc protocol version to grpc caller. */ + // TODO(unknown): Pass highest common rpc protocol version to grpc caller. bool check_result = grpc_gcp_rpc_protocol_versions_check( &local_versions, &peer_versions, nullptr); if (!check_result) { gpr_log(GPR_ERROR, "Mismatch of local and peer rpc protocol versions."); return nullptr; } - /* Validate ALTS Context. */ + // Validate ALTS Context. const tsi_peer_property* alts_context_prop = tsi_peer_get_property_by_name(peer, TSI_ALTS_CONTEXT); if (alts_context_prop == nullptr) { gpr_log(GPR_ERROR, "Missing alts context property."); return nullptr; } - /* Create auth context. */ + // Create auth context. auto ctx = MakeRefCounted(nullptr); grpc_auth_context_add_cstring_property( ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME, @@ -250,7 +250,7 @@ RefCountedPtr grpc_alts_auth_context_from_tsi_peer( size_t i = 0; for (i = 0; i < peer->property_count; i++) { const tsi_peer_property* tsi_prop = &peer->properties[i]; - /* Add service account to auth context. */ + // Add service account to auth context. if (strcmp(tsi_prop->name, TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY) == 0) { grpc_auth_context_add_property( ctx.get(), TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY, @@ -258,13 +258,13 @@ RefCountedPtr grpc_alts_auth_context_from_tsi_peer( GPR_ASSERT(grpc_auth_context_set_peer_identity_property_name( ctx.get(), TSI_ALTS_SERVICE_ACCOUNT_PEER_PROPERTY) == 1); } - /* Add alts context to auth context. */ + // Add alts context to auth context. if (strcmp(tsi_prop->name, TSI_ALTS_CONTEXT) == 0) { grpc_auth_context_add_property(ctx.get(), TSI_ALTS_CONTEXT, tsi_prop->value.data, tsi_prop->value.length); } - /* Add security level to auth context. */ + // Add security level to auth context. if (strcmp(tsi_prop->name, TSI_SECURITY_LEVEL_PEER_PROPERTY) == 0) { grpc_auth_context_add_property( ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME, diff --git a/src/core/lib/security/security_connector/alts/alts_security_connector.h b/src/core/lib/security/security_connector/alts/alts_security_connector.h index a95797611aa..fb6c1fc5b1e 100644 --- a/src/core/lib/security/security_connector/alts/alts_security_connector.h +++ b/src/core/lib/security/security_connector/alts/alts_security_connector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H @@ -30,50 +30,49 @@ #define GRPC_ALTS_TRANSPORT_SECURITY_TYPE "alts" -/** - * This method creates an ALTS channel security connector. - * - * - channel_creds: channel credential instance. - * - request_metadata_creds: credential object which will be sent with each - * request. This parameter can be nullptr. - * - target_name: the name of the endpoint that the channel is connecting to. - * - sc: address of ALTS channel security connector instance to be returned from - * the method. - * - * It returns nullptr on failure. - */ +/// +/// This method creates an ALTS channel security connector. +/// +///- channel_creds: channel credential instance. +///- request_metadata_creds: credential object which will be sent with each +/// request. This parameter can be nullptr. +///- target_name: the name of the endpoint that the channel is connecting to. +///- sc: address of ALTS channel security connector instance to be returned from +/// the method. +/// +/// It returns nullptr on failure. +/// grpc_core::RefCountedPtr grpc_alts_channel_security_connector_create( grpc_core::RefCountedPtr channel_creds, grpc_core::RefCountedPtr request_metadata_creds, const char* target_name); -/** - * This method creates an ALTS server security connector. - * - * - server_creds: server credential instance. - * - sc: address of ALTS server security connector instance to be returned from - * the method. - * - * It returns nullptr on failure. - */ +/// +/// This method creates an ALTS server security connector. +/// +///- server_creds: server credential instance. +///- sc: address of ALTS server security connector instance to be returned from +/// the method. +/// +/// It returns nullptr on failure. +/// grpc_core::RefCountedPtr grpc_alts_server_security_connector_create( grpc_core::RefCountedPtr server_creds); -/* Initializes rpc_versions. */ +// Initializes rpc_versions. void grpc_alts_set_rpc_protocol_versions( grpc_gcp_rpc_protocol_versions* rpc_versions); namespace grpc_core { namespace internal { -/* Exposed only for testing. */ +// Exposed only for testing. RefCountedPtr grpc_alts_auth_context_from_tsi_peer( const tsi_peer* peer); } // namespace internal } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_ALTS_ALTS_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/src/core/lib/security/security_connector/fake/fake_security_connector.cc index 8ad2b21177a..b3d9438a877 100644 --- a/src/core/lib/security/security_connector/fake/fake_security_connector.cc +++ b/src/core/lib/security/security_connector/fake/fake_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/lib/security/security_connector/fake/fake_security_connector.h b/src/core/lib/security/security_connector/fake/fake_security_connector.h index 3f8daee82c1..fd23747c9ce 100644 --- a/src/core/lib/security/security_connector/fake/fake_security_connector.h +++ b/src/core/lib/security/security_connector/fake/fake_security_connector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_FAKE_FAKE_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_FAKE_FAKE_SECURITY_CONNECTOR_H @@ -27,17 +27,16 @@ #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/security_connector/security_connector.h" -/* Creates a fake connector that emulates real channel security. */ +// Creates a fake connector that emulates real channel security. grpc_core::RefCountedPtr grpc_fake_channel_security_connector_create( grpc_core::RefCountedPtr channel_creds, grpc_core::RefCountedPtr request_metadata_creds, const char* target, const grpc_core::ChannelArgs& args); -/* Creates a fake connector that emulates real server security. */ +// Creates a fake connector that emulates real server security. grpc_core::RefCountedPtr grpc_fake_server_security_connector_create( grpc_core::RefCountedPtr server_creds); -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_FAKE_FAKE_SECURITY_CONNECTOR_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_FAKE_FAKE_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/insecure/insecure_security_connector.h b/src/core/lib/security/security_connector/insecure/insecure_security_connector.h index 003a86adf70..3975e170965 100644 --- a/src/core/lib/security/security_connector/insecure/insecure_security_connector.h +++ b/src/core/lib/security/security_connector/insecure/insecure_security_connector.h @@ -100,5 +100,4 @@ class InsecureServerSecurityConnector : public grpc_server_security_connector { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_INSECURE_INSECURE_SECURITY_CONNECTOR_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_INSECURE_INSECURE_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/load_system_roots.h b/src/core/lib/security/security_connector/load_system_roots.h index c6b445119a6..0609b22016f 100644 --- a/src/core/lib/security/security_connector/load_system_roots.h +++ b/src/core/lib/security/security_connector/load_system_roots.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H @@ -30,4 +30,4 @@ grpc_slice LoadSystemRootCerts(); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_H diff --git a/src/core/lib/security/security_connector/load_system_roots_fallback.cc b/src/core/lib/security/security_connector/load_system_roots_fallback.cc index adef3cd14a2..45231c9aef9 100644 --- a/src/core/lib/security/security_connector/load_system_roots_fallback.cc +++ b/src/core/lib/security/security_connector/load_system_roots_fallback.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -32,4 +32,4 @@ grpc_slice LoadSystemRootCerts() { return grpc_empty_slice(); } } // namespace grpc_core -#endif /* !(GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE) */ +#endif // !(GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE) diff --git a/src/core/lib/security/security_connector/load_system_roots_supported.cc b/src/core/lib/security/security_connector/load_system_roots_supported.cc index 44cab4cbd48..bb6dc3169b8 100644 --- a/src/core/lib/security/security_connector/load_system_roots_supported.cc +++ b/src/core/lib/security/security_connector/load_system_roots_supported.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -172,4 +172,4 @@ grpc_slice LoadSystemRootCerts() { } // namespace grpc_core -#endif /* GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE */ +#endif // GPR_LINUX || GPR_ANDROID || GPR_FREEBSD || GPR_APPLE diff --git a/src/core/lib/security/security_connector/load_system_roots_supported.h b/src/core/lib/security/security_connector/load_system_roots_supported.h index 30997ade03e..9c028b83e51 100644 --- a/src/core/lib/security/security_connector/load_system_roots_supported.h +++ b/src/core/lib/security/security_connector/load_system_roots_supported.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H @@ -41,6 +41,5 @@ void GetAbsoluteFilePath(const char* valid_file_dir, } // namespace grpc_core -#endif /* GPR_LINUX || GPR_FREEBSD || GPR_APPLE */ -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H \ - */ +#endif // GPR_LINUX || GPR_FREEBSD || GPR_APPLE +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOAD_SYSTEM_ROOTS_SUPPORTED_H diff --git a/src/core/lib/security/security_connector/local/local_security_connector.cc b/src/core/lib/security/security_connector/local/local_security_connector.cc index 7c11411aff0..722175a07df 100644 --- a/src/core/lib/security/security_connector/local/local_security_connector.cc +++ b/src/core/lib/security/security_connector/local/local_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -72,7 +72,7 @@ namespace { grpc_core::RefCountedPtr local_auth_context_create( const tsi_peer* peer) { - /* Create auth context. */ + // Create auth context. grpc_core::RefCountedPtr ctx = grpc_core::MakeRefCounted(nullptr); grpc_auth_context_add_cstring_property( @@ -152,11 +152,11 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep, &peer.properties[peer.property_count]); if (result != TSI_OK) return; peer.property_count++; - /* Create an auth context which is necessary to pass the santiy check in - * {client, server}_auth_filter that verifies if the peer's auth context is - * obtained during handshakes. The auth context is only checked for its - * existence and not actually used. - */ + // Create an auth context which is necessary to pass the santiy check in + // {client, server}_auth_filter that verifies if the peer's auth context is + // obtained during handshakes. The auth context is only checked for its + // existence and not actually used. + // *auth_context = local_auth_context_create(&peer); tsi_peer_destruct(&peer); error = *auth_context != nullptr diff --git a/src/core/lib/security/security_connector/local/local_security_connector.h b/src/core/lib/security/security_connector/local/local_security_connector.h index 2dcd12c212f..cd828ecccc5 100644 --- a/src/core/lib/security/security_connector/local/local_security_connector.h +++ b/src/core/lib/security/security_connector/local/local_security_connector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOCAL_LOCAL_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOCAL_LOCAL_SECURITY_CONNECTOR_H @@ -27,37 +27,36 @@ #include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/security/security_connector/security_connector.h" -/** - * This method creates a local channel security connector. - * - * - channel_creds: channel credential instance. - * - request_metadata_creds: credential object which will be sent with each - * request. This parameter can be nullptr. - * - target_name: the name of the endpoint that the channel is connecting to. - * - args: channel args passed from the caller. - * - sc: address of local channel security connector instance to be returned - * from the method. - * - * It returns nullptr on failure. - */ +/// +/// This method creates a local channel security connector. +/// +///- channel_creds: channel credential instance. +///- request_metadata_creds: credential object which will be sent with each +/// request. This parameter can be nullptr. +///- target_name: the name of the endpoint that the channel is connecting to. +///- args: channel args passed from the caller. +///- sc: address of local channel security connector instance to be returned +/// from the method. +/// +/// It returns nullptr on failure. +/// grpc_core::RefCountedPtr grpc_local_channel_security_connector_create( grpc_core::RefCountedPtr channel_creds, grpc_core::RefCountedPtr request_metadata_creds, const grpc_core::ChannelArgs& args, const char* target_name); -/** - * This method creates a local server security connector. - * - * - server_creds: server credential instance. - * - sc: address of local server security connector instance to be returned from - * the method. - * - * It returns nullptr on failure. - */ +/// +/// This method creates a local server security connector. +/// +///- server_creds: server credential instance. +///- sc: address of local server security connector instance to be returned from +/// the method. +/// +/// It returns nullptr on failure. +/// grpc_core::RefCountedPtr grpc_local_server_security_connector_create( grpc_core::RefCountedPtr server_creds); -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOCAL_LOCAL_SECURITY_CONNECTOR_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_LOCAL_LOCAL_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/security_connector.cc b/src/core/lib/security/security_connector/security_connector.cc index 33eae90ee20..175aa5df8bf 100644 --- a/src/core/lib/security/security_connector/security_connector.cc +++ b/src/core/lib/security/security_connector/security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/security/security_connector/security_connector.h b/src/core/lib/security/security_connector/security_connector.h index 40124ac1b87..42f6c506b69 100644 --- a/src/core/lib/security/security_connector/security_connector.h +++ b/src/core/lib/security/security_connector/security_connector.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SECURITY_CONNECTOR_H @@ -44,17 +44,17 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_security_connector_refcount; -/* --- URL schemes. --- */ +// --- URL schemes. --- #define GRPC_SSL_URL_SCHEME "https" #define GRPC_FAKE_SECURITY_URL_SCHEME "http+fake_security" typedef enum { GRPC_SECURITY_OK = 0, GRPC_SECURITY_ERROR } grpc_security_status; -/* --- security_connector object. --- +// --- security_connector object. --- - A security connector object represents away to configure the underlying - transport security mechanism and check the resulting trusted peer. */ +// A security connector object represents away to configure the underlying +// transport security mechanism and check the resulting trusted peer. #define GRPC_ARG_SECURITY_CONNECTOR "grpc.internal.security_connector" @@ -85,7 +85,7 @@ class grpc_security_connector virtual void cancel_check_peer(grpc_closure* on_peer_checked, grpc_error_handle error) = 0; - /* Compares two security connectors. */ + // Compares two security connectors. virtual int cmp(const grpc_security_connector* other) const = 0; static int ChannelArgsCompare(const grpc_security_connector* a, @@ -101,20 +101,20 @@ class grpc_security_connector absl::string_view url_scheme_; }; -/* Util to encapsulate the connector in a channel arg. */ +// Util to encapsulate the connector in a channel arg. grpc_arg grpc_security_connector_to_arg(grpc_security_connector* sc); -/* Util to get the connector from a channel arg. */ +// Util to get the connector from a channel arg. grpc_security_connector* grpc_security_connector_from_arg(const grpc_arg* arg); -/* Util to find the connector from channel args. */ +// Util to find the connector from channel args. grpc_security_connector* grpc_security_connector_find_in_args( const grpc_channel_args* args); -/* --- channel_security_connector object. --- +// --- channel_security_connector object. --- - A channel security connector object represents a way to configure the - underlying transport security mechanism on the client side. */ +// A channel security connector object represents a way to configure the +// underlying transport security mechanism on the client side. class grpc_channel_security_connector : public grpc_security_connector { public: @@ -164,10 +164,10 @@ class grpc_channel_security_connector : public grpc_security_connector { std::unique_ptr channel_args_; }; -/* --- server_security_connector object. --- +// --- server_security_connector object. --- - A server security connector object represents a way to configure the - underlying transport security mechanism on the server side. */ +// A server security connector object represents a way to configure the +// underlying transport security mechanism on the server side. class grpc_server_security_connector : public grpc_security_connector { public: @@ -197,4 +197,4 @@ class grpc_server_security_connector : public grpc_security_connector { grpc_core::RefCountedPtr server_creds_; }; -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SECURITY_CONNECTOR_H */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc b/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc index f1e9e8f2449..aef398afebb 100644 --- a/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +++ b/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -64,7 +64,7 @@ grpc_error_handle ssl_check_peer( if (!error.ok()) { return error; } - /* Check the peer name if specified. */ + // Check the peer name if specified. if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) { return GRPC_ERROR_CREATE( absl::StrCat("Peer name ", peer_name, " is not in peer certificate")); @@ -311,9 +311,9 @@ class grpc_ssl_server_security_connector } private: - /* Attempts to fetch the server certificate config if a callback is available. - * Current certificate config will continue to be used if the callback returns - * an error. Returns true if new credentials were successfully loaded. */ + // Attempts to fetch the server certificate config if a callback is available. + // Current certificate config will continue to be used if the callback returns + // an error. Returns true if new credentials were successfully loaded. bool try_fetch_ssl_server_credentials() { grpc_ssl_server_certificate_config* certificate_config = nullptr; bool status; @@ -343,10 +343,10 @@ class grpc_ssl_server_security_connector return status; } - /* Attempts to replace the server_handshaker_factory with a new factory using - * the provided grpc_ssl_server_certificate_config. Should new factory - * creation fail, the existing factory will not be replaced. Returns true on - * success (new factory created). */ + // Attempts to replace the server_handshaker_factory with a new factory using + // the provided grpc_ssl_server_certificate_config. Should new factory + // creation fail, the existing factory will not be replaced. Returns true on + // success (new factory created). bool try_replace_server_handshaker_factory( const grpc_ssl_server_certificate_config* config) { if (config == nullptr) { diff --git a/src/core/lib/security/security_connector/ssl/ssl_security_connector.h b/src/core/lib/security/security_connector/ssl/ssl_security_connector.h index e62ce399764..da78e57df32 100644 --- a/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +++ b/src/core/lib/security/security_connector/ssl/ssl_security_connector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H @@ -38,19 +38,19 @@ struct grpc_ssl_config { grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3; }; -/* Creates an SSL channel_security_connector. - - request_metadata_creds is the credentials object which metadata - will be sent with each request. This parameter can be NULL. - - config is the SSL config to be used for the SSL channel establishment. - - is_client should be 0 for a server or a non-0 value for a client. - - secure_peer_name is the secure peer name that should be checked in - grpc_channel_security_connector_check_peer. This parameter may be NULL in - which case the peer name will not be checked. Note that if this parameter - is not NULL, then, pem_root_certs should not be NULL either. - - sc is a pointer on the connector to be created. - This function returns GRPC_SECURITY_OK in case of success or a - specific error code otherwise. -*/ +// Creates an SSL channel_security_connector. +// - request_metadata_creds is the credentials object which metadata +// will be sent with each request. This parameter can be NULL. +// - config is the SSL config to be used for the SSL channel establishment. +// - is_client should be 0 for a server or a non-0 value for a client. +// - secure_peer_name is the secure peer name that should be checked in +// grpc_channel_security_connector_check_peer. This parameter may be NULL in +// which case the peer name will not be checked. Note that if this parameter +// is not NULL, then, pem_root_certs should not be NULL either. +// - sc is a pointer on the connector to be created. +// This function returns GRPC_SECURITY_OK in case of success or a +// specific error code otherwise. +// grpc_core::RefCountedPtr grpc_ssl_channel_security_connector_create( grpc_core::RefCountedPtr channel_creds, @@ -59,7 +59,7 @@ grpc_ssl_channel_security_connector_create( const char* overridden_target_name, tsi_ssl_session_cache* ssl_session_cache); -/* Config for ssl servers. */ +// Config for ssl servers. struct grpc_ssl_server_config { tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs = nullptr; size_t num_key_cert_pairs = 0; @@ -69,15 +69,14 @@ struct grpc_ssl_server_config { grpc_tls_version min_tls_version = grpc_tls_version::TLS1_2; grpc_tls_version max_tls_version = grpc_tls_version::TLS1_3; }; -/* Creates an SSL server_security_connector. - - config is the SSL config to be used for the SSL channel establishment. - - sc is a pointer on the connector to be created. - This function returns GRPC_SECURITY_OK in case of success or a - specific error code otherwise. -*/ +// Creates an SSL server_security_connector. +// - config is the SSL config to be used for the SSL channel establishment. +// - sc is a pointer on the connector to be created. +// This function returns GRPC_SECURITY_OK in case of success or a +// specific error code otherwise. +// grpc_core::RefCountedPtr grpc_ssl_server_security_connector_create( grpc_core::RefCountedPtr server_credentials); -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_SSL_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/security_connector/ssl_utils.cc b/src/core/lib/security/security_connector/ssl_utils.cc index da5c4eacc81..7f88846f2dd 100644 --- a/src/core/lib/security/security_connector/ssl_utils.cc +++ b/src/core/lib/security/security_connector/ssl_utils.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -48,7 +48,7 @@ #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security.h" -/* -- Constants. -- */ +// -- Constants. -- #if defined(GRPC_ROOT_PEM_PATH) static const char* installed_roots_path = GRPC_ROOT_PEM_PATH; @@ -63,7 +63,7 @@ static const char* installed_roots_path = "/usr/share/grpc/roots.pem"; #define TSI_OPENSSL_ALPN_SUPPORT 1 #endif -/* -- Overridden default roots. -- */ +// -- Overridden default roots. -- static grpc_ssl_roots_override_callback ssl_roots_override_cb = nullptr; @@ -71,7 +71,7 @@ void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb) { ssl_roots_override_cb = cb; } -/* -- Cipher suites. -- */ +// -- Cipher suites. -- static gpr_once cipher_suites_once = GPR_ONCE_INIT; static const char* cipher_suites = nullptr; @@ -94,7 +94,7 @@ static void init_cipher_suites(void) { cipher_suites = value.release(); } -/* --- Util --- */ +// --- Util --- const char* grpc_get_ssl_cipher_suites(void) { gpr_once_init(&cipher_suites_once, init_cipher_suites); @@ -139,7 +139,7 @@ tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version) { grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer) { #if TSI_OPENSSL_ALPN_SUPPORT - /* Check the ALPN if ALPN is supported. */ + // Check the ALPN if ALPN is supported. const tsi_peer_property* p = tsi_peer_get_property_by_name(peer, TSI_SSL_ALPN_SELECTED_PROTOCOL); if (p == nullptr) { @@ -149,13 +149,13 @@ grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer) { if (!grpc_chttp2_is_alpn_version_supported(p->value.data, p->value.length)) { return GRPC_ERROR_CREATE("Cannot check peer: invalid ALPN value."); } -#endif /* TSI_OPENSSL_ALPN_SUPPORT */ +#endif // TSI_OPENSSL_ALPN_SUPPORT return absl::OkStatus(); } grpc_error_handle grpc_ssl_check_peer_name(absl::string_view peer_name, const tsi_peer* peer) { - /* Check the peer name if specified. */ + // Check the peer name if specified. if (!peer_name.empty() && !grpc_ssl_host_matches_name(peer, peer_name)) { return GRPC_ERROR_CREATE( absl::StrCat("Peer name ", peer_name, " is not in peer certificate")); @@ -182,9 +182,9 @@ absl::Status SslCheckCallHost(absl::string_view host, grpc_security_status status = GRPC_SECURITY_ERROR; tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context); if (grpc_ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK; - /* If the target name was overridden, then the original target_name was - 'checked' transitively during the previous peer check at the end of the - handshake. */ + // If the target name was overridden, then the original target_name was + //'checked' transitively during the previous peer check at the end of the + // handshake. if (!overridden_target_name.empty() && host == target_name) { status = GRPC_SECURITY_OK; } @@ -261,7 +261,7 @@ grpc_core::RefCountedPtr grpc_ssl_peer_to_auth_context( size_t i; const char* peer_identity_property_name = nullptr; - /* The caller has checked the certificate type property. */ + // The caller has checked the certificate type property. GPR_ASSERT(peer->property_count >= 1); grpc_core::RefCountedPtr ctx = grpc_core::MakeRefCounted(nullptr); @@ -280,7 +280,7 @@ grpc_core::RefCountedPtr grpc_ssl_peer_to_auth_context( prop->value.data, prop->value.length); } else if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) { - /* If there is no subject alt name, have the CN as the identity. */ + // If there is no subject alt name, have the CN as the identity. if (peer_identity_property_name == nullptr) { peer_identity_property_name = GRPC_X509_CN_PROPERTY_NAME; } @@ -509,7 +509,7 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init( return GRPC_SECURITY_OK; } -/* --- Ssl cache implementation. --- */ +// --- Ssl cache implementation. --- grpc_ssl_session_cache* grpc_ssl_session_cache_create_lru(size_t capacity) { tsi_ssl_session_cache* cache = tsi_ssl_session_cache_create_lru(capacity); @@ -551,7 +551,7 @@ grpc_arg grpc_ssl_session_cache_create_channel_arg( const_cast(GRPC_SSL_SESSION_CACHE_ARG), cache, &vtable); } -/* --- Default SSL root store implementation. --- */ +// --- Default SSL root store implementation. --- namespace grpc_core { diff --git a/src/core/lib/security/security_connector/ssl_utils.h b/src/core/lib/security/security_connector/ssl_utils.h index 69ada762ac9..c0ff4ec4efe 100644 --- a/src/core/lib/security/security_connector/ssl_utils.h +++ b/src/core/lib/security/security_connector/ssl_utils.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_H @@ -41,44 +41,44 @@ #include "src/core/tsi/ssl_transport_security.h" #include "src/core/tsi/transport_security_interface.h" -/* --- Util --- */ +// --- Util --- -/* Check ALPN information returned from SSL handshakes. */ +// Check ALPN information returned from SSL handshakes. grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer); -/* Check peer name information returned from SSL handshakes. */ +// Check peer name information returned from SSL handshakes. grpc_error_handle grpc_ssl_check_peer_name(absl::string_view peer_name, const tsi_peer* peer); -/* Compare targer_name information extracted from SSL security connectors. */ +// Compare targer_name information extracted from SSL security connectors. int grpc_ssl_cmp_target_name(absl::string_view target_name, absl::string_view other_target_name, absl::string_view overridden_target_name, absl::string_view other_overridden_target_name); namespace grpc_core { -/* Check the host that will be set for a call is acceptable.*/ +// Check the host that will be set for a call is acceptable. absl::Status SslCheckCallHost(absl::string_view host, absl::string_view target_name, absl::string_view overridden_target_name, grpc_auth_context* auth_context); } // namespace grpc_core -/* Return HTTP2-compliant cipher suites that gRPC accepts by default. */ +// Return HTTP2-compliant cipher suites that gRPC accepts by default. const char* grpc_get_ssl_cipher_suites(void); -/* Map from grpc_ssl_client_certificate_request_type to - * tsi_client_certificate_request_type. */ +// Map from grpc_ssl_client_certificate_request_type to +// tsi_client_certificate_request_type. tsi_client_certificate_request_type grpc_get_tsi_client_certificate_request_type( grpc_ssl_client_certificate_request_type grpc_request_type); -/* Map grpc_tls_version to tsi_tls_version. */ +// Map grpc_tls_version to tsi_tls_version. tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version); -/* Return an array of strings containing alpn protocols. */ +// Return an array of strings containing alpn protocols. const char** grpc_fill_alpn_protocol_strings(size_t* num_alpn_protocols); -/* Initialize TSI SSL server/client handshaker factory. */ +// Initialize TSI SSL server/client handshaker factory. grpc_security_status grpc_ssl_tsi_client_handshaker_factory_init( tsi_ssl_pem_key_cert_pair* key_cert_pair, const char* pem_root_certs, bool skip_server_certificate_verification, tsi_tls_version min_tls_version, @@ -96,10 +96,10 @@ grpc_security_status grpc_ssl_tsi_server_handshaker_factory_init( const char* crl_directory, tsi_ssl_server_handshaker_factory** handshaker_factory); -/* Free the memory occupied by key cert pairs. */ +// Free the memory occupied by key cert pairs. void grpc_tsi_ssl_pem_key_cert_pairs_destroy(tsi_ssl_pem_key_cert_pair* kp, size_t num_key_cert_pairs); -/* Exposed for testing only. */ +// Exposed for testing only. grpc_core::RefCountedPtr grpc_ssl_peer_to_auth_context( const tsi_peer* peer, const char* transport_security_type); tsi_peer grpc_shallow_peer_from_ssl_auth_context( @@ -108,7 +108,7 @@ void grpc_shallow_peer_destruct(tsi_peer* peer); int grpc_ssl_host_matches_name(const tsi_peer* peer, absl::string_view peer_name); -/* --- Default SSL Root Store. --- */ +// --- Default SSL Root Store. --- namespace grpc_core { // The class implements default SSL root store. diff --git a/src/core/lib/security/security_connector/ssl_utils_config.cc b/src/core/lib/security/security_connector/ssl_utils_config.cc index 2d056a781fd..cf0d3811c49 100644 --- a/src/core/lib/security/security_connector/ssl_utils_config.cc +++ b/src/core/lib/security/security_connector/ssl_utils_config.cc @@ -1,32 +1,32 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include "src/core/lib/security/security_connector/ssl_utils_config.h" -/** Config variable that points to the default SSL roots file. This file - must be a PEM encoded file with all the roots such as the one that can be - downloaded from https://pki.google.com/roots.pem. */ +/// Config variable that points to the default SSL roots file. This file +/// must be a PEM encoded file with all the roots such as the one that can be +/// downloaded from https://pki.google.com/roots.pem. GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_default_ssl_roots_file_path, "", "Path to the default SSL roots file."); -/** Config variable used as a flag to enable/disable loading system root - certificates from the OS trust store. */ +/// Config variable used as a flag to enable/disable loading system root +/// certificates from the OS trust store. GPR_GLOBAL_CONFIG_DEFINE_BOOL(grpc_not_use_system_ssl_roots, false, "Disable loading system root certificates."); diff --git a/src/core/lib/security/security_connector/ssl_utils_config.h b/src/core/lib/security/security_connector/ssl_utils_config.h index d0979924cef..345bc5e527e 100644 --- a/src/core/lib/security/security_connector/ssl_utils_config.h +++ b/src/core/lib/security/security_connector/ssl_utils_config.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H @@ -26,5 +26,4 @@ GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_default_ssl_roots_file_path); GPR_GLOBAL_CONFIG_DECLARE_BOOL(grpc_not_use_system_ssl_roots); -#endif /* GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H \ - */ +#endif // GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_SSL_UTILS_CONFIG_H diff --git a/src/core/lib/security/security_connector/tls/tls_security_connector.cc b/src/core/lib/security/security_connector/tls/tls_security_connector.cc index 644666e5658..1fea77986f9 100644 --- a/src/core/lib/security/security_connector/tls/tls_security_connector.cc +++ b/src/core/lib/security/security_connector/tls/tls_security_connector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -522,7 +522,7 @@ void TlsChannelSecurityConnector::ChannelPendingVerifierRequest::OnVerifyDone( grpc_security_status TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() { bool skip_server_certificate_verification = !options_->verify_server_cert(); - /* Free the client handshaker factory if exists. */ + // Free the client handshaker factory if exists. if (client_handshaker_factory_ != nullptr) { tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_); } @@ -546,7 +546,7 @@ TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() { grpc_get_tsi_tls_version(options_->max_tls_version()), ssl_session_cache_, tls_session_key_logger_.get(), options_->crl_directory().c_str(), &client_handshaker_factory_); - /* Free memory. */ + // Free memory. if (pem_key_cert_pair != nullptr) { grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pair, 1); } @@ -795,7 +795,7 @@ void TlsServerSecurityConnector::ServerPendingVerifierRequest::OnVerifyDone( // BlockOnInitialCredentialHandshaker is implemented. grpc_security_status TlsServerSecurityConnector::UpdateHandshakerFactoryLocked() { - /* Free the server handshaker factory if exists. */ + // Free the server handshaker factory if exists. if (server_handshaker_factory_ != nullptr) { tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory_); } @@ -819,7 +819,7 @@ TlsServerSecurityConnector::UpdateHandshakerFactoryLocked() { grpc_get_tsi_tls_version(options_->max_tls_version()), tls_session_key_logger_.get(), options_->crl_directory().c_str(), &server_handshaker_factory_); - /* Free memory. */ + // Free memory. grpc_tsi_ssl_pem_key_cert_pairs_destroy(pem_key_cert_pairs, num_key_cert_pairs); return status; diff --git a/src/core/lib/security/security_connector/tls/tls_security_connector.h b/src/core/lib/security/security_connector/tls/tls_security_connector.h index 21774d2b8b9..887410f92f3 100644 --- a/src/core/lib/security/security_connector/tls/tls_security_connector.h +++ b/src/core/lib/security/security_connector/tls/tls_security_connector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H #define GRPC_CORE_LIB_SECURITY_SECURITY_CONNECTOR_TLS_TLS_SECURITY_CONNECTOR_H diff --git a/src/core/lib/security/transport/auth_filters.h b/src/core/lib/security/transport/auth_filters.h index e6e9a80a351..b7551d2f588 100644 --- a/src/core/lib/security/transport/auth_filters.h +++ b/src/core/lib/security/transport/auth_filters.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H #define GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H @@ -73,4 +73,4 @@ class ClientAuthFilter final : public ChannelFilter { bool grpc_check_security_level(grpc_security_level channel_level, grpc_security_level call_cred_level); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H */ +#endif // GRPC_CORE_LIB_SECURITY_TRANSPORT_AUTH_FILTERS_H diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc index e8a262749ee..8094ff429a5 100644 --- a/src/core/lib/security/transport/client_auth_filter.cc +++ b/src/core/lib/security/transport/client_auth_filter.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -118,7 +118,7 @@ ArenaPromise> ClientAuthFilter::GetCallCredsMetadata( const bool call_creds_has_md = (ctx != nullptr) && (ctx->creds != nullptr); if (channel_call_creds == nullptr && !call_creds_has_md) { - /* Skip sending metadata altogether. */ + // Skip sending metadata altogether. return Immediate(absl::StatusOr(std::move(call_args))); } @@ -137,8 +137,8 @@ ArenaPromise> ClientAuthFilter::GetCallCredsMetadata( creds = channel_call_creds->Ref(); } - /* Check security level of call credential and channel, and do not send - * metadata if the check fails. */ + // Check security level of call credential and channel, and do not send + // metadata if the check fails. grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name( args_.auth_context.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME); const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it); diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc index 159230f6644..3e64aacb7f3 100644 --- a/src/core/lib/security/transport/secure_endpoint.cc +++ b/src/core/lib/security/transport/secure_endpoint.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -126,15 +126,15 @@ struct secure_endpoint { gpr_mu protector_mu; grpc_core::Mutex read_mu; grpc_core::Mutex write_mu; - /* saved upper level callbacks and user_data. */ + // saved upper level callbacks and user_data. grpc_closure* read_cb = nullptr; grpc_closure* write_cb = nullptr; grpc_closure on_read; grpc_slice_buffer* read_buffer = nullptr; grpc_slice_buffer source_buffer; - /* saved handshaker leftover data to unprotect. */ + // saved handshaker leftover data to unprotect. grpc_slice_buffer leftover_bytes; - /* buffers for read and write */ + // buffers for read and write grpc_slice read_staging_buffer ABSL_GUARDED_BY(read_mu); grpc_slice write_staging_buffer ABSL_GUARDED_BY(write_mu); grpc_slice_buffer output_buffer; @@ -285,7 +285,7 @@ static void on_read(void* user_data, grpc_error_handle error) { ep->min_progress_size = result != TSI_OK ? 1 : min_progress_size; } else { // Use frame protector to unprotect. - /* TODO(yangg) check error, maybe bail out early */ + // TODO(yangg) check error, maybe bail out early for (i = 0; i < ep->source_buffer.count; i++) { grpc_slice encrypted = ep->source_buffer.slices[i]; uint8_t* message_bytes = GRPC_SLICE_START_PTR(encrypted); @@ -311,10 +311,10 @@ static void on_read(void* user_data, grpc_error_handle error) { if (cur == end) { flush_read_staging_buffer(ep, &cur, &end); - /* Force to enter the loop again to extract buffered bytes in - protector. The bytes could be buffered because of running out of - staging_buffer. If this happens at the end of all slices, doing - another unprotect avoids leaving data in the protector. */ + // Force to enter the loop again to extract buffered bytes in + // protector. The bytes could be buffered because of running out of + // staging_buffer. If this happens at the end of all slices, doing + // another unprotect avoids leaving data in the protector. keep_looping = 1; } else if (unprotected_buffer_size_written > 0) { keep_looping = 1; @@ -336,8 +336,8 @@ static void on_read(void* user_data, grpc_error_handle error) { } } - /* TODO(yangg) experiment with moving this block after read_cb to see if it - helps latency */ + // TODO(yangg) experiment with moving this block after read_cb to see if it + // helps latency grpc_slice_buffer_reset_and_unref(&ep->source_buffer); if (result != TSI_OK) { @@ -481,7 +481,7 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices, } if (result != TSI_OK) { - /* TODO(yangg) do different things according to the error type? */ + // TODO(yangg) do different things according to the error type? grpc_slice_buffer_reset_and_unref(&ep->output_buffer); grpc_core::ExecCtx::Run( DEBUG_LOCATION, cb, diff --git a/src/core/lib/security/transport/secure_endpoint.h b/src/core/lib/security/transport/secure_endpoint.h index 66496da4bcc..65c3f7e7398 100644 --- a/src/core/lib/security/transport/secure_endpoint.h +++ b/src/core/lib/security/transport/secure_endpoint.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H #define GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H @@ -31,13 +31,13 @@ extern grpc_core::TraceFlag grpc_trace_secure_endpoint; -/* Takes ownership of protector, zero_copy_protector, and to_wrap, and refs - * leftover_slices. If zero_copy_protector is not NULL, protector will never be - * used. */ +// Takes ownership of protector, zero_copy_protector, and to_wrap, and refs +// leftover_slices. If zero_copy_protector is not NULL, protector will never be +// used. grpc_endpoint* grpc_secure_endpoint_create( struct tsi_frame_protector* protector, struct tsi_zero_copy_grpc_protector* zero_copy_protector, grpc_endpoint* to_wrap, grpc_slice* leftover_slices, const grpc_channel_args* channel_args, size_t leftover_nslices); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H */ +#endif // GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURE_ENDPOINT_H diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc index 45738ec2fa0..696344e278f 100644 --- a/src/core/lib/security/transport/security_handshaker.cc +++ b/src/core/lib/security/transport/security_handshaker.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/security/transport/security_handshaker.h b/src/core/lib/security/transport/security_handshaker.h index 344c7214592..0e099f36074 100644 --- a/src/core/lib/security/transport/security_handshaker.h +++ b/src/core/lib/security/transport/security_handshaker.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H #define GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H @@ -48,4 +48,4 @@ grpc_handshaker* grpc_security_handshaker_create( tsi_handshaker* handshaker, grpc_security_connector* connector, const grpc_channel_args* args); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */ +#endif // GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H diff --git a/src/core/lib/security/transport/server_auth_filter.cc b/src/core/lib/security/transport/server_auth_filter.cc index a15da628a10..a933524ce0d 100644 --- a/src/core/lib/security/transport/server_auth_filter.cc +++ b/src/core/lib/security/transport/server_auth_filter.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -166,7 +166,7 @@ static void on_md_processing_done_inner(grpc_call_element* elem, grpc_error_handle error) { call_data* calld = static_cast(elem->call_data); grpc_transport_stream_op_batch* batch = calld->recv_initial_metadata_batch; - /* TODO(ZhenLian): Implement support for response_md. */ + // TODO(ZhenLian): Implement support for response_md. if (response_md != nullptr && num_response_md > 0) { gpr_log(GPR_ERROR, "response_md in auth metadata processing not supported for now. " @@ -309,14 +309,14 @@ static void server_auth_start_transport_stream_op_batch( grpc_call_next_op(elem, batch); } -/* Constructor for call_data */ +// Constructor for call_data static grpc_error_handle server_auth_init_call_elem( grpc_call_element* elem, const grpc_call_element_args* args) { new (elem->call_data) call_data(elem, *args); return absl::OkStatus(); } -/* Destructor for call_data */ +// Destructor for call_data static void server_auth_destroy_call_elem( grpc_call_element* elem, const grpc_call_final_info* /*final_info*/, grpc_closure* /*ignored*/) { @@ -324,7 +324,7 @@ static void server_auth_destroy_call_elem( calld->~call_data(); } -/* Constructor for channel_data */ +// Constructor for channel_data static grpc_error_handle server_auth_init_channel_elem( grpc_channel_element* elem, grpc_channel_element_args* args) { GPR_ASSERT(!args->is_last); @@ -337,7 +337,7 @@ static grpc_error_handle server_auth_init_channel_elem( return absl::OkStatus(); } -/* Destructor for channel data */ +// Destructor for channel data static void server_auth_destroy_channel_elem(grpc_channel_element* elem) { channel_data* chand = static_cast(elem->channel_data); chand->~channel_data(); diff --git a/src/core/lib/security/transport/tsi_error.cc b/src/core/lib/security/transport/tsi_error.cc index 6808e952a2c..647bbba1e7a 100644 --- a/src/core/lib/security/transport/tsi_error.cc +++ b/src/core/lib/security/transport/tsi_error.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/security/transport/tsi_error.h b/src/core/lib/security/transport/tsi_error.h index 26b8806dd21..537bb0052b7 100644 --- a/src/core/lib/security/transport/tsi_error.h +++ b/src/core/lib/security/transport/tsi_error.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H #define GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H @@ -27,4 +27,4 @@ grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error, tsi_result result); -#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */ +#endif // GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H diff --git a/src/core/lib/security/util/json_util.cc b/src/core/lib/security/util/json_util.cc index db1650845cb..294cb43ec20 100644 --- a/src/core/lib/security/util/json_util.cc +++ b/src/core/lib/security/util/json_util.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/security/util/json_util.h b/src/core/lib/security/util/json_util.h index 24ab6c507a5..82e37d5ab55 100644 --- a/src/core/lib/security/util/json_util.h +++ b/src/core/lib/security/util/json_util.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H #define GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H @@ -40,4 +40,4 @@ const char* grpc_json_get_string_property(const grpc_core::Json& json, bool grpc_copy_json_string_property(const grpc_core::Json& json, const char* prop_name, char** copied_value); -#endif /* GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H */ +#endif // GRPC_CORE_LIB_SECURITY_UTIL_JSON_UTIL_H diff --git a/src/core/lib/service_config/service_config.h b/src/core/lib/service_config/service_config.h index fa73d55e337..34e6ca9f3aa 100644 --- a/src/core/lib/service_config/service_config.h +++ b/src/core/lib/service_config/service_config.h @@ -86,4 +86,4 @@ class ServiceConfig : public RefCounted { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H */ +#endif // GRPC_CORE_LIB_SERVICE_CONFIG_SERVICE_CONFIG_H diff --git a/src/core/lib/slice/b64.cc b/src/core/lib/slice/b64.cc index 38112ee8bfb..a41b361033b 100644 --- a/src/core/lib/slice/b64.cc +++ b/src/core/lib/slice/b64.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -29,7 +29,7 @@ #include "src/core/lib/gpr/useful.h" #include "src/core/lib/slice/slice.h" -/* --- Constants. --- */ +// --- Constants. --- static const int8_t base64_bytes[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -54,7 +54,7 @@ static const char base64_url_safe_chars[] = #define GRPC_BASE64_MULTILINE_LINE_LEN 76 #define GRPC_BASE64_MULTILINE_NUM_BLOCKS (GRPC_BASE64_MULTILINE_LINE_LEN / 4) -/* --- base64 functions. --- */ +// --- base64 functions. --- char* grpc_base64_encode(const void* vdata, size_t data_size, int url_safe, int multiline) { @@ -86,7 +86,7 @@ void grpc_base64_encode_core(char* result, const void* vdata, size_t data_size, size_t num_blocks = 0; size_t i = 0; - /* Encode each block. */ + // Encode each block. while (data_size >= 3) { *current++ = base64_chars[(data[i] >> 2) & 0x3F]; *current++ = @@ -104,7 +104,7 @@ void grpc_base64_encode_core(char* result, const void* vdata, size_t data_size, } } - /* Take care of the tail. */ + // Take care of the tail. if (data_size == 2) { *current++ = base64_chars[(data[i] >> 2) & 0x3F]; *current++ = @@ -147,7 +147,7 @@ static int decode_group(const unsigned char* codes, size_t num_codes, unsigned char* result, size_t* result_offset) { GPR_ASSERT(num_codes <= 4); - /* Short end groups that may not have padding. */ + // Short end groups that may not have padding. if (num_codes == 1) { gpr_log(GPR_ERROR, "Invalid group. Must be at least 2 bytes."); return 0; @@ -161,7 +161,7 @@ static int decode_group(const unsigned char* codes, size_t num_codes, return 1; } - /* Regular 4 byte groups with padding or not. */ + // Regular 4 byte groups with padding or not. GPR_ASSERT(num_codes == 4); if (codes[0] == GRPC_BASE64_PAD_BYTE || codes[1] == GRPC_BASE64_PAD_BYTE) { gpr_log(GPR_ERROR, "Invalid padding detected."); @@ -177,7 +177,7 @@ static int decode_group(const unsigned char* codes, size_t num_codes, } else if (codes[3] == GRPC_BASE64_PAD_BYTE) { decode_two_chars(codes, result, result_offset); } else { - /* No padding. */ + // No padding. uint32_t packed = (static_cast(codes[0]) << 18) | (static_cast(codes[1]) << 12) | (static_cast(codes[2]) << 6) | codes[3]; diff --git a/src/core/lib/slice/b64.h b/src/core/lib/slice/b64.h index 573fc6877b4..09f8c29d1cb 100644 --- a/src/core/lib/slice/b64.h +++ b/src/core/lib/slice/b64.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SLICE_B64_H #define GRPC_CORE_LIB_SLICE_B64_H @@ -25,28 +25,28 @@ #include -/* Encodes data using base64. It is the caller's responsibility to free - the returned char * using gpr_free. Returns NULL on NULL input. - TODO(makdharma) : change the flags to bool from int */ +// Encodes data using base64. It is the caller's responsibility to free +// the returned char * using gpr_free. Returns NULL on NULL input. +// TODO(makdharma) : change the flags to bool from int char* grpc_base64_encode(const void* data, size_t data_size, int url_safe, int multiline); -/* estimate the upper bound on size of base64 encoded data. The actual size - * is guaranteed to be less than or equal to the size returned here. */ +// estimate the upper bound on size of base64 encoded data. The actual size +// is guaranteed to be less than or equal to the size returned here. size_t grpc_base64_estimate_encoded_size(size_t data_size, int multiline); -/* Encodes data using base64 and write it to memory pointed to by result. It is - * the caller's responsibility to allocate enough memory in |result| to fit the - * encoded data. */ +// Encodes data using base64 and write it to memory pointed to by result. It is +// the caller's responsibility to allocate enough memory in |result| to fit the +// encoded data. void grpc_base64_encode_core(char* result, const void* vdata, size_t data_size, int url_safe, int multiline); -/* Decodes data according to the base64 specification. Returns an empty - slice in case of failure. */ +// Decodes data according to the base64 specification. Returns an empty +// slice in case of failure. grpc_slice grpc_base64_decode(const char* b64, int url_safe); -/* Same as above except that the length is provided by the caller. */ +// Same as above except that the length is provided by the caller. grpc_slice grpc_base64_decode_with_len(const char* b64, size_t b64_len, int url_safe); -#endif /* GRPC_CORE_LIB_SLICE_B64_H */ +#endif // GRPC_CORE_LIB_SLICE_B64_H diff --git a/src/core/lib/slice/percent_encoding.cc b/src/core/lib/slice/percent_encoding.cc index 117e98d7b9f..1b7327d5284 100644 --- a/src/core/lib/slice/percent_encoding.cc +++ b/src/core/lib/slice/percent_encoding.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/slice/percent_encoding.h b/src/core/lib/slice/percent_encoding.h index 736b7274caf..4cf8fe388fd 100644 --- a/src/core/lib/slice/percent_encoding.h +++ b/src/core/lib/slice/percent_encoding.h @@ -1,30 +1,30 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H #define GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H -/* Percent encoding and decoding of slices. - Transforms arbitrary strings into safe-for-transmission strings by using - variants of percent encoding (RFC 3986). - Two major variants are supplied: one that strictly matches URL encoding, - and another which applies percent encoding only to non-http2 header - bytes (the 'compatible' variant) */ +// Percent encoding and decoding of slices. +// Transforms arbitrary strings into safe-for-transmission strings by using +// variants of percent encoding (RFC 3986). +// Two major variants are supplied: one that strictly matches URL encoding, +// and another which applies percent encoding only to non-http2 header +// bytes (the 'compatible' variant) #include @@ -51,4 +51,4 @@ Slice PermissivePercentDecodeSlice(Slice slice_in); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */ +#endif // GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc index 898a62823c8..177ca456ec5 100644 --- a/src/core/lib/slice/slice.cc +++ b/src/core/lib/slice/slice.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -52,8 +52,8 @@ grpc_slice grpc_slice_copy(grpc_slice s) { namespace grpc_core { -/* grpc_slice_new support structures - we create a refcount object extended - with the user provided data pointer & destroy function */ +// grpc_slice_new support structures - we create a refcount object extended +// with the user provided data pointer & destroy function class NewSliceRefcount : public grpc_slice_refcount { public: NewSliceRefcount(void (*destroy)(void*), void* user_data) @@ -101,13 +101,13 @@ grpc_slice grpc_slice_new_with_user_data(void* p, size_t len, } grpc_slice grpc_slice_new(void* p, size_t len, void (*destroy)(void*)) { - /* Pass "p" to *destroy when the slice is no longer needed. */ + // Pass "p" to *destroy when the slice is no longer needed. return grpc_slice_new_with_user_data(p, len, destroy, p); } namespace grpc_core { -/* grpc_slice_new_with_len support structures - we create a refcount object - extended with the user provided data pointer & destroy function */ +// grpc_slice_new_with_len support structures - we create a refcount object +// extended with the user provided data pointer & destroy function class NewWithLenSliceRefcount : public grpc_slice_refcount { public: NewWithLenSliceRefcount(void (*destroy)(void*, size_t), void* user_data, @@ -128,7 +128,7 @@ class NewWithLenSliceRefcount : public grpc_slice_refcount { void (*user_destroy_)(void*, size_t); }; -/** grpc_slice_from_moved_(string|buffer) ref count .*/ +/// grpc_slice_from_moved_(string|buffer) ref count . class MovedStringSliceRefCount : public grpc_slice_refcount { public: explicit MovedStringSliceRefCount(UniquePtr&& str) @@ -248,16 +248,16 @@ static grpc_slice sub_no_ref(const grpc_slice& source, size_t begin, GPR_ASSERT(end >= begin); if (source.refcount != nullptr) { - /* Enforce preconditions */ + // Enforce preconditions GPR_ASSERT(source.data.refcounted.length >= end); - /* Build the result */ + // Build the result subset.refcount = source.refcount; - /* Point into the source array */ + // Point into the source array subset.data.refcounted.bytes = source.data.refcounted.bytes + begin; subset.data.refcounted.length = end - begin; } else { - /* Enforce preconditions */ + // Enforce preconditions GPR_ASSERT(source.data.inlined.length >= end); subset.refcount = nullptr; subset.data.inlined.length = static_cast(end - begin); @@ -281,7 +281,7 @@ grpc_slice grpc_slice_sub(grpc_slice source, size_t begin, size_t end) { end - begin); } else { subset = grpc_slice_sub_no_ref(source, begin, end); - /* Bump the refcount */ + // Bump the refcount if (subset.refcount != grpc_slice_refcount::NoopRefcount()) { subset.refcount->Ref(); } @@ -294,7 +294,7 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split, grpc_slice tail; if (source->refcount == nullptr) { - /* inlined data, copy it out */ + // inlined data, copy it out GPR_ASSERT(source->data.inlined.length >= split); tail.refcount = nullptr; tail.data.inlined.length = @@ -303,7 +303,7 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split, tail.data.inlined.length); source->data.inlined.length = static_cast(split); } else if (source->refcount == grpc_slice_refcount::NoopRefcount()) { - /* refcount == NoopRefcount(), so we can just split in-place */ + // refcount == NoopRefcount(), so we can just split in-place tail.refcount = grpc_slice_refcount::NoopRefcount(); tail.data.refcounted.bytes = source->data.refcounted.bytes + split; tail.data.refcounted.length = source->data.refcounted.length - split; @@ -313,13 +313,13 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split, GPR_ASSERT(source->data.refcounted.length >= split); if (tail_length < sizeof(tail.data.inlined.bytes) && ref_whom != GRPC_SLICE_REF_TAIL) { - /* Copy out the bytes - it'll be cheaper than refcounting */ + // Copy out the bytes - it'll be cheaper than refcounting tail.refcount = nullptr; tail.data.inlined.length = static_cast(tail_length); memcpy(tail.data.inlined.bytes, source->data.refcounted.bytes + split, tail_length); } else { - /* Build the result */ + // Build the result switch (ref_whom) { case GRPC_SLICE_REF_TAIL: tail.refcount = source->refcount; @@ -330,13 +330,13 @@ grpc_slice grpc_slice_split_tail_maybe_ref(grpc_slice* source, size_t split, break; case GRPC_SLICE_REF_BOTH: tail.refcount = source->refcount; - /* Bump the refcount */ + // Bump the refcount if (tail.refcount != grpc_slice_refcount::NoopRefcount()) { tail.refcount->Ref(); } break; } - /* Point into the source array */ + // Point into the source array tail.data.refcounted.bytes = source->data.refcounted.bytes + split; tail.data.refcounted.length = tail_length; } @@ -374,13 +374,13 @@ grpc_slice grpc_slice_split_head(grpc_slice* source, size_t split) { } else { GPR_ASSERT(source->data.refcounted.length >= split); - /* Build the result */ + // Build the result head.refcount = source->refcount; - /* Bump the refcount */ + // Bump the refcount if (head.refcount != grpc_slice_refcount::NoopRefcount()) { head.refcount->Ref(); } - /* Point into the source array */ + // Point into the source array head.data.refcounted.bytes = source->data.refcounted.bytes; head.data.refcounted.length = split; source->data.refcounted.bytes += split; diff --git a/src/core/lib/slice/slice_buffer.cc b/src/core/lib/slice/slice_buffer.cc index 64be083548b..85d556efc71 100644 --- a/src/core/lib/slice/slice_buffer.cc +++ b/src/core/lib/slice/slice_buffer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -72,22 +72,22 @@ std::string SliceBuffer::JoinIntoString() const { } // namespace grpc_core -/* grow a buffer; requires GRPC_SLICE_BUFFER_INLINE_ELEMENTS > 1 */ +// grow a buffer; requires GRPC_SLICE_BUFFER_INLINE_ELEMENTS > 1 #define GROW(x) (3 * (x) / 2) -/* Typically, we do not actually need to embiggen (by calling - * memmove/malloc/realloc) - only if we were up against the full capacity of the - * slice buffer. If do_embiggen is inlined, the compiler clobbers multiple - * registers pointlessly in the common case. */ +// Typically, we do not actually need to embiggen (by calling +// memmove/malloc/realloc) - only if we were up against the full capacity of the +// slice buffer. If do_embiggen is inlined, the compiler clobbers multiple +// registers pointlessly in the common case. static void GPR_ATTRIBUTE_NOINLINE do_embiggen(grpc_slice_buffer* sb, const size_t slice_count, const size_t slice_offset) { if (slice_offset != 0) { - /* Make room by moving elements if there's still space unused */ + // Make room by moving elements if there's still space unused memmove(sb->base_slices, sb->slices, sb->count * sizeof(grpc_slice)); sb->slices = sb->base_slices; } else { - /* Allocate more memory if no more space is available */ + // Allocate more memory if no more space is available const size_t new_capacity = GROW(sb->capacity); sb->capacity = new_capacity; if (sb->base_slices == sb->inlined) { @@ -109,7 +109,7 @@ static void maybe_embiggen(grpc_slice_buffer* sb) { return; } - /* How far away from sb->base_slices is sb->slices pointer */ + // How far away from sb->base_slices is sb->slices pointer size_t slice_offset = static_cast(sb->slices - sb->base_slices); size_t slice_count = sb->count + slice_offset; if (GPR_UNLIKELY(slice_count == sb->capacity)) { @@ -191,11 +191,11 @@ void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice s) { } if (!s.refcount && n) { - /* if both the last slice in the slice buffer and the slice being added - are inlined (that is, that they carry their data inside the slice data - structure), and the back slice is not full, then concatenate directly - into the back slice, preventing many small slices being passed into - writes */ + // if both the last slice in the slice buffer and the slice being added + // are inlined (that is, that they carry their data inside the slice data + // structure), and the back slice is not full, then concatenate directly + // into the back slice, preventing many small slices being passed into + // writes if (!back->refcount && back->data.inlined.length < GRPC_SLICE_INLINED_SIZE) { if (s.data.inlined.length + back->data.inlined.length <= @@ -219,7 +219,7 @@ void grpc_slice_buffer_add(grpc_slice_buffer* sb, grpc_slice s) { s.data.inlined.length - cp1); } sb->length += s.data.inlined.length; - return; /* early out */ + return; // early out } } grpc_slice_buffer_add_indexed(sb, s); @@ -259,34 +259,34 @@ void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) { if (a->base_slices == a->inlined) { if (b->base_slices == b->inlined) { - /* swap contents of inlined buffer */ + // swap contents of inlined buffer grpc_slice temp[GRPC_SLICE_BUFFER_INLINE_ELEMENTS]; memcpy(temp, a->base_slices, a_count * sizeof(grpc_slice)); memcpy(a->base_slices, b->base_slices, b_count * sizeof(grpc_slice)); memcpy(b->base_slices, temp, a_count * sizeof(grpc_slice)); } else { - /* a is inlined, b is not - copy a inlined into b, fix pointers */ + // a is inlined, b is not - copy a inlined into b, fix pointers a->base_slices = b->base_slices; b->base_slices = b->inlined; memcpy(b->base_slices, a->inlined, a_count * sizeof(grpc_slice)); } } else if (b->base_slices == b->inlined) { - /* b is inlined, a is not - copy b inlined int a, fix pointers */ + // b is inlined, a is not - copy b inlined int a, fix pointers b->base_slices = a->base_slices; a->base_slices = a->inlined; memcpy(a->base_slices, b->inlined, b_count * sizeof(grpc_slice)); } else { - /* no inlining: easy swap */ + // no inlining: easy swap std::swap(a->base_slices, b->base_slices); } - /* Update the slices pointers (cannot do a std::swap on slices fields here). - * Also note that since the base_slices pointers are already swapped we need - * use 'b_offset' for 'a->base_slices' and vice versa */ + // Update the slices pointers (cannot do a std::swap on slices fields here). + // Also note that since the base_slices pointers are already swapped we need + // use 'b_offset' for 'a->base_slices' and vice versa a->slices = a->base_slices + b_offset; b->slices = b->base_slices + a_offset; - /* base_slices and slices fields are correctly set. Swap all other fields */ + // base_slices and slices fields are correctly set. Swap all other fields std::swap(a->count, b->count); std::swap(a->capacity, b->capacity); std::swap(a->length, b->length); @@ -294,16 +294,16 @@ void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) { void grpc_slice_buffer_move_into(grpc_slice_buffer* src, grpc_slice_buffer* dst) { - /* anything to move? */ + // anything to move? if (src->count == 0) { return; } - /* anything in dst? */ + // anything in dst? if (dst->count == 0) { grpc_slice_buffer_swap(src, dst); return; } - /* both buffers have data - copy, and reset src */ + // both buffers have data - copy, and reset src grpc_slice_buffer_addn(dst, src->slices, src->count); src->count = 0; src->length = 0; @@ -330,13 +330,13 @@ static void slice_buffer_move_first_maybe_ref(grpc_slice_buffer* src, size_t n, } else if (n == slice_len) { grpc_slice_buffer_add(dst, slice); break; - } else if (incref) { /* n < slice_len */ + } else if (incref) { // n < slice_len grpc_slice_buffer_undo_take_first( src, grpc_slice_split_tail_maybe_ref(&slice, n, GRPC_SLICE_REF_BOTH)); GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == n); grpc_slice_buffer_add(dst, slice); break; - } else { /* n < slice_len */ + } else { // n < slice_len grpc_slice_buffer_undo_take_first( src, grpc_slice_split_tail_maybe_ref(&slice, n, GRPC_SLICE_REF_TAIL)); GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == n); diff --git a/src/core/lib/slice/slice_internal.h b/src/core/lib/slice/slice_internal.h index e29ed382d1f..aa30bc37219 100644 --- a/src/core/lib/slice/slice_internal.h +++ b/src/core/lib/slice/slice_internal.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H #define GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H @@ -94,4 +94,4 @@ inline bool operator==(const grpc_slice& s1, const grpc_slice& s2) { return grpc_slice_eq(s1, s2); } -#endif /* GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H */ +#endif // GRPC_CORE_LIB_SLICE_SLICE_INTERNAL_H diff --git a/src/core/lib/slice/slice_string_helpers.cc b/src/core/lib/slice/slice_string_helpers.cc index 0377091fc5a..29d688140b8 100644 --- a/src/core/lib/slice/slice_string_helpers.cc +++ b/src/core/lib/slice/slice_string_helpers.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/slice/slice_string_helpers.h b/src/core/lib/slice/slice_string_helpers.h index 2457c69edbd..33883b1e66c 100644 --- a/src/core/lib/slice/slice_string_helpers.h +++ b/src/core/lib/slice/slice_string_helpers.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H #define GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H @@ -25,7 +25,7 @@ #include -/* Calls gpr_dump on a slice. */ +// Calls gpr_dump on a slice. char* grpc_dump_slice(const grpc_slice& slice, uint32_t flags); -#endif /* GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H */ +#endif // GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H diff --git a/src/core/lib/surface/api_trace.cc b/src/core/lib/surface/api_trace.cc index c40b9e1beb2..1e27ec111d3 100644 --- a/src/core/lib/surface/api_trace.cc +++ b/src/core/lib/surface/api_trace.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/api_trace.h b/src/core/lib/surface/api_trace.h index a7981d14bbc..1b04094b2e8 100644 --- a/src/core/lib/surface/api_trace.h +++ b/src/core/lib/surface/api_trace.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_API_TRACE_H #define GRPC_CORE_LIB_SURFACE_API_TRACE_H @@ -27,8 +27,8 @@ extern grpc_core::TraceFlag grpc_api_trace; -/* Provide unwrapping macros because we're in C89 and variadic macros weren't - introduced until C99... */ +// Provide unwrapping macros because we're in C89 and variadic macros weren't +// introduced until C99... #define GRPC_API_TRACE_UNWRAP0() #define GRPC_API_TRACE_UNWRAP1(a) , a #define GRPC_API_TRACE_UNWRAP2(a, b) , a, b @@ -43,11 +43,11 @@ extern grpc_core::TraceFlag grpc_api_trace; #define GRPC_API_TRACE_UNWRAP10(a, b, c, d, e, f, g, h, i, j) \ , a, b, c, d, e, f, g, h, i, j -/* Due to the limitations of C89's preprocessor, the arity of the var-arg list - 'nargs' must be specified. */ +// Due to the limitations of C89's preprocessor, the arity of the var-arg list +// 'nargs' must be specified. #define GRPC_API_TRACE(fmt, nargs, args) \ if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace)) { \ gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \ } -#endif /* GRPC_CORE_LIB_SURFACE_API_TRACE_H */ +#endif // GRPC_CORE_LIB_SURFACE_API_TRACE_H diff --git a/src/core/lib/surface/byte_buffer.cc b/src/core/lib/surface/byte_buffer.cc index a23633013c4..4e00c080cea 100644 --- a/src/core/lib/surface/byte_buffer.cc +++ b/src/core/lib/surface/byte_buffer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/byte_buffer_reader.cc b/src/core/lib/surface/byte_buffer_reader.cc index 73d5b46068b..2f362c2c3cf 100644 --- a/src/core/lib/surface/byte_buffer_reader.cc +++ b/src/core/lib/surface/byte_buffer_reader.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -86,7 +86,7 @@ grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader* reader) { size_t bytes_read = 0; const size_t input_size = grpc_byte_buffer_length(reader->buffer_out); grpc_slice out_slice = GRPC_SLICE_MALLOC(input_size); - uint8_t* const outbuf = GRPC_SLICE_START_PTR(out_slice); /* just an alias */ + uint8_t* const outbuf = GRPC_SLICE_START_PTR(out_slice); // just an alias grpc_core::ExecCtx exec_ctx; while (grpc_byte_buffer_reader_next(reader, &in_slice) != 0) { diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index dfcb936297c..3bc4681bfec 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -163,9 +163,9 @@ class Call : public CppImplOf { struct ChildCall { explicit ChildCall(Call* parent) : parent(parent) {} Call* parent; - /** siblings: children of the same parent form a list, and this list is - protected under - parent->mu */ + /// siblings: children of the same parent form a list, and this list is + /// protected under + /// parent->mu Call* sibling_next = nullptr; Call* sibling_prev = nullptr; }; @@ -244,10 +244,10 @@ absl::Status Call::InitParent(Call* parent, uint32_t propagation_mask) { if (propagation_mask & GRPC_PROPAGATE_DEADLINE) { send_deadline_ = std::min(send_deadline_, parent->send_deadline_); } - /* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with - * GRPC_PROPAGATE_STATS_CONTEXT */ - /* TODO(ctiller): This should change to use the appropriate census start_op - * call. */ + // for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with + // GRPC_PROPAGATE_STATS_CONTEXT + // TODO(ctiller): This should change to use the appropriate census start_op + // call. if (propagation_mask & GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT) { if (0 == (propagation_mask & GRPC_PROPAGATE_CENSUS_STATS_CONTEXT)) { return absl::UnknownError( @@ -452,21 +452,21 @@ class FilterStackCall final : public Call { struct BatchControl { FilterStackCall* call_ = nullptr; grpc_transport_stream_op_batch op_; - /* Share memory for cq_completion and notify_tag as they are never needed - simultaneously. Each byte used in this data structure count as six bytes - per call, so any savings we can make are worthwhile, + // Share memory for cq_completion and notify_tag as they are never needed + // simultaneously. Each byte used in this data structure count as six bytes + // per call, so any savings we can make are worthwhile, - We use notify_tag to determine whether or not to send notification to the - completion queue. Once we've made that determination, we can reuse the - memory for cq_completion. */ + // We use notify_tag to determine whether or not to send notification to the + // completion queue. Once we've made that determination, we can reuse the + // memory for cq_completion. union { grpc_cq_completion cq_completion; struct { - /* Any given op indicates completion by either (a) calling a closure or - (b) sending a notification on the call's completion queue. If - \a is_closure is true, \a tag indicates a closure to be invoked; - otherwise, \a tag indicates the tag to be used in the notification to - be sent to the completion queue. */ + // Any given op indicates completion by either (a) calling a closure or + // (b) sending a notification on the call's completion queue. If + // \a is_closure is true, \a tag indicates a closure to be invoked; + // otherwise, \a tag indicates the tag to be used in the notification to + // be sent to the completion queue. void* tag; bool is_closure; } notify_tag; @@ -528,11 +528,11 @@ class FilterStackCall final : public Call { grpc_polling_entity pollent_; gpr_cycle_counter start_time_ = gpr_get_cycle_counter(); - /** has grpc_call_unref been called */ + /// has grpc_call_unref been called bool destroy_called_ = false; // Trailers-only response status bool is_trailers_only_ = false; - /** which ops are in-flight */ + /// which ops are in-flight bool sent_initial_metadata_ = false; bool sending_message_ = false; bool sent_final_op_ = false; @@ -544,28 +544,28 @@ class FilterStackCall final : public Call { BatchControl* active_batches_[kMaxConcurrentBatches] = {}; grpc_transport_stream_op_batch_payload stream_op_payload_; - /* first idx: is_receiving, second idx: is_trailing */ + // first idx: is_receiving, second idx: is_trailing grpc_metadata_batch send_initial_metadata_{arena()}; grpc_metadata_batch send_trailing_metadata_{arena()}; grpc_metadata_batch recv_initial_metadata_{arena()}; grpc_metadata_batch recv_trailing_metadata_{arena()}; - /* Buffered read metadata waiting to be returned to the application. - Element 0 is initial metadata, element 1 is trailing metadata. */ + // Buffered read metadata waiting to be returned to the application. + // Element 0 is initial metadata, element 1 is trailing metadata. grpc_metadata_array* buffered_metadata_[2] = {}; - /* Call data useful used for reporting. Only valid after the call has - * completed */ + // Call data useful used for reporting. Only valid after the call has + // completed grpc_call_final_info final_info_; - /* Compression algorithm for *incoming* data */ + // Compression algorithm for *incoming* data grpc_compression_algorithm incoming_compression_algorithm_ = GRPC_COMPRESS_NONE; - /* Supported encodings (compression algorithms), a bitset. - * Always support no compression. */ + // Supported encodings (compression algorithms), a bitset. + // Always support no compression. CompressionAlgorithmSet encodings_accepted_by_peer_{GRPC_COMPRESS_NONE}; - /* Contexts for various subsystems (security, tracing, ...). */ + // Contexts for various subsystems (security, tracing, ...). grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {}; SliceBuffer send_slice_buffer_; @@ -599,22 +599,22 @@ class FilterStackCall final : public Call { } final_op_; AtomicError status_error_; - /* recv_state can contain one of the following values: - RECV_NONE : : no initial metadata and messages received - RECV_INITIAL_METADATA_FIRST : received initial metadata first - a batch_control* : received messages first - - +------1------RECV_NONE------3-----+ - | | - | | - v v - RECV_INITIAL_METADATA_FIRST receiving_stream_ready_bctlp - | ^ | ^ - | | | | - +-----2-----+ +-----4-----+ - - For 1, 4: See receiving_initial_metadata_ready() function - For 2, 3: See receiving_stream_ready() function */ + // recv_state can contain one of the following values: + // RECV_NONE : : no initial metadata and messages received + // RECV_INITIAL_METADATA_FIRST : received initial metadata first + // a batch_control* : received messages first + + // +------1------RECV_NONE------3-----+ + // | | + // | | + // v v + // RECV_INITIAL_METADATA_FIRST receiving_stream_ready_bctlp + // | ^ | ^ + // | | | | + // +-----2-----+ +-----4-----+ + + // For 1, 4: See receiving_initial_metadata_ready() function + // For 2, 3: See receiving_stream_ready() function gpr_atm recv_state_ = 0; }; @@ -672,7 +672,7 @@ grpc_error_handle FilterStackCall::Create(grpc_call_create_args* args, add_init_error(&error, absl_status_to_grpc_error(call->InitParent( parent, args->propagation_mask))); } - /* initial refcount dropped by grpc_call_unref */ + // initial refcount dropped by grpc_call_unref grpc_call_element_args call_args = { call->call_stack(), args->server_transport_data, call->context_, path, @@ -1044,7 +1044,7 @@ void FilterStackCall::RecvTrailingFilter(grpc_metadata_batch* b, namespace { bool AreWriteFlagsValid(uint32_t flags) { - /* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */ + // check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set const uint32_t allowed_write_positions = (GRPC_WRITE_USED_MASK | GRPC_WRITE_INTERNAL_USED_MASK); const uint32_t invalid_positions = ~allowed_write_positions; @@ -1052,7 +1052,7 @@ bool AreWriteFlagsValid(uint32_t flags) { } bool AreInitialMetadataFlagsValid(uint32_t flags) { - /* check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set */ + // check that only bits in GRPC_WRITE_(INTERNAL?)_USED_MASK are set uint32_t invalid_positions = ~GRPC_INITIAL_METADATA_USED_MASK; return !(flags & invalid_positions); } @@ -1120,7 +1120,7 @@ void FilterStackCall::BatchControl::PostCompletion() { call->send_trailing_metadata_.Clear(); } if (op_.recv_trailing_metadata) { - /* propagate cancellation to any interested children */ + // propagate cancellation to any interested children gpr_atm_rel_store(&call->received_final_op_atm_, 1); call->PropagateCancellationToChildren(); error = absl::OkStatus(); @@ -1132,14 +1132,14 @@ void FilterStackCall::BatchControl::PostCompletion() { batch_error_.set(absl::OkStatus()); if (completion_data_.notify_tag.is_closure) { - /* unrefs error */ + // unrefs error call_ = nullptr; Closure::Run(DEBUG_LOCATION, static_cast(completion_data_.notify_tag.tag), error); call->InternalUnref("completion"); } else { - /* unrefs error */ + // unrefs error grpc_cq_end_op( call->cq_, completion_data_.notify_tag.tag, error, [](void* user_data, grpc_cq_completion* /*storage*/) { @@ -1192,9 +1192,9 @@ void FilterStackCall::BatchControl::ReceivingStreamReady( } call->CancelWithError(error); } - /* If recv_state is kRecvNone, we will save the batch_control - * object with rel_cas, and will not use it after the cas. Its corresponding - * acq_load is in receiving_initial_metadata_ready() */ + // If recv_state is kRecvNone, we will save the batch_control + // object with rel_cas, and will not use it after the cas. Its corresponding + // acq_load is in receiving_initial_metadata_ready() if (!error.ok() || !call->receiving_slice_buffer_.has_value() || !gpr_atm_rel_cas(&call->recv_state_, kRecvNone, reinterpret_cast(this))) { @@ -1233,10 +1233,10 @@ void FilterStackCall::BatchControl::ValidateFilteredMetadata() { if (GPR_UNLIKELY(!CompressionAlgorithmSet::FromUint32( compression_options.enabled_algorithms_bitset) .IsSet(compression_algorithm))) { - /* check if algorithm is supported by current channel config */ + // check if algorithm is supported by current channel config call->HandleCompressionAlgorithmDisabled(compression_algorithm); } - /* GRPC_COMPRESS_NONE is always set. */ + // GRPC_COMPRESS_NONE is always set. GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer_.IsSet(GRPC_COMPRESS_NONE)); if (GPR_UNLIKELY( !call->encodings_accepted_by_peer_.IsSet(compression_algorithm))) { @@ -1256,7 +1256,7 @@ void FilterStackCall::BatchControl::ReceivingInitialMetadataReady( grpc_metadata_batch* md = &call->recv_initial_metadata_; call->RecvInitialFilter(md); - /* TODO(ctiller): this could be moved into recv_initial_filter now */ + // TODO(ctiller): this could be moved into recv_initial_filter now ValidateFilteredMetadata(); absl::optional deadline = md->get(GrpcTimeoutMetadata()); @@ -1273,27 +1273,27 @@ void FilterStackCall::BatchControl::ReceivingInitialMetadataReady( grpc_closure* saved_rsr_closure = nullptr; while (true) { gpr_atm rsr_bctlp = gpr_atm_acq_load(&call->recv_state_); - /* Should only receive initial metadata once */ + // Should only receive initial metadata once GPR_ASSERT(rsr_bctlp != 1); if (rsr_bctlp == 0) { - /* We haven't seen initial metadata and messages before, thus initial - * metadata is received first. - * no_barrier_cas is used, as this function won't access the batch_control - * object saved by receiving_stream_ready() if the initial metadata is - * received first. */ + // We haven't seen initial metadata and messages before, thus initial + // metadata is received first. + // no_barrier_cas is used, as this function won't access the batch_control + // object saved by receiving_stream_ready() if the initial metadata is + // received first. if (gpr_atm_no_barrier_cas(&call->recv_state_, kRecvNone, kRecvInitialMetadataFirst)) { break; } } else { - /* Already received messages */ + // Already received messages saved_rsr_closure = GRPC_CLOSURE_CREATE( [](void* bctl, grpc_error_handle error) { static_cast(bctl)->ReceivingStreamReady(error); }, reinterpret_cast(rsr_bctlp), grpc_schedule_on_exec_ctx); - /* No need to modify recv_state */ + // No need to modify recv_state break; } } @@ -1390,7 +1390,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, stream_op = &bctl->op_; stream_op_payload = &stream_op_payload_; - /* rewrite batch ops into a transport op */ + // rewrite batch ops into a transport op for (i = 0; i < nops; i++) { op = &ops[i]; if (op->reserved != nullptr) { @@ -1399,7 +1399,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, } switch (op->op) { case GRPC_OP_SEND_INITIAL_METADATA: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (!AreInitialMetadataFlagsValid(op->flags)) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1412,7 +1412,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, // algorithm by setting the initial metadata with key of // GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY, we shouldn't override that // with the compression algorithm mapped from compression level. - /* process compression level */ + // process compression level grpc_compression_level effective_compression_level = GRPC_COMPRESS_LEVEL_NONE; bool level_set = false; @@ -1452,7 +1452,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, } // Ignore any te metadata key value pairs specified. send_initial_metadata_.Remove(TeMetadata()); - /* TODO(ctiller): just make these the same variable? */ + // TODO(ctiller): just make these the same variable? if (is_client() && send_deadline() != Timestamp::InfFuture()) { send_initial_metadata_.Set(GrpcTimeoutMetadata(), send_deadline()); } @@ -1487,9 +1487,9 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, goto done_with_error; } uint32_t flags = op->flags; - /* If the outgoing buffer is already compressed, mark it as so in the - flags. These will be picked up by the compression filter and further - (wasteful) attempts at compression skipped. */ + // If the outgoing buffer is already compressed, mark it as so in the + // flags. These will be picked up by the compression filter and further + // (wasteful) attempts at compression skipped. if (op->data.send_message.send_message->data.raw.compression > GRPC_COMPRESS_NONE) { flags |= GRPC_WRITE_INTERNAL_COMPRESS; @@ -1506,7 +1506,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_SEND_CLOSE_FROM_CLIENT: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1527,7 +1527,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_SEND_STATUS_FROM_SERVER: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1591,7 +1591,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_RECV_INITIAL_METADATA: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1626,7 +1626,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_RECV_MESSAGE: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1662,7 +1662,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_RECV_STATUS_ON_CLIENT: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1701,7 +1701,7 @@ grpc_call_error FilterStackCall::StartBatch(const grpc_op* ops, size_t nops, break; } case GRPC_OP_RECV_CLOSE_ON_SERVER: { - /* Flag validation: currently allow no flags */ + // Flag validation: currently allow no flags if (op->flags != 0) { error = GRPC_CALL_ERROR_INVALID_FLAGS; goto done_with_error; @@ -1758,7 +1758,7 @@ done: return error; done_with_error: - /* reverse any mutations that occurred */ + // reverse any mutations that occurred if (stream_op->send_initial_metadata) { sent_initial_metadata_ = false; send_initial_metadata_.Clear(); @@ -2188,7 +2188,7 @@ class PromiseBasedCall : public Call, CallContext call_context_{this}; bool keep_polling_ ABSL_GUARDED_BY(mu()) = false; - /* Contexts for various subsystems (security, tracing, ...). */ + // Contexts for various subsystems (security, tracing, ...). grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {}; grpc_completion_queue* cq_ ABSL_GUARDED_BY(mu_); NonOwningWakable* non_owning_wakeable_ ABSL_GUARDED_BY(mu_) = nullptr; diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index f0ea64d084e..cd51b692b68 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_CALL_H #define GRPC_CORE_LIB_SURFACE_CALL_H @@ -61,7 +61,7 @@ typedef struct grpc_call_create_args { uint32_t propagation_mask; grpc_completion_queue* cq; - /* if not NULL, it'll be used in lieu of cq */ + // if not NULL, it'll be used in lieu of cq grpc_pollset_set* pollset_set_alternative; const void* server_transport_data; @@ -114,9 +114,9 @@ template <> struct ContextType {}; } // namespace grpc_core -/* Create a new call based on \a args. - Regardless of success or failure, always returns a valid new call into *call - */ +// Create a new call based on \a args. +// Regardless of success or failure, always returns a valid new call into *call +// grpc_error_handle grpc_call_create(grpc_call_create_args* args, grpc_call** call); @@ -131,22 +131,22 @@ grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call, size_t nops, grpc_closure* closure); -/* gRPC core internal version of grpc_call_cancel that does not create - * exec_ctx. */ +// gRPC core internal version of grpc_call_cancel that does not create +// exec_ctx. void grpc_call_cancel_internal(grpc_call* call); -/* Given the top call_element, get the call object. */ +// Given the top call_element, get the call object. grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element); void grpc_call_log_batch(const char* file, int line, gpr_log_severity severity, const grpc_op* ops, size_t nops); -/* Set a context pointer. - No thread safety guarantees are made wrt this value. */ -/* TODO(#9731): add exec_ctx to destroy */ +// Set a context pointer. +// No thread safety guarantees are made wrt this value. +// TODO(#9731): add exec_ctx to destroy void grpc_call_context_set(grpc_call* call, grpc_context_index elem, void* value, void (*destroy)(void* value)); -/* Get a context pointer. */ +// Get a context pointer. void* grpc_call_context_get(grpc_call* call, grpc_context_index elem); #define GRPC_CALL_LOG_BATCH(sev, ops, nops) \ @@ -158,19 +158,19 @@ void* grpc_call_context_get(grpc_call* call, grpc_context_index elem); uint8_t grpc_call_is_client(grpc_call* call); -/* Get the estimated memory size for a call BESIDES the call stack. Combined - * with the size of the call stack, it helps estimate the arena size for the - * initial call. */ +// Get the estimated memory size for a call BESIDES the call stack. Combined +// with the size of the call stack, it helps estimate the arena size for the +// initial call. size_t grpc_call_get_initial_size_estimate(); -/* Return an appropriate compression algorithm for the requested compression \a - * level in the context of \a call. */ +// Return an appropriate compression algorithm for the requested compression \a +// level in the context of \a call. grpc_compression_algorithm grpc_call_compression_for_level( grpc_call* call, grpc_compression_level level); -/* Did this client call receive a trailers-only response */ -/* TODO(markdroth): This is currently available only to the C++ API. - Move to surface API if requested by other languages. */ +// Did this client call receive a trailers-only response +// TODO(markdroth): This is currently available only to the C++ API. +// Move to surface API if requested by other languages. bool grpc_call_is_trailers_only(const grpc_call* call); // Returns the authority for the call, as seen on the server side. @@ -179,4 +179,4 @@ absl::string_view grpc_call_server_authority(const grpc_call* call); extern grpc_core::TraceFlag grpc_call_error_trace; extern grpc_core::TraceFlag grpc_compression_trace; -#endif /* GRPC_CORE_LIB_SURFACE_CALL_H */ +#endif // GRPC_CORE_LIB_SURFACE_CALL_H diff --git a/src/core/lib/surface/call_details.cc b/src/core/lib/surface/call_details.cc index bd948c4bfc8..07f7e5a604e 100644 --- a/src/core/lib/surface/call_details.cc +++ b/src/core/lib/surface/call_details.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/call_log_batch.cc b/src/core/lib/surface/call_log_batch.cc index 669b438726d..94ae8d6b562 100644 --- a/src/core/lib/surface/call_log_batch.cc +++ b/src/core/lib/surface/call_log_batch.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/call_test_only.h b/src/core/lib/surface/call_test_only.h index a84c976e575..d46a4adfdba 100644 --- a/src/core/lib/surface/call_test_only.h +++ b/src/core/lib/surface/call_test_only.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_CALL_TEST_ONLY_H #define GRPC_CORE_LIB_SURFACE_CALL_TEST_ONLY_H @@ -26,21 +26,21 @@ #include #include -/** Return the message compression algorithm from \a call. - * - * \warning This function should \b only be used in test code. */ +/// Return the message compression algorithm from \a call. +/// +///\warning This function should \b only be used in test code. grpc_compression_algorithm grpc_call_test_only_get_compression_algorithm( grpc_call* call); -/** Return the message flags from \a call. - * - * \warning This function should \b only be used in test code. */ +/// Return the message flags from \a call. +/// +///\warning This function should \b only be used in test code. uint32_t grpc_call_test_only_get_message_flags(grpc_call* call); -/** Returns a bitset for the encodings (compression algorithms) supported by \a - * call's peer. - * - * To be indexed by grpc_compression_algorithm enum values. */ +/// Returns a bitset for the encodings (compression algorithms) supported by \a +/// call's peer. +/// +/// To be indexed by grpc_compression_algorithm enum values. uint32_t grpc_call_test_only_get_encodings_accepted_by_peer(grpc_call* call); -#endif /* GRPC_CORE_LIB_SURFACE_CALL_TEST_ONLY_H */ +#endif // GRPC_CORE_LIB_SURFACE_CALL_TEST_ONLY_H diff --git a/src/core/lib/surface/call_trace.cc b/src/core/lib/surface/call_trace.cc index a8a8d5690a5..f2798aefbc0 100644 --- a/src/core/lib/surface/call_trace.cc +++ b/src/core/lib/surface/call_trace.cc @@ -46,7 +46,7 @@ const grpc_channel_filter* PromiseTracingFilterFor( explicit DerivedFilter(const grpc_channel_filter* filter) : grpc_channel_filter{ /* start_transport_stream_op_batch: */ grpc_call_next_op, - /* make_call_promise: */ + // make_call_promise: [](grpc_channel_element* elem, CallArgs call_args, NextPromiseFactory next_promise_factory) -> ArenaPromise { @@ -77,19 +77,19 @@ const grpc_channel_filter* PromiseTracingFilterFor( }; }, grpc_channel_next_op, /* sizeof_call_data: */ 0, - /* init_call_elem: */ + // init_call_elem: [](grpc_call_element*, const grpc_call_element_args*) { return absl::OkStatus(); }, grpc_call_stack_ignore_set_pollset_or_pollset_set, - /* destroy_call_elem: */ + // destroy_call_elem: [](grpc_call_element*, const grpc_call_final_info*, grpc_closure*) {}, - /* sizeof_channel_data: */ 0, /* init_channel_elem: */ + /* sizeof_channel_data: */ 0, // init_channel_elem: [](grpc_channel_element*, grpc_channel_element_args*) { return absl::OkStatus(); }, - /* post_init_channel_elem: */ + // post_init_channel_elem: [](grpc_channel_stack*, grpc_channel_element*) {}, /* destroy_channel_elem: */ [](grpc_channel_element*) {}, grpc_channel_next_get_info, filter->name}, diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index a786158287e..0448134a04a 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/channel.h b/src/core/lib/surface/channel.h index b6c37f964eb..86be25417a8 100644 --- a/src/core/lib/surface/channel.h +++ b/src/core/lib/surface/channel.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_CHANNEL_H #define GRPC_CORE_LIB_SURFACE_CHANNEL_H @@ -57,24 +57,24 @@ #include "src/core/lib/surface/channel_stack_type.h" #include "src/core/lib/transport/transport_fwd.h" -/** The same as grpc_channel_destroy, but doesn't create an ExecCtx, and so - * is safe to use from within core. */ +/// The same as grpc_channel_destroy, but doesn't create an ExecCtx, and so +/// is safe to use from within core. void grpc_channel_destroy_internal(grpc_channel* channel); -/** Create a call given a grpc_channel, in order to call \a method. - Progress is tied to activity on \a pollset_set. The returned call object is - meant to be used with \a grpc_call_start_batch_and_execute, which relies on - callbacks to signal completions. \a method and \a host need - only live through the invocation of this function. If \a parent_call is - non-NULL, it must be a server-side call. It will be used to propagate - properties from the server call to this new client call, depending on the - value of \a propagation_mask (see propagation_bits.h for possible values) */ +/// Create a call given a grpc_channel, in order to call \a method. +/// Progress is tied to activity on \a pollset_set. The returned call object is +/// meant to be used with \a grpc_call_start_batch_and_execute, which relies on +/// callbacks to signal completions. \a method and \a host need +/// only live through the invocation of this function. If \a parent_call is +/// non-NULL, it must be a server-side call. It will be used to propagate +/// properties from the server call to this new client call, depending on the +/// value of \a propagation_mask (see propagation_bits.h for possible values) grpc_call* grpc_channel_create_pollset_set_call( grpc_channel* channel, grpc_call* parent_call, uint32_t propagation_mask, grpc_pollset_set* pollset_set, const grpc_slice& method, const grpc_slice* host, grpc_core::Timestamp deadline, void* reserved); -/** Get a (borrowed) pointer to this channels underlying channel stack */ +/// Get a (borrowed) pointer to this channels underlying channel stack grpc_channel_stack* grpc_channel_get_channel_stack(grpc_channel* channel); grpc_core::channelz::ChannelNode* grpc_channel_get_channelz_node( @@ -211,4 +211,4 @@ grpc_compression_options grpc_channel_compression_options( void grpc_channel_ping(grpc_channel* channel, grpc_completion_queue* cq, void* tag, void* reserved); -#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_H */ +#endif // GRPC_CORE_LIB_SURFACE_CHANNEL_H diff --git a/src/core/lib/surface/channel_init.cc b/src/core/lib/surface/channel_init.cc index 459cbdea9b3..b921764b59f 100644 --- a/src/core/lib/surface/channel_init.cc +++ b/src/core/lib/surface/channel_init.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/surface/channel_init.h b/src/core/lib/surface/channel_init.h index ee0112c03be..c79f6218706 100644 --- a/src/core/lib/surface/channel_init.h +++ b/src/core/lib/surface/channel_init.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H #define GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H @@ -81,4 +81,4 @@ class ChannelInit { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H */ +#endif // GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H diff --git a/src/core/lib/surface/channel_ping.cc b/src/core/lib/surface/channel_ping.cc index 7fb247f75e8..d07b8bc0b3c 100644 --- a/src/core/lib/surface/channel_ping.cc +++ b/src/core/lib/surface/channel_ping.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/channel_stack_type.cc b/src/core/lib/surface/channel_stack_type.cc index d140628a169..0f38cf367f5 100644 --- a/src/core/lib/surface/channel_stack_type.cc +++ b/src/core/lib/surface/channel_stack_type.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/surface/channel_stack_type.h b/src/core/lib/surface/channel_stack_type.h index 433230d67bd..8cadc0f433a 100644 --- a/src/core/lib/surface/channel_stack_type.h +++ b/src/core/lib/surface/channel_stack_type.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H #define GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H @@ -44,4 +44,4 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type); const char* grpc_channel_stack_type_string(grpc_channel_stack_type type); -#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ +#endif // GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 1ed650c251f..e02fafa565d 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 #include "src/core/lib/surface/completion_queue.h" @@ -189,13 +189,13 @@ void non_polling_poller_shutdown(grpc_pollset* pollset, grpc_closure* closure) { } const cq_poller_vtable g_poller_vtable_by_poller_type[] = { - /* GRPC_CQ_DEFAULT_POLLING */ + // GRPC_CQ_DEFAULT_POLLING {true, true, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick, grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy}, - /* GRPC_CQ_NON_LISTENING */ + // GRPC_CQ_NON_LISTENING {true, false, grpc_pollset_size, grpc_pollset_init, grpc_pollset_kick, grpc_pollset_work, grpc_pollset_shutdown, grpc_pollset_destroy}, - /* GRPC_CQ_NON_POLLING */ + // GRPC_CQ_NON_POLLING {false, false, non_polling_poller_size, non_polling_poller_init, non_polling_poller_kick, non_polling_poller_work, non_polling_poller_shutdown, non_polling_poller_destroy}, @@ -221,17 +221,17 @@ struct cq_vtable { namespace { -/* Queue that holds the cq_completion_events. Internally uses - * MultiProducerSingleConsumerQueue (a lockfree multiproducer single consumer - * queue). It uses a queue_lock to support multiple consumers. - * Only used in completion queues whose completion_type is GRPC_CQ_NEXT */ +// Queue that holds the cq_completion_events. Internally uses +// MultiProducerSingleConsumerQueue (a lockfree multiproducer single consumer +// queue). It uses a queue_lock to support multiple consumers. +// Only used in completion queues whose completion_type is GRPC_CQ_NEXT class CqEventQueue { public: CqEventQueue() = default; ~CqEventQueue() = default; - /* Note: The counter is not incremented/decremented atomically with push/pop. - * The count is only eventually consistent */ + // Note: The counter is not incremented/decremented atomically with push/pop. + // The count is only eventually consistent intptr_t num_items() const { return num_queue_items_.load(std::memory_order_relaxed); } @@ -240,14 +240,14 @@ class CqEventQueue { grpc_cq_completion* Pop(); private: - /* Spinlock to serialize consumers i.e pop() operations */ + // Spinlock to serialize consumers i.e pop() operations gpr_spinlock queue_lock_ = GPR_SPINLOCK_INITIALIZER; grpc_core::MultiProducerSingleConsumerQueue queue_; - /* A lazy counter of number of items in the queue. This is NOT atomically - incremented/decremented along with push/pop operations and hence is only - eventually consistent */ + // A lazy counter of number of items in the queue. This is NOT atomically + // incremented/decremented along with push/pop operations and hence is only + // eventually consistent std::atomic num_queue_items_{0}; }; @@ -261,18 +261,18 @@ struct cq_next_data { #endif } - /** Completed events for completion-queues of type GRPC_CQ_NEXT */ + /// Completed events for completion-queues of type GRPC_CQ_NEXT CqEventQueue queue; - /** Counter of how many things have ever been queued on this completion queue - useful for avoiding locks to check the queue */ + /// Counter of how many things have ever been queued on this completion queue + /// useful for avoiding locks to check the queue std::atomic things_queued_ever{0}; - /** Number of outstanding events (+1 if not shut down) - Initial count is dropped by grpc_completion_queue_shutdown */ + /// Number of outstanding events (+1 if not shut down) + /// Initial count is dropped by grpc_completion_queue_shutdown std::atomic pending_events{1}; - /** 0 initially. 1 once we initiated shutdown */ + /// 0 initially. 1 once we initiated shutdown bool shutdown_called = false; }; @@ -292,25 +292,25 @@ struct cq_pluck_data { #endif } - /** Completed events for completion-queues of type GRPC_CQ_PLUCK */ + /// Completed events for completion-queues of type GRPC_CQ_PLUCK grpc_cq_completion completed_head; grpc_cq_completion* completed_tail; - /** Number of pending events (+1 if we're not shutdown). - Initial count is dropped by grpc_completion_queue_shutdown. */ + /// Number of pending events (+1 if we're not shutdown). + /// Initial count is dropped by grpc_completion_queue_shutdown. std::atomic pending_events{1}; - /** Counter of how many things have ever been queued on this completion queue - useful for avoiding locks to check the queue */ + /// Counter of how many things have ever been queued on this completion queue + /// useful for avoiding locks to check the queue std::atomic things_queued_ever{0}; - /** 0 initially. 1 once we completed shutting */ - /* TODO: (sreek) This is not needed since (shutdown == 1) if and only if - * (pending_events == 0). So consider removing this in future and use - * pending_events */ + /// 0 initially. 1 once we completed shutting + // TODO(sreek): This is not needed since (shutdown == 1) if and only if + // (pending_events == 0). So consider removing this in future and use + // pending_events std::atomic shutdown{false}; - /** 0 initially. 1 once we initiated shutdown */ + /// 0 initially. 1 once we initiated shutdown bool shutdown_called = false; int num_pluckers = 0; @@ -329,24 +329,24 @@ struct cq_callback_data { #endif } - /** No actual completed events queue, unlike other types */ + /// No actual completed events queue, unlike other types - /** Number of pending events (+1 if we're not shutdown). - Initial count is dropped by grpc_completion_queue_shutdown. */ + /// Number of pending events (+1 if we're not shutdown). + /// Initial count is dropped by grpc_completion_queue_shutdown. std::atomic pending_events{1}; - /** 0 initially. 1 once we initiated shutdown */ + /// 0 initially. 1 once we initiated shutdown bool shutdown_called = false; - /** A callback that gets invoked when the CQ completes shutdown */ + /// A callback that gets invoked when the CQ completes shutdown grpc_completion_queue_functor* shutdown_callback; }; } // namespace -/* Completion queue structure */ +// Completion queue structure struct grpc_completion_queue { - /** Once owning_refs drops to zero, we will destroy the cq */ + /// Once owning_refs drops to zero, we will destroy the cq grpc_core::RefCount owning_refs; gpr_mu* mu; @@ -364,7 +364,7 @@ struct grpc_completion_queue { int num_polls; }; -/* Forward declarations */ +// Forward declarations static void cq_finish_shutdown_next(grpc_completion_queue* cq); static void cq_finish_shutdown_pluck(grpc_completion_queue* cq); static void cq_finish_shutdown_callback(grpc_completion_queue* cq); @@ -414,17 +414,17 @@ static void cq_destroy_next(void* data); static void cq_destroy_pluck(void* data); static void cq_destroy_callback(void* data); -/* Completion queue vtables based on the completion-type */ +// Completion queue vtables based on the completion-type static const cq_vtable g_cq_vtable[] = { - /* GRPC_CQ_NEXT */ + // GRPC_CQ_NEXT {GRPC_CQ_NEXT, sizeof(cq_next_data), cq_init_next, cq_shutdown_next, cq_destroy_next, cq_begin_op_for_next, cq_end_op_for_next, cq_next, nullptr}, - /* GRPC_CQ_PLUCK */ + // GRPC_CQ_PLUCK {GRPC_CQ_PLUCK, sizeof(cq_pluck_data), cq_init_pluck, cq_shutdown_pluck, cq_destroy_pluck, cq_begin_op_for_pluck, cq_end_op_for_pluck, nullptr, cq_pluck}, - /* GRPC_CQ_CALLBACK */ + // GRPC_CQ_CALLBACK {GRPC_CQ_CALLBACK, sizeof(cq_callback_data), cq_init_callback, cq_shutdown_callback, cq_destroy_callback, cq_begin_op_for_callback, cq_end_op_for_callback, nullptr, nullptr}, @@ -537,7 +537,7 @@ grpc_completion_queue* grpc_completion_queue_create_internal( cq->vtable = vtable; cq->poller_vtable = poller_vtable; - /* One for destroy(), one for pollset_shutdown */ + // One for destroy(), one for pollset_shutdown new (&cq->owning_refs) grpc_core::RefCount(2); poller_vtable->init(POLLSET_FROM_CQ(cq), &cq->mu); @@ -685,9 +685,9 @@ bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) { return cq->vtable->begin_op(cq, tag); } -/* Queue a GRPC_OP_COMPLETED operation to a completion queue (with a - * completion - * type of GRPC_CQ_NEXT) */ +// Queue a GRPC_OP_COMPLETED operation to a completion queue (with a +// completion +// type of GRPC_CQ_NEXT) static void cq_end_op_for_next( grpc_completion_queue* cq, void* tag, grpc_error_handle error, void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, @@ -712,21 +712,21 @@ static void cq_end_op_for_next( storage->done_arg = done_arg; storage->next = static_cast(is_success); - cq_check_tag(cq, tag, true); /* Used in debug builds only */ + cq_check_tag(cq, tag, true); // Used in debug builds only if (g_cached_cq == cq && g_cached_event == nullptr) { g_cached_event = storage; } else { - /* Add the completion to the queue */ + // Add the completion to the queue bool is_first = cqd->queue.Push(storage); cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed); - /* Since we do not hold the cq lock here, it is important to do an 'acquire' - load here (instead of a 'no_barrier' load) to match with the release - store - (done via pending_events.fetch_sub(1, ACQ_REL)) in cq_shutdown_next - */ + // Since we do not hold the cq lock here, it is important to do an 'acquire' + // load here (instead of a 'no_barrier' load) to match with the release + // store + // (done via pending_events.fetch_sub(1, ACQ_REL)) in cq_shutdown_next + // if (cqd->pending_events.load(std::memory_order_acquire) != 1) { - /* Only kick if this is the first item queued */ + // Only kick if this is the first item queued if (is_first) { gpr_mu_lock(cq->mu); grpc_error_handle kick_error = @@ -756,9 +756,9 @@ static void cq_end_op_for_next( } } -/* Queue a GRPC_OP_COMPLETED operation to a completion queue (with a - * completion - * type of GRPC_CQ_PLUCK) */ +// Queue a GRPC_OP_COMPLETED operation to a completion queue (with a +// completion +// type of GRPC_CQ_PLUCK) static void cq_end_op_for_pluck( grpc_completion_queue* cq, void* tag, grpc_error_handle error, void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, @@ -786,9 +786,9 @@ static void cq_end_op_for_pluck( static_cast(is_success); gpr_mu_lock(cq->mu); - cq_check_tag(cq, tag, false); /* Used in debug builds only */ + cq_check_tag(cq, tag, false); // Used in debug builds only - /* Add to the list of completions */ + // Add to the list of completions cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed); cqd->completed_tail->next = reinterpret_cast(storage) | (1u & cqd->completed_tail->next); @@ -821,7 +821,7 @@ static void functor_callback(void* arg, grpc_error_handle error) { functor->functor_run(functor, error.ok()); } -/* Complete an event on a completion queue of type GRPC_CQ_CALLBACK */ +// Complete an event on a completion queue of type GRPC_CQ_CALLBACK static void cq_end_op_for_callback( grpc_completion_queue* cq, void* tag, grpc_error_handle error, void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg, @@ -845,7 +845,7 @@ static void cq_end_op_for_callback( // for reserved storage. Invoke the done callback right away to release it. done(done_arg, storage); - cq_check_tag(cq, tag, true); /* Used in debug builds only */ + cq_check_tag(cq, tag, true); // Used in debug builds only if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) { cq_finish_shutdown_callback(cq); @@ -884,7 +884,7 @@ struct cq_is_finished_arg { grpc_completion_queue* cq; grpc_core::Timestamp deadline; grpc_cq_completion* stolen_completion; - void* tag; /* for pluck */ + void* tag; // for pluck bool first_loop; }; class ExecCtxNext : public grpc_core::ExecCtx { @@ -907,11 +907,11 @@ class ExecCtxNext : public grpc_core::ExecCtx { a->last_seen_things_queued_ever = cqd->things_queued_ever.load(std::memory_order_relaxed); - /* Pop a cq_completion from the queue. Returns NULL if the queue is empty - * might return NULL in some cases even if the queue is not empty; but - * that - * is ok and doesn't affect correctness. Might effect the tail latencies a - * bit) */ + // Pop a cq_completion from the queue. Returns NULL if the queue is empty + // might return NULL in some cases even if the queue is not empty; but + // that + // is ok and doesn't affect correctness. Might effect the tail latencies a + // bit) a->stolen_completion = cqd->queue.Pop(); if (a->stolen_completion != nullptr) { return true; @@ -992,26 +992,26 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline, c->done(c->done_arg, c); break; } else { - /* If c == NULL it means either the queue is empty OR in an transient - inconsistent state. If it is the latter, we shold do a 0-timeout poll - so that the thread comes back quickly from poll to make a second - attempt at popping. Not doing this can potentially deadlock this - thread forever (if the deadline is infinity) */ + // If c == NULL it means either the queue is empty OR in an transient + // inconsistent state. If it is the latter, we shold do a 0-timeout poll + // so that the thread comes back quickly from poll to make a second + // attempt at popping. Not doing this can potentially deadlock this + // thread forever (if the deadline is infinity) if (cqd->queue.num_items() > 0) { iteration_deadline = grpc_core::Timestamp::ProcessEpoch(); } } if (cqd->pending_events.load(std::memory_order_acquire) == 0) { - /* Before returning, check if the queue has any items left over (since - MultiProducerSingleConsumerQueue::Pop() can sometimes return NULL - even if the queue is not empty. If so, keep retrying but do not - return GRPC_QUEUE_SHUTDOWN */ + // Before returning, check if the queue has any items left over (since + // MultiProducerSingleConsumerQueue::Pop() can sometimes return NULL + // even if the queue is not empty. If so, keep retrying but do not + // return GRPC_QUEUE_SHUTDOWN if (cqd->queue.num_items() > 0) { - /* Go to the beginning of the loop. No point doing a poll because - (cq->shutdown == true) is only possible when there is no pending - work (i.e cq->pending_events == 0) and any outstanding completion - events should have already been queued on this cq */ + // Go to the beginning of the loop. No point doing a poll because + // (cq->shutdown == true) is only possible when there is no pending + // work (i.e cq->pending_events == 0) and any outstanding completion + // events should have already been queued on this cq continue; } @@ -1028,7 +1028,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline, break; } - /* The main polling work happens in grpc_pollset_work */ + // The main polling work happens in grpc_pollset_work gpr_mu_lock(cq->mu); cq->num_polls++; grpc_error_handle err = cq->poller_vtable->work( @@ -1065,12 +1065,12 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline, return ret; } -/* Finishes the completion queue shutdown. This means that there are no more - completion events / tags expected from the completion queue - - Must be called under completion queue lock - - Must be called only once in completion queue's lifetime - - grpc_completion_queue_shutdown() MUST have been called before calling - this function */ +// Finishes the completion queue shutdown. This means that there are no more +// completion events / tags expected from the completion queue +// - Must be called under completion queue lock +// - Must be called only once in completion queue's lifetime +// - grpc_completion_queue_shutdown() MUST have been called before calling +// this function static void cq_finish_shutdown_next(grpc_completion_queue* cq) { cq_next_data* cqd = static_cast DATA_FROM_CQ(cq); @@ -1083,12 +1083,12 @@ static void cq_finish_shutdown_next(grpc_completion_queue* cq) { static void cq_shutdown_next(grpc_completion_queue* cq) { cq_next_data* cqd = static_cast DATA_FROM_CQ(cq); - /* Need an extra ref for cq here because: - * We call cq_finish_shutdown_next() below, that would call pollset shutdown. - * Pollset shutdown decrements the cq ref count which can potentially destroy - * the cq (if that happens to be the last ref). - * Creating an extra ref here prevents the cq from getting destroyed while - * this function is still active */ + // Need an extra ref for cq here because: + // We call cq_finish_shutdown_next() below, that would call pollset shutdown. + // Pollset shutdown decrements the cq ref count which can potentially destroy + // the cq (if that happens to be the last ref). + // Creating an extra ref here prevents the cq from getting destroyed while + // this function is still active GRPC_CQ_INTERNAL_REF(cq, "shutting_down"); gpr_mu_lock(cq->mu); if (cqd->shutdown_called) { @@ -1097,9 +1097,9 @@ static void cq_shutdown_next(grpc_completion_queue* cq) { return; } cqd->shutdown_called = true; - /* Doing acq/release fetch_sub here to match with - * cq_begin_op_for_next and cq_end_op_for_next functions which read/write - * on this counter without necessarily holding a lock on cq */ + // Doing acq/release fetch_sub here to match with + // cq_begin_op_for_next and cq_end_op_for_next functions which read/write + // on this counter without necessarily holding a lock on cq if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) { cq_finish_shutdown_next(cq); } @@ -1255,7 +1255,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag, "is %d", GRPC_MAX_COMPLETION_QUEUE_PLUCKERS); gpr_mu_unlock(cq->mu); - /* TODO(ctiller): should we use a different result here */ + // TODO(ctiller): should we use a different result here ret.type = GRPC_QUEUE_TIMEOUT; ret.success = 0; dump_pending_tags(cq); @@ -1310,17 +1310,17 @@ static void cq_finish_shutdown_pluck(grpc_completion_queue* cq) { cq->poller_vtable->shutdown(POLLSET_FROM_CQ(cq), &cq->pollset_shutdown_done); } -/* NOTE: This function is almost exactly identical to cq_shutdown_next() but - * merging them is a bit tricky and probably not worth it */ +// NOTE: This function is almost exactly identical to cq_shutdown_next() but +// merging them is a bit tricky and probably not worth it static void cq_shutdown_pluck(grpc_completion_queue* cq) { cq_pluck_data* cqd = static_cast DATA_FROM_CQ(cq); - /* Need an extra ref for cq here because: - * We call cq_finish_shutdown_pluck() below, that would call pollset shutdown. - * Pollset shutdown decrements the cq ref count which can potentially destroy - * the cq (if that happens to be the last ref). - * Creating an extra ref here prevents the cq from getting destroyed while - * this function is still active */ + // Need an extra ref for cq here because: + // We call cq_finish_shutdown_pluck() below, that would call pollset shutdown. + // Pollset shutdown decrements the cq ref count which can potentially destroy + // the cq (if that happens to be the last ref). + // Creating an extra ref here prevents the cq from getting destroyed while + // this function is still active GRPC_CQ_INTERNAL_REF(cq, "shutting_down (pluck cq)"); gpr_mu_lock(cq->mu); if (cqd->shutdown_called) { @@ -1358,12 +1358,12 @@ static void cq_finish_shutdown_callback(grpc_completion_queue* cq) { static void cq_shutdown_callback(grpc_completion_queue* cq) { cq_callback_data* cqd = static_cast DATA_FROM_CQ(cq); - /* Need an extra ref for cq here because: - * We call cq_finish_shutdown_callback() below, which calls pollset shutdown. - * Pollset shutdown decrements the cq ref count which can potentially destroy - * the cq (if that happens to be the last ref). - * Creating an extra ref here prevents the cq from getting destroyed while - * this function is still active */ + // Need an extra ref for cq here because: + // We call cq_finish_shutdown_callback() below, which calls pollset shutdown. + // Pollset shutdown decrements the cq ref count which can potentially destroy + // the cq (if that happens to be the last ref). + // Creating an extra ref here prevents the cq from getting destroyed while + // this function is still active GRPC_CQ_INTERNAL_REF(cq, "shutting_down (callback cq)"); gpr_mu_lock(cq->mu); if (cqd->shutdown_called) { @@ -1381,8 +1381,8 @@ static void cq_shutdown_callback(grpc_completion_queue* cq) { GRPC_CQ_INTERNAL_UNREF(cq, "shutting_down (callback cq)"); } -/* Shutdown simply drops a ref that we reserved at creation time; if we drop - to zero here, then enter shutdown mode and wake up any waiters */ +// Shutdown simply drops a ref that we reserved at creation time; if we drop +// to zero here, then enter shutdown mode and wake up any waiters void grpc_completion_queue_shutdown(grpc_completion_queue* cq) { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index e2c907f28b4..4e9cd0efb30 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -1,25 +1,25 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H #define GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H -/* Internal API for completion queues */ +// Internal API for completion queues #include @@ -33,8 +33,8 @@ #include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/iomgr_fwd.h" -/* These trace flags default to 1. The corresponding lines are only traced - if grpc_api_trace is also truthy */ +// These trace flags default to 1. The corresponding lines are only traced +// if grpc_api_trace is also truthy extern grpc_core::TraceFlag grpc_cq_pluck_trace; extern grpc_core::TraceFlag grpc_trace_operation_failures; extern grpc_core::DebugOnlyTraceFlag grpc_trace_pending_tags; @@ -45,13 +45,13 @@ typedef struct grpc_cq_completion { grpc_core::MultiProducerSingleConsumerQueue::Node> node; - /** user supplied tag */ + /// user supplied tag void* tag; - /** done callback - called when this queue element is no longer - needed by the completion queue */ + /// done callback - called when this queue element is no longer + /// needed by the completion queue void (*done)(void* done_arg, struct grpc_cq_completion* c); void* done_arg; - /** next pointer; low bit is used to indicate success or not */ + /// next pointer; low bit is used to indicate success or not uintptr_t next; } grpc_cq_completion; @@ -71,14 +71,14 @@ void grpc_cq_internal_unref(grpc_completion_queue* cq); #define GRPC_CQ_INTERNAL_UNREF(cq, reason) grpc_cq_internal_unref(cq) #endif -/* Flag that an operation is beginning: the completion channel will not finish - shutdown until a corrensponding grpc_cq_end_* call is made. - \a tag is currently used only in debug builds. Return true on success, and - false if completion_queue has been shutdown. */ +// Flag that an operation is beginning: the completion channel will not finish +// shutdown until a corrensponding grpc_cq_end_* call is made. +// \a tag is currently used only in debug builds. Return true on success, and +// false if completion_queue has been shutdown. bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag); -/* Queue a GRPC_OP_COMPLETED operation; tag must correspond to the tag passed to - grpc_cq_begin_op */ +// Queue a GRPC_OP_COMPLETED operation; tag must correspond to the tag passed to +// grpc_cq_begin_op void grpc_cq_end_op(grpc_completion_queue* cq, void* tag, grpc_error_handle error, void (*done)(void* done_arg, grpc_cq_completion* storage), @@ -97,4 +97,4 @@ grpc_completion_queue* grpc_completion_queue_create_internal( grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type, grpc_completion_queue_functor* shutdown_callback); -#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */ +#endif // GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H diff --git a/src/core/lib/surface/completion_queue_factory.cc b/src/core/lib/surface/completion_queue_factory.cc index 29542b478bc..5864d92e6f7 100644 --- a/src/core/lib/surface/completion_queue_factory.cc +++ b/src/core/lib/surface/completion_queue_factory.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -26,9 +26,9 @@ #include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/surface/completion_queue.h" -/* - * == Default completion queue factory implementation == - */ +// +// == Default completion queue factory implementation == +// static grpc_completion_queue* default_create( const grpc_completion_queue_factory* /*factory*/, @@ -42,23 +42,23 @@ static grpc_completion_queue_factory_vtable default_vtable = {default_create}; static const grpc_completion_queue_factory g_default_cq_factory = { "Default Factory", nullptr, &default_vtable}; -/* - * == Completion queue factory APIs - */ +// +// == Completion queue factory APIs +// const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup( const grpc_completion_queue_attributes* attributes) { GPR_ASSERT(attributes->version >= 1 && attributes->version <= GRPC_CQ_CURRENT_VERSION); - /* The default factory can handle version 1 of the attributes structure. We - may have to change this as more fields are added to the structure */ + // The default factory can handle version 1 of the attributes structure. We + // may have to change this as more fields are added to the structure return &g_default_cq_factory; } -/* - * == Completion queue creation APIs == - */ +// +// == Completion queue creation APIs == +// grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) { grpc_core::ExecCtx exec_ctx; diff --git a/src/core/lib/surface/completion_queue_factory.h b/src/core/lib/surface/completion_queue_factory.h index 60ed5f1599b..a19dbbf0d4d 100644 --- a/src/core/lib/surface/completion_queue_factory.h +++ b/src/core/lib/surface/completion_queue_factory.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H #define GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H @@ -30,8 +30,8 @@ typedef struct grpc_completion_queue_factory_vtable { struct grpc_completion_queue_factory { const char* name; - void* data; /* Factory specific data */ + void* data; // Factory specific data grpc_completion_queue_factory_vtable* vtable; }; -#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H */ +#endif // GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_FACTORY_H diff --git a/src/core/lib/surface/event_string.cc b/src/core/lib/surface/event_string.cc index 35a05a895b7..0666d4beff8 100644 --- a/src/core/lib/surface/event_string.cc +++ b/src/core/lib/surface/event_string.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/event_string.h b/src/core/lib/surface/event_string.h index 9e02a52e5cb..62927a591d1 100644 --- a/src/core/lib/surface/event_string.h +++ b/src/core/lib/surface/event_string.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_EVENT_STRING_H #define GRPC_CORE_LIB_SURFACE_EVENT_STRING_H @@ -25,7 +25,7 @@ #include -/* Returns a string describing an event. Must be later freed with gpr_free() */ +// Returns a string describing an event. Must be later freed with gpr_free() std::string grpc_event_string(grpc_event* ev); -#endif /* GRPC_CORE_LIB_SURFACE_EVENT_STRING_H */ +#endif // GRPC_CORE_LIB_SURFACE_EVENT_STRING_H diff --git a/src/core/lib/surface/init.cc b/src/core/lib/surface/init.cc index cf735f194ef..9af5938255b 100644 --- a/src/core/lib/surface/init.cc +++ b/src/core/lib/surface/init.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/init.h b/src/core/lib/surface/init.h index b5ca5e032b7..eada56a8c39 100644 --- a/src/core/lib/surface/init.h +++ b/src/core/lib/surface/init.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_INIT_H #define GRPC_CORE_LIB_SURFACE_INIT_H @@ -22,4 +22,4 @@ void grpc_maybe_wait_for_async_shutdown(void); -#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */ +#endif // GRPC_CORE_LIB_SURFACE_INIT_H diff --git a/src/core/lib/surface/lame_client.cc b/src/core/lib/surface/lame_client.cc index a45b08ade00..181beb9b4b1 100644 --- a/src/core/lib/surface/lame_client.cc +++ b/src/core/lib/surface/lame_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/lame_client.h b/src/core/lib/surface/lame_client.h index 75b6d92c001..564b376aab7 100644 --- a/src/core/lib/surface/lame_client.h +++ b/src/core/lib/surface/lame_client.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H #define GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H @@ -68,4 +68,4 @@ class LameClientFilter : public ChannelFilter { }; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H */ +#endif // GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H diff --git a/src/core/lib/surface/metadata_array.cc b/src/core/lib/surface/metadata_array.cc index 562ab5a2f2e..382f4992cce 100644 --- a/src/core/lib/surface/metadata_array.cc +++ b/src/core/lib/surface/metadata_array.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index 190e2322920..61fb6cee98d 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -231,8 +231,8 @@ class Server::RealRequestMatcher : public RequestMatcherInterface { void RequestCallWithPossiblePublish(size_t request_queue_index, RequestedCall* call) override { if (requests_per_cq_[request_queue_index].Push(&call->mpscq_node)) { - /* this was the first queued request: we need to lock and start - matching calls */ + // this was the first queued request: we need to lock and start + // matching calls struct PendingCall { RequestedCall* rc = nullptr; CallData* calld; @@ -1059,8 +1059,8 @@ void Server::ChannelData::InitTransport(RefCountedPtr server, Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod( const grpc_slice& host, const grpc_slice& path) { if (registered_methods_ == nullptr) return nullptr; - /* TODO(ctiller): unify these two searches */ - /* check for an exact match with host */ + // TODO(ctiller): unify these two searches + // check for an exact match with host uint32_t hash = MixHash32(grpc_slice_hash(host), grpc_slice_hash(path)); for (size_t i = 0; i <= registered_method_max_probes_; i++) { ChannelRegisteredMethod* rm = @@ -1071,7 +1071,7 @@ Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod( if (rm->method != path) continue; return rm; } - /* check for a wildcard method definition (no host set) */ + // check for a wildcard method definition (no host set) hash = MixHash32(0, grpc_slice_hash(path)); for (size_t i = 0; i <= registered_method_max_probes_; i++) { ChannelRegisteredMethod* rm = @@ -1087,7 +1087,7 @@ Server::ChannelRegisteredMethod* Server::ChannelData::GetRegisteredMethod( void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/, const void* transport_server_data) { auto* chand = static_cast(arg); - /* create a call */ + // create a call grpc_call_create_args args; args.channel = chand->channel_; args.server = chand->server_.get(); @@ -1357,9 +1357,9 @@ void Server::CallData::RecvInitialMetadataReady(void* arg, calld->deadline_ = *op_deadline; } if (calld->host_.has_value() && calld->path_.has_value()) { - /* do nothing */ + // do nothing } else if (error.ok()) { - /* Pass the error reference to calld->recv_initial_metadata_error */ + // Pass the error reference to calld->recv_initial_metadata_error grpc_error_handle src_error = error; error = absl::UnknownError("Missing :authority or :path"); calld->recv_initial_metadata_error_ = error; @@ -1444,8 +1444,8 @@ void grpc_server_register_completion_queue(grpc_server* server, "Completion queue of type %d is being registered as a " "server-completion-queue", static_cast(cq_type)); - /* Ideally we should log an error and abort but ruby-wrapped-language API - calls grpc_completion_queue_pluck() on server completion queues */ + // Ideally we should log an error and abort but ruby-wrapped-language API + // calls grpc_completion_queue_pluck() on server completion queues } grpc_core::Server::FromC(server)->RegisterCompletionQueue(cq); } diff --git a/src/core/lib/surface/server.h b/src/core/lib/surface/server.h index 5b474738114..850d4a7b76c 100644 --- a/src/core/lib/surface/server.h +++ b/src/core/lib/surface/server.h @@ -521,4 +521,4 @@ struct grpc_server_config_fetcher { virtual grpc_pollset_set* interested_parties() = 0; }; -#endif /* GRPC_CORE_LIB_SURFACE_SERVER_H */ +#endif // GRPC_CORE_LIB_SURFACE_SERVER_H diff --git a/src/core/lib/surface/validate_metadata.cc b/src/core/lib/surface/validate_metadata.cc index fd6f5f2eb5e..3fef4781906 100644 --- a/src/core/lib/surface/validate_metadata.cc +++ b/src/core/lib/surface/validate_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/surface/validate_metadata.h b/src/core/lib/surface/validate_metadata.h index 642023dcd2c..a4e9d94cd4a 100644 --- a/src/core/lib/surface/validate_metadata.h +++ b/src/core/lib/surface/validate_metadata.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H #define GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H @@ -45,4 +45,4 @@ inline int grpc_is_refcounted_slice_binary_header(const grpc_slice& slice) { slice.data.refcounted.length); } -#endif /* GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H */ +#endif // GRPC_CORE_LIB_SURFACE_VALIDATE_METADATA_H diff --git a/src/core/lib/surface/version.cc b/src/core/lib/surface/version.cc index 0ab6cc3a830..a3c40a5be68 100644 --- a/src/core/lib/surface/version.cc +++ b/src/core/lib/surface/version.cc @@ -1,23 +1,23 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This file is autogenerated from: - templates/src/core/surface/version.c.template */ +// This file is autogenerated from: +// templates/src/core/surface/version.c.template #include diff --git a/src/core/lib/transport/bdp_estimator.cc b/src/core/lib/transport/bdp_estimator.cc index cc3ede26e2d..053a06684be 100644 --- a/src/core/lib/transport/bdp_estimator.cc +++ b/src/core/lib/transport/bdp_estimator.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/transport/bdp_estimator.h b/src/core/lib/transport/bdp_estimator.h index c88b4531c86..86aa71e7ae5 100644 --- a/src/core/lib/transport/bdp_estimator.h +++ b/src/core/lib/transport/bdp_estimator.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H #define GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H @@ -90,4 +90,4 @@ class BdpEstimator { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_BDP_ESTIMATOR_H diff --git a/src/core/lib/transport/connectivity_state.cc b/src/core/lib/transport/connectivity_state.cc index e3c4d00e2a3..ceda57d1bf2 100644 --- a/src/core/lib/transport/connectivity_state.cc +++ b/src/core/lib/transport/connectivity_state.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/core/lib/transport/connectivity_state.h b/src/core/lib/transport/connectivity_state.h index ee7cbd0875b..d91d5575065 100644 --- a/src/core/lib/transport/connectivity_state.h +++ b/src/core/lib/transport/connectivity_state.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H #define GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H @@ -141,4 +141,4 @@ class ConnectivityStateTracker { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_CONNECTIVITY_STATE_H diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc index df5d38a22d8..6246c9bbe47 100644 --- a/src/core/lib/transport/error_utils.cc +++ b/src/core/lib/transport/error_utils.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h index b181eff3ad1..9e3b25fcde9 100644 --- a/src/core/lib/transport/error_utils.h +++ b/src/core/lib/transport/error_utils.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H #define GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H @@ -60,4 +60,4 @@ grpc_error_handle absl_status_to_grpc_error(absl::Status status); /// absl::OkStatus() or absl::CancelledError() bool grpc_error_has_clear_grpc_status(grpc_error_handle error); -#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H diff --git a/src/core/lib/transport/handshaker.cc b/src/core/lib/transport/handshaker.cc index cf7adaa286d..3ab00827e5d 100644 --- a/src/core/lib/transport/handshaker.cc +++ b/src/core/lib/transport/handshaker.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/transport/handshaker.h b/src/core/lib/transport/handshaker.h index 5e29cb30040..cb3963af12f 100644 --- a/src/core/lib/transport/handshaker.h +++ b/src/core/lib/transport/handshaker.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_H #define GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_H @@ -169,4 +169,4 @@ typedef grpc_core::Handshaker grpc_handshaker; void grpc_handshake_manager_add(grpc_handshake_manager* mgr, grpc_handshaker* handshaker); -#endif /* GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_H diff --git a/src/core/lib/transport/handshaker_factory.h b/src/core/lib/transport/handshaker_factory.h index 11411352ff3..d451aad4e72 100644 --- a/src/core/lib/transport/handshaker_factory.h +++ b/src/core/lib/transport/handshaker_factory.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_FACTORY_H #define GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_FACTORY_H @@ -71,4 +71,4 @@ class HandshakerFactory { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_FACTORY_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_FACTORY_H diff --git a/src/core/lib/transport/handshaker_registry.cc b/src/core/lib/transport/handshaker_registry.cc index c0440a7ad20..6505516481c 100644 --- a/src/core/lib/transport/handshaker_registry.cc +++ b/src/core/lib/transport/handshaker_registry.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/transport/handshaker_registry.h b/src/core/lib/transport/handshaker_registry.h index 6dabdfb8fac..487065eb3ea 100644 --- a/src/core/lib/transport/handshaker_registry.h +++ b/src/core/lib/transport/handshaker_registry.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_REGISTRY_H #define GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_REGISTRY_H @@ -66,4 +66,4 @@ class HandshakerRegistry { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_REGISTRY_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_HANDSHAKER_REGISTRY_H diff --git a/src/core/lib/transport/http2_errors.h b/src/core/lib/transport/http2_errors.h index d412c5dffc7..ee6e3f57e86 100644 --- a/src/core/lib/transport/http2_errors.h +++ b/src/core/lib/transport/http2_errors.h @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_HTTP2_ERRORS_H #define GRPC_CORE_LIB_TRANSPORT_HTTP2_ERRORS_H -/* error codes for RST_STREAM from http2 draft 14 section 7 */ +// error codes for RST_STREAM from http2 draft 14 section 7 typedef enum { GRPC_HTTP2_NO_ERROR = 0x0, GRPC_HTTP2_PROTOCOL_ERROR = 0x1, @@ -34,8 +34,8 @@ typedef enum { GRPC_HTTP2_CONNECT_ERROR = 0xa, GRPC_HTTP2_ENHANCE_YOUR_CALM = 0xb, GRPC_HTTP2_INADEQUATE_SECURITY = 0xc, - /* force use of a default clause */ + // force use of a default clause GRPC_HTTP2__ERROR_DO_NOT_USE = -1 } grpc_http2_error_code; -#endif /* GRPC_CORE_LIB_TRANSPORT_HTTP2_ERRORS_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_HTTP2_ERRORS_H diff --git a/src/core/lib/transport/http_connect_handshaker.cc b/src/core/lib/transport/http_connect_handshaker.cc index bc3135762d7..11e2332bc8f 100644 --- a/src/core/lib/transport/http_connect_handshaker.cc +++ b/src/core/lib/transport/http_connect_handshaker.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/lib/transport/http_connect_handshaker.h b/src/core/lib/transport/http_connect_handshaker.h index 7ac74b50eb0..4b52e8f5f17 100644 --- a/src/core/lib/transport/http_connect_handshaker.h +++ b/src/core/lib/transport/http_connect_handshaker.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_HTTP_CONNECT_HANDSHAKER_H #define GRPC_CORE_LIB_TRANSPORT_HTTP_CONNECT_HANDSHAKER_H @@ -39,4 +39,4 @@ void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_HTTP_CONNECT_HANDSHAKER_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_HTTP_CONNECT_HANDSHAKER_H diff --git a/src/core/lib/transport/metadata_batch.h b/src/core/lib/transport/metadata_batch.h index d06d0f3e6f0..d4b6821f5e2 100644 --- a/src/core/lib/transport/metadata_batch.h +++ b/src/core/lib/transport/metadata_batch.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H #define GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H @@ -1332,4 +1332,4 @@ struct grpc_metadata_batch : public grpc_metadata_batch_base { using grpc_metadata_batch_base::grpc_metadata_batch_base; }; -#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H diff --git a/src/core/lib/transport/pid_controller.cc b/src/core/lib/transport/pid_controller.cc index c0dc38ad6ad..ca654b7d05c 100644 --- a/src/core/lib/transport/pid_controller.cc +++ b/src/core/lib/transport/pid_controller.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -29,15 +29,15 @@ PidController::PidController(const Args& args) double PidController::Update(double error, double dt) { if (dt <= 0) return last_control_value_; - /* integrate error using the trapezoid rule */ + // integrate error using the trapezoid rule error_integral_ += dt * (last_error_ + error) * 0.5; error_integral_ = Clamp(error_integral_, -args_.integral_range(), args_.integral_range()); double diff_error = (error - last_error_) / dt; - /* calculate derivative of control value vs time */ + // calculate derivative of control value vs time double dc_dt = args_.gain_p() * error + args_.gain_i() * error_integral_ + args_.gain_d() * diff_error; - /* and perform trapezoidal integration */ + // and perform trapezoidal integration double new_control_value = last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5; new_control_value = Clamp(new_control_value, args_.min_control_value(), diff --git a/src/core/lib/transport/pid_controller.h b/src/core/lib/transport/pid_controller.h index e26205bf20d..aa294ec5a37 100644 --- a/src/core/lib/transport/pid_controller.h +++ b/src/core/lib/transport/pid_controller.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H #define GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H @@ -23,12 +23,12 @@ #include -/* \file Simple PID controller. - Implements a proportional-integral-derivative controller. - Used when we want to iteratively control a variable to converge some other - observed value to a 'set-point'. - Gains can be set to adjust sensitivity to current error (p), the integral - of error (i), and the derivative of error (d). */ +// \file Simple PID controller. +// Implements a proportional-integral-derivative controller. +// Used when we want to iteratively control a variable to converge some other +// observed value to a 'set-point'. +// Gains can be set to adjust sensitivity to current error (p), the integral +// of error (i), and the derivative of error (d). namespace grpc_core { @@ -113,4 +113,4 @@ class PidController { } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_PID_CONTROLLER_H diff --git a/src/core/lib/transport/status_conversion.cc b/src/core/lib/transport/status_conversion.cc index d301c2a36bb..808134dc5f6 100644 --- a/src/core/lib/transport/status_conversion.cc +++ b/src/core/lib/transport/status_conversion.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -43,11 +43,11 @@ grpc_status_code grpc_http2_error_to_grpc_status( grpc_http2_error_code error, grpc_core::Timestamp deadline) { switch (error) { case GRPC_HTTP2_NO_ERROR: - /* should never be received */ + // should never be received return GRPC_STATUS_INTERNAL; case GRPC_HTTP2_CANCEL: - /* http2 cancel translates to STATUS_CANCELLED iff deadline hasn't been - * exceeded */ + // http2 cancel translates to STATUS_CANCELLED iff deadline hasn't been + // exceeded return grpc_core::Timestamp::Now() > deadline ? GRPC_STATUS_DEADLINE_EXCEEDED : GRPC_STATUS_CANCELLED; @@ -64,7 +64,7 @@ grpc_status_code grpc_http2_error_to_grpc_status( grpc_status_code grpc_http2_status_to_grpc_status(int status) { switch (status) { - /* these HTTP2 status codes are called out explicitly in status.proto */ + // these HTTP2 status codes are called out explicitly in status.proto case 200: return GRPC_STATUS_OK; case 400: @@ -83,7 +83,7 @@ grpc_status_code grpc_http2_status_to_grpc_status(int status) { return GRPC_STATUS_UNAVAILABLE; case 504: return GRPC_STATUS_UNAVAILABLE; - /* everything else is unknown */ + // everything else is unknown default: return GRPC_STATUS_UNKNOWN; } diff --git a/src/core/lib/transport/status_conversion.h b/src/core/lib/transport/status_conversion.h index 1a1681a461b..597d81e1d5e 100644 --- a/src/core/lib/transport/status_conversion.h +++ b/src/core/lib/transport/status_conversion.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H #define GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H @@ -26,13 +26,13 @@ #include "src/core/lib/gprpp/time.h" #include "src/core/lib/transport/http2_errors.h" -/* Conversion of grpc status codes to http2 error codes (for RST_STREAM) */ +// Conversion of grpc status codes to http2 error codes (for RST_STREAM) grpc_http2_error_code grpc_status_to_http2_error(grpc_status_code status); grpc_status_code grpc_http2_error_to_grpc_status(grpc_http2_error_code error, grpc_core::Timestamp deadline); -/* Conversion of HTTP status codes (:status) to grpc status codes */ +// Conversion of HTTP status codes (:status) to grpc status codes grpc_status_code grpc_http2_status_to_grpc_status(int status); int grpc_status_to_http2_status(grpc_status_code status); -#endif /* GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_STATUS_CONVERSION_H diff --git a/src/core/lib/transport/tcp_connect_handshaker.h b/src/core/lib/transport/tcp_connect_handshaker.h index 7f845606fa6..43401adf020 100644 --- a/src/core/lib/transport/tcp_connect_handshaker.h +++ b/src/core/lib/transport/tcp_connect_handshaker.h @@ -36,4 +36,4 @@ void RegisterTCPConnectHandshaker(CoreConfiguration::Builder* builder); } // namespace grpc_core -#endif // GRPC_CORE_LIB_TRANSPORT_TCP_CONNECT_HANDSHAKER_H \ No newline at end of file +#endif // GRPC_CORE_LIB_TRANSPORT_TCP_CONNECT_HANDSHAKER_H diff --git a/src/core/lib/transport/timeout_encoding.cc b/src/core/lib/transport/timeout_encoding.cc index ae714ba6291..aa28eefc82e 100644 --- a/src/core/lib/transport/timeout_encoding.cc +++ b/src/core/lib/transport/timeout_encoding.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -230,14 +230,14 @@ absl::optional ParseTimeout(const Slice& text) { const uint8_t* p = text.begin(); const uint8_t* end = text.end(); int have_digit = 0; - /* skip whitespace */ + // skip whitespace for (; p != end && *p == ' '; p++) { } - /* decode numeric part */ + // decode numeric part for (; p != end && *p >= '0' && *p <= '9'; p++) { int32_t digit = static_cast(*p - static_cast('0')); have_digit = 1; - /* spec allows max. 8 digits, but we allow values up to 1,000,000,000 */ + // spec allows max. 8 digits, but we allow values up to 1,000,000,000 if (x >= (100 * 1000 * 1000)) { if (x != (100 * 1000 * 1000) || digit != 0) { return Duration::Infinity(); @@ -246,11 +246,11 @@ absl::optional ParseTimeout(const Slice& text) { x = x * 10 + digit; } if (!have_digit) return absl::nullopt; - /* skip whitespace */ + // skip whitespace for (; p != end && *p == ' '; p++) { } if (p == end) return absl::nullopt; - /* decode unit specifier */ + // decode unit specifier Duration timeout; switch (*p) { case 'n': diff --git a/src/core/lib/transport/timeout_encoding.h b/src/core/lib/transport/timeout_encoding.h index 7c66ae0db4d..48bfb3659e7 100644 --- a/src/core/lib/transport/timeout_encoding.h +++ b/src/core/lib/transport/timeout_encoding.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H #define GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H @@ -69,4 +69,4 @@ absl::optional ParseTimeout(const Slice& text); } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_TIMEOUT_ENCODING_H diff --git a/src/core/lib/transport/transport.cc b/src/core/lib/transport/transport.cc index 9ee68c30888..f138cbc628b 100644 --- a/src/core/lib/transport/transport.cc +++ b/src/core/lib/transport/transport.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -42,13 +42,13 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount(false, void grpc_stream_destroy(grpc_stream_refcount* refcount) { if ((grpc_core::ExecCtx::Get()->flags() & GRPC_EXEC_CTX_FLAG_THREAD_RESOURCE_LOOP)) { - /* Ick. - The thread we're running on MAY be owned (indirectly) by a call-stack. - If that's the case, destroying the call-stack MAY try to destroy the - thread, which is a tangled mess that we just don't want to ever have to - cope with. - Throw this over to the executor (on a core-owned thread) and process it - there. */ + // Ick. + // The thread we're running on MAY be owned (indirectly) by a call-stack. + // If that's the case, destroying the call-stack MAY try to destroy the + // thread, which is a tangled mess that we just don't want to ever have to + // cope with. + // Throw this over to the executor (on a core-owned thread) and process it + // there. grpc_event_engine::experimental::GetDefaultEventEngine()->Run([refcount] { grpc_core::ApplicationCallbackExecCtx callback_exec_ctx; grpc_core::ExecCtx exec_ctx; diff --git a/src/core/lib/transport/transport.h b/src/core/lib/transport/transport.h index 247b2876051..da9a877480c 100644 --- a/src/core/lib/transport/transport.h +++ b/src/core/lib/transport/transport.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H #define GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H @@ -61,7 +61,7 @@ #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport_fwd.h" -/* Minimum and maximum protocol accepted versions. */ +// Minimum and maximum protocol accepted versions. #define GRPC_PROTOCOL_VERSION_MAX_MAJOR 2 #define GRPC_PROTOCOL_VERSION_MAX_MINOR 1 #define GRPC_PROTOCOL_VERSION_MIN_MAJOR 2 @@ -69,14 +69,14 @@ #define GRPC_ARG_TRANSPORT "grpc.internal.transport" -/** Internal bit flag for grpc_begin_message's \a flags signaling the use of - * compression for the message. (Does not apply for stream compression.) */ +/// Internal bit flag for grpc_begin_message's \a flags signaling the use of +/// compression for the message. (Does not apply for stream compression.) #define GRPC_WRITE_INTERNAL_COMPRESS (0x80000000u) -/** Internal bit flag for determining whether the message was compressed and had - * to be decompressed by the message_decompress filter. (Does not apply for - * stream compression.) */ +/// Internal bit flag for determining whether the message was compressed and had +/// to be decompressed by the message_decompress filter. (Does not apply for +/// stream compression.) #define GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED (0x40000000u) -/** Mask of all valid internal flags. */ +/// Mask of all valid internal flags. #define GRPC_WRITE_INTERNAL_USED_MASK \ (GRPC_WRITE_INTERNAL_COMPRESS | GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED) @@ -157,11 +157,11 @@ using NextPromiseFactory = } // namespace grpc_core -/* forward declarations */ +// forward declarations -/* grpc_stream doesn't actually exist. It's used as a typesafe - opaque pointer for whatever data the transport wants to track - for a stream. */ +// grpc_stream doesn't actually exist. It's used as a typesafe +// opaque pointer for whatever data the transport wants to track +// for a stream. typedef struct grpc_stream grpc_stream; extern grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount; @@ -226,8 +226,8 @@ inline void grpc_stream_unref(grpc_stream_refcount* refcount) { } #endif -/* Wrap a buffer that is owned by some stream object into a slice that shares - the same refcount */ +// Wrap a buffer that is owned by some stream object into a slice that shares +// the same refcount grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount, void* buffer, size_t length); @@ -271,8 +271,8 @@ struct grpc_handler_private_op_data { typedef struct grpc_transport_stream_op_batch_payload grpc_transport_stream_op_batch_payload; -/* Transport stream op: a set of operations to perform on a transport - against a single stream */ +// Transport stream op: a set of operations to perform on a transport +// against a single stream struct grpc_transport_stream_op_batch { grpc_transport_stream_op_batch() : send_initial_metadata(false), @@ -284,48 +284,48 @@ struct grpc_transport_stream_op_batch { cancel_stream(false), is_traced(false) {} - /** Should be scheduled when all of the non-recv operations in the batch - are complete. + /// Should be scheduled when all of the non-recv operations in the batch + /// are complete. - The recv ops (recv_initial_metadata, recv_message, and - recv_trailing_metadata) each have their own callbacks. If a batch - contains both recv ops and non-recv ops, on_complete should be - scheduled as soon as the non-recv ops are complete, regardless of - whether or not the recv ops are complete. If a batch contains - only recv ops, on_complete can be null. */ + /// The recv ops (recv_initial_metadata, recv_message, and + /// recv_trailing_metadata) each have their own callbacks. If a batch + /// contains both recv ops and non-recv ops, on_complete should be + /// scheduled as soon as the non-recv ops are complete, regardless of + /// whether or not the recv ops are complete. If a batch contains + /// only recv ops, on_complete can be null. grpc_closure* on_complete = nullptr; - /** Values for the stream op (fields set are determined by flags above) */ + /// Values for the stream op (fields set are determined by flags above) grpc_transport_stream_op_batch_payload* payload = nullptr; - /** Send initial metadata to the peer, from the provided metadata batch. */ + /// Send initial metadata to the peer, from the provided metadata batch. bool send_initial_metadata : 1; - /** Send trailing metadata to the peer, from the provided metadata batch. */ + /// Send trailing metadata to the peer, from the provided metadata batch. bool send_trailing_metadata : 1; - /** Send message data to the peer, from the provided byte stream. */ + /// Send message data to the peer, from the provided byte stream. bool send_message : 1; - /** Receive initial metadata from the stream, into provided metadata batch. */ + /// Receive initial metadata from the stream, into provided metadata batch. bool recv_initial_metadata : 1; - /** Receive message data from the stream, into provided byte stream. */ + /// Receive message data from the stream, into provided byte stream. bool recv_message : 1; - /** Receive trailing metadata from the stream, into provided metadata batch. - */ + /// Receive trailing metadata from the stream, into provided metadata batch. + /// bool recv_trailing_metadata : 1; - /** Cancel this stream with the provided error */ + /// Cancel this stream with the provided error bool cancel_stream : 1; - /** Is this stream traced */ + /// Is this stream traced bool is_traced : 1; - /*************************************************************************** - * remaining fields are initialized and used at the discretion of the - * current handler of the op */ + //************************************************************************** + // remaining fields are initialized and used at the discretion of the + // current handler of the op grpc_handler_private_op_data handler_private; }; @@ -377,7 +377,7 @@ struct grpc_transport_stream_op_batch_payload { struct { grpc_metadata_batch* recv_initial_metadata = nullptr; - /** Should be enqueued when initial metadata is ready to be processed. */ + /// Should be enqueued when initial metadata is ready to be processed. grpc_closure* recv_initial_metadata_ready = nullptr; // If not NULL, will be set to true if trailing metadata is // immediately available. This may be a signal that we received a @@ -402,108 +402,108 @@ struct grpc_transport_stream_op_batch_payload { uint32_t* flags = nullptr; // Was this recv_message failed for reasons other than a clean end-of-stream bool* call_failed_before_recv_message = nullptr; - /** Should be enqueued when one message is ready to be processed. */ + /// Should be enqueued when one message is ready to be processed. grpc_closure* recv_message_ready = nullptr; } recv_message; struct { grpc_metadata_batch* recv_trailing_metadata = nullptr; grpc_transport_stream_stats* collect_stats = nullptr; - /** Should be enqueued when trailing metadata is ready to be processed. */ + /// Should be enqueued when trailing metadata is ready to be processed. grpc_closure* recv_trailing_metadata_ready = nullptr; } recv_trailing_metadata; - /** Forcefully close this stream. - The HTTP2 semantics should be: - - server side: if cancel_error has - grpc_core::StatusIntProperty::kRpcStatus, and trailing metadata has not - been sent, send trailing metadata with status and message from cancel_error - (use grpc_error_get_status) followed by a RST_STREAM with - error=GRPC_CHTTP2_NO_ERROR to force a full close - - at all other times: use grpc_error_get_status to get a status code, and - convert to a HTTP2 error code using - grpc_chttp2_grpc_status_to_http2_error. Send a RST_STREAM with this - error. */ + /// Forcefully close this stream. + /// The HTTP2 semantics should be: + /// - server side: if cancel_error has + /// grpc_core::StatusIntProperty::kRpcStatus, and trailing metadata has not + /// been sent, send trailing metadata with status and message from + /// cancel_error (use grpc_error_get_status) followed by a RST_STREAM with + /// error=GRPC_CHTTP2_NO_ERROR to force a full close + /// - at all other times: use grpc_error_get_status to get a status code, and + /// convert to a HTTP2 error code using + /// grpc_chttp2_grpc_status_to_http2_error. Send a RST_STREAM with this + /// error. struct { // Error contract: the transport that gets this op must cause cancel_error // to be unref'ed after processing it grpc_error_handle cancel_error; } cancel_stream; - /* Indexes correspond to grpc_context_index enum values */ + // Indexes correspond to grpc_context_index enum values grpc_call_context_element* context; }; -/** Transport op: a set of operations to perform on a transport as a whole */ +/// Transport op: a set of operations to perform on a transport as a whole typedef struct grpc_transport_op { - /** Called when processing of this op is done. */ + /// Called when processing of this op is done. grpc_closure* on_consumed = nullptr; - /** connectivity monitoring - set connectivity_state to NULL to unsubscribe */ + /// connectivity monitoring - set connectivity_state to NULL to unsubscribe grpc_core::OrphanablePtr start_connectivity_watch; grpc_connectivity_state start_connectivity_watch_state = GRPC_CHANNEL_IDLE; grpc_core::ConnectivityStateWatcherInterface* stop_connectivity_watch = nullptr; - /** should the transport be disconnected - * Error contract: the transport that gets this op must cause - * disconnect_with_error to be unref'ed after processing it */ + /// should the transport be disconnected + /// Error contract: the transport that gets this op must cause + /// disconnect_with_error to be unref'ed after processing it grpc_error_handle disconnect_with_error; - /** what should the goaway contain? - * Error contract: the transport that gets this op must cause - * goaway_error to be unref'ed after processing it */ + /// what should the goaway contain? + /// Error contract: the transport that gets this op must cause + /// goaway_error to be unref'ed after processing it grpc_error_handle goaway_error; - /** set the callback for accepting new streams; - this is a permanent callback, unlike the other one-shot closures. - If true, the callback is set to set_accept_stream_fn, with its - user_data argument set to set_accept_stream_user_data */ + /// set the callback for accepting new streams; + /// this is a permanent callback, unlike the other one-shot closures. + /// If true, the callback is set to set_accept_stream_fn, with its + /// user_data argument set to set_accept_stream_user_data bool set_accept_stream = false; void (*set_accept_stream_fn)(void* user_data, grpc_transport* transport, const void* server_data) = nullptr; void* set_accept_stream_user_data = nullptr; - /** set the callback for accepting new streams based upon promises; - this is a permanent callback, unlike the other one-shot closures. - If true, the callback is set to set_make_promise_fn, with its - user_data argument set to set_make_promise_data */ + /// set the callback for accepting new streams based upon promises; + /// this is a permanent callback, unlike the other one-shot closures. + /// If true, the callback is set to set_make_promise_fn, with its + /// user_data argument set to set_make_promise_data bool set_make_promise = false; void (*set_make_promise_fn)(void* user_data, grpc_transport* transport, const void* server_data) = nullptr; void* set_make_promise_user_data = nullptr; - /** add this transport to a pollset */ + /// add this transport to a pollset grpc_pollset* bind_pollset = nullptr; - /** add this transport to a pollset_set */ + /// add this transport to a pollset_set grpc_pollset_set* bind_pollset_set = nullptr; - /** send a ping, if either on_initiate or on_ack is not NULL */ + /// send a ping, if either on_initiate or on_ack is not NULL struct { - /** Ping may be delayed by the transport, on_initiate callback will be - called when the ping is actually being sent. */ + /// Ping may be delayed by the transport, on_initiate callback will be + /// called when the ping is actually being sent. grpc_closure* on_initiate = nullptr; - /** Called when the ping ack is received */ + /// Called when the ping ack is received grpc_closure* on_ack = nullptr; } send_ping; // If true, will reset the channel's connection backoff. bool reset_connect_backoff = false; - /*************************************************************************** - * remaining fields are initialized and used at the discretion of the - * transport implementation */ + //************************************************************************** + // remaining fields are initialized and used at the discretion of the + // transport implementation grpc_handler_private_op_data handler_private; } grpc_transport_op; -/* Returns the amount of memory required to store a grpc_stream for this - transport */ +// Returns the amount of memory required to store a grpc_stream for this +// transport size_t grpc_transport_stream_size(grpc_transport* transport); -/* Initialize transport data for a stream. +// Initialize transport data for a stream. - Returns 0 on success, any other (transport-defined) value for failure. - May assume that stream contains all-zeros. +// Returns 0 on success, any other (transport-defined) value for failure. +// May assume that stream contains all-zeros. - Arguments: - transport - the transport on which to create this stream - stream - a pointer to uninitialized memory to initialize - server_data - either NULL for a client initiated stream, or a pointer - supplied from the accept_stream callback function */ +// Arguments: +// transport - the transport on which to create this stream +// stream - a pointer to uninitialized memory to initialize +// server_data - either NULL for a client initiated stream, or a pointer +// supplied from the accept_stream callback function int grpc_transport_init_stream(grpc_transport* transport, grpc_stream* stream, grpc_stream_refcount* refcount, const void* server_data, @@ -512,16 +512,16 @@ int grpc_transport_init_stream(grpc_transport* transport, grpc_stream* stream, void grpc_transport_set_pops(grpc_transport* transport, grpc_stream* stream, grpc_polling_entity* pollent); -/* Destroy transport data for a stream. +// Destroy transport data for a stream. - Requires: a recv_batch with final_state == GRPC_STREAM_CLOSED has been - received by the up-layer. Must not be called in the same call stack as - recv_frame. +// Requires: a recv_batch with final_state == GRPC_STREAM_CLOSED has been +// received by the up-layer. Must not be called in the same call stack as +// recv_frame. - Arguments: - transport - the transport on which to create this stream - stream - the grpc_stream to destroy (memory is still owned by the - caller, but any child memory must be cleaned up) */ +// Arguments: +// transport - the transport on which to create this stream +// stream - the grpc_stream to destroy (memory is still owned by the +// caller, but any child memory must be cleaned up) void grpc_transport_destroy_stream(grpc_transport* transport, grpc_stream* stream, grpc_closure* then_schedule_closure); @@ -541,16 +541,16 @@ std::string grpc_transport_stream_op_batch_string( grpc_transport_stream_op_batch* op); std::string grpc_transport_op_string(grpc_transport_op* op); -/* Send a batch of operations on a transport +// Send a batch of operations on a transport - Takes ownership of any objects contained in ops. +// Takes ownership of any objects contained in ops. - Arguments: - transport - the transport on which to initiate the stream - stream - the stream on which to send the operations. This must be - non-NULL and previously initialized by the same transport. - op - a grpc_transport_stream_op_batch specifying the op to perform - */ +// Arguments: +// transport - the transport on which to initiate the stream +// stream - the stream on which to send the operations. This must be +// non-NULL and previously initialized by the same transport. +// op - a grpc_transport_stream_op_batch specifying the op to perform +// void grpc_transport_perform_stream_op(grpc_transport* transport, grpc_stream* stream, grpc_transport_stream_op_batch* op); @@ -558,27 +558,27 @@ void grpc_transport_perform_stream_op(grpc_transport* transport, void grpc_transport_perform_op(grpc_transport* transport, grpc_transport_op* op); -/* Send a ping on a transport +// Send a ping on a transport - Calls cb with user data when a response is received. */ +// Calls cb with user data when a response is received. void grpc_transport_ping(grpc_transport* transport, grpc_closure* cb); -/* Advise peer of pending connection termination. */ +// Advise peer of pending connection termination. void grpc_transport_goaway(grpc_transport* transport, grpc_status_code status, grpc_slice debug_data); -/* Destroy the transport */ +// Destroy the transport void grpc_transport_destroy(grpc_transport* transport); -/* Get the endpoint used by \a transport */ +// Get the endpoint used by \a transport grpc_endpoint* grpc_transport_get_endpoint(grpc_transport* transport); -/* Allocate a grpc_transport_op, and preconfigure the on_complete closure to - \a on_complete and then delete the returned transport op */ +// Allocate a grpc_transport_op, and preconfigure the on_complete closure to +// \a on_complete and then delete the returned transport op grpc_transport_op* grpc_make_transport_op(grpc_closure* on_complete); -/* Allocate a grpc_transport_stream_op_batch, and preconfigure the on_complete - closure - to \a on_complete and then delete the returned transport op */ +// Allocate a grpc_transport_stream_op_batch, and preconfigure the on_complete +// closure +// to \a on_complete and then delete the returned transport op grpc_transport_stream_op_batch* grpc_make_transport_stream_op( grpc_closure* on_complete); @@ -589,4 +589,4 @@ constexpr const char* kKeepaliveThrottlingKey = "grpc.internal.keepalive_throttling"; } // namespace grpc_core -#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_TRANSPORT_H diff --git a/src/core/lib/transport/transport_impl.h b/src/core/lib/transport/transport_impl.h index fd586af7523..ff65adde60f 100644 --- a/src/core/lib/transport/transport_impl.h +++ b/src/core/lib/transport/transport_impl.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H #define GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H @@ -34,62 +34,62 @@ #include "src/core/lib/transport/transport_fwd.h" typedef struct grpc_transport_vtable { - /* Memory required for a single stream element - this is allocated by upper - layers and initialized by the transport */ - size_t sizeof_stream; /* = sizeof(transport stream) */ + // Memory required for a single stream element - this is allocated by upper + // layers and initialized by the transport + size_t sizeof_stream; // = sizeof(transport stream) - /* name of this transport implementation */ + // name of this transport implementation const char* name; - /* implementation of grpc_transport_init_stream */ + // implementation of grpc_transport_init_stream int (*init_stream)(grpc_transport* self, grpc_stream* stream, grpc_stream_refcount* refcount, const void* server_data, grpc_core::Arena* arena); - /* Create a promise to execute one client call. - If this is non-null, it may be used in preference to - perform_stream_op. - If this is used in preference to perform_stream_op, the - following can be omitted also: - - calling init_stream, destroy_stream, set_pollset, set_pollset_set - - allocation of memory for call data (sizeof_stream may be ignored) - There is an on-going migration to move all filters to providing this, and - then to drop perform_stream_op. */ + // Create a promise to execute one client call. + // If this is non-null, it may be used in preference to + // perform_stream_op. + // If this is used in preference to perform_stream_op, the + // following can be omitted also: + // - calling init_stream, destroy_stream, set_pollset, set_pollset_set + // - allocation of memory for call data (sizeof_stream may be ignored) + // There is an on-going migration to move all filters to providing this, and + // then to drop perform_stream_op. grpc_core::ArenaPromise (*make_call_promise)( grpc_transport* self, grpc_core::CallArgs call_args); - /* implementation of grpc_transport_set_pollset */ + // implementation of grpc_transport_set_pollset void (*set_pollset)(grpc_transport* self, grpc_stream* stream, grpc_pollset* pollset); - /* implementation of grpc_transport_set_pollset */ + // implementation of grpc_transport_set_pollset void (*set_pollset_set)(grpc_transport* self, grpc_stream* stream, grpc_pollset_set* pollset_set); - /* implementation of grpc_transport_perform_stream_op */ + // implementation of grpc_transport_perform_stream_op void (*perform_stream_op)(grpc_transport* self, grpc_stream* stream, grpc_transport_stream_op_batch* op); - /* implementation of grpc_transport_perform_op */ + // implementation of grpc_transport_perform_op void (*perform_op)(grpc_transport* self, grpc_transport_op* op); - /* implementation of grpc_transport_destroy_stream */ + // implementation of grpc_transport_destroy_stream void (*destroy_stream)(grpc_transport* self, grpc_stream* stream, grpc_closure* then_schedule_closure); - /* implementation of grpc_transport_destroy */ + // implementation of grpc_transport_destroy void (*destroy)(grpc_transport* self); - /* implementation of grpc_transport_get_endpoint */ + // implementation of grpc_transport_get_endpoint grpc_endpoint* (*get_endpoint)(grpc_transport* self); } grpc_transport_vtable; -/* an instance of a grpc transport */ +// an instance of a grpc transport struct grpc_transport { struct RawPointerChannelArgTag {}; static absl::string_view ChannelArgName() { return GRPC_ARG_TRANSPORT; } - /* pointer to a vtable defining operations on this transport */ + // pointer to a vtable defining operations on this transport const grpc_transport_vtable* vtable; }; -#endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */ +#endif // GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H diff --git a/src/core/lib/transport/transport_op_string.cc b/src/core/lib/transport/transport_op_string.cc index 394b062d9d1..db3fc641680 100644 --- a/src/core/lib/transport/transport_op_string.cc +++ b/src/core/lib/transport/transport_op_string.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -39,8 +39,8 @@ #include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/transport.h" -/* These routines are here to facilitate debugging - they produce string - representations of various transport data structures */ +// These routines are here to facilitate debugging - they produce string +// representations of various transport data structures std::string grpc_transport_stream_op_batch_string( grpc_transport_stream_op_batch* op) { diff --git a/src/core/plugin_registry/grpc_plugin_registry.cc b/src/core/plugin_registry/grpc_plugin_registry.cc index e04efebbe7c..f8cd6de28c9 100644 --- a/src/core/plugin_registry/grpc_plugin_registry.cc +++ b/src/core/plugin_registry/grpc_plugin_registry.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc index 4eaaee2898b..34ddb893475 100644 --- a/src/core/tsi/alts/crypt/aes_gcm.cc +++ b/src/core/tsi/alts/crypt/aes_gcm.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -35,13 +35,13 @@ constexpr size_t kKdfCounterLen = 6; constexpr size_t kKdfCounterOffset = 2; constexpr size_t kRekeyAeadKeyLen = kAes128GcmKeyLength; -/* Struct for additional data required if rekeying is enabled. */ +// Struct for additional data required if rekeying is enabled. struct gsec_aes_gcm_aead_rekey_data { uint8_t kdf_counter[kKdfCounterLen]; uint8_t nonce_mask[kAesGcmNonceLength]; }; -/* Main struct for AES_GCM crypter interface. */ +// Main struct for AES_GCM crypter interface. struct gsec_aes_gcm_aead_crypter { gsec_aead_crypter crypter; size_t key_length; @@ -79,7 +79,7 @@ static void aes_gcm_format_errors(const char* error_msg, char** error_details) { } char* openssl_errors = aes_gcm_get_openssl_errors(); if (openssl_errors != nullptr && error_msg != nullptr) { - size_t len = strlen(error_msg) + strlen(openssl_errors) + 2; /* ", " */ + size_t len = strlen(error_msg) + strlen(openssl_errors) + 2; // ", " *error_details = static_cast(gpr_malloc(len + 1)); snprintf(*error_details, len + 1, "%s, %s", error_msg, openssl_errors); gpr_free(openssl_errors); diff --git a/src/core/tsi/alts/crypt/gsec.cc b/src/core/tsi/alts/crypt/gsec.cc index d4de9cdbff4..a6145c5d070 100644 --- a/src/core/tsi/alts/crypt/gsec.cc +++ b/src/core/tsi/alts/crypt/gsec.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -52,7 +52,7 @@ grpc_status_code gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, &aad_vec, 1, &plaintext_vec, 1, ciphertext_vec, bytes_written, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -70,7 +70,7 @@ grpc_status_code gsec_aead_crypter_encrypt_iovec( plaintext_vec_length, ciphertext_vec, ciphertext_bytes_written, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -90,7 +90,7 @@ grpc_status_code gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, &aad_vec, 1, &ciphertext_vec, 1, plaintext_vec, bytes_written, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -108,7 +108,7 @@ grpc_status_code gsec_aead_crypter_decrypt_iovec( ciphertext_vec_length, plaintext_vec, plaintext_bytes_written, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -122,7 +122,7 @@ grpc_status_code gsec_aead_crypter_max_ciphertext_and_tag_length( crypter, plaintext_length, max_ciphertext_and_tag_length_to_return, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -136,7 +136,7 @@ grpc_status_code gsec_aead_crypter_max_plaintext_length( crypter, ciphertext_and_tag_length, max_plaintext_length_to_return, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -149,7 +149,7 @@ grpc_status_code gsec_aead_crypter_nonce_length( return crypter->vtable->nonce_length(crypter, nonce_length_to_return, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -162,7 +162,7 @@ grpc_status_code gsec_aead_crypter_key_length(const gsec_aead_crypter* crypter, return crypter->vtable->key_length(crypter, key_length_to_return, error_details); } - /* An error occurred */ + // An error occurred maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } @@ -175,7 +175,7 @@ grpc_status_code gsec_aead_crypter_tag_length(const gsec_aead_crypter* crypter, return crypter->vtable->tag_length(crypter, tag_length_to_return, error_details); } - /* An error occurred. */ + // An error occurred. maybe_copy_error_msg(vtable_error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } diff --git a/src/core/tsi/alts/crypt/gsec.h b/src/core/tsi/alts/crypt/gsec.h index 11b215497be..8d08999f481 100644 --- a/src/core/tsi/alts/crypt/gsec.h +++ b/src/core/tsi/alts/crypt/gsec.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_CRYPT_GSEC_H #define GRPC_CORE_TSI_ALTS_CRYPT_GSEC_H @@ -37,13 +37,13 @@ struct iovec { #endif // GRPC_EVENT_ENGINE_POSIX #endif // _STRUCT_IOVEC -/** - * A gsec interface for AEAD encryption schemes. The API is thread-compatible. - * Each implementation of this interface should specify supported values for - * key, nonce, and tag lengths. - */ +/// +/// A gsec interface for AEAD encryption schemes. The API is thread-compatible. +/// Each implementation of this interface should specify supported values for +/// key, nonce, and tag lengths. +/// -/* Key, nonce, and tag length in bytes */ +// Key, nonce, and tag length in bytes const size_t kAesGcmNonceLength = 12; const size_t kAesGcmTagLength = 16; const size_t kAes128GcmKeyLength = 16; @@ -55,94 +55,94 @@ const size_t kAes128GcmRekeyKeyLength = 44; typedef struct gsec_aead_crypter gsec_aead_crypter; -/** - * The gsec_aead_crypter is an API for different AEAD implementations such as - * AES_GCM. It encapsulates all AEAD-related operations in the format of - * V-table that stores pointers to functions implementing those operations. - * It also provides helper functions to wrap each of those function pointers. - * - * A typical usage of this object would be: - * - *------------------------------------------------------------------------------ - * // Declare a gsec_aead_crypter object, and create and assign an instance - * // of specific AEAD implementation e.g., AES_GCM to it. We assume both - * // key and nonce contain cryptographically secure random bytes, and the key - * // can be derived from an upper-layer application. - * gsec_aead_crypter* crypter; - * char* error_in_creation; - * // User can populate the message with any 100 bytes data. - * uint8_t* message = gpr_malloc(100); - * grpc_status_code creation_status = gsec_aes_gcm_aead_crypter_create(key, - * kAes128GcmKeyLength, - * kAesGcmNonceLength, - * kAesGcmTagLength, - * &crypter, - * false, - * 0 - * &error_in_creation); - * - * if (creation_status == GRPC_STATUS_OK) { - * // Allocate a correct amount of memory to hold a ciphertext. - * size_t clength = 0; - * gsec_aead_crypter_max_ciphertext_and_tag_length(crypter, 100, &clength, - * nullptr); - * uint8_t* ciphertext = gpr_malloc(clength); - * - * // Perform encryption - * size_t num_encrypted_bytes = 0; - * char* error_in_encryption = nullptr; - * grpc_status_code status = gsec_aead_crypter_encrypt(crypter, nonce, - * kAesGcmNonceLength, - * nullptr, 0, message, - * 100, ciphertext, - * clength, - * &num_encrypted_bytes, - * &error_in_encryption); - * if (status == GRPC_STATUS_OK) { - * // Allocate a correct amount of memory to hold a plaintext. - * size_t plength = 0; - * gsec_aead_crypter_max_plaintext_length(crypter, num_encrypted_bytes, - * &plength, nullptr); - * uint8_t* plaintext = gpr_malloc(plength); - * - * // Perform decryption. - * size_t num_decrypted_bytes = 0; - * char* error_in_decryption = nullptr; - * status = gsec_aead_crypter_decrypt(crypter, nonce, - * kAesGcmNonceLength, nullptr, 0, - * ciphertext, num_encrypted_bytes, - * plaintext, plength, - * &num_decrypted_bytes, - * &error_in_decryption); - * if (status != GRPC_STATUS_OK) { - * fprintf(stderr, "AEAD decrypt operation failed with error code:" - * "%d, message: %s\n", status, error_in_decryption); - * } - * ... - * gpr_free(plaintext); - * gpr_free(error_in_decryption); - * } else { - * fprintf(stderr, "AEAD encrypt operation failed with error code:" - * "%d, message: %s\n", status, error_in_encryption); - * } - * ... - * gpr_free(ciphertext); - * gpr_free(error_in_encryption); - * } else { - * fprintf(stderr, "Creation of AEAD crypter instance failed with error code:" - * "%d, message: %s\n", creation_status, error_in_creation); - * } - * - * // Destruct AEAD crypter instance. - * if (creation_status == GRPC_STATUS_OK) { - * gsec_aead_crypter_destroy(crypter); - * } - * gpr_free(error_in_creation); - * gpr_free(message); - * ----------------------------------------------------------------------------- - */ +/// +/// The gsec_aead_crypter is an API for different AEAD implementations such as +/// AES_GCM. It encapsulates all AEAD-related operations in the format of +/// V-table that stores pointers to functions implementing those operations. +/// It also provides helper functions to wrap each of those function pointers. +/// +/// A typical usage of this object would be: +/// +///------------------------------------------------------------------------------ +///// Declare a gsec_aead_crypter object, and create and assign an instance +///// of specific AEAD implementation e.g., AES_GCM to it. We assume both +///// key and nonce contain cryptographically secure random bytes, and the key +///// can be derived from an upper-layer application. +/// gsec_aead_crypter* crypter; +/// char* error_in_creation; +///// User can populate the message with any 100 bytes data. +/// uint8_t* message = gpr_malloc(100); +/// grpc_status_code creation_status = gsec_aes_gcm_aead_crypter_create(key, +/// kAes128GcmKeyLength, +/// kAesGcmNonceLength, +/// kAesGcmTagLength, +/// &crypter, +/// false, +/// 0 +/// &error_in_creation); +/// +/// if (creation_status == GRPC_STATUS_OK) { +/// // Allocate a correct amount of memory to hold a ciphertext. +/// size_t clength = 0; +/// gsec_aead_crypter_max_ciphertext_and_tag_length(crypter, 100, &clength, +/// nullptr); +/// uint8_t* ciphertext = gpr_malloc(clength); +/// +/// // Perform encryption +/// size_t num_encrypted_bytes = 0; +/// char* error_in_encryption = nullptr; +/// grpc_status_code status = gsec_aead_crypter_encrypt(crypter, nonce, +/// kAesGcmNonceLength, +/// nullptr, 0, message, +/// 100, ciphertext, +/// clength, +/// &num_encrypted_bytes, +/// &error_in_encryption); +/// if (status == GRPC_STATUS_OK) { +/// // Allocate a correct amount of memory to hold a plaintext. +/// size_t plength = 0; +/// gsec_aead_crypter_max_plaintext_length(crypter, num_encrypted_bytes, +/// &plength, nullptr); +/// uint8_t* plaintext = gpr_malloc(plength); +/// +/// // Perform decryption. +/// size_t num_decrypted_bytes = 0; +/// char* error_in_decryption = nullptr; +/// status = gsec_aead_crypter_decrypt(crypter, nonce, +/// kAesGcmNonceLength, nullptr, 0, +/// ciphertext, num_encrypted_bytes, +/// plaintext, plength, +/// &num_decrypted_bytes, +/// &error_in_decryption); +/// if (status != GRPC_STATUS_OK) { +/// fprintf(stderr, "AEAD decrypt operation failed with error code:" +/// "%d, message: %s\n", status, error_in_decryption); +/// } +/// ... +/// gpr_free(plaintext); +/// gpr_free(error_in_decryption); +/// } else { +/// fprintf(stderr, "AEAD encrypt operation failed with error code:" +/// "%d, message: %s\n", status, error_in_encryption); +/// } +/// ... +/// gpr_free(ciphertext); +/// gpr_free(error_in_encryption); +///} else { +/// fprintf(stderr, "Creation of AEAD crypter instance failed with error code:" +/// "%d, message: %s\n", creation_status, error_in_creation); +///} +/// +///// Destruct AEAD crypter instance. +/// if (creation_status == GRPC_STATUS_OK) { +/// gsec_aead_crypter_destroy(crypter); +///} +/// gpr_free(error_in_creation); +/// gpr_free(message); +///----------------------------------------------------------------------------- +/// -/* V-table for gsec AEAD operations */ +// V-table for gsec AEAD operations typedef struct gsec_aead_crypter_vtable { grpc_status_code (*encrypt_iovec)( gsec_aead_crypter* crypter, const uint8_t* nonce, size_t nonce_length, @@ -174,44 +174,44 @@ typedef struct gsec_aead_crypter_vtable { void (*destruct)(gsec_aead_crypter* crypter); } gsec_aead_crypter_vtable; -/* Main struct for gsec interface */ +// Main struct for gsec interface struct gsec_aead_crypter { const struct gsec_aead_crypter_vtable* vtable; }; -/** - * This method performs an AEAD encrypt operation. - * - * - crypter: AEAD crypter instance. - * - nonce: buffer containing a nonce with its size equal to nonce_length. - * - nonce_length: size of nonce buffer, and must be equal to the value returned - * from method gsec_aead_crypter_nonce_length. - * - aad: buffer containing data that needs to be authenticated but not - * encrypted with its size equal to aad_length. - * - aad_length: size of aad buffer, which should be zero if the buffer is - * nullptr. - * - plaintext: buffer containing data that needs to be both encrypted and - * authenticated with its size equal to plaintext_length. - * - plaintext_length: size of plaintext buffer, which should be zero if - * plaintext is nullptr. - * - ciphertext_and_tag: buffer that will contain ciphertext and tags the method - * produced. The buffer should not overlap the plaintext buffer, and pointers - * to those buffers should not be equal. Also if the ciphertext+tag buffer is - * nullptr, the plaintext_length should be zero. - * - ciphertext_and_tag_length: size of ciphertext+tag buffer, which should be - * at least as long as the one returned from method - * gsec_aead_crypter_max_ciphertext_and_tag_length. - * - bytes_written: the actual number of bytes written to the ciphertext+tag - * buffer. If bytes_written is nullptr, the plaintext_length should be zero. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of encryption, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - * - */ +/// +/// This method performs an AEAD encrypt operation. +/// +///- crypter: AEAD crypter instance. +///- nonce: buffer containing a nonce with its size equal to nonce_length. +///- nonce_length: size of nonce buffer, and must be equal to the value returned +/// from method gsec_aead_crypter_nonce_length. +///- aad: buffer containing data that needs to be authenticated but not +/// encrypted with its size equal to aad_length. +///- aad_length: size of aad buffer, which should be zero if the buffer is +/// nullptr. +///- plaintext: buffer containing data that needs to be both encrypted and +/// authenticated with its size equal to plaintext_length. +///- plaintext_length: size of plaintext buffer, which should be zero if +/// plaintext is nullptr. +///- ciphertext_and_tag: buffer that will contain ciphertext and tags the method +/// produced. The buffer should not overlap the plaintext buffer, and pointers +/// to those buffers should not be equal. Also if the ciphertext+tag buffer is +/// nullptr, the plaintext_length should be zero. +///- ciphertext_and_tag_length: size of ciphertext+tag buffer, which should be +/// at least as long as the one returned from method +/// gsec_aead_crypter_max_ciphertext_and_tag_length. +///- bytes_written: the actual number of bytes written to the ciphertext+tag +/// buffer. If bytes_written is nullptr, the plaintext_length should be zero. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of encryption, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// +/// grpc_status_code gsec_aead_crypter_encrypt( gsec_aead_crypter* crypter, const uint8_t* nonce, size_t nonce_length, const uint8_t* aad, size_t aad_length, const uint8_t* plaintext, @@ -219,32 +219,32 @@ grpc_status_code gsec_aead_crypter_encrypt( size_t ciphertext_and_tag_length, size_t* bytes_written, char** error_details); -/** - * This method performs an AEAD encrypt operation. - * - * - crypter: AEAD crypter instance. - * - nonce: buffer containing a nonce with its size equal to nonce_length. - * - nonce_length: size of nonce buffer, and must be equal to the value returned - * from method gsec_aead_crypter_nonce_length. - * - aad_vec: an iovec array containing data that needs to be authenticated but - * not encrypted. - * - aad_vec_length: the array length of aad_vec. - * - plaintext_vec: an iovec array containing data that needs to be both - * encrypted and authenticated. - * - plaintext_vec_length: the array length of plaintext_vec. - * - ciphertext_vec: an iovec containing a ciphertext buffer. The buffer should - * not overlap the plaintext buffer. - * - ciphertext_bytes_written: the actual number of bytes written to - * ciphertext_vec. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of encryption, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - * - */ +/// +/// This method performs an AEAD encrypt operation. +/// +///- crypter: AEAD crypter instance. +///- nonce: buffer containing a nonce with its size equal to nonce_length. +///- nonce_length: size of nonce buffer, and must be equal to the value returned +/// from method gsec_aead_crypter_nonce_length. +///- aad_vec: an iovec array containing data that needs to be authenticated but +/// not encrypted. +///- aad_vec_length: the array length of aad_vec. +///- plaintext_vec: an iovec array containing data that needs to be both +/// encrypted and authenticated. +///- plaintext_vec_length: the array length of plaintext_vec. +///- ciphertext_vec: an iovec containing a ciphertext buffer. The buffer should +/// not overlap the plaintext buffer. +///- ciphertext_bytes_written: the actual number of bytes written to +/// ciphertext_vec. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of encryption, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// +/// grpc_status_code gsec_aead_crypter_encrypt_iovec( gsec_aead_crypter* crypter, const uint8_t* nonce, size_t nonce_length, const struct iovec* aad_vec, size_t aad_vec_length, @@ -252,67 +252,67 @@ grpc_status_code gsec_aead_crypter_encrypt_iovec( struct iovec ciphertext_vec, size_t* ciphertext_bytes_written, char** error_details); -/** - * This method performs an AEAD decrypt operation. - * - * - crypter: AEAD crypter instance. - * - nonce: buffer containing a nonce with its size equal to nonce_length. - * - nonce_length: size of nonce buffer, and must be equal to the value returned - * from method gsec_aead_crypter_nonce_length. - * - aad: buffer containing data that needs to be authenticated only. - * - aad_length: size of aad buffer, which should be zero if the buffer is - * nullptr. - * - ciphertext_and_tag: buffer containing ciphertext and tag. - * - ciphertext_and_tag_length: length of ciphertext and tag. It should be zero - * if any of plaintext, ciphertext_and_tag, or bytes_written is nullptr. Also, - * ciphertext_and_tag_length should be at least as large as the tag length set - * at AEAD crypter instance construction time. - * - plaintext: buffer containing decrypted and authenticated data the method - * produced. The buffer should not overlap with the ciphertext+tag buffer, and - * pointers to those buffers should not be equal. - * - plaintext_length: size of plaintext buffer, which should be at least as - * long as the one returned from gsec_aead_crypter_max_plaintext_length - * method. - * - bytes_written: the actual number of bytes written to the plaintext - * buffer. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of decryption, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method performs an AEAD decrypt operation. +/// +///- crypter: AEAD crypter instance. +///- nonce: buffer containing a nonce with its size equal to nonce_length. +///- nonce_length: size of nonce buffer, and must be equal to the value returned +/// from method gsec_aead_crypter_nonce_length. +///- aad: buffer containing data that needs to be authenticated only. +///- aad_length: size of aad buffer, which should be zero if the buffer is +/// nullptr. +///- ciphertext_and_tag: buffer containing ciphertext and tag. +///- ciphertext_and_tag_length: length of ciphertext and tag. It should be zero +/// if any of plaintext, ciphertext_and_tag, or bytes_written is nullptr. Also, +/// ciphertext_and_tag_length should be at least as large as the tag length set +/// at AEAD crypter instance construction time. +///- plaintext: buffer containing decrypted and authenticated data the method +/// produced. The buffer should not overlap with the ciphertext+tag buffer, and +/// pointers to those buffers should not be equal. +///- plaintext_length: size of plaintext buffer, which should be at least as +/// long as the one returned from gsec_aead_crypter_max_plaintext_length +/// method. +///- bytes_written: the actual number of bytes written to the plaintext +/// buffer. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of decryption, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_decrypt( gsec_aead_crypter* crypter, const uint8_t* nonce, size_t nonce_length, const uint8_t* aad, size_t aad_length, const uint8_t* ciphertext_and_tag, size_t ciphertext_and_tag_length, uint8_t* plaintext, size_t plaintext_length, size_t* bytes_written, char** error_details); -/** - * This method performs an AEAD decrypt operation. - * - * - crypter: AEAD crypter instance. - * - nonce: buffer containing a nonce with its size equal to nonce_length. - * - nonce_length: size of nonce buffer, and must be equal to the value returned - * from method gsec_aead_crypter_nonce_length. - * - aad_vec: an iovec array containing data that needs to be authenticated but - * not encrypted. - * - aad_vec_length: the array length of aad_vec. - * - ciphertext_vec: an iovec array containing the ciphertext and tag. - * - ciphertext_vec_length: the array length of ciphertext_vec. - * - plaintext_vec: an iovec containing a plaintext buffer. The buffer should - * not overlap the ciphertext buffer. - * - plaintext_bytes_written: the actual number of bytes written to - * plaintext_vec. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of decryption, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method performs an AEAD decrypt operation. +/// +///- crypter: AEAD crypter instance. +///- nonce: buffer containing a nonce with its size equal to nonce_length. +///- nonce_length: size of nonce buffer, and must be equal to the value returned +/// from method gsec_aead_crypter_nonce_length. +///- aad_vec: an iovec array containing data that needs to be authenticated but +/// not encrypted. +///- aad_vec_length: the array length of aad_vec. +///- ciphertext_vec: an iovec array containing the ciphertext and tag. +///- ciphertext_vec_length: the array length of ciphertext_vec. +///- plaintext_vec: an iovec containing a plaintext buffer. The buffer should +/// not overlap the ciphertext buffer. +///- plaintext_bytes_written: the actual number of bytes written to +/// plaintext_vec. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of decryption, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_decrypt_iovec( gsec_aead_crypter* crypter, const uint8_t* nonce, size_t nonce_length, const struct iovec* aad_vec, size_t aad_vec_length, @@ -320,135 +320,135 @@ grpc_status_code gsec_aead_crypter_decrypt_iovec( struct iovec plaintext_vec, size_t* plaintext_bytes_written, char** error_details); -/** - * This method computes the size of ciphertext+tag buffer that must be passed to - * gsec_aead_crypter_encrypt function to ensure correct encryption of a - * plaintext. The actual size of ciphertext+tag written to the buffer could be - * smaller. - * - * - crypter: AEAD crypter instance. - * - plaintext_length: length of plaintext. - * - max_ciphertext_and_tag_length_to_return: the size of ciphertext+tag buffer - * the method returns. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method computes the size of ciphertext+tag buffer that must be passed +/// to gsec_aead_crypter_encrypt function to ensure correct encryption of a +/// plaintext. The actual size of ciphertext+tag written to the buffer could be +/// smaller. +/// +///- crypter: AEAD crypter instance. +///- plaintext_length: length of plaintext. +///- max_ciphertext_and_tag_length_to_return: the size of ciphertext+tag buffer +/// the method returns. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_max_ciphertext_and_tag_length( const gsec_aead_crypter* crypter, size_t plaintext_length, size_t* max_ciphertext_and_tag_length_to_return, char** error_details); -/** - * This method computes the size of plaintext buffer that must be passed to - * gsec_aead_crypter_decrypt function to ensure correct decryption of a - * ciphertext. The actual size of plaintext written to the buffer could be - * smaller. - * - * - crypter: AEAD crypter instance. - * - ciphertext_and_tag_length: length of ciphertext and tag. - * - max_plaintext_length_to_return: the size of plaintext buffer the method - * returns. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method computes the size of plaintext buffer that must be passed to +/// gsec_aead_crypter_decrypt function to ensure correct decryption of a +/// ciphertext. The actual size of plaintext written to the buffer could be +/// smaller. +/// +///- crypter: AEAD crypter instance. +///- ciphertext_and_tag_length: length of ciphertext and tag. +///- max_plaintext_length_to_return: the size of plaintext buffer the method +/// returns. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_max_plaintext_length( const gsec_aead_crypter* crypter, size_t ciphertext_and_tag_length, size_t* max_plaintext_length_to_return, char** error_details); -/** - * This method returns a valid size of nonce array used at the construction of - * AEAD crypter instance. It is also the size that should be passed to encrypt - * and decrypt methods executed on the instance. - * - * - crypter: AEAD crypter instance. - * - nonce_length_to_return: the length of nonce array the method returns. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method returns a valid size of nonce array used at the construction of +/// AEAD crypter instance. It is also the size that should be passed to encrypt +/// and decrypt methods executed on the instance. +/// +///- crypter: AEAD crypter instance. +///- nonce_length_to_return: the length of nonce array the method returns. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_nonce_length( const gsec_aead_crypter* crypter, size_t* nonce_length_to_return, char** error_details); -/** - * This method returns a valid size of key array used at the construction of - * AEAD crypter instance. It is also the size that should be passed to encrypt - * and decrypt methods executed on the instance. - * - * - crypter: AEAD crypter instance. - * - key_length_to_return: the length of key array the method returns. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method returns a valid size of key array used at the construction of +/// AEAD crypter instance. It is also the size that should be passed to encrypt +/// and decrypt methods executed on the instance. +/// +///- crypter: AEAD crypter instance. +///- key_length_to_return: the length of key array the method returns. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_key_length(const gsec_aead_crypter* crypter, size_t* key_length_to_return, char** error_details); -/** - * This method returns a valid size of tag array used at the construction of - * AEAD crypter instance. It is also the size that should be passed to encrypt - * and decrypt methods executed on the instance. - * - * - crypter: AEAD crypter instance. - * - tag_length_to_return: the length of tag array the method returns. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method returns a valid size of tag array used at the construction of +/// AEAD crypter instance. It is also the size that should be passed to encrypt +/// and decrypt methods executed on the instance. +/// +///- crypter: AEAD crypter instance. +///- tag_length_to_return: the length of tag array the method returns. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On the success of execution, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code gsec_aead_crypter_tag_length(const gsec_aead_crypter* crypter, size_t* tag_length_to_return, char** error_details); -/** - * This method destroys an AEAD crypter instance by de-allocating all of its - * occupied memory. - * - * - crypter: AEAD crypter instance that needs to be destroyed. - */ +/// +/// This method destroys an AEAD crypter instance by de-allocating all of its +/// occupied memory. +/// +///- crypter: AEAD crypter instance that needs to be destroyed. +/// void gsec_aead_crypter_destroy(gsec_aead_crypter* crypter); -/** - * This method creates an AEAD crypter instance of AES-GCM encryption scheme - * which supports 16 and 32 bytes long keys, 12 and 16 bytes long nonces, and - * 16 bytes long tags. It should be noted that once the lengths of key, nonce, - * and tag are determined at construction time, they cannot be modified later. - * - * - key: buffer containing a key which is binded with AEAD crypter instance. - * - key_length: length of a key in bytes, which should be 44 if rekeying is - * enabled and 16 or 32 otherwise. - * - nonce_length: length of a nonce in bytes, which should be either 12 or 16. - * - tag_length: length of a tag in bytes, which should be always 16. - * - rekey: enable nonce-based rekeying and nonce-masking. - * - crypter: address of AES_GCM crypter instance returned from the method. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On success of instance creation, it stores the address of instance at - * crypter. Otherwise, it returns an error status code together with its details - * specified in error_details. - */ +/// +/// This method creates an AEAD crypter instance of AES-GCM encryption scheme +/// which supports 16 and 32 bytes long keys, 12 and 16 bytes long nonces, and +/// 16 bytes long tags. It should be noted that once the lengths of key, nonce, +/// and tag are determined at construction time, they cannot be modified later. +/// +///- key: buffer containing a key which is binded with AEAD crypter instance. +///- key_length: length of a key in bytes, which should be 44 if rekeying is +/// enabled and 16 or 32 otherwise. +///- nonce_length: length of a nonce in bytes, which should be either 12 or 16. +///- tag_length: length of a tag in bytes, which should be always 16. +///- rekey: enable nonce-based rekeying and nonce-masking. +///- crypter: address of AES_GCM crypter instance returned from the method. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success of instance creation, it stores the address of instance at +/// crypter. Otherwise, it returns an error status code together with its +/// details specified in error_details. +/// grpc_status_code gsec_aes_gcm_aead_crypter_create(const uint8_t* key, size_t key_length, size_t nonce_length, @@ -456,4 +456,4 @@ grpc_status_code gsec_aes_gcm_aead_crypter_create(const uint8_t* key, gsec_aead_crypter** crypter, char** error_details); -#endif /* GRPC_CORE_TSI_ALTS_CRYPT_GSEC_H */ +#endif // GRPC_CORE_TSI_ALTS_CRYPT_GSEC_H diff --git a/src/core/tsi/alts/frame_protector/alts_counter.cc b/src/core/tsi/alts/frame_protector/alts_counter.cc index de163e3e08c..1468817513b 100644 --- a/src/core/tsi/alts/frame_protector/alts_counter.cc +++ b/src/core/tsi/alts/frame_protector/alts_counter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -35,7 +35,7 @@ grpc_status_code alts_counter_create(bool is_client, size_t counter_size, size_t overflow_size, alts_counter** crypter_counter, char** error_details) { - /* Perform input sanity check. */ + // Perform input sanity check. if (counter_size == 0) { const char error_msg[] = "counter_size is invalid."; maybe_copy_error_msg(error_msg, error_details); @@ -66,7 +66,7 @@ grpc_status_code alts_counter_create(bool is_client, size_t counter_size, grpc_status_code alts_counter_increment(alts_counter* crypter_counter, bool* is_overflow, char** error_details) { - /* Perform input sanity check. */ + // Perform input sanity check. if (crypter_counter == nullptr) { const char error_msg[] = "crypter_counter is nullptr."; maybe_copy_error_msg(error_msg, error_details); @@ -77,7 +77,7 @@ grpc_status_code alts_counter_increment(alts_counter* crypter_counter, maybe_copy_error_msg(error_msg, error_details); return GRPC_STATUS_INVALID_ARGUMENT; } - /* Increment the internal counter. */ + // Increment the internal counter. size_t i = 0; for (; i < crypter_counter->overflow_size; i++) { (crypter_counter->counter)[i]++; @@ -85,9 +85,9 @@ grpc_status_code alts_counter_increment(alts_counter* crypter_counter, break; } } - /** - * If the lower overflow_size bytes are all zero, the counter has overflowed. - */ + /// + /// If the lower overflow_size bytes are all zero, the counter has overflowed. + /// if (i == crypter_counter->overflow_size) { *is_overflow = true; return GRPC_STATUS_FAILED_PRECONDITION; diff --git a/src/core/tsi/alts/frame_protector/alts_counter.h b/src/core/tsi/alts/frame_protector/alts_counter.h index d705638fa8c..db662877dda 100644 --- a/src/core/tsi/alts/frame_protector/alts_counter.h +++ b/src/core/tsi/alts/frame_protector/alts_counter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H #define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H @@ -26,73 +26,73 @@ #include -/* Main struct for a crypter counter managed within seal/unseal operations. */ +// Main struct for a crypter counter managed within seal/unseal operations. typedef struct alts_counter { size_t size; size_t overflow_size; unsigned char* counter; } alts_counter; -/** - * This method creates and initializes an alts_counter instance. - * - * - is_client: a flag indicating if the alts_counter instance will be used - * at client (is_client = true) or server (is_client = false) side. - * - counter_size: size of buffer holding the counter value. - * - overflow_size: overflow size in bytes. The counter instance can be used - * to produce at most 2^(overflow_size*8) frames. - * - crypter_counter: an alts_counter instance to be returned from the method. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details and - * otherwise, the parameter should be freed with gpr_free. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method creates and initializes an alts_counter instance. +/// +///- is_client: a flag indicating if the alts_counter instance will be used +/// at client (is_client = true) or server (is_client = false) side. +///- counter_size: size of buffer holding the counter value. +///- overflow_size: overflow size in bytes. The counter instance can be used +/// to produce at most 2^(overflow_size*8) frames. +///- crypter_counter: an alts_counter instance to be returned from the method. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code alts_counter_create(bool is_client, size_t counter_size, size_t overflow_size, alts_counter** crypter_counter, char** error_details); -/** - * This method increments the internal counter. - * - * - crypter_counter: an alts_counter instance. - * - is_overflow: after incrementing the internal counter, if an overflow - * occurs, is_overflow is set to true, and no further calls to - * alts_counter_increment() should be made. Otherwise, is_overflow is set to - * false. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details and - * otherwise, the parameter should be freed with gpr_free. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method increments the internal counter. +/// +///- crypter_counter: an alts_counter instance. +///- is_overflow: after incrementing the internal counter, if an overflow +/// occurs, is_overflow is set to true, and no further calls to +/// alts_counter_increment() should be made. Otherwise, is_overflow is set to +/// false. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code alts_counter_increment(alts_counter* crypter_counter, bool* is_overflow, char** error_details); -/** - * This method returns the size of counter buffer. - * - * - crypter_counter: an alts_counter instance. - */ +/// +/// This method returns the size of counter buffer. +/// +///- crypter_counter: an alts_counter instance. +/// size_t alts_counter_get_size(alts_counter* crypter_counter); -/** - * This method returns the counter buffer. - * - * - crypter_counter: an alts_counter instance. - */ +/// +/// This method returns the counter buffer. +/// +///- crypter_counter: an alts_counter instance. +/// unsigned char* alts_counter_get_counter(alts_counter* crypter_counter); -/** - * This method de-allocates all memory allocated to an alts_coutner instance. - * - crypter_counter: an alts_counter instance. - */ +/// +/// This method de-allocates all memory allocated to an alts_coutner instance. +///- crypter_counter: an alts_counter instance. +/// void alts_counter_destroy(alts_counter* crypter_counter); -#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H */ +#endif // GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_COUNTER_H diff --git a/src/core/tsi/alts/frame_protector/alts_crypter.cc b/src/core/tsi/alts/frame_protector/alts_crypter.cc index 56f05121863..194c9f41767 100644 --- a/src/core/tsi/alts/frame_protector/alts_crypter.cc +++ b/src/core/tsi/alts/frame_protector/alts_crypter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -40,7 +40,7 @@ grpc_status_code alts_crypter_process_in_place( data_size, output_size, error_details); } - /* An error occurred. */ + // An error occurred. const char error_msg[] = "crypter or crypter->vtable has not been initialized properly."; maybe_copy_error_msg(error_msg, error_details); @@ -52,7 +52,7 @@ size_t alts_crypter_num_overhead_bytes(const alts_crypter* crypter) { crypter->vtable->num_overhead_bytes != nullptr) { return crypter->vtable->num_overhead_bytes(crypter); } - /* An error occurred. */ + // An error occurred. return 0; } diff --git a/src/core/tsi/alts/frame_protector/alts_crypter.h b/src/core/tsi/alts/frame_protector/alts_crypter.h index 3140778f4fc..192e52df7d0 100644 --- a/src/core/tsi/alts/frame_protector/alts_crypter.h +++ b/src/core/tsi/alts/frame_protector/alts_crypter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_CRYPTER_H #define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_CRYPTER_H @@ -28,99 +28,99 @@ #include "src/core/tsi/alts/crypt/gsec.h" -/** - * An alts_crypter interface for an ALTS record protocol providing - * seal/unseal functionality. The interface is thread-compatible. - */ +/// +/// An alts_crypter interface for an ALTS record protocol providing +/// seal/unseal functionality. The interface is thread-compatible. +/// typedef struct alts_crypter alts_crypter; -/** - * A typical usage of the interface would be - *------------------------------------------------------------------------------ - * // Perform a seal operation. We assume the gsec_aead_crypter instance - - * // client_aead_crypter is created beforehand with a 16-byte key and 12-byte - * // nonce length. - * - * alts_crypter* client = nullptr; - * char* client_error_in_creation = nullptr; - * unsigned char* data = nullptr; - * grpc_status_code client_status = - * alts_seal_crypter_create(client_aead_crypter, 1, 5, &client, - * &client_error_in_creation); - * if (client_status == GRPC_STATUS_OK) { - * size_t data_size = 100; - * size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(client); - * size_t data_allocated_size = data_size + num_overhead_bytes; - * data = gpr_malloc(data_allocated_size); - * char* client_error_in_seal = nullptr; - * // Client performs a seal operation. - * client_status = alts_crypter_process_in_place(client, data, - * data_allocated_size, - * &data_size, - * &client_error_in_seal); - * if (client_status != GRPC_STATUS_OK) { - * fprintf(stderr, "seal operation failed with error code:" - * "%d, message: %s\n", client_status, - * client_error_in_seal); - * } - * gpr_free(client_error_in_seal); - * } else { - * fprintf(stderr, "alts_crypter instance creation failed with error" - * "code: %d, message: %s\n", client_status, - * client_error_in_creation); - * } - * - * ... - * - * gpr_free(client_error_in_creation); - * alts_crypter_destroy(client); - * - * ... - * - * // Perform an unseal operation. We assume the gsec_aead_crypter instance - - * // server_aead_crypter is created beforehand with a 16-byte key and 12-byte - * // nonce length. The key used in the creation of gsec_aead_crypter instances - * // at server and client sides should be identical. - * - * alts_crypter* server = nullptr; - * char* server_error_in_creation = nullptr; - * grpc_status_code server_status = - * alts_unseal_crypter_create(server_aead_crypter, 0, 5, &server, - * &server_error_in_creation); - * if (server_status == GRPC_STATUS_OK) { - * size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(server); - * size_t data_size = 100 + num_overhead_bytes; - * size_t data_allocated_size = data_size; - * char* server_error_in_unseal = nullptr; - * // Server performs an unseal operation. - * server_status = alts_crypter_process_in_place(server, data, - * data_allocated_size, - * &data_size, - * &server_error_in_unseal); - * if (server_status != GRPC_STATUS_OK) { - * fprintf(stderr, "unseal operation failed with error code:" - * "%d, message: %s\n", server_status, - * server_error_in_unseal); - * } - * gpr_free(server_error_in_unseal); - * } else { - * fprintf(stderr, "alts_crypter instance creation failed with error" - * "code: %d, message: %s\n", server_status, - * server_error_in_creation); - * } - * - * ... - * - * gpr_free(data); - * gpr_free(server_error_in_creation); - * alts_crypter_destroy(server); - * - * ... - *------------------------------------------------------------------------------ - */ - -/* V-table for alts_crypter operations */ +/// +/// A typical usage of the interface would be +///------------------------------------------------------------------------------ +///// Perform a seal operation. We assume the gsec_aead_crypter instance - +///// client_aead_crypter is created beforehand with a 16-byte key and 12-byte +///// nonce length. +/// +/// alts_crypter* client = nullptr; +/// char* client_error_in_creation = nullptr; +/// unsigned char* data = nullptr; +/// grpc_status_code client_status = +/// alts_seal_crypter_create(client_aead_crypter, 1, 5, &client, +/// &client_error_in_creation); +/// if (client_status == GRPC_STATUS_OK) { +/// size_t data_size = 100; +/// size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(client); +/// size_t data_allocated_size = data_size + num_overhead_bytes; +/// data = gpr_malloc(data_allocated_size); +/// char* client_error_in_seal = nullptr; +/// // Client performs a seal operation. +/// client_status = alts_crypter_process_in_place(client, data, +/// data_allocated_size, +/// &data_size, +/// &client_error_in_seal); +/// if (client_status != GRPC_STATUS_OK) { +/// fprintf(stderr, "seal operation failed with error code:" +/// "%d, message: %s\n", client_status, +/// client_error_in_seal); +/// } +/// gpr_free(client_error_in_seal); +///} else { +/// fprintf(stderr, "alts_crypter instance creation failed with error" +/// "code: %d, message: %s\n", client_status, +/// client_error_in_creation); +///} +/// +///... +/// +/// gpr_free(client_error_in_creation); +/// alts_crypter_destroy(client); +/// +///... +/// +///// Perform an unseal operation. We assume the gsec_aead_crypter instance - +///// server_aead_crypter is created beforehand with a 16-byte key and 12-byte +///// nonce length. The key used in the creation of gsec_aead_crypter instances +///// at server and client sides should be identical. +/// +/// alts_crypter* server = nullptr; +/// char* server_error_in_creation = nullptr; +/// grpc_status_code server_status = +/// alts_unseal_crypter_create(server_aead_crypter, 0, 5, &server, +/// &server_error_in_creation); +/// if (server_status == GRPC_STATUS_OK) { +/// size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(server); +/// size_t data_size = 100 + num_overhead_bytes; +/// size_t data_allocated_size = data_size; +/// char* server_error_in_unseal = nullptr; +/// // Server performs an unseal operation. +/// server_status = alts_crypter_process_in_place(server, data, +/// data_allocated_size, +/// &data_size, +/// &server_error_in_unseal); +/// if (server_status != GRPC_STATUS_OK) { +/// fprintf(stderr, "unseal operation failed with error code:" +/// "%d, message: %s\n", server_status, +/// server_error_in_unseal); +/// } +/// gpr_free(server_error_in_unseal); +///} else { +/// fprintf(stderr, "alts_crypter instance creation failed with error" +/// "code: %d, message: %s\n", server_status, +/// server_error_in_creation); +///} +/// +///... +/// +/// gpr_free(data); +/// gpr_free(server_error_in_creation); +/// alts_crypter_destroy(server); +/// +///... +///------------------------------------------------------------------------------ +/// + +// V-table for alts_crypter operations typedef struct alts_crypter_vtable { size_t (*num_overhead_bytes)(const alts_crypter* crypter); grpc_status_code (*process_in_place)(alts_crypter* crypter, @@ -131,125 +131,125 @@ typedef struct alts_crypter_vtable { void (*destruct)(alts_crypter* crypter); } alts_crypter_vtable; -/* Main struct for alts_crypter interface */ +// Main struct for alts_crypter interface struct alts_crypter { const alts_crypter_vtable* vtable; }; -/** - * This method gets the number of overhead bytes needed for sealing data that - * is the difference in size between the protected and raw data. The counter - * value used in a seal or unseal operation is locally maintained (not sent or - * received from the other peer) and therefore, will not be counted as part of - * overhead bytes. - * - * - crypter: an alts_crypter instance. - * - * On success, the method returns the number of overhead bytes. Otherwise, it - * returns zero. - * - */ +/// +/// This method gets the number of overhead bytes needed for sealing data that +/// is the difference in size between the protected and raw data. The counter +/// value used in a seal or unseal operation is locally maintained (not sent or +/// received from the other peer) and therefore, will not be counted as part of +/// overhead bytes. +/// +///- crypter: an alts_crypter instance. +/// +/// On success, the method returns the number of overhead bytes. Otherwise, it +/// returns zero. +/// +/// size_t alts_crypter_num_overhead_bytes(const alts_crypter* crypter); -/** - * This method performs either a seal or an unseal operation depending on the - * alts_crypter instance - crypter passed to the method. If the crypter is - * an instance implementing a seal operation, the method will perform a seal - * operation. That is, it seals raw data and stores the result in-place, and the - * memory allocated for data must be at least data_length + - * alts_crypter_num_overhead_bytes(). If the crypter is an instance - * implementing an unseal operation, the method will perform an unseal - * operation. That is, it unseals protected data and stores the result in-place. - * The size of unsealed data will be data_length - - * alts_crypter_num_overhead_bytes(). Integrity tag will be verified during - * the unseal operation, and if verification fails, the data will be wiped. - * The counters used in both seal and unseal operations are managed internally. - * - * - crypter: an alts_crypter instance. - * - data: if the method performs a seal operation, the data represents raw data - * that needs to be sealed. It also plays the role of buffer to hold the - * protected data as a result of seal. If the method performs an unseal - * operation, the data represents protected data that needs to be unsealed. It - * also plays the role of buffer to hold raw data as a result of unseal. - * - data_allocated_size: the size of data buffer. The parameter is used to - * check whether the result of either seal or unseal can be safely written to - * the data buffer. - * - data_size: if the method performs a seal operation, data_size - * represents the size of raw data that needs to be sealed, and if the method - * performs an unseal operation, data_size represents the size of protected - * data that needs to be unsealed. - * - output_size: size of data written to the data buffer after a seal or an - * unseal operation. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is legal to pass nullptr into error_details and - * otherwise, the parameter should be freed with gpr_free. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method performs either a seal or an unseal operation depending on the +/// alts_crypter instance - crypter passed to the method. If the crypter is +/// an instance implementing a seal operation, the method will perform a seal +/// operation. That is, it seals raw data and stores the result in-place, and +/// the memory allocated for data must be at least data_length + +/// alts_crypter_num_overhead_bytes(). If the crypter is an instance +/// implementing an unseal operation, the method will perform an unseal +/// operation. That is, it unseals protected data and stores the result +/// in-place. The size of unsealed data will be data_length - +/// alts_crypter_num_overhead_bytes(). Integrity tag will be verified during +/// the unseal operation, and if verification fails, the data will be wiped. +/// The counters used in both seal and unseal operations are managed internally. +/// +///- crypter: an alts_crypter instance. +///- data: if the method performs a seal operation, the data represents raw data +/// that needs to be sealed. It also plays the role of buffer to hold the +/// protected data as a result of seal. If the method performs an unseal +/// operation, the data represents protected data that needs to be unsealed. It +/// also plays the role of buffer to hold raw data as a result of unseal. +///- data_allocated_size: the size of data buffer. The parameter is used to +/// check whether the result of either seal or unseal can be safely written to +/// the data buffer. +///- data_size: if the method performs a seal operation, data_size +/// represents the size of raw data that needs to be sealed, and if the method +/// performs an unseal operation, data_size represents the size of protected +/// data that needs to be unsealed. +///- output_size: size of data written to the data buffer after a seal or an +/// unseal operation. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is legal to pass nullptr into error_details and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code alts_crypter_process_in_place( alts_crypter* crypter, unsigned char* data, size_t data_allocated_size, size_t data_size, size_t* output_size, char** error_details); -/** - * This method creates an alts_crypter instance to be used to perform a seal - * operation, given a gsec_aead_crypter instance and a flag indicating if the - * created instance will be used at the client or server side. It takes - * ownership of gsec_aead_crypter instance. - * - * - gc: a gsec_aead_crypter instance used to perform AEAD encryption. - * - is_client: a flag indicating if the alts_crypter instance will be - * used at the client (is_client = true) or server (is_client = - * false) side. - * - overflow_size: overflow size of counter in bytes. - * - crypter: an alts_crypter instance to be returned from the method. - * - error_details: a buffer containing an error message if the method does - * not function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On success of creation, the method returns GRPC_STATUS_OK. - * Otherwise, it returns an error status code along with its details specified - * in error_details (if error_details is not nullptr). - */ +/// +/// This method creates an alts_crypter instance to be used to perform a seal +/// operation, given a gsec_aead_crypter instance and a flag indicating if the +/// created instance will be used at the client or server side. It takes +/// ownership of gsec_aead_crypter instance. +/// +///- gc: a gsec_aead_crypter instance used to perform AEAD encryption. +///- is_client: a flag indicating if the alts_crypter instance will be +/// used at the client (is_client = true) or server (is_client = +/// false) side. +///- overflow_size: overflow size of counter in bytes. +///- crypter: an alts_crypter instance to be returned from the method. +///- error_details: a buffer containing an error message if the method does +/// not function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success of creation, the method returns GRPC_STATUS_OK. +/// Otherwise, it returns an error status code along with its details specified +/// in error_details (if error_details is not nullptr). +/// grpc_status_code alts_seal_crypter_create(gsec_aead_crypter* gc, bool is_client, size_t overflow_size, alts_crypter** crypter, char** error_details); -/** - * This method creates an alts_crypter instance used to perform an unseal - * operation, given a gsec_aead_crypter instance and a flag indicating if the - * created instance will be used at the client or server side. It takes - * ownership of gsec_aead_crypter instance. - * - * - gc: a gsec_aead_crypter instance used to perform AEAD decryption. - * - is_client: a flag indicating if the alts_crypter instance will be - * used at the client (is_client = true) or server (is_client = - * false) side. - * - overflow_size: overflow size of counter in bytes. - * - crypter: an alts_crypter instance to be returned from the method. - * - error_details: a buffer containing an error message if the method does - * not function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On success of creation, the method returns GRPC_STATUS_OK. - * Otherwise, it returns an error status code along with its details specified - * in error_details (if error_details is not nullptr). - */ +/// +/// This method creates an alts_crypter instance used to perform an unseal +/// operation, given a gsec_aead_crypter instance and a flag indicating if the +/// created instance will be used at the client or server side. It takes +/// ownership of gsec_aead_crypter instance. +/// +///- gc: a gsec_aead_crypter instance used to perform AEAD decryption. +///- is_client: a flag indicating if the alts_crypter instance will be +/// used at the client (is_client = true) or server (is_client = +/// false) side. +///- overflow_size: overflow size of counter in bytes. +///- crypter: an alts_crypter instance to be returned from the method. +///- error_details: a buffer containing an error message if the method does +/// not function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success of creation, the method returns GRPC_STATUS_OK. +/// Otherwise, it returns an error status code along with its details specified +/// in error_details (if error_details is not nullptr). +/// grpc_status_code alts_unseal_crypter_create(gsec_aead_crypter* gc, bool is_client, size_t overflow_size, alts_crypter** crypter, char** error_details); -/** - * This method destroys an alts_crypter instance by de-allocating all of its - * occupied memory. A gsec_aead_crypter instance passed in at alts_crypter - * instance creation time will be destroyed in this method. - * - * - crypter: an alts_crypter instance. - */ +/// +/// This method destroys an alts_crypter instance by de-allocating all of its +/// occupied memory. A gsec_aead_crypter instance passed in at alts_crypter +/// instance creation time will be destroyed in this method. +/// +///- crypter: an alts_crypter instance. +/// void alts_crypter_destroy(alts_crypter* crypter); -#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_CRYPTER_H */ +#endif // GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_CRYPTER_H diff --git a/src/core/tsi/alts/frame_protector/alts_frame_protector.cc b/src/core/tsi/alts/frame_protector/alts_frame_protector.cc index aae92a4733c..bb62a5eb83a 100644 --- a/src/core/tsi/alts/frame_protector/alts_frame_protector.cc +++ b/src/core/tsi/alts/frame_protector/alts_frame_protector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -42,7 +42,7 @@ constexpr size_t kMaxFrameLength = 1024 * 1024; constexpr size_t kAltsRecordProtocolRekeyFrameLimit = 8; constexpr size_t kAltsRecordProtocolFrameLimit = 5; -/* Main struct for alts_frame_protector. */ +// Main struct for alts_frame_protector. struct alts_frame_protector { tsi_frame_protector base; alts_crypter* seal_crypter; @@ -90,20 +90,20 @@ static tsi_result alts_protect_flush(tsi_frame_protector* self, return TSI_INVALID_ARGUMENT; } alts_frame_protector* impl = reinterpret_cast(self); - /** - * If there's nothing to flush (i.e., in_place_protect_buffer is empty), - * we're done. - */ + /// + /// If there's nothing to flush (i.e., in_place_protect_buffer is empty), + /// we're done. + /// if (impl->in_place_protect_bytes_buffered == 0) { *protected_output_frames_size = 0; *still_pending_size = 0; return TSI_OK; } - /** - * If a new frame can start being processed, we encrypt the payload and reset - * the frame writer to point to in_place_protect_buffer that holds the newly - * sealed frame. - */ + /// + /// If a new frame can start being processed, we encrypt the payload and reset + /// the frame writer to point to in_place_protect_buffer that holds the newly + /// sealed frame. + /// if (alts_is_frame_writer_done(impl->writer)) { tsi_result result = seal(impl); if (result != TSI_OK) { @@ -115,12 +115,12 @@ static tsi_result alts_protect_flush(tsi_frame_protector* self, return TSI_INTERNAL_ERROR; } } - /** - * Write the sealed frame as much as possible to protected_output_frames. It's - * possible a frame will not be written out completely by a single flush - * (i.e., still_pending_size != 0), in which case the flush should be called - * iteratively until a complete frame has been written out. - */ + /// + /// Write the sealed frame as much as possible to protected_output_frames. + /// It's possible a frame will not be written out completely by a single flush + ///(i.e., still_pending_size != 0), in which case the flush should be called + /// iteratively until a complete frame has been written out. + /// size_t written_frame_bytes = *protected_output_frames_size; if (!alts_write_frame_bytes(impl->writer, protected_output_frames, &written_frame_bytes)) { @@ -129,10 +129,10 @@ static tsi_result alts_protect_flush(tsi_frame_protector* self, } *protected_output_frames_size = written_frame_bytes; *still_pending_size = alts_get_num_writer_bytes_remaining(impl->writer); - /** - * If the current frame has been finished processing (i.e., sealed and written - * out completely), we empty in_place_protect_buffer. - */ + /// + /// If the current frame has been finished processing (i.e., sealed and + /// written out completely), we empty in_place_protect_buffer. + /// if (alts_is_frame_writer_done(impl->writer)) { impl->in_place_protect_bytes_buffered = 0; } @@ -152,10 +152,10 @@ static tsi_result alts_protect(tsi_frame_protector* self, } alts_frame_protector* impl = reinterpret_cast(self); - /** - * If more payload can be buffered, we buffer it as much as possible to - * in_place_protect_buffer. - */ + /// + /// If more payload can be buffered, we buffer it as much as possible to + /// in_place_protect_buffer. + /// if (impl->in_place_protect_bytes_buffered + impl->overhead_length < max_encrypted_payload_bytes(impl)) { size_t bytes_to_buffer = std::min( @@ -172,12 +172,12 @@ static tsi_result alts_protect(tsi_frame_protector* self, } else { *unprotected_bytes_size = 0; } - /** - * If a full frame has been buffered, we output it. If the first condition - * holds, then there exists an unencrypted full frame. If the second - * condition holds, then there exists a full frame that has already been - * encrypted. - */ + /// + /// If a full frame has been buffered, we output it. If the first condition + /// holds, then there exists an unencrypted full frame. If the second + /// condition holds, then there exists a full frame that has already been + /// encrypted. + /// if (max_encrypted_payload_bytes(impl) == impl->in_place_protect_bytes_buffered + impl->overhead_length || max_encrypted_payload_bytes(impl) == @@ -213,10 +213,10 @@ static void ensure_buffer_size(alts_frame_protector* impl) { } size_t buffer_space_remaining = impl->max_unprotected_frame_size - alts_get_output_bytes_read(impl->reader); - /** - * Check if we need to resize in_place_unprotect_buffer in order to hold - * remaining bytes of a full frame. - */ + /// + /// Check if we need to resize in_place_unprotect_buffer in order to hold + /// remaining bytes of a full frame. + /// if (buffer_space_remaining < alts_get_reader_bytes_remaining(impl->reader)) { size_t buffer_len = alts_get_output_bytes_read(impl->reader) + alts_get_reader_bytes_remaining(impl->reader); @@ -243,11 +243,11 @@ static tsi_result alts_unprotect(tsi_frame_protector* self, return TSI_INVALID_ARGUMENT; } alts_frame_protector* impl = reinterpret_cast(self); - /** - * If a new frame can start being processed, we reset the frame reader to - * point to in_place_unprotect_buffer that will be used to hold deframed - * result. - */ + /// + /// If a new frame can start being processed, we reset the frame reader to + /// point to in_place_unprotect_buffer that will be used to hold deframed + /// result. + /// if (alts_is_frame_reader_done(impl->reader) && ((alts_get_output_buffer(impl->reader) == nullptr) || (alts_get_output_bytes_read(impl->reader) == @@ -259,12 +259,12 @@ static tsi_result alts_unprotect(tsi_frame_protector* self, } impl->in_place_unprotect_bytes_processed = 0; } - /** - * If a full frame has not yet been read, we read more bytes from - * protected_frames_bytes until a full frame has been read. We also need to - * make sure in_place_unprotect_buffer is large enough to hold a complete - * frame. - */ + /// + /// If a full frame has not yet been read, we read more bytes from + /// protected_frames_bytes until a full frame has been read. We also need to + /// make sure in_place_unprotect_buffer is large enough to hold a complete + /// frame. + /// if (!alts_is_frame_reader_done(impl->reader)) { ensure_buffer_size(impl); *protected_frames_bytes_size = @@ -281,10 +281,10 @@ static tsi_result alts_unprotect(tsi_frame_protector* self, } else { *protected_frames_bytes_size = 0; } - /** - * If a full frame has been read, we unseal it, and write out the - * deframed result to unprotected_bytes. - */ + /// + /// If a full frame has been read, we unseal it, and write out the + /// deframed result to unprotected_bytes. + /// if (alts_is_frame_reader_done(impl->reader)) { if (impl->in_place_unprotect_bytes_processed == 0) { tsi_result result = unseal(impl); @@ -378,11 +378,11 @@ tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size, gpr_free(error_details); return TSI_INTERNAL_ERROR; } - /** - * Set maximum frame size to be used by a frame protector. If it is nullptr, a - * default frame size will be used. Otherwise, the provided frame size will be - * adjusted (if not falling into a valid frame range) and used. - */ + /// + /// Set maximum frame size to be used by a frame protector. If it is nullptr, + /// a default frame size will be used. Otherwise, the provided frame size will + /// be adjusted (if not falling into a valid frame range) and used. + /// size_t max_protected_frame_size_to_set = kDefaultFrameLength; if (max_protected_frame_size != nullptr) { *max_protected_frame_size = diff --git a/src/core/tsi/alts/frame_protector/alts_frame_protector.h b/src/core/tsi/alts/frame_protector/alts_frame_protector.h index 321bffaed84..e68834b8298 100644 --- a/src/core/tsi/alts/frame_protector/alts_frame_protector.h +++ b/src/core/tsi/alts/frame_protector/alts_frame_protector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_FRAME_PROTECTOR_H #define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_FRAME_PROTECTOR_H @@ -27,29 +27,29 @@ typedef struct alts_frame_protector alts_frame_protector; -/** - * TODO: Add a parameter to the interface to support the use of - * different record protocols within a frame protector. - * - * This method creates a frame protector. - * - * - key: a symmetric key used to seal/unseal frames. - * - key_size: the size of symmetric key. - * - is_client: a flag indicating if the frame protector will be used at client - * (is_client = true) or server (is_client = false) side. - * - is_rekey: a flag indicating if the frame protector will use an AEAD with - * rekeying. - * - max_protected_frame_size: an in/out parameter indicating max frame size - * to be used by the frame protector. If it is nullptr, the default frame - * size will be used. Otherwise, the provided frame size will be adjusted (if - * not falling into a valid frame range) and used. - * - self: a pointer to the frame protector returned from the method. - * - * This method returns TSI_OK on success and TSI_INTERNAL_ERROR otherwise. - */ +/// +/// TODO: Add a parameter to the interface to support the use of +/// different record protocols within a frame protector. +/// +/// This method creates a frame protector. +/// +///- key: a symmetric key used to seal/unseal frames. +///- key_size: the size of symmetric key. +///- is_client: a flag indicating if the frame protector will be used at client +/// (is_client = true) or server (is_client = false) side. +///- is_rekey: a flag indicating if the frame protector will use an AEAD with +/// rekeying. +///- max_protected_frame_size: an in/out parameter indicating max frame size +/// to be used by the frame protector. If it is nullptr, the default frame +/// size will be used. Otherwise, the provided frame size will be adjusted (if +/// not falling into a valid frame range) and used. +///- self: a pointer to the frame protector returned from the method. +/// +/// This method returns TSI_OK on success and TSI_INTERNAL_ERROR otherwise. +/// tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size, bool is_client, bool is_rekey, size_t* max_protected_frame_size, tsi_frame_protector** self); -#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_FRAME_PROTECTOR_H */ +#endif // GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_FRAME_PROTECTOR_H diff --git a/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc b/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc index 0574ed5012e..3ff100bdb3f 100644 --- a/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc +++ b/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -99,7 +99,7 @@ alts_record_protocol_crypter* alts_crypter_create_common( if (status != GRPC_STATUS_OK) { return nullptr; } - /* Create a counter. */ + // Create a counter. status = alts_counter_create(is_client, counter_size, overflow_size, &rp_crypter->ctr, error_details); if (status != GRPC_STATUS_OK) { diff --git a/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h b/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h index 682a8f7e7a9..fa685696d76 100644 --- a/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h +++ b/src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_RECORD_PROTOCOL_CRYPTER_COMMON_H #define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_RECORD_PROTOCOL_CRYPTER_COMMON_H @@ -26,89 +26,88 @@ #include "src/core/tsi/alts/frame_protector/alts_counter.h" #include "src/core/tsi/alts/frame_protector/alts_crypter.h" -/** - * This file contains common implementation that will be used in both seal and - * unseal operations. - */ +/// +/// This file contains common implementation that will be used in both seal and +/// unseal operations. +/// -/** - * Main struct for alts_record_protocol_crypter that will be used in both - * seal and unseal operations. - */ +/// +/// Main struct for alts_record_protocol_crypter that will be used in both +/// seal and unseal operations. +/// typedef struct alts_record_protocol_crypter { alts_crypter base; gsec_aead_crypter* crypter; alts_counter* ctr; } alts_record_protocol_crypter; -/** - * This method performs input sanity checks on a subset of inputs to - * alts_crypter_process_in_place() for both seal and unseal operations. - * - * - rp_crypter: an alts_record_protocol_crypter instance. - * - data: it represents raw data that needs to be sealed in a seal operation or - * protected data that needs to be unsealed in an unseal operation. - * - output_size: size of data written to the data buffer after a seal or - * unseal operation. - * - error_details: a buffer containing an error message if any of checked - * inputs is nullptr. It is legal to pass nullptr into error_details and - * otherwise, the parameter should be freed with gpr_free. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method performs input sanity checks on a subset of inputs to +/// alts_crypter_process_in_place() for both seal and unseal operations. +/// +///- rp_crypter: an alts_record_protocol_crypter instance. +///- data: it represents raw data that needs to be sealed in a seal operation or +/// protected data that needs to be unsealed in an unseal operation. +///- output_size: size of data written to the data buffer after a seal or +/// unseal operation. +///- error_details: a buffer containing an error message if any of checked +/// inputs is nullptr. It is legal to pass nullptr into error_details and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code input_sanity_check( const alts_record_protocol_crypter* rp_crypter, const unsigned char* data, size_t* output_size, char** error_details); -/** - * This method increments the counter within an alts_record_protocol_crypter - * instance. - * - * - rp_crypter: an alts_record_protocol_crypter instance. - * - error_details: a buffer containing an error message if the method does not - * function correctly or the counter is wrapped. It is legal to pass nullptr - * into error_details and otherwise, the parameter should be freed with - * gpr_free. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, - * it returns an error status code along with its details specified in - * error_details (if error_details is not nullptr). - */ +/// +/// This method increments the counter within an alts_record_protocol_crypter +/// instance. +/// +///- rp_crypter: an alts_record_protocol_crypter instance. +///- error_details: a buffer containing an error message if the method does not +/// function correctly or the counter is wrapped. It is legal to pass nullptr +/// into error_details and otherwise, the parameter should be freed with +/// gpr_free. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, +/// it returns an error status code along with its details specified in +/// error_details (if error_details is not nullptr). +/// grpc_status_code increment_counter(alts_record_protocol_crypter* rp_crypter, char** error_details); -/** - * This method creates an alts_crypter instance, and populates the fields - * that are common to both seal and unseal operations. - * - * - crypter: a gsec_aead_crypter instance used to perform AEAD decryption. The - * function does not take ownership of crypter. - * - is_client: a flag indicating if the alts_crypter instance will be - * used at the client (is_client = true) or server (is_client = - * false) side. - * - overflow_size: overflow size of counter in bytes. - * - error_details: a buffer containing an error message if the method does - * not function correctly. It is legal to pass nullptr into error_details, and - * otherwise, the parameter should be freed with gpr_free. - * - * On success of creation, the method returns alts_record_protocol_crypter - * instance. Otherwise, it returns nullptr with its details specified in - * error_details (if error_details is not nullptr). - * - */ +/// +/// This method creates an alts_crypter instance, and populates the fields +/// that are common to both seal and unseal operations. +/// +///- crypter: a gsec_aead_crypter instance used to perform AEAD decryption. The +/// function does not take ownership of crypter. +///- is_client: a flag indicating if the alts_crypter instance will be +/// used at the client (is_client = true) or server (is_client = +/// false) side. +///- overflow_size: overflow size of counter in bytes. +///- error_details: a buffer containing an error message if the method does +/// not function correctly. It is legal to pass nullptr into error_details, and +/// otherwise, the parameter should be freed with gpr_free. +/// +/// On success of creation, the method returns alts_record_protocol_crypter +/// instance. Otherwise, it returns nullptr with its details specified in +/// error_details (if error_details is not nullptr). +/// +/// alts_record_protocol_crypter* alts_crypter_create_common( gsec_aead_crypter* crypter, bool is_client, size_t overflow_size, char** error_details); -/** - * For the following two methods, please refer to the corresponding API in - * alts_crypter.h for detailed specifications. - */ +/// +/// For the following two methods, please refer to the corresponding API in +/// alts_crypter.h for detailed specifications. +/// size_t alts_record_protocol_crypter_num_overhead_bytes(const alts_crypter* c); void alts_record_protocol_crypter_destruct(alts_crypter* c); -#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_RECORD_PROTOCOL_CRYPTER_COMMON_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_ALTS_RECORD_PROTOCOL_CRYPTER_COMMON_H diff --git a/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc b/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc index f407831613a..8b9136cc0b8 100644 --- a/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc +++ b/src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -31,16 +31,16 @@ static void maybe_copy_error_msg(const char* src, char** dst) { } } -/* Perform input santity check for a seal operation. */ +// Perform input santity check for a seal operation. static grpc_status_code seal_check(alts_crypter* c, const unsigned char* data, size_t data_allocated_size, size_t data_size, size_t* output_size, char** error_details) { - /* Do common input sanity check. */ + // Do common input sanity check. grpc_status_code status = input_sanity_check( reinterpret_cast(c), data, output_size, error_details); if (status != GRPC_STATUS_OK) return status; - /* Do seal-specific check. */ + // Do seal-specific check. size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(reinterpret_cast(c)); if (data_size == 0) { @@ -66,7 +66,7 @@ static grpc_status_code alts_seal_crypter_process_in_place( if (status != GRPC_STATUS_OK) { return status; } - /* Do AEAD encryption. */ + // Do AEAD encryption. alts_record_protocol_crypter* rp_crypter = reinterpret_cast(c); status = gsec_aead_crypter_encrypt( @@ -77,7 +77,7 @@ static grpc_status_code alts_seal_crypter_process_in_place( if (status != GRPC_STATUS_OK) { return status; } - /* Increment the crypter counter. */ + // Increment the crypter counter. return increment_counter(rp_crypter, error_details); } diff --git a/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc b/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc index a5b70032313..805a93fc19d 100644 --- a/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc +++ b/src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -31,19 +31,19 @@ static void maybe_copy_error_msg(const char* src, char** dst) { } } -/* Perform input santity check. */ +// Perform input santity check. static grpc_status_code unseal_check(alts_crypter* c, const unsigned char* data, size_t /*data_allocated_size*/, size_t data_size, size_t* output_size, char** error_details) { - /* Do common input sanity check. */ + // Do common input sanity check. grpc_status_code status = input_sanity_check( reinterpret_cast(c), data, output_size, error_details); if (status != GRPC_STATUS_OK) { return status; } - /* Do unseal-specific input check. */ + // Do unseal-specific input check. size_t num_overhead_bytes = alts_crypter_num_overhead_bytes(reinterpret_cast(c)); if (num_overhead_bytes > data_size) { @@ -62,7 +62,7 @@ static grpc_status_code alts_unseal_crypter_process_in_place( if (status != GRPC_STATUS_OK) { return status; } - /* Do AEAD decryption. */ + // Do AEAD decryption. alts_record_protocol_crypter* rp_crypter = reinterpret_cast(c); status = gsec_aead_crypter_decrypt( @@ -73,7 +73,7 @@ static grpc_status_code alts_unseal_crypter_process_in_place( if (status != GRPC_STATUS_OK) { return status; } - /* Increment the crypter counter. */ + // Increment the crypter counter. return increment_counter(rp_crypter, error_details); } diff --git a/src/core/tsi/alts/frame_protector/frame_handler.cc b/src/core/tsi/alts/frame_protector/frame_handler.cc index 0237f24707b..5fe8bb8c864 100644 --- a/src/core/tsi/alts/frame_protector/frame_handler.cc +++ b/src/core/tsi/alts/frame_protector/frame_handler.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -31,7 +31,7 @@ #include "src/core/lib/gprpp/memory.h" -/* Use little endian to interpret a string of bytes as uint32_t. */ +// Use little endian to interpret a string of bytes as uint32_t. static uint32_t load_32_le(const unsigned char* buffer) { return (static_cast(buffer[3]) << 24) | (static_cast(buffer[2]) << 16) | @@ -39,7 +39,7 @@ static uint32_t load_32_le(const unsigned char* buffer) { static_cast(buffer[0]); } -/* Store uint32_t as a string of little endian bytes. */ +// Store uint32_t as a string of little endian bytes. static void store_32_le(uint32_t value, unsigned char* buffer) { buffer[3] = static_cast(value >> 24) & 0xFF; buffer[2] = static_cast(value >> 16) & 0xFF; @@ -47,7 +47,7 @@ static void store_32_le(uint32_t value, unsigned char* buffer) { buffer[0] = static_cast(value) & 0xFF; } -/* Frame writer implementation. */ +// Frame writer implementation. alts_frame_writer* alts_create_frame_writer() { return grpc_core::Zalloc(); } @@ -79,7 +79,7 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output, return true; } size_t bytes_written = 0; - /* Write some header bytes, if needed. */ + // Write some header bytes, if needed. if (writer->header_bytes_written != sizeof(writer->header_buffer)) { size_t bytes_to_write = std::min(*bytes_size, @@ -95,7 +95,7 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output, return true; } } - /* Write some non-header bytes. */ + // Write some non-header bytes. size_t bytes_to_write = std::min(writer->input_size - writer->input_bytes_written, *bytes_size); memcpy(output, writer->input_buffer, bytes_to_write); @@ -118,7 +118,7 @@ size_t alts_get_num_writer_bytes_remaining(alts_frame_writer* writer) { void alts_destroy_frame_writer(alts_frame_writer* writer) { gpr_free(writer); } -/* Frame reader implementation. */ +// Frame reader implementation. alts_frame_reader* alts_create_frame_reader() { alts_frame_reader* reader = grpc_core::Zalloc(); return reader; @@ -164,7 +164,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader, return true; } size_t bytes_processed = 0; - /* Process the header, if needed. */ + // Process the header, if needed. if (reader->header_bytes_read != sizeof(reader->header_buffer)) { size_t bytes_to_write = std::min( *bytes_size, sizeof(reader->header_buffer) - reader->header_bytes_read); @@ -197,7 +197,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader, } reader->bytes_remaining = frame_length - kFrameMessageTypeFieldSize; } - /* Process the non-header bytes. */ + // Process the non-header bytes. size_t bytes_to_write = std::min(*bytes_size, reader->bytes_remaining); memcpy(reader->output_buffer, bytes, bytes_to_write); reader->output_buffer += bytes_to_write; diff --git a/src/core/tsi/alts/frame_protector/frame_handler.h b/src/core/tsi/alts/frame_protector/frame_handler.h index a703ff40d30..541db42a767 100644 --- a/src/core/tsi/alts/frame_protector/frame_handler.h +++ b/src/core/tsi/alts/frame_protector/frame_handler.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_FRAME_HANDLER_H #define GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_FRAME_HANDLER_H @@ -31,15 +31,15 @@ const size_t kFrameMaxSize = 1024 * 1024; const size_t kFrameHeaderSize = kFrameLengthFieldSize + kFrameMessageTypeFieldSize; -/** - * Implementation of frame reader and frame writer. All APIs in the - * header are thread-compatible. - */ +/// +/// Implementation of frame reader and frame writer. All APIs in the +/// header are thread-compatible. +/// -/** - * Main struct for a frame writer. It reads frames from an input buffer, and - * writes the contents as raw bytes. It does not own the input buffer. - */ +/// +/// Main struct for a frame writer. It reads frames from an input buffer, and +/// writes the contents as raw bytes. It does not own the input buffer. +/// typedef struct alts_frame_writer { const unsigned char* input_buffer; unsigned char header_buffer[kFrameHeaderSize]; @@ -48,10 +48,10 @@ typedef struct alts_frame_writer { size_t input_size; } alts_frame_writer; -/** - * Main struct for a frame reader. It reads raw bytes and puts the framed - * result into an output buffer. It does not own the output buffer. - */ +/// +/// Main struct for a frame reader. It reads raw bytes and puts the framed +/// result into an output buffer. It does not own the output buffer. +/// typedef struct alts_frame_reader { unsigned char* output_buffer; unsigned char header_buffer[kFrameHeaderSize]; @@ -60,177 +60,177 @@ typedef struct alts_frame_reader { size_t bytes_remaining; } alts_frame_reader; -/** - * This method creates a frame writer instance and initializes its internal - * states. - */ +/// +/// This method creates a frame writer instance and initializes its internal +/// states. +/// alts_frame_writer* alts_create_frame_writer(); -/** - * This method resets internal states of a frame writer and prepares to write - * a single frame. It does not take ownership of payload_buffer. - * The payload_buffer must outlive the writer. - * - * - writer: a frame writer instance. - * - buffer: a buffer storing full payload data to be framed. - * - length: size of payload data. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method resets internal states of a frame writer and prepares to write +/// a single frame. It does not take ownership of payload_buffer. +/// The payload_buffer must outlive the writer. +/// +///- writer: a frame writer instance. +///- buffer: a buffer storing full payload data to be framed. +///- length: size of payload data. +/// +/// The method returns true on success and false otherwise. +/// bool alts_reset_frame_writer(alts_frame_writer* writer, const unsigned char* buffer, size_t length); -/** - * This method writes up to bytes_size bytes of a frame to output. - * - * - writer: a frame writer instance. - * - output: an output buffer used to store the frame. - * - bytes_size: an in/out parameter that stores the size of output buffer - * before the call, and gets written the number of frame bytes written to the - * buffer. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method writes up to bytes_size bytes of a frame to output. +/// +///- writer: a frame writer instance. +///- output: an output buffer used to store the frame. +///- bytes_size: an in/out parameter that stores the size of output buffer +/// before the call, and gets written the number of frame bytes written to the +/// buffer. +/// +/// The method returns true on success and false otherwise. +/// bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output, size_t* bytes_size); -/** - * This method checks if a reset can be called to write a new frame. It returns - * true if it's the first time to frame a payload, or the current frame has - * been finished processing. It returns false if it's not ready yet to start a - * new frame (e.g., more payload data needs to be accumulated to process the - * current frame). - * - * if (alts_is_frame_writer_done(writer)) { - * // a new frame can be written, call reset. - * alts_reset_frame_writer(writer, payload_buffer, payload_size); - * } else { - * // accumulate more payload data until a full frame can be written. - * } - * - * - writer: a frame writer instance. - */ +/// +/// This method checks if a reset can be called to write a new frame. It returns +/// true if it's the first time to frame a payload, or the current frame has +/// been finished processing. It returns false if it's not ready yet to start a +/// new frame (e.g., more payload data needs to be accumulated to process the +/// current frame). +/// +/// if (alts_is_frame_writer_done(writer)) { +/// // a new frame can be written, call reset. +/// alts_reset_frame_writer(writer, payload_buffer, payload_size); +///} else { +/// // accumulate more payload data until a full frame can be written. +///} +/// +///- writer: a frame writer instance. +/// bool alts_is_frame_writer_done(alts_frame_writer* writer); -/** - * This method returns the number of bytes left to write before a complete frame - * is formed. - * - * - writer: a frame writer instance. - */ +/// +/// This method returns the number of bytes left to write before a complete +/// frame is formed. +/// +///- writer: a frame writer instance. +/// size_t alts_get_num_writer_bytes_remaining(alts_frame_writer* writer); -/** - * This method destroys a frame writer instance. - * - * - writer: a frame writer instance. - */ +/// +/// This method destroys a frame writer instance. +/// +///- writer: a frame writer instance. +/// void alts_destroy_frame_writer(alts_frame_writer* writer); -/** - * This method creates a frame reader instance and initializes its internal - * states. - */ +/// +/// This method creates a frame reader instance and initializes its internal +/// states. +/// alts_frame_reader* alts_create_frame_reader(); -/** - * This method resets internal states of a frame reader (including setting its - * output_buffer with buffer), and prepares to write processed bytes to - * an output_buffer. It does not take ownership of buffer. The buffer must - * outlive reader. - * - * - reader: a frame reader instance. - * - buffer: an output buffer used to store deframed results. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method resets internal states of a frame reader (including setting its +/// output_buffer with buffer), and prepares to write processed bytes to +/// an output_buffer. It does not take ownership of buffer. The buffer must +/// outlive reader. +/// +///- reader: a frame reader instance. +///- buffer: an output buffer used to store deframed results. +/// +/// The method returns true on success and false otherwise. +/// bool alts_reset_frame_reader(alts_frame_reader* reader, unsigned char* buffer); -/** - * This method processes up to the number of bytes given in bytes_size. It may - * choose not to process all the bytes, if, for instance, more bytes are - * given to the method than required to complete the current frame. - * - * - reader: a frame reader instance. - * - bytes: a buffer that stores data to be processed. - * - bytes_size: an in/out parameter that stores the size of bytes before the - * call and gets written the number of bytes processed. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method processes up to the number of bytes given in bytes_size. It may +/// choose not to process all the bytes, if, for instance, more bytes are +/// given to the method than required to complete the current frame. +/// +///- reader: a frame reader instance. +///- bytes: a buffer that stores data to be processed. +///- bytes_size: an in/out parameter that stores the size of bytes before the +/// call and gets written the number of bytes processed. +/// +/// The method returns true on success and false otherwise. +/// bool alts_read_frame_bytes(alts_frame_reader* reader, const unsigned char* bytes, size_t* bytes_size); -/** - * This method checks if a frame length has been read. - * - * - reader: a frame reader instance. - * - * The method returns true if a frame length has been read and false otherwise. - */ +/// +/// This method checks if a frame length has been read. +/// +///- reader: a frame reader instance. +/// +/// The method returns true if a frame length has been read and false otherwise. +/// bool alts_has_read_frame_length(alts_frame_reader* reader); -/** - * This method returns the number of bytes the frame reader intends to write. - * It may only be called if alts_has_read_frame_length() returns true. - * - * - reader: a frame reader instance. - */ +/// +/// This method returns the number of bytes the frame reader intends to write. +/// It may only be called if alts_has_read_frame_length() returns true. +/// +///- reader: a frame reader instance. +/// size_t alts_get_reader_bytes_remaining(alts_frame_reader* reader); -/** - * This method resets output_buffer but does not otherwise modify other internal - * states of a frame reader instance. After being set, the new output_buffer - * will hold the deframed payload held by the original output_buffer. It does - * not take ownership of buffer. The buffer must outlive the reader. - * To distinguish between two reset methods on a frame reader, - * - * if (alts_fh_is_frame_reader_done(reader)) { - * // if buffer contains a full payload to be deframed, call reset. - * alts_reset_frame_reader(reader, buffer); - * } - * - * // if remaining buffer space is not enough to hold a full payload - * if (buffer_space_remaining < alts_get_reader_bytes_remaining(reader)) { - * // allocate enough space for a new buffer, copy back data processed so far, - * // and call reset. - * alts_reset_reader_output_buffer(reader, new_buffer). - * } - * - * - reader: a frame reader instance. - * - buffer: a buffer used to set reader's output_buffer. - */ +/// +/// This method resets output_buffer but does not otherwise modify other +/// internal states of a frame reader instance. After being set, the new +/// output_buffer will hold the deframed payload held by the original +/// output_buffer. It does not take ownership of buffer. The buffer must outlive +/// the reader. To distinguish between two reset methods on a frame reader, +/// +/// if (alts_fh_is_frame_reader_done(reader)) { +/// // if buffer contains a full payload to be deframed, call reset. +/// alts_reset_frame_reader(reader, buffer); +///} +/// +///// if remaining buffer space is not enough to hold a full payload +/// if (buffer_space_remaining < alts_get_reader_bytes_remaining(reader)) { +/// // allocate enough space for a new buffer, copy back data processed so far, +/// // and call reset. +/// alts_reset_reader_output_buffer(reader, new_buffer). +///} +/// +///- reader: a frame reader instance. +///- buffer: a buffer used to set reader's output_buffer. +/// void alts_reset_reader_output_buffer(alts_frame_reader* reader, unsigned char* buffer); -/** - * This method checks if reset can be called to start processing a new frame. - * If true and reset was previously called, a full frame has been processed and - * the content of the frame is available in output_buffer. +/// +/// This method checks if reset can be called to start processing a new frame. +/// If true and reset was previously called, a full frame has been processed and +/// the content of the frame is available in output_buffer. - * - reader: a frame reader instance. - */ +///- reader: a frame reader instance. +/// bool alts_is_frame_reader_done(alts_frame_reader* reader); -/** - * This method returns output_bytes_read of a frame reader instance. - * - * - reader: a frame reader instance. - */ +/// +/// This method returns output_bytes_read of a frame reader instance. +/// +///- reader: a frame reader instance. +/// size_t alts_get_output_bytes_read(alts_frame_reader* reader); -/** - * This method returns output_buffer of a frame reader instance. - * - * - reader: a frame reader instance. - */ +/// +/// This method returns output_buffer of a frame reader instance. +/// +///- reader: a frame reader instance. +/// unsigned char* alts_get_output_buffer(alts_frame_reader* reader); -/** - * This method destroys a frame reader instance. - * - * - reader: a frame reader instance. - */ +/// +/// This method destroys a frame reader instance. +/// +///- reader: a frame reader instance. +/// void alts_destroy_frame_reader(alts_frame_reader* reader); -#endif /* GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_FRAME_HANDLER_H */ +#endif // GRPC_CORE_TSI_ALTS_FRAME_PROTECTOR_FRAME_HANDLER_H diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc index 3742e2fa20c..9e6fecd7e4c 100644 --- a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +++ b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -53,59 +53,59 @@ struct recv_message_result { typedef struct alts_grpc_handshaker_client { alts_handshaker_client base; - /* One ref is held by the entity that created this handshaker_client, and - * another ref is held by the pending RECEIVE_STATUS_ON_CLIENT op. */ + // One ref is held by the entity that created this handshaker_client, and + // another ref is held by the pending RECEIVE_STATUS_ON_CLIENT op. gpr_refcount refs; alts_tsi_handshaker* handshaker; grpc_call* call; - /* A pointer to a function handling the interaction with handshaker service. - * That is, it points to grpc_call_start_batch_and_execute when the handshaker - * client is used in a non-testing use case and points to a custom function - * that validates the data to be sent to handshaker service in a testing use - * case. */ + // A pointer to a function handling the interaction with handshaker service. + // That is, it points to grpc_call_start_batch_and_execute when the handshaker + // client is used in a non-testing use case and points to a custom function + // that validates the data to be sent to handshaker service in a testing use + // case. alts_grpc_caller grpc_caller; - /* A gRPC closure to be scheduled when the response from handshaker service - * is received. It will be initialized with the injected grpc RPC callback. */ + // A gRPC closure to be scheduled when the response from handshaker service + // is received. It will be initialized with the injected grpc RPC callback. grpc_closure on_handshaker_service_resp_recv; - /* Buffers containing information to be sent (or received) to (or from) the - * handshaker service. */ + // Buffers containing information to be sent (or received) to (or from) the + // handshaker service. grpc_byte_buffer* send_buffer = nullptr; grpc_byte_buffer* recv_buffer = nullptr; // Used to inject a read failure from tests. bool inject_read_failure = false; - /* Initial metadata to be received from handshaker service. */ + // Initial metadata to be received from handshaker service. grpc_metadata_array recv_initial_metadata; - /* A callback function provided by an application to be invoked when response - * is received from handshaker service. */ + // A callback function provided by an application to be invoked when response + // is received from handshaker service. tsi_handshaker_on_next_done_cb cb; void* user_data; - /* ALTS credential options passed in from the caller. */ + // ALTS credential options passed in from the caller. grpc_alts_credentials_options* options; - /* target name information to be passed to handshaker service for server - * authorization check. */ + // target name information to be passed to handshaker service for server + // authorization check. grpc_slice target_name; - /* boolean flag indicating if the handshaker client is used at client - * (is_client = true) or server (is_client = false) side. */ + // boolean flag indicating if the handshaker client is used at client + // (is_client = true) or server (is_client = false) side. bool is_client; - /* a temporary store for data received from handshaker service used to extract - * unused data. */ + // a temporary store for data received from handshaker service used to extract + // unused data. grpc_slice recv_bytes; - /* a buffer containing data to be sent to the grpc client or server's peer. */ + // a buffer containing data to be sent to the grpc client or server's peer. unsigned char* buffer; size_t buffer_size; - /** callback for receiving handshake call status */ + /// callback for receiving handshake call status grpc_closure on_status_received; - /** gRPC status code of handshake call */ + /// gRPC status code of handshake call grpc_status_code handshake_status_code = GRPC_STATUS_OK; - /** gRPC status details of handshake call */ + /// gRPC status details of handshake call grpc_slice handshake_status_details; - /* mu synchronizes all fields below including their internal fields. */ + // mu synchronizes all fields below including their internal fields. grpc_core::Mutex mu; - /* indicates if the handshaker call's RECV_STATUS_ON_CLIENT op is done. */ + // indicates if the handshaker call's RECV_STATUS_ON_CLIENT op is done. bool receive_status_finished = false; - /* if non-null, contains arguments to complete a TSI next callback. */ + // if non-null, contains arguments to complete a TSI next callback. recv_message_result* pending_recv_message_result = nullptr; - /* Maximum frame size used by frame protector. */ + // Maximum frame size used by frame protector. size_t max_frame_size; // If non-null, will be populated with an error string upon error. std::string* error; @@ -198,7 +198,7 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, reinterpret_cast(c); grpc_byte_buffer* recv_buffer = client->recv_buffer; alts_tsi_handshaker* handshaker = client->handshaker; - /* Invalid input check. */ + // Invalid input check. if (client->cb == nullptr) { gpr_log(GPR_ERROR, "client->cb is nullptr in alts_tsi_handshaker_handle_response()"); @@ -213,14 +213,14 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, nullptr, 0, nullptr); return; } - /* TSI handshake has been shutdown. */ + // TSI handshake has been shutdown. if (alts_tsi_handshaker_has_shutdown(handshaker)) { gpr_log(GPR_INFO, "TSI handshake shutdown"); handle_response_done(client, TSI_HANDSHAKE_SHUTDOWN, "TSI handshake shutdown", nullptr, 0, nullptr); return; } - /* Check for failed grpc read. */ + // Check for failed grpc read. if (!is_ok || client->inject_read_failure) { gpr_log(GPR_INFO, "read failed on grpc call to handshaker service"); handle_response_done(client, TSI_INTERNAL_ERROR, @@ -242,7 +242,7 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, alts_tsi_utils_deserialize_response(recv_buffer, arena.ptr()); grpc_byte_buffer_destroy(client->recv_buffer); client->recv_buffer = nullptr; - /* Invalid handshaker response check. */ + // Invalid handshaker response check. if (resp == nullptr) { gpr_log(GPR_ERROR, "alts_tsi_utils_deserialize_response() failed"); handle_response_done(client, TSI_DATA_CORRUPTED, @@ -406,14 +406,14 @@ class HandshakeQueue { }; gpr_once g_queued_handshakes_init = GPR_ONCE_INIT; -/* Using separate queues for client and server handshakes is a - * hack that's mainly intended to satisfy the alts_concurrent_connectivity_test, - * which runs many concurrent handshakes where both endpoints - * are in the same process; this situation is problematic with a - * single queue because we have a high chance of using up all outstanding - * slots in the queue, such that there aren't any - * mutual client/server handshakes outstanding at the same time and - * able to make progress. */ +// Using separate queues for client and server handshakes is a +// hack that's mainly intended to satisfy the alts_concurrent_connectivity_test, +// which runs many concurrent handshakes where both endpoints +// are in the same process; this situation is problematic with a +// single queue because we have a high chance of using up all outstanding +// slots in the queue, such that there aren't any +// mutual client/server handshakes outstanding at the same time and +// able to make progress. HandshakeQueue* g_client_handshake_queue; HandshakeQueue* g_server_handshake_queue; @@ -440,10 +440,10 @@ void HandshakeDone(bool is_client) { }; // namespace -/** - * Populate grpc operation data with the fields of ALTS handshaker client and - * make a grpc call. - */ +/// +/// Populate grpc operation data with the fields of ALTS handshaker client and +/// make a grpc call. +/// static tsi_result make_grpc_call(alts_handshaker_client* c, bool is_start) { GPR_ASSERT(c != nullptr); alts_grpc_handshaker_client* client = @@ -477,8 +477,8 @@ static void on_status_received(void* arg, grpc_error_handle error) { alts_grpc_handshaker_client_unref(client); } -/* Serializes a grpc_gcp_HandshakerReq message into a buffer and returns newly - * grpc_byte_buffer holding it. */ +// Serializes a grpc_gcp_HandshakerReq message into a buffer and returns newly +// grpc_byte_buffer holding it. static grpc_byte_buffer* get_serialized_handshaker_req( grpc_gcp_HandshakerReq* req, upb_Arena* arena) { size_t buf_length; @@ -492,7 +492,7 @@ static grpc_byte_buffer* get_serialized_handshaker_req( return byte_buffer; } -/* Create and populate a client_start handshaker request, then serialize it. */ +// Create and populate a client_start handshaker request, then serialize it. static grpc_byte_buffer* get_serialized_start_client( alts_handshaker_client* c) { GPR_ASSERT(c != nullptr); @@ -557,7 +557,7 @@ static tsi_result handshaker_client_start_client(alts_handshaker_client* c) { return result; } -/* Create and populate a start_server handshaker request, then serialize it. */ +// Create and populate a start_server handshaker request, then serialize it. static grpc_byte_buffer* get_serialized_start_server( alts_handshaker_client* c, grpc_slice* bytes_received) { GPR_ASSERT(c != nullptr); @@ -616,7 +616,7 @@ static tsi_result handshaker_client_start_server(alts_handshaker_client* c, return result; } -/* Create and populate a next handshaker request, then serialize it. */ +// Create and populate a next handshaker request, then serialize it. static grpc_byte_buffer* get_serialized_next(grpc_slice* bytes_received) { GPR_ASSERT(bytes_received != nullptr); upb::Arena arena; diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_client.h b/src/core/tsi/alts/handshaker/alts_handshaker_client.h index a4591b548bd..fe7caafa402 100644 --- a/src/core/tsi/alts/handshaker/alts_handshaker_client.h +++ b/src/core/tsi/alts/handshaker/alts_handshaker_client.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_CLIENT_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_CLIENT_H @@ -38,19 +38,19 @@ const size_t kAltsAes128GcmRekeyKeyLength = 44; typedef struct alts_tsi_handshaker alts_tsi_handshaker; -/** - * A ALTS handshaker client interface. It is used to communicate with - * ALTS handshaker service by scheduling a handshaker request that could be one - * of client_start, server_start, and next handshaker requests. All APIs in the - * header are thread-compatible. - */ +/// +/// A ALTS handshaker client interface. It is used to communicate with +/// ALTS handshaker service by scheduling a handshaker request that could be one +/// of client_start, server_start, and next handshaker requests. All APIs in the +/// header are thread-compatible. +/// typedef struct alts_handshaker_client alts_handshaker_client; -/* A function that makes the grpc call to the handshaker service. */ +// A function that makes the grpc call to the handshaker service. typedef grpc_call_error (*alts_grpc_caller)(grpc_call* call, const grpc_op* ops, size_t nops, grpc_closure* tag); -/* V-table for ALTS handshaker client operations. */ +// V-table for ALTS handshaker client operations. typedef struct alts_handshaker_client_vtable { tsi_result (*client_start)(alts_handshaker_client* client); tsi_result (*server_start)(alts_handshaker_client* client, @@ -61,83 +61,83 @@ typedef struct alts_handshaker_client_vtable { void (*destruct)(alts_handshaker_client* client); } alts_handshaker_client_vtable; -/** - * This method schedules a client_start handshaker request to ALTS handshaker - * service. - * - * - client: ALTS handshaker client instance. - * - * It returns TSI_OK on success and an error status code on failure. - */ +/// +/// This method schedules a client_start handshaker request to ALTS handshaker +/// service. +/// +///- client: ALTS handshaker client instance. +/// +/// It returns TSI_OK on success and an error status code on failure. +/// tsi_result alts_handshaker_client_start_client(alts_handshaker_client* client); -/** - * This method schedules a server_start handshaker request to ALTS handshaker - * service. - * - * - client: ALTS handshaker client instance. - * - bytes_received: bytes in out_frames returned from the peer's handshaker - * response. - * - * It returns TSI_OK on success and an error status code on failure. - */ +/// +/// This method schedules a server_start handshaker request to ALTS handshaker +/// service. +/// +///- client: ALTS handshaker client instance. +///- bytes_received: bytes in out_frames returned from the peer's handshaker +/// response. +/// +/// It returns TSI_OK on success and an error status code on failure. +/// tsi_result alts_handshaker_client_start_server(alts_handshaker_client* client, grpc_slice* bytes_received); -/** - * This method schedules a next handshaker request to ALTS handshaker service. - * - * - client: ALTS handshaker client instance. - * - bytes_received: bytes in out_frames returned from the peer's handshaker - * response. - * - * It returns TSI_OK on success and an error status code on failure. - */ +/// +/// This method schedules a next handshaker request to ALTS handshaker service. +/// +///- client: ALTS handshaker client instance. +///- bytes_received: bytes in out_frames returned from the peer's handshaker +/// response. +/// +/// It returns TSI_OK on success and an error status code on failure. +/// tsi_result alts_handshaker_client_next(alts_handshaker_client* client, grpc_slice* bytes_received); -/** - * This method cancels previously scheduled, but yet executed handshaker - * requests to ALTS handshaker service. After this operation, the handshake - * will be shutdown, and no more handshaker requests will get scheduled. - * - * - client: ALTS handshaker client instance. - */ +/// +/// This method cancels previously scheduled, but yet executed handshaker +/// requests to ALTS handshaker service. After this operation, the handshake +/// will be shutdown, and no more handshaker requests will get scheduled. +/// +///- client: ALTS handshaker client instance. +/// void alts_handshaker_client_shutdown(alts_handshaker_client* client); -/** - * This method destroys an ALTS handshaker client. - * - * - client: an ALTS handshaker client instance. - */ +/// +/// This method destroys an ALTS handshaker client. +/// +///- client: an ALTS handshaker client instance. +/// void alts_handshaker_client_destroy(alts_handshaker_client* client); -/** - * This method creates an ALTS handshaker client. - * - * - handshaker: ALTS TSI handshaker to which the created handshaker client - * belongs to. - * - channel: grpc channel to ALTS handshaker service. - * - handshaker_service_url: address of ALTS handshaker service in the format of - * "host:port". - * - interested_parties: set of pollsets interested in this connection. - * - options: ALTS credentials options containing information passed from TSI - * caller (e.g., rpc protocol versions) - * - target_name: the name of the endpoint that the channel is connecting to, - * and will be used for secure naming check - * - grpc_cb: gRPC provided callbacks passed from TSI handshaker. - * - cb: callback to be executed when tsi_handshaker_next API compltes. - * - user_data: argument passed to cb. - * - vtable_for_testing: ALTS handshaker client vtable instance used for - * testing purpose. - * - is_client: a boolean value indicating if the created handshaker client is - * used at the client (is_client = true) or server (is_client = false) side. - * - max_frame_size: Maximum frame size used by frame protector (User specified - * maximum frame size if present or default max frame size). - * - * It returns the created ALTS handshaker client on success, and NULL - * on failure. - */ +/// +/// This method creates an ALTS handshaker client. +/// +///- handshaker: ALTS TSI handshaker to which the created handshaker client +/// belongs to. +///- channel: grpc channel to ALTS handshaker service. +///- handshaker_service_url: address of ALTS handshaker service in the format of +/// "host:port". +///- interested_parties: set of pollsets interested in this connection. +///- options: ALTS credentials options containing information passed from TSI +/// caller (e.g., rpc protocol versions) +///- target_name: the name of the endpoint that the channel is connecting to, +/// and will be used for secure naming check +///- grpc_cb: gRPC provided callbacks passed from TSI handshaker. +///- cb: callback to be executed when tsi_handshaker_next API compltes. +///- user_data: argument passed to cb. +///- vtable_for_testing: ALTS handshaker client vtable instance used for +/// testing purpose. +///- is_client: a boolean value indicating if the created handshaker client is +/// used at the client (is_client = true) or server (is_client = false) side. +///- max_frame_size: Maximum frame size used by frame protector (User specified +/// maximum frame size if present or default max frame size). +/// +/// It returns the created ALTS handshaker client on success, and NULL +/// on failure. +/// alts_handshaker_client* alts_grpc_handshaker_client_create( alts_tsi_handshaker* handshaker, grpc_channel* channel, const char* handshaker_service_url, grpc_pollset_set* interested_parties, @@ -146,15 +146,15 @@ alts_handshaker_client* alts_grpc_handshaker_client_create( void* user_data, alts_handshaker_client_vtable* vtable_for_testing, bool is_client, size_t max_frame_size, std::string* error); -/** - * This method handles handshaker response returned from ALTS handshaker - * service. Note that the only reason the API is exposed is that it is used in - * alts_shared_resources.cc. - * - * - client: an ALTS handshaker client instance. - * - is_ok: a boolean value indicating if the handshaker response is ok to read. - */ +/// +/// This method handles handshaker response returned from ALTS handshaker +/// service. Note that the only reason the API is exposed is that it is used in +/// alts_shared_resources.cc. +/// +///- client: an ALTS handshaker client instance. +///- is_ok: a boolean value indicating if the handshaker response is ok to read. +/// void alts_handshaker_client_handle_response(alts_handshaker_client* client, bool is_ok); -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_CLIENT_H */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_CLIENT_H diff --git a/src/core/tsi/alts/handshaker/alts_shared_resource.cc b/src/core/tsi/alts/handshaker/alts_shared_resource.cc index a4a1fb20233..53d7decf419 100644 --- a/src/core/tsi/alts/handshaker/alts_shared_resource.cc +++ b/src/core/tsi/alts/handshaker/alts_shared_resource.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/tsi/alts/handshaker/alts_shared_resource.h b/src/core/tsi/alts/handshaker/alts_shared_resource.h index d8638e7df69..2adb1d39c51 100644 --- a/src/core/tsi/alts/handshaker/alts_shared_resource.h +++ b/src/core/tsi/alts/handshaker/alts_shared_resource.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_SHARED_RESOURCE_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_SHARED_RESOURCE_H @@ -28,10 +28,10 @@ #include "src/core/lib/iomgr/pollset_set.h" #include "src/core/lib/surface/completion_queue.h" -/** - * Main struct containing ALTS shared resources used when - * employing the dedicated completion queue and thread. - */ +/// +/// Main struct containing ALTS shared resources used when +/// employing the dedicated completion queue and thread. +/// typedef struct alts_shared_resource_dedicated { grpc_core::Thread thread; grpc_completion_queue* cq; @@ -41,33 +41,32 @@ typedef struct alts_shared_resource_dedicated { grpc_channel* channel; } alts_shared_resource_dedicated; -/* This method returns the address of alts_shared_resource_dedicated - * object shared by all TSI handshakes. - */ +// This method returns the address of alts_shared_resource_dedicated +// object shared by all TSI handshakes. +// alts_shared_resource_dedicated* grpc_alts_get_shared_resource_dedicated(void); -/** - * This method destroys the alts_shared_resource_dedicated object - * shared by all TSI handshakes. The application is responsible for - * invoking the API before calling grpc_shutdown(). - */ +/// +/// This method destroys the alts_shared_resource_dedicated object +/// shared by all TSI handshakes. The application is responsible for +/// invoking the API before calling grpc_shutdown(). +/// void grpc_alts_shared_resource_dedicated_shutdown(); -/** - * This method initializes the alts_shared_resource_dedicated object - * shared by all TSI handshakes. The application is responsible for - * invoking the API after calling grpc_init(); - */ +/// +/// This method initializes the alts_shared_resource_dedicated object +/// shared by all TSI handshakes. The application is responsible for +/// invoking the API after calling grpc_init(); +/// void grpc_alts_shared_resource_dedicated_init(); -/** - * This method populates various fields of the alts_shared_resource_dedicated - * object shared by all TSI handshakes and start the dedicated thread. - * The API will be invoked by the caller in a lazy manner. That is, - * it will get invoked when ALTS TSI handshake occurs for the first time. - */ +/// +/// This method populates various fields of the alts_shared_resource_dedicated +/// object shared by all TSI handshakes and start the dedicated thread. +/// The API will be invoked by the caller in a lazy manner. That is, +/// it will get invoked when ALTS TSI handshake occurs for the first time. +/// void grpc_alts_shared_resource_dedicated_start( const char* handshaker_service_url); -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_SHARED_RESOURCE_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_SHARED_RESOURCE_H diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc index e1788385e65..e2800dc4c72 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -45,7 +45,7 @@ #include "src/core/tsi/alts/handshaker/alts_tsi_utils.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h" -/* Main struct for ALTS TSI handshaker. */ +// Main struct for ALTS TSI handshaker. struct alts_tsi_handshaker { tsi_handshaker base; grpc_slice target_name; @@ -71,7 +71,7 @@ struct alts_tsi_handshaker { size_t max_frame_size; }; -/* Main struct for ALTS TSI handshaker result. */ +// Main struct for ALTS TSI handshaker result. typedef struct alts_tsi_handshaker_result { tsi_handshaker_result base; char* peer_identity; @@ -382,7 +382,7 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp, return TSI_OK; } -/* gRPC provided callback used when gRPC thread model is applied. */ +// gRPC provided callback used when gRPC thread model is applied. static void on_handshaker_service_resp_recv(void* arg, grpc_error_handle error) { alts_handshaker_client* client = static_cast(arg); @@ -400,8 +400,8 @@ static void on_handshaker_service_resp_recv(void* arg, alts_handshaker_client_handle_response(client, success); } -/* gRPC provided callback used when dedicatd CQ and thread are used. - * It serves to safely bring the control back to application. */ +// gRPC provided callback used when dedicatd CQ and thread are used. +// It serves to safely bring the control back to application. static void on_handshaker_service_resp_recv_dedicated( void* arg, grpc_error_handle /*error*/) { alts_shared_resource_dedicated* resource = @@ -412,7 +412,7 @@ static void on_handshaker_service_resp_recv_dedicated( &resource->storage); } -/* Returns TSI_OK if and only if no error is encountered. */ +// Returns TSI_OK if and only if no error is encountered. static tsi_result alts_tsi_handshaker_continue_handshaker_next( alts_tsi_handshaker* handshaker, const unsigned char* received_bytes, size_t received_bytes_size, tsi_handshaker_on_next_done_cb cb, @@ -575,11 +575,11 @@ static tsi_result handshaker_next( return TSI_ASYNC; } -/* - * This API will be invoked by a non-gRPC application, and an ExecCtx needs - * to be explicitly created in order to invoke ALTS handshaker client API's - * that assumes the caller is inside gRPC core. - */ +// +// This API will be invoked by a non-gRPC application, and an ExecCtx needs +// to be explicitly created in order to invoke ALTS handshaker client API's +// that assumes the caller is inside gRPC core. +// static tsi_result handshaker_next_dedicated( tsi_handshaker* self, const unsigned char* received_bytes, size_t received_bytes_size, const unsigned char** bytes_to_send, diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h index 1c3605afc21..a22cd53917e 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_H @@ -45,60 +45,60 @@ const size_t kTsiAltsMaxFrameSize = 1024 * 1024; typedef struct alts_tsi_handshaker alts_tsi_handshaker; -/** - * This method creates a ALTS TSI handshaker instance. - * - * - options: ALTS credentials options containing information passed from TSI - * caller (e.g., rpc protocol versions). - * - target_name: the name of the endpoint that the channel is connecting to, - * and will be used for secure naming check. - * - handshaker_service_url: address of ALTS handshaker service in the format of - * "host:port". - * - is_client: boolean value indicating if the handshaker is used at the client - * (is_client = true) or server (is_client = false) side. - * - interested_parties: set of pollsets interested in this connection. - * - self: address of ALTS TSI handshaker instance to be returned from the - * method. - * - user_specified_max_frame_size: Determines the maximum frame size used by - * frame protector that is specified via user. If unspecified, the value is 0. - * - * It returns TSI_OK on success and an error status code on failure. Note that - * if interested_parties is nullptr, a dedicated TSI thread will be created and - * used. - */ +/// +/// This method creates a ALTS TSI handshaker instance. +/// +///- options: ALTS credentials options containing information passed from TSI +/// caller (e.g., rpc protocol versions). +///- target_name: the name of the endpoint that the channel is connecting to, +/// and will be used for secure naming check. +///- handshaker_service_url: address of ALTS handshaker service in the format of +/// "host:port". +///- is_client: boolean value indicating if the handshaker is used at the client +/// (is_client = true) or server (is_client = false) side. +///- interested_parties: set of pollsets interested in this connection. +///- self: address of ALTS TSI handshaker instance to be returned from the +/// method. +///- user_specified_max_frame_size: Determines the maximum frame size used by +/// frame protector that is specified via user. If unspecified, the value is 0. +/// +/// It returns TSI_OK on success and an error status code on failure. Note that +/// if interested_parties is nullptr, a dedicated TSI thread will be created and +/// used. +/// tsi_result alts_tsi_handshaker_create( const grpc_alts_credentials_options* options, const char* target_name, const char* handshaker_service_url, bool is_client, grpc_pollset_set* interested_parties, tsi_handshaker** self, size_t user_specified_max_frame_size); -/** - * This method creates an ALTS TSI handshaker result instance. - * - * - resp: data received from the handshaker service. - * - is_client: a boolean value indicating if the result belongs to a - * client or not. - * - result: address of ALTS TSI handshaker result instance. - */ +/// +/// This method creates an ALTS TSI handshaker result instance. +/// +///- resp: data received from the handshaker service. +///- is_client: a boolean value indicating if the result belongs to a +/// client or not. +///- result: address of ALTS TSI handshaker result instance. +/// tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp, bool is_client, tsi_handshaker_result** result); -/** - * This method sets unused bytes of ALTS TSI handshaker result instance. - * - * - result: an ALTS TSI handshaker result instance. - * - recv_bytes: data received from the handshaker service. - * - bytes_consumed: size of data consumed by the handshaker service. - */ +/// +/// This method sets unused bytes of ALTS TSI handshaker result instance. +/// +///- result: an ALTS TSI handshaker result instance. +///- recv_bytes: data received from the handshaker service. +///- bytes_consumed: size of data consumed by the handshaker service. +/// void alts_tsi_handshaker_result_set_unused_bytes(tsi_handshaker_result* result, grpc_slice* recv_bytes, size_t bytes_consumed); -/** - * This method returns a boolean value indicating if an ALTS TSI handshaker - * has been shutdown or not. - */ +/// +/// This method returns a boolean value indicating if an ALTS TSI handshaker +/// has been shutdown or not. +/// bool alts_tsi_handshaker_has_shutdown(alts_tsi_handshaker* handshaker); -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_H */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_H diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h b/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h index e90d9e9f471..86c8784f86e 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_PRIVATE_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_PRIVATE_H @@ -26,8 +26,8 @@ namespace grpc_core { namespace internal { -/** - * Unsafe, use for testing only. */ +/// +/// Unsafe, use for testing only. alts_handshaker_client* alts_tsi_handshaker_get_client_for_testing( alts_tsi_handshaker* handshaker); @@ -86,4 +86,4 @@ void alts_handshaker_client_ref_for_testing(alts_handshaker_client* c); } // namespace internal } // namespace grpc_core -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_PRIVATE_H */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_HANDSHAKER_PRIVATE_H diff --git a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc index 4464ae22d8a..5d0e8d47e0a 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_utils.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_utils.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/tsi/alts/handshaker/alts_tsi_utils.h b/src/core/tsi/alts/handshaker/alts_tsi_utils.h index c856a70657e..63c6f18f072 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_utils.h +++ b/src/core/tsi/alts/handshaker/alts_tsi_utils.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H @@ -27,27 +27,27 @@ #include "src/core/tsi/transport_security_interface.h" #include "src/proto/grpc/gcp/handshaker.upb.h" -/** - * This method converts grpc_status_code code to the corresponding tsi_result - * code. - * - * - code: grpc_status_code code. - * - * It returns the converted tsi_result code. - */ +/// +/// This method converts grpc_status_code code to the corresponding tsi_result +/// code. +/// +///- code: grpc_status_code code. +/// +/// It returns the converted tsi_result code. +/// tsi_result alts_tsi_utils_convert_to_tsi_result(grpc_status_code code); -/** - * This method deserializes a handshaker response returned from ALTS handshaker - * service. - * - * - bytes_received: data returned from ALTS handshaker service. - * - arena: upb arena. - * - * It returns a deserialized handshaker response on success and nullptr on - * failure. - */ +/// +/// This method deserializes a handshaker response returned from ALTS handshaker +/// service. +/// +///- bytes_received: data returned from ALTS handshaker service. +///- arena: upb arena. +/// +/// It returns a deserialized handshaker response on success and nullptr on +/// failure. +/// grpc_gcp_HandshakerResp* alts_tsi_utils_deserialize_response( grpc_byte_buffer* resp_buffer, upb_Arena* arena); -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_ALTS_TSI_UTILS_H diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.cc b/src/core/tsi/alts/handshaker/transport_security_common_api.cc index b7644a07298..126ea996f9f 100644 --- a/src/core/tsi/alts/handshaker/transport_security_common_api.cc +++ b/src/core/tsi/alts/handshaker/transport_security_common_api.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -201,13 +201,13 @@ bool grpc_gcp_rpc_protocol_versions_check( "grpc_gcp_rpc_protocol_versions_check()."); return false; } - /* max_common_version is MIN(local.max, peer.max) */ + // max_common_version is MIN(local.max, peer.max) const grpc_gcp_rpc_protocol_versions_version* max_common_version = grpc_core::internal::grpc_gcp_rpc_protocol_version_compare( &local_versions->max_rpc_version, &peer_versions->max_rpc_version) > 0 ? &peer_versions->max_rpc_version : &local_versions->max_rpc_version; - /* min_common_version is MAX(local.min, peer.min) */ + // min_common_version is MAX(local.min, peer.min) const grpc_gcp_rpc_protocol_versions_version* min_common_version = grpc_core::internal::grpc_gcp_rpc_protocol_version_compare( &local_versions->min_rpc_version, &peer_versions->min_rpc_version) > 0 diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.h b/src/core/tsi/alts/handshaker/transport_security_common_api.h index 34675ad9963..5da57fb9a45 100644 --- a/src/core/tsi/alts/handshaker/transport_security_common_api.h +++ b/src/core/tsi/alts/handshaker/transport_security_common_api.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H #define GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H @@ -40,113 +40,113 @@ typedef struct _grpc_gcp_RpcProtocolVersions { grpc_gcp_rpc_protocol_versions_version min_rpc_version; } grpc_gcp_rpc_protocol_versions; -/** - * This method sets the value for max_rpc_versions field of rpc protocol - * versions. - * - * - versions: an rpc protocol version instance. - * - max_major: a major version of maximum supported RPC version. - * - max_minor: a minor version of maximum supported RPC version. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method sets the value for max_rpc_versions field of rpc protocol +/// versions. +/// +///- versions: an rpc protocol version instance. +///- max_major: a major version of maximum supported RPC version. +///- max_minor: a minor version of maximum supported RPC version. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_set_max( grpc_gcp_rpc_protocol_versions* versions, uint32_t max_major, uint32_t max_minor); -/** - * This method sets the value for min_rpc_versions field of rpc protocol - * versions. - * - * - versions: an rpc protocol version instance. - * - min_major: a major version of minimum supported RPC version. - * - min_minor: a minor version of minimum supported RPC version. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method sets the value for min_rpc_versions field of rpc protocol +/// versions. +/// +///- versions: an rpc protocol version instance. +///- min_major: a major version of minimum supported RPC version. +///- min_minor: a minor version of minimum supported RPC version. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_set_min( grpc_gcp_rpc_protocol_versions* versions, uint32_t min_major, uint32_t min_minor); -/** - * This method serializes an rpc protocol version and returns serialized rpc - * versions in grpc slice. - * - * - versions: an rpc protocol versions instance. - * - slice: grpc slice where the serialized result will be written. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method serializes an rpc protocol version and returns serialized rpc +/// versions in grpc slice. +/// +///- versions: an rpc protocol versions instance. +///- slice: grpc slice where the serialized result will be written. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_encode( const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice); -/** - * This method serializes an rpc protocol version and returns serialized rpc - * versions in grpc slice. - * - * - versions: an rpc protocol versions instance. - * - arena: upb arena. - * - slice: grpc slice where the serialized result will be written. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method serializes an rpc protocol version and returns serialized rpc +/// versions in grpc slice. +/// +///- versions: an rpc protocol versions instance. +///- arena: upb arena. +///- slice: grpc slice where the serialized result will be written. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_encode( const grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena, grpc_slice* slice); -/** - * This method de-serializes input in grpc slice form and stores the result - * in rpc protocol versions. - * - * - slice: a data stream containing a serialized rpc protocol version. - * - versions: an rpc protocol version instance used to hold de-serialized - * result. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method de-serializes input in grpc slice form and stores the result +/// in rpc protocol versions. +/// +///- slice: a data stream containing a serialized rpc protocol version. +///- versions: an rpc protocol version instance used to hold de-serialized +/// result. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_decode( const grpc_slice& slice, grpc_gcp_rpc_protocol_versions* versions); -/** - * Assigns value of upb RpcProtocolVersions to grpc_gcp_rpc_protocol_versions. - */ +/// +/// Assigns value of upb RpcProtocolVersions to grpc_gcp_rpc_protocol_versions. +/// void grpc_gcp_rpc_protocol_versions_assign_from_upb( grpc_gcp_rpc_protocol_versions* versions, const grpc_gcp_RpcProtocolVersions* value); -/** - * Assigns value of struct grpc_gcp_rpc_protocol_versions to - * RpcProtocolVersions. - */ +/// +/// Assigns value of struct grpc_gcp_rpc_protocol_versions to +/// RpcProtocolVersions. +/// void grpc_gcp_RpcProtocolVersions_assign_from_struct( grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena, const grpc_gcp_rpc_protocol_versions* value); -/** - * This method performs a deep copy operation on rpc protocol versions - * instance. - * - * - src: rpc protocol versions instance that needs to be copied. - * - dst: rpc protocol versions instance that stores the copied result. - * - * The method returns true on success and false otherwise. - */ +/// +/// This method performs a deep copy operation on rpc protocol versions +/// instance. +/// +///- src: rpc protocol versions instance that needs to be copied. +///- dst: rpc protocol versions instance that stores the copied result. +/// +/// The method returns true on success and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_copy( const grpc_gcp_rpc_protocol_versions* src, grpc_gcp_rpc_protocol_versions* dst); -/** - * This method performs a version check between local and peer rpc protocol - * versions. - * - * - local_versions: local rpc protocol versions instance. - * - peer_versions: peer rpc protocol versions instance. - * - highest_common_version: an output parameter that will store the highest - * common rpc protocol version both parties agreed on. - * - * The method returns true if the check passes which means both parties agreed - * on a common rpc protocol to use, and false otherwise. - */ +/// +/// This method performs a version check between local and peer rpc protocol +/// versions. +/// +///- local_versions: local rpc protocol versions instance. +///- peer_versions: peer rpc protocol versions instance. +///- highest_common_version: an output parameter that will store the highest +/// common rpc protocol version both parties agreed on. +/// +/// The method returns true if the check passes which means both parties agreed +/// on a common rpc protocol to use, and false otherwise. +/// bool grpc_gcp_rpc_protocol_versions_check( const grpc_gcp_rpc_protocol_versions* local_versions, const grpc_gcp_rpc_protocol_versions* peer_versions, @@ -155,12 +155,12 @@ bool grpc_gcp_rpc_protocol_versions_check( namespace grpc_core { namespace internal { -/** - * Exposed for testing only. - * The method returns 0 if v1 = v2, - * returns 1 if v1 > v2, - * returns -1 if v1 < v2. - */ +/// +/// Exposed for testing only. +/// The method returns 0 if v1 = v2, +/// returns 1 if v1 > v2, +/// returns -1 if v1 < v2. +/// int grpc_gcp_rpc_protocol_version_compare( const grpc_gcp_rpc_protocol_versions_version* v1, const grpc_gcp_rpc_protocol_versions_version* v2); @@ -168,4 +168,4 @@ int grpc_gcp_rpc_protocol_version_compare( } // namespace internal } // namespace grpc_core -#endif /* GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H */ +#endif // GRPC_CORE_TSI_ALTS_HANDSHAKER_TRANSPORT_SECURITY_COMMON_API_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc index 8635a83d0f8..0e517e19248 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -30,7 +30,7 @@ #include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h" -/* Main struct for alts_grpc_integrity_only_record_protocol. */ +// Main struct for alts_grpc_integrity_only_record_protocol. typedef struct alts_grpc_integrity_only_record_protocol { alts_grpc_record_protocol base; bool enable_extra_copy; @@ -38,12 +38,12 @@ typedef struct alts_grpc_integrity_only_record_protocol { unsigned char* tag_buf; } alts_grpc_integrity_only_record_protocol; -/* --- alts_grpc_record_protocol methods implementation. --- */ +// --- alts_grpc_record_protocol methods implementation. --- static tsi_result alts_grpc_integrity_only_extra_copy_protect( alts_grpc_record_protocol* rp, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices) { - /* Allocates memory for protected frame and copies data. */ + // Allocates memory for protected frame and copies data. size_t data_length = unprotected_slices->length; size_t protected_frame_size = unprotected_slices->length + rp->header_length + rp->tag_length; @@ -54,7 +54,7 @@ static tsi_result alts_grpc_integrity_only_extra_copy_protect( GRPC_SLICE_LENGTH(unprotected_slices->slices[i])); data += GRPC_SLICE_LENGTH(unprotected_slices->slices[i]); } - /* Calls alts_iovec_record_protocol protect. */ + // Calls alts_iovec_record_protocol protect. char* error_details = nullptr; iovec_t header_iovec = {GRPC_SLICE_START_PTR(protected_slice), rp->header_length}; @@ -79,7 +79,7 @@ static tsi_result alts_grpc_integrity_only_extra_copy_protect( static tsi_result alts_grpc_integrity_only_protect( alts_grpc_record_protocol* rp, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices) { - /* Input sanity check. */ + // Input sanity check. if (rp == nullptr || unprotected_slices == nullptr || protected_slices == nullptr) { gpr_log(GPR_ERROR, @@ -92,10 +92,10 @@ static tsi_result alts_grpc_integrity_only_protect( return alts_grpc_integrity_only_extra_copy_protect(rp, unprotected_slices, protected_slices); } - /* Allocates memory for header and tag slices. */ + // Allocates memory for header and tag slices. grpc_slice header_slice = GRPC_SLICE_MALLOC(rp->header_length); grpc_slice tag_slice = GRPC_SLICE_MALLOC(rp->tag_length); - /* Calls alts_iovec_record_protocol protect. */ + // Calls alts_iovec_record_protocol protect. char* error_details = nullptr; iovec_t header_iovec = {GRPC_SLICE_START_PTR(header_slice), GRPC_SLICE_LENGTH(header_slice)}; @@ -111,7 +111,7 @@ static tsi_result alts_grpc_integrity_only_protect( gpr_free(error_details); return TSI_INTERNAL_ERROR; } - /* Appends result to protected_slices. */ + // Appends result to protected_slices. grpc_slice_buffer_add(protected_slices, header_slice); grpc_slice_buffer_move_into(unprotected_slices, protected_slices); grpc_slice_buffer_add(protected_slices, tag_slice); @@ -121,7 +121,7 @@ static tsi_result alts_grpc_integrity_only_protect( static tsi_result alts_grpc_integrity_only_unprotect( alts_grpc_record_protocol* rp, grpc_slice_buffer* protected_slices, grpc_slice_buffer* unprotected_slices) { - /* Input sanity check. */ + // Input sanity check. if (rp == nullptr || protected_slices == nullptr || unprotected_slices == nullptr) { gpr_log( @@ -133,18 +133,18 @@ static tsi_result alts_grpc_integrity_only_unprotect( gpr_log(GPR_ERROR, "Protected slices do not have sufficient data."); return TSI_INVALID_ARGUMENT; } - /* In this method, rp points to alts_grpc_record_protocol struct - * and integrity_only_record_protocol points to - * alts_grpc_integrity_only_record_protocol struct. */ + // In this method, rp points to alts_grpc_record_protocol struct + // and integrity_only_record_protocol points to + // alts_grpc_integrity_only_record_protocol struct. alts_grpc_integrity_only_record_protocol* integrity_only_record_protocol = reinterpret_cast(rp); - /* Strips frame header from protected slices. */ + // Strips frame header from protected slices. grpc_slice_buffer_reset_and_unref(&rp->header_sb); grpc_slice_buffer_move_first(protected_slices, rp->header_length, &rp->header_sb); GPR_ASSERT(rp->header_sb.length == rp->header_length); iovec_t header_iovec = alts_grpc_record_protocol_get_header_iovec(rp); - /* Moves protected slices data to data_sb and leaves the remaining tag. */ + // Moves protected slices data to data_sb and leaves the remaining tag. grpc_slice_buffer_reset_and_unref(&integrity_only_record_protocol->data_sb); grpc_slice_buffer_move_first(protected_slices, protected_slices->length - rp->tag_length, @@ -154,13 +154,13 @@ static tsi_result alts_grpc_integrity_only_unprotect( if (protected_slices->count == 1) { tag_iovec.iov_base = GRPC_SLICE_START_PTR(protected_slices->slices[0]); } else { - /* Frame tag is in multiple slices, copies the tag bytes from slice - * buffer to a single flat buffer. */ + // Frame tag is in multiple slices, copies the tag bytes from slice + // buffer to a single flat buffer. alts_grpc_record_protocol_copy_slice_buffer( protected_slices, integrity_only_record_protocol->tag_buf); tag_iovec.iov_base = integrity_only_record_protocol->tag_buf; } - /* Calls alts_iovec_record_protocol unprotect. */ + // Calls alts_iovec_record_protocol unprotect. char* error_details = nullptr; alts_grpc_record_protocol_convert_slice_buffer_to_iovec( rp, &integrity_only_record_protocol->data_sb); @@ -206,7 +206,7 @@ tsi_result alts_grpc_integrity_only_record_protocol_create( alts_grpc_integrity_only_record_protocol* impl = static_cast( gpr_zalloc(sizeof(alts_grpc_integrity_only_record_protocol))); - /* Calls alts_grpc_record_protocol init. */ + // Calls alts_grpc_record_protocol init. tsi_result result = alts_grpc_record_protocol_init( &impl->base, crypter, overflow_size, is_client, /*is_integrity_only=*/true, is_protect); @@ -215,9 +215,9 @@ tsi_result alts_grpc_integrity_only_record_protocol_create( return result; } impl->enable_extra_copy = enable_extra_copy; - /* Initializes slice buffer for data_sb. */ + // Initializes slice buffer for data_sb. grpc_slice_buffer_init(&impl->data_sb); - /* Allocates tag buffer. */ + // Allocates tag buffer. impl->tag_buf = static_cast(gpr_malloc(impl->base.tag_length)); impl->base.vtable = &alts_grpc_integrity_only_record_protocol_vtable; diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h index 5456d34fad5..74c1affd447 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_INTEGRITY_ONLY_RECORD_PROTOCOL_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_INTEGRITY_ONLY_RECORD_PROTOCOL_H @@ -26,29 +26,28 @@ #include "src/core/tsi/alts/crypt/gsec.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h" -/** - * This method creates an integrity-only alts_grpc_record_protocol instance, - * given a gsec_aead_crypter instance and a flag indicating if the created - * instance will be used at the client or server side. The ownership of - * gsec_aead_crypter instance is transferred to this new object. - * - * - crypter: a gsec_aead_crypter instance used to perform AEAD decryption. - * - overflow_size: overflow size of counter in bytes. - * - is_client: a flag indicating if the alts_grpc_record_protocol instance will - * be used at the client or server side. - * - is_protect: a flag indicating if the alts_grpc_record_protocol instance - * will be used for protect or unprotect. - *- enable_extra_copy: a flag indicating if the instance uses one-copy instead - * of zero-copy in the protect operation. - * - rp: an alts_grpc_record_protocol instance to be returned from - * the method. - * - * This method returns TSI_OK in case of success or a specific error code in - * case of failure. - */ +/// +/// This method creates an integrity-only alts_grpc_record_protocol instance, +/// given a gsec_aead_crypter instance and a flag indicating if the created +/// instance will be used at the client or server side. The ownership of +/// gsec_aead_crypter instance is transferred to this new object. +/// +///- crypter: a gsec_aead_crypter instance used to perform AEAD decryption. +///- overflow_size: overflow size of counter in bytes. +///- is_client: a flag indicating if the alts_grpc_record_protocol instance will +/// be used at the client or server side. +///- is_protect: a flag indicating if the alts_grpc_record_protocol instance +/// will be used for protect or unprotect. +///- enable_extra_copy: a flag indicating if the instance uses one-copy instead +/// of zero-copy in the protect operation. +///- rp: an alts_grpc_record_protocol instance to be returned from +/// the method. +/// +/// This method returns TSI_OK in case of success or a specific error code in +/// case of failure. +/// tsi_result alts_grpc_integrity_only_record_protocol_create( gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_protect, bool enable_extra_copy, alts_grpc_record_protocol** rp); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_INTEGRITY_ONLY_RECORD_PROTOCOL_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_INTEGRITY_ONLY_RECORD_PROTOCOL_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc index c8b352fd29d..ae2856090d6 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -28,30 +28,30 @@ #include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h" -/* Privacy-integrity alts_grpc_record_protocol object uses the same struct - * defined in alts_grpc_record_protocol_common.h. */ +// Privacy-integrity alts_grpc_record_protocol object uses the same struct +// defined in alts_grpc_record_protocol_common.h. -/* --- alts_grpc_record_protocol methods implementation. --- */ +// --- alts_grpc_record_protocol methods implementation. --- static tsi_result alts_grpc_privacy_integrity_protect( alts_grpc_record_protocol* rp, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices) { - /* Input sanity check. */ + // Input sanity check. if (rp == nullptr || unprotected_slices == nullptr || protected_slices == nullptr) { gpr_log(GPR_ERROR, "Invalid nullptr arguments to alts_grpc_record_protocol protect."); return TSI_INVALID_ARGUMENT; } - /* Allocates memory for output frame. In privacy-integrity protect, the - * protected frame is stored in a newly allocated buffer. */ + // Allocates memory for output frame. In privacy-integrity protect, the + // protected frame is stored in a newly allocated buffer. size_t protected_frame_size = unprotected_slices->length + rp->header_length + alts_iovec_record_protocol_get_tag_length(rp->iovec_rp); grpc_slice protected_slice = GRPC_SLICE_MALLOC(protected_frame_size); iovec_t protected_iovec = {GRPC_SLICE_START_PTR(protected_slice), GRPC_SLICE_LENGTH(protected_slice)}; - /* Calls alts_iovec_record_protocol protect. */ + // Calls alts_iovec_record_protocol protect. char* error_details = nullptr; alts_grpc_record_protocol_convert_slice_buffer_to_iovec(rp, unprotected_slices); @@ -73,7 +73,7 @@ static tsi_result alts_grpc_privacy_integrity_protect( static tsi_result alts_grpc_privacy_integrity_unprotect( alts_grpc_record_protocol* rp, grpc_slice_buffer* protected_slices, grpc_slice_buffer* unprotected_slices) { - /* Input sanity check. */ + // Input sanity check. if (rp == nullptr || protected_slices == nullptr || unprotected_slices == nullptr) { gpr_log( @@ -81,8 +81,8 @@ static tsi_result alts_grpc_privacy_integrity_unprotect( "Invalid nullptr arguments to alts_grpc_record_protocol unprotect."); return TSI_INVALID_ARGUMENT; } - /* Allocates memory for output frame. In privacy-integrity unprotect, the - * unprotected data are stored in a newly allocated buffer. */ + // Allocates memory for output frame. In privacy-integrity unprotect, the + // unprotected data are stored in a newly allocated buffer. if (protected_slices->length < rp->header_length + rp->tag_length) { gpr_log(GPR_ERROR, "Protected slices do not have sufficient data."); return TSI_INVALID_ARGUMENT; @@ -92,12 +92,12 @@ static tsi_result alts_grpc_privacy_integrity_unprotect( grpc_slice unprotected_slice = GRPC_SLICE_MALLOC(unprotected_frame_size); iovec_t unprotected_iovec = {GRPC_SLICE_START_PTR(unprotected_slice), GRPC_SLICE_LENGTH(unprotected_slice)}; - /* Strips frame header from protected slices. */ + // Strips frame header from protected slices. grpc_slice_buffer_reset_and_unref(&rp->header_sb); grpc_slice_buffer_move_first(protected_slices, rp->header_length, &rp->header_sb); iovec_t header_iovec = alts_grpc_record_protocol_get_header_iovec(rp); - /* Calls alts_iovec_record_protocol unprotect. */ + // Calls alts_iovec_record_protocol unprotect. char* error_details = nullptr; alts_grpc_record_protocol_convert_slice_buffer_to_iovec(rp, protected_slices); grpc_status_code status = @@ -131,7 +131,7 @@ tsi_result alts_grpc_privacy_integrity_record_protocol_create( } auto* impl = static_cast( gpr_zalloc(sizeof(alts_grpc_record_protocol))); - /* Calls alts_grpc_record_protocol init. */ + // Calls alts_grpc_record_protocol init. tsi_result result = alts_grpc_record_protocol_init(impl, crypter, overflow_size, is_client, /*is_integrity_only=*/false, is_protect); diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h index 1e34aef2d87..861927865ed 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_PRIVACY_INTEGRITY_RECORD_PROTOCOL_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_PRIVACY_INTEGRITY_RECORD_PROTOCOL_H @@ -26,24 +26,23 @@ #include "src/core/tsi/alts/crypt/gsec.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h" -/** - * This method creates a privacy-integrity alts_grpc_record_protocol instance, - * given a gsec_aead_crypter instance and a flag indicating if the created - * instance will be used at the client or server side. The ownership of - * gsec_aead_crypter instance is transferred to this new object. - * - * - crypter: a gsec_aead_crypter instance used to perform AEAD decryption. - * - is_client: a flag indicating if the alts_grpc_record_protocol instance will - * be used at the client or server side. - * - rp: an alts_grpc_record_protocol instance to be returned from - * the method. - * - * This method returns TSI_OK in case of success or a specific error code in - * case of failure. - */ +/// +/// This method creates a privacy-integrity alts_grpc_record_protocol instance, +/// given a gsec_aead_crypter instance and a flag indicating if the created +/// instance will be used at the client or server side. The ownership of +/// gsec_aead_crypter instance is transferred to this new object. +/// +///- crypter: a gsec_aead_crypter instance used to perform AEAD decryption. +///- is_client: a flag indicating if the alts_grpc_record_protocol instance will +/// be used at the client or server side. +///- rp: an alts_grpc_record_protocol instance to be returned from +/// the method. +/// +/// This method returns TSI_OK in case of success or a specific error code in +/// case of failure. +/// tsi_result alts_grpc_privacy_integrity_record_protocol_create( gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_protect, alts_grpc_record_protocol** rp); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_PRIVACY_INTEGRITY_RECORD_PROTOCOL_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_PRIVACY_INTEGRITY_RECORD_PROTOCOL_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h index d1e433dac47..8001e763935 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_H @@ -25,67 +25,66 @@ #include "src/core/tsi/transport_security_interface.h" -/** - * This alts_grpc_record_protocol object protects and unprotects a single frame - * stored in grpc slice buffer with zero or minimized memory copy. - * Implementations of this object must be thread compatible. - */ +/// +/// This alts_grpc_record_protocol object protects and unprotects a single frame +/// stored in grpc slice buffer with zero or minimized memory copy. +/// Implementations of this object must be thread compatible. +/// typedef struct alts_grpc_record_protocol alts_grpc_record_protocol; -/** - * This methods performs protect operation on unprotected data and appends the - * protected frame to protected_slices. The caller needs to ensure the length - * of unprotected data plus the frame overhead is less than or equal to the - * maximum frame length. The input unprotected data slice buffer will be - * cleared, although the actual unprotected data bytes are not modified. - * - * - self: an alts_grpc_record_protocol instance. - * - unprotected_slices: the unprotected data to be protected. - * - protected_slices: slice buffer where the protected frame is appended. - * - * This method returns TSI_OK in case of success or a specific error code in - * case of failure. - */ +/// +/// This methods performs protect operation on unprotected data and appends the +/// protected frame to protected_slices. The caller needs to ensure the length +/// of unprotected data plus the frame overhead is less than or equal to the +/// maximum frame length. The input unprotected data slice buffer will be +/// cleared, although the actual unprotected data bytes are not modified. +/// +///- self: an alts_grpc_record_protocol instance. +///- unprotected_slices: the unprotected data to be protected. +///- protected_slices: slice buffer where the protected frame is appended. +/// +/// This method returns TSI_OK in case of success or a specific error code in +/// case of failure. +/// tsi_result alts_grpc_record_protocol_protect( alts_grpc_record_protocol* self, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices); -/** - * This methods performs unprotect operation on a full frame of protected data - * and appends unprotected data to unprotected_slices. It is the caller's - * responsibility to prepare a full frame of data before calling this method. - * The input protected frame slice buffer will be cleared, although the actual - * protected data bytes are not modified. - * - * - self: an alts_grpc_record_protocol instance. - * - protected_slices: a full frame of protected data in grpc slices. - * - unprotected_slices: slice buffer where unprotected data is appended. - * - * This method returns TSI_OK in case of success or a specific error code in - * case of failure. - */ +/// +/// This methods performs unprotect operation on a full frame of protected data +/// and appends unprotected data to unprotected_slices. It is the caller's +/// responsibility to prepare a full frame of data before calling this method. +/// The input protected frame slice buffer will be cleared, although the actual +/// protected data bytes are not modified. +/// +///- self: an alts_grpc_record_protocol instance. +///- protected_slices: a full frame of protected data in grpc slices. +///- unprotected_slices: slice buffer where unprotected data is appended. +/// +/// This method returns TSI_OK in case of success or a specific error code in +/// case of failure. +/// tsi_result alts_grpc_record_protocol_unprotect( alts_grpc_record_protocol* self, grpc_slice_buffer* protected_slices, grpc_slice_buffer* unprotected_slices); -/** - * This method returns maximum allowed unprotected data size, given maximum - * protected frame size. - * - * - self: an alts_grpc_record_protocol instance. - * - max_protected_frame_size: maximum protected frame size. - * - * On success, the method returns the maximum allowed unprotected data size. - * Otherwise, it returns zero. - */ +/// +/// This method returns maximum allowed unprotected data size, given maximum +/// protected frame size. +/// +///- self: an alts_grpc_record_protocol instance. +///- max_protected_frame_size: maximum protected frame size. +/// +/// On success, the method returns the maximum allowed unprotected data size. +/// Otherwise, it returns zero. +/// size_t alts_grpc_record_protocol_max_unprotected_data_size( const alts_grpc_record_protocol* self, size_t max_protected_frame_size); -/** - * This method destroys an alts_grpc_record_protocol instance by de-allocating - * all of its occupied memory. - */ +/// +/// This method destroys an alts_grpc_record_protocol instance by de-allocating +/// all of its occupied memory. +/// void alts_grpc_record_protocol_destroy(alts_grpc_record_protocol* self); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc index abf5df50503..a0756853949 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -31,21 +31,21 @@ const size_t kInitialIovecBufferSize = 8; -/* Makes sure iovec_buf in alts_grpc_record_protocol is large enough. */ +// Makes sure iovec_buf in alts_grpc_record_protocol is large enough. static void ensure_iovec_buf_size(alts_grpc_record_protocol* rp, const grpc_slice_buffer* sb) { GPR_ASSERT(rp != nullptr && sb != nullptr); if (sb->count <= rp->iovec_buf_length) { return; } - /* At least double the iovec buffer size. */ + // At least double the iovec buffer size. rp->iovec_buf_length = std::max(sb->count, 2 * rp->iovec_buf_length); rp->iovec_buf = static_cast( gpr_realloc(rp->iovec_buf, rp->iovec_buf_length * sizeof(iovec_t))); } -/* --- Implementation of methods defined in tsi_grpc_record_protocol_common.h. - * --- */ +// --- Implementation of methods defined in tsi_grpc_record_protocol_common.h. +// --- void alts_grpc_record_protocol_convert_slice_buffer_to_iovec( alts_grpc_record_protocol* rp, const grpc_slice_buffer* sb) { @@ -77,8 +77,8 @@ iovec_t alts_grpc_record_protocol_get_header_iovec( if (rp->header_sb.count == 1) { header_iovec.iov_base = GRPC_SLICE_START_PTR(rp->header_sb.slices[0]); } else { - /* Frame header is in multiple slices, copies the header bytes from slice - * buffer to a single flat buffer. */ + // Frame header is in multiple slices, copies the header bytes from slice + // buffer to a single flat buffer. alts_grpc_record_protocol_copy_slice_buffer(&rp->header_sb, rp->header_buf); header_iovec.iov_base = rp->header_buf; } @@ -95,7 +95,7 @@ tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp, "Invalid nullptr arguments to alts_grpc_record_protocol init."); return TSI_INVALID_ARGUMENT; } - /* Creates alts_iovec_record_protocol. */ + // Creates alts_iovec_record_protocol. char* error_details = nullptr; grpc_status_code status = alts_iovec_record_protocol_create( crypter, overflow_size, is_client, is_integrity_only, is_protect, @@ -106,20 +106,20 @@ tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp, gpr_free(error_details); return TSI_INTERNAL_ERROR; } - /* Allocates header slice buffer. */ + // Allocates header slice buffer. grpc_slice_buffer_init(&rp->header_sb); - /* Allocates header buffer. */ + // Allocates header buffer. rp->header_length = alts_iovec_record_protocol_get_header_length(); rp->header_buf = static_cast(gpr_malloc(rp->header_length)); rp->tag_length = alts_iovec_record_protocol_get_tag_length(rp->iovec_rp); - /* Allocates iovec buffer. */ + // Allocates iovec buffer. rp->iovec_buf_length = kInitialIovecBufferSize; rp->iovec_buf = static_cast(gpr_malloc(rp->iovec_buf_length * sizeof(iovec_t))); return TSI_OK; } -/* --- Implementation of methods defined in tsi_grpc_record_protocol.h. --- */ +// --- Implementation of methods defined in tsi_grpc_record_protocol.h. --- tsi_result alts_grpc_record_protocol_protect( alts_grpc_record_protocol* self, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices) { @@ -162,8 +162,8 @@ void alts_grpc_record_protocol_destroy(alts_grpc_record_protocol* self) { gpr_free(self); } -/* Integrity-only and privacy-integrity share the same implementation. No need - * to call vtable. */ +// Integrity-only and privacy-integrity share the same implementation. No need +// to call vtable. size_t alts_grpc_record_protocol_max_unprotected_data_size( const alts_grpc_record_protocol* self, size_t max_protected_frame_size) { if (self == nullptr) { diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h index 571a915768f..b98a5a026c2 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h @@ -1,36 +1,36 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_COMMON_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_COMMON_H -/** - * this file contains alts_grpc_record_protocol internals and internal-only - * helper functions. The public functions of alts_grpc_record_protocol are - * defined in the alts_grpc_record_protocol.h. - */ +/// +/// this file contains alts_grpc_record_protocol internals and internal-only +/// helper functions. The public functions of alts_grpc_record_protocol are +/// defined in the alts_grpc_record_protocol.h. +/// #include #include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h" #include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h" -/* V-table for alts_grpc_record_protocol implementations. */ +// V-table for alts_grpc_record_protocol implementations. struct alts_grpc_record_protocol_vtable { tsi_result (*protect)(alts_grpc_record_protocol* self, grpc_slice_buffer* unprotected_slices, @@ -40,10 +40,10 @@ struct alts_grpc_record_protocol_vtable { grpc_slice_buffer* unprotected_slices); void (*destruct)(alts_grpc_record_protocol* self); }; -/* Main struct for alts_grpc_record_protocol implementation, shared by both - * integrity-only record protocol and privacy-integrity record protocol. - * Integrity-only record protocol has additional data elements. - * Privacy-integrity record protocol uses this struct directly. */ +// Main struct for alts_grpc_record_protocol implementation, shared by both +// integrity-only record protocol and privacy-integrity record protocol. +// Integrity-only record protocol has additional data elements. +// Privacy-integrity record protocol uses this struct directly. struct alts_grpc_record_protocol { const alts_grpc_record_protocol_vtable* vtable; alts_iovec_record_protocol* iovec_rp; @@ -55,45 +55,44 @@ struct alts_grpc_record_protocol { size_t iovec_buf_length; }; -/** - * Converts the slices of input sb into iovec_t's and puts the result into - * rp->iovec_buf. Note that the actual data are not copied, only - * pointers and lengths are copied. - */ +/// +/// Converts the slices of input sb into iovec_t's and puts the result into +/// rp->iovec_buf. Note that the actual data are not copied, only +/// pointers and lengths are copied. +/// void alts_grpc_record_protocol_convert_slice_buffer_to_iovec( alts_grpc_record_protocol* rp, const grpc_slice_buffer* sb); -/** - * Copies bytes from slice buffer to destination buffer. Caller is responsible - * for allocating enough memory of destination buffer. This method is used for - * copying frame header and tag in case they are stored in multiple slices. - */ +/// +/// Copies bytes from slice buffer to destination buffer. Caller is responsible +/// for allocating enough memory of destination buffer. This method is used for +/// copying frame header and tag in case they are stored in multiple slices. +/// void alts_grpc_record_protocol_copy_slice_buffer(const grpc_slice_buffer* src, unsigned char* dst); -/** - * This method returns an iovec object pointing to the frame header stored in - * rp->header_sb. If the frame header is stored in multiple slices, - * this method will copy the bytes in rp->header_sb to - * rp->header_buf, and return an iovec object pointing to - * rp->header_buf. - */ +/// +/// This method returns an iovec object pointing to the frame header stored in +/// rp->header_sb. If the frame header is stored in multiple slices, +/// this method will copy the bytes in rp->header_sb to +/// rp->header_buf, and return an iovec object pointing to +/// rp->header_buf. +/// iovec_t alts_grpc_record_protocol_get_header_iovec( alts_grpc_record_protocol* rp); -/** - * Initializes an alts_grpc_record_protocol object, given a gsec_aead_crypter - * instance, the overflow size of the counter in bytes, a flag indicating if the - * object is used for client or server side, a flag indicating if it is used for - * integrity-only or privacy-integrity mode, and a flag indicating if it is for - * protect or unprotect. The ownership of gsec_aead_crypter object is - * transferred to the alts_grpc_record_protocol object. - */ +/// +/// Initializes an alts_grpc_record_protocol object, given a gsec_aead_crypter +/// instance, the overflow size of the counter in bytes, a flag indicating if +/// the object is used for client or server side, a flag indicating if it is +/// used for integrity-only or privacy-integrity mode, and a flag indicating if +/// it is for protect or unprotect. The ownership of gsec_aead_crypter object is +/// transferred to the alts_grpc_record_protocol object. +/// tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp, gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_integrity_only, bool is_protect); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_COMMON_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_GRPC_RECORD_PROTOCOL_COMMON_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc index 26c18a45048..e8f302b91cf 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -36,7 +36,7 @@ struct alts_iovec_record_protocol { bool is_protect; }; -/* Copies error message to destination. */ +// Copies error message to destination. static void maybe_copy_error_msg(const char* src, char** dst) { if (dst != nullptr && src != nullptr) { *dst = static_cast(gpr_malloc(strlen(src) + 1)); @@ -44,7 +44,7 @@ static void maybe_copy_error_msg(const char* src, char** dst) { } } -/* Appends error message to destination. */ +// Appends error message to destination. static void maybe_append_error_msg(const char* appendix, char** dst) { if (dst != nullptr && appendix != nullptr) { int dst_len = static_cast(strlen(*dst)); @@ -54,7 +54,7 @@ static void maybe_append_error_msg(const char* appendix, char** dst) { } } -/* Use little endian to interpret a string of bytes as uint32_t. */ +// Use little endian to interpret a string of bytes as uint32_t. static uint32_t load_32_le(const unsigned char* buffer) { return (static_cast(buffer[3]) << 24) | (static_cast(buffer[2]) << 16) | @@ -62,7 +62,7 @@ static uint32_t load_32_le(const unsigned char* buffer) { static_cast(buffer[0]); } -/* Store uint32_t as a string of little endian bytes. */ +// Store uint32_t as a string of little endian bytes. static void store_32_le(uint32_t value, unsigned char* buffer) { buffer[3] = static_cast(value >> 24) & 0xFF; buffer[2] = static_cast(value >> 16) & 0xFF; @@ -70,7 +70,7 @@ static void store_32_le(uint32_t value, unsigned char* buffer) { buffer[0] = static_cast(value) & 0xFF; } -/* Ensures header and tag iovec have sufficient length. */ +// Ensures header and tag iovec have sufficient length. static grpc_status_code ensure_header_and_tag_length( const alts_iovec_record_protocol* rp, iovec_t header, iovec_t tag, char** error_details) { @@ -96,7 +96,7 @@ static grpc_status_code ensure_header_and_tag_length( return GRPC_STATUS_OK; } -/* Increments crypter counter and checks overflow. */ +// Increments crypter counter and checks overflow. static grpc_status_code increment_counter(alts_counter* counter, char** error_details) { if (counter == nullptr) { @@ -115,7 +115,7 @@ static grpc_status_code increment_counter(alts_counter* counter, return GRPC_STATUS_OK; } -/* Given an array of iovec, computes the total length of buffer. */ +// Given an array of iovec, computes the total length of buffer. static size_t get_total_length(const iovec_t* vec, size_t vec_length) { size_t total_length = 0; for (size_t i = 0; i < vec_length; ++i) { @@ -124,7 +124,7 @@ static size_t get_total_length(const iovec_t* vec, size_t vec_length) { return total_length; } -/* Writes frame header given data and tag length. */ +// Writes frame header given data and tag length. static grpc_status_code write_frame_header(size_t data_length, unsigned char* header, char** error_details) { @@ -139,7 +139,7 @@ static grpc_status_code write_frame_header(size_t data_length, return GRPC_STATUS_OK; } -/* Verifies frame header given protected data length. */ +// Verifies frame header given protected data length. static grpc_status_code verify_frame_header(size_t data_length, unsigned char* header, char** error_details) { @@ -160,7 +160,7 @@ static grpc_status_code verify_frame_header(size_t data_length, return GRPC_STATUS_OK; } -/* --- alts_iovec_record_protocol methods implementation. --- */ +// --- alts_iovec_record_protocol methods implementation. --- size_t alts_iovec_record_protocol_get_header_length() { return kZeroCopyFrameHeaderSize; @@ -189,7 +189,7 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_protect( alts_iovec_record_protocol* rp, const iovec_t* unprotected_vec, size_t unprotected_vec_length, iovec_t header, iovec_t tag, char** error_details) { - /* Input sanity checks. */ + // Input sanity checks. if (rp == nullptr) { maybe_copy_error_msg("Input iovec_record_protocol is nullptr.", error_details); @@ -211,17 +211,17 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_protect( if (status != GRPC_STATUS_OK) { return status; } - /* Unprotected data should not be zero length. */ + // Unprotected data should not be zero length. size_t data_length = get_total_length(unprotected_vec, unprotected_vec_length); - /* Sets frame header. */ + // Sets frame header. status = write_frame_header(data_length + rp->tag_length, static_cast(header.iov_base), error_details); if (status != GRPC_STATUS_OK) { return status; } - /* Computes frame tag by calling AEAD crypter. */ + // Computes frame tag by calling AEAD crypter. size_t bytes_written = 0; status = gsec_aead_crypter_encrypt_iovec( rp->crypter, alts_counter_get_counter(rp->ctr), @@ -236,7 +236,7 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_protect( error_details); return GRPC_STATUS_INTERNAL; } - /* Increments the crypter counter. */ + // Increments the crypter counter. return increment_counter(rp->ctr, error_details); } @@ -244,7 +244,7 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_unprotect( alts_iovec_record_protocol* rp, const iovec_t* protected_vec, size_t protected_vec_length, iovec_t header, iovec_t tag, char** error_details) { - /* Input sanity checks. */ + // Input sanity checks. if (rp == nullptr) { maybe_copy_error_msg("Input iovec_record_protocol is nullptr.", error_details); @@ -264,16 +264,16 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_unprotect( grpc_status_code status = ensure_header_and_tag_length(rp, header, tag, error_details); if (status != GRPC_STATUS_OK) return status; - /* Protected data should not be zero length. */ + // Protected data should not be zero length. size_t data_length = get_total_length(protected_vec, protected_vec_length); - /* Verifies frame header. */ + // Verifies frame header. status = verify_frame_header(data_length + rp->tag_length, static_cast(header.iov_base), error_details); if (status != GRPC_STATUS_OK) { return status; } - /* Verifies frame tag by calling AEAD crypter. */ + // Verifies frame tag by calling AEAD crypter. iovec_t plaintext = {nullptr, 0}; size_t bytes_written = 0; status = gsec_aead_crypter_decrypt_iovec( @@ -284,7 +284,7 @@ grpc_status_code alts_iovec_record_protocol_integrity_only_unprotect( maybe_append_error_msg(" Frame tag verification failed.", error_details); return GRPC_STATUS_INTERNAL; } - /* Increments the crypter counter. */ + // Increments the crypter counter. return increment_counter(rp->ctr, error_details); } @@ -292,7 +292,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_protect( alts_iovec_record_protocol* rp, const iovec_t* unprotected_vec, size_t unprotected_vec_length, iovec_t protected_frame, char** error_details) { - /* Input sanity checks. */ + // Input sanity checks. if (rp == nullptr) { maybe_copy_error_msg("Input iovec_record_protocol is nullptr.", error_details); @@ -309,10 +309,10 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_protect( error_details); return GRPC_STATUS_FAILED_PRECONDITION; } - /* Unprotected data should not be zero length. */ + // Unprotected data should not be zero length. size_t data_length = get_total_length(unprotected_vec, unprotected_vec_length); - /* Ensures protected frame iovec has sufficient size. */ + // Ensures protected frame iovec has sufficient size. if (protected_frame.iov_base == nullptr) { maybe_copy_error_msg("Protected frame is nullptr.", error_details); return GRPC_STATUS_INVALID_ARGUMENT; @@ -323,14 +323,14 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_protect( maybe_copy_error_msg("Protected frame size is incorrect.", error_details); return GRPC_STATUS_INVALID_ARGUMENT; } - /* Writer frame header. */ + // Writer frame header. grpc_status_code status = write_frame_header( data_length + rp->tag_length, static_cast(protected_frame.iov_base), error_details); if (status != GRPC_STATUS_OK) { return status; } - /* Encrypt unprotected data by calling AEAD crypter. */ + // Encrypt unprotected data by calling AEAD crypter. unsigned char* ciphertext_buffer = static_cast(protected_frame.iov_base) + alts_iovec_record_protocol_get_header_length(); @@ -350,7 +350,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_protect( error_details); return GRPC_STATUS_INTERNAL; } - /* Increments the crypter counter. */ + // Increments the crypter counter. return increment_counter(rp->ctr, error_details); } @@ -358,7 +358,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( alts_iovec_record_protocol* rp, iovec_t header, const iovec_t* protected_vec, size_t protected_vec_length, iovec_t unprotected_data, char** error_details) { - /* Input sanity checks. */ + // Input sanity checks. if (rp == nullptr) { maybe_copy_error_msg("Input iovec_record_protocol is nullptr.", error_details); @@ -375,7 +375,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( "Unprotect operations are not allowed for this object.", error_details); return GRPC_STATUS_FAILED_PRECONDITION; } - /* Protected data size should be no less than tag size. */ + // Protected data size should be no less than tag size. size_t protected_data_length = get_total_length(protected_vec, protected_vec_length); if (protected_data_length < rp->tag_length) { @@ -384,7 +384,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( error_details); return GRPC_STATUS_INVALID_ARGUMENT; } - /* Ensures header has sufficient size. */ + // Ensures header has sufficient size. if (header.iov_base == nullptr) { maybe_copy_error_msg("Header is nullptr.", error_details); return GRPC_STATUS_INVALID_ARGUMENT; @@ -393,19 +393,19 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( maybe_copy_error_msg("Header length is incorrect.", error_details); return GRPC_STATUS_INVALID_ARGUMENT; } - /* Ensures unprotected data iovec has sufficient size. */ + // Ensures unprotected data iovec has sufficient size. if (unprotected_data.iov_len != protected_data_length - rp->tag_length) { maybe_copy_error_msg("Unprotected data size is incorrect.", error_details); return GRPC_STATUS_INVALID_ARGUMENT; } - /* Verify frame header. */ + // Verify frame header. grpc_status_code status = verify_frame_header( protected_data_length, static_cast(header.iov_base), error_details); if (status != GRPC_STATUS_OK) { return status; } - /* Decrypt protected data by calling AEAD crypter. */ + // Decrypt protected data by calling AEAD crypter. size_t bytes_written = 0; status = gsec_aead_crypter_decrypt_iovec( rp->crypter, alts_counter_get_counter(rp->ctr), @@ -422,7 +422,7 @@ grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( error_details); return GRPC_STATUS_INTERNAL; } - /* Increments the crypter counter. */ + // Increments the crypter counter. return increment_counter(rp->ctr, error_details); } @@ -438,21 +438,21 @@ grpc_status_code alts_iovec_record_protocol_create( } alts_iovec_record_protocol* impl = static_cast( gpr_zalloc(sizeof(alts_iovec_record_protocol))); - /* Gets counter length. */ + // Gets counter length. size_t counter_length = 0; grpc_status_code status = gsec_aead_crypter_nonce_length(crypter, &counter_length, error_details); if (status != GRPC_STATUS_OK) { goto cleanup; } - /* Creates counters. */ + // Creates counters. status = alts_counter_create(is_protect ? !is_client : is_client, counter_length, overflow_size, &impl->ctr, error_details); if (status != GRPC_STATUS_OK) { goto cleanup; } - /* Gets tag length. */ + // Gets tag length. status = gsec_aead_crypter_tag_length(crypter, &impl->tag_length, error_details); if (status != GRPC_STATUS_OK) { diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h index 0b7d1bf5bf3..52822a8d380 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_IOVEC_RECORD_PROTOCOL_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_IOVEC_RECORD_PROTOCOL_H @@ -35,165 +35,164 @@ constexpr size_t kZeroCopyFrameHeaderSize = constexpr size_t kAltsRecordProtocolRekeyFrameLimit = 8; constexpr size_t kAltsRecordProtocolFrameLimit = 5; -/* An implementation of alts record protocol. The API is thread-compatible. */ +// An implementation of alts record protocol. The API is thread-compatible. typedef struct iovec iovec_t; typedef struct alts_iovec_record_protocol alts_iovec_record_protocol; -/** - * This method gets the length of record protocol frame header. - */ +/// +/// This method gets the length of record protocol frame header. +/// size_t alts_iovec_record_protocol_get_header_length(); -/** - * This method gets the length of record protocol frame tag. - * - * - rp: an alts_iovec_record_protocol instance. - * - * On success, the method returns the length of record protocol frame tag. - * Otherwise, it returns zero. - */ +/// +/// This method gets the length of record protocol frame tag. +/// +///- rp: an alts_iovec_record_protocol instance. +/// +/// On success, the method returns the length of record protocol frame tag. +/// Otherwise, it returns zero. +/// size_t alts_iovec_record_protocol_get_tag_length( const alts_iovec_record_protocol* rp); -/** - * This method returns maximum allowed unprotected data size, given maximum - * protected frame size. - * - * - rp: an alts_iovec_record_protocol instance. - * - max_protected_frame_size: maximum protected frame size. - * - * On success, the method returns the maximum allowed unprotected data size. - * Otherwise, it returns zero. - */ +/// +/// This method returns maximum allowed unprotected data size, given maximum +/// protected frame size. +/// +///- rp: an alts_iovec_record_protocol instance. +///- max_protected_frame_size: maximum protected frame size. +/// +/// On success, the method returns the maximum allowed unprotected data size. +/// Otherwise, it returns zero. +/// size_t alts_iovec_record_protocol_max_unprotected_data_size( const alts_iovec_record_protocol* rp, size_t max_protected_frame_size); -/** - * This method performs integrity-only protect operation on a - * alts_iovec_record_protocol instance, i.e., compute frame header and tag. The - * caller needs to allocate the memory for header and tag prior to calling this - * method. - * - * - rp: an alts_iovec_record_protocol instance. - * - unprotected_vec: an iovec array containing unprotected data. - * - unprotected_vec_length: the array length of unprotected_vec. - * - header: an iovec containing the output frame header. - * - tag: an iovec containing the output frame tag. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is OK to pass nullptr into error_details. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an - * error status code along with its details specified in error_details (if - * error_details is not nullptr). - */ +/// +/// This method performs integrity-only protect operation on a +/// alts_iovec_record_protocol instance, i.e., compute frame header and tag. The +/// caller needs to allocate the memory for header and tag prior to calling this +/// method. +/// +///- rp: an alts_iovec_record_protocol instance. +///- unprotected_vec: an iovec array containing unprotected data. +///- unprotected_vec_length: the array length of unprotected_vec. +///- header: an iovec containing the output frame header. +///- tag: an iovec containing the output frame tag. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is OK to pass nullptr into error_details. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an +/// error status code along with its details specified in error_details (if +/// error_details is not nullptr). +/// grpc_status_code alts_iovec_record_protocol_integrity_only_protect( alts_iovec_record_protocol* rp, const iovec_t* unprotected_vec, size_t unprotected_vec_length, iovec_t header, iovec_t tag, char** error_details); -/** - * This method performs integrity-only unprotect operation on a - * alts_iovec_record_protocol instance, i.e., verify frame header and tag. - * - * - rp: an alts_iovec_record_protocol instance. - * - protected_vec: an iovec array containing protected data. - * - protected_vec_length: the array length of protected_vec. - * - header: an iovec containing the frame header. - * - tag: an iovec containing the frame tag. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is OK to pass nullptr into error_details. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an - * error status code along with its details specified in error_details (if - * error_details is not nullptr). - */ +/// +/// This method performs integrity-only unprotect operation on a +/// alts_iovec_record_protocol instance, i.e., verify frame header and tag. +/// +///- rp: an alts_iovec_record_protocol instance. +///- protected_vec: an iovec array containing protected data. +///- protected_vec_length: the array length of protected_vec. +///- header: an iovec containing the frame header. +///- tag: an iovec containing the frame tag. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is OK to pass nullptr into error_details. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an +/// error status code along with its details specified in error_details (if +/// error_details is not nullptr). +/// grpc_status_code alts_iovec_record_protocol_integrity_only_unprotect( alts_iovec_record_protocol* rp, const iovec_t* protected_vec, size_t protected_vec_length, iovec_t header, iovec_t tag, char** error_details); -/** - * This method performs privacy-integrity protect operation on a - * alts_iovec_record_protocol instance, i.e., compute a protected frame. The - * caller needs to allocate the memory for the protected frame prior to calling - * this method. - * - * - rp: an alts_iovec_record_protocol instance. - * - unprotected_vec: an iovec array containing unprotected data. - * - unprotected_vec_length: the array length of unprotected_vec. - * - protected_frame: an iovec containing the output protected frame. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is OK to pass nullptr into error_details. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an - * error status code along with its details specified in error_details (if - * error_details is not nullptr). - */ +/// +/// This method performs privacy-integrity protect operation on a +/// alts_iovec_record_protocol instance, i.e., compute a protected frame. The +/// caller needs to allocate the memory for the protected frame prior to calling +/// this method. +/// +///- rp: an alts_iovec_record_protocol instance. +///- unprotected_vec: an iovec array containing unprotected data. +///- unprotected_vec_length: the array length of unprotected_vec. +///- protected_frame: an iovec containing the output protected frame. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is OK to pass nullptr into error_details. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an +/// error status code along with its details specified in error_details (if +/// error_details is not nullptr). +/// grpc_status_code alts_iovec_record_protocol_privacy_integrity_protect( alts_iovec_record_protocol* rp, const iovec_t* unprotected_vec, size_t unprotected_vec_length, iovec_t protected_frame, char** error_details); -/** - * This method performs privacy-integrity unprotect operation on a - * alts_iovec_record_protocol instance given a full protected frame, i.e., - * compute the unprotected data. The caller needs to allocated the memory for - * the unprotected data prior to calling this method. - * - * - rp: an alts_iovec_record_protocol instance. - * - header: an iovec containing the frame header. - * - protected_vec: an iovec array containing protected data including the tag. - * - protected_vec_length: the array length of protected_vec. - * - unprotected_data: an iovec containing the output unprotected data. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is OK to pass nullptr into error_details. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an - * error status code along with its details specified in error_details (if - * error_details is not nullptr). - */ +/// +/// This method performs privacy-integrity unprotect operation on a +/// alts_iovec_record_protocol instance given a full protected frame, i.e., +/// compute the unprotected data. The caller needs to allocated the memory for +/// the unprotected data prior to calling this method. +/// +///- rp: an alts_iovec_record_protocol instance. +///- header: an iovec containing the frame header. +///- protected_vec: an iovec array containing protected data including the tag. +///- protected_vec_length: the array length of protected_vec. +///- unprotected_data: an iovec containing the output unprotected data. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is OK to pass nullptr into error_details. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an +/// error status code along with its details specified in error_details (if +/// error_details is not nullptr). +/// grpc_status_code alts_iovec_record_protocol_privacy_integrity_unprotect( alts_iovec_record_protocol* rp, iovec_t header, const iovec_t* protected_vec, size_t protected_vec_length, iovec_t unprotected_data, char** error_details); -/** - * This method creates an alts_iovec_record_protocol instance, given a - * gsec_aead_crypter instance, a flag indicating if the created instance will be - * used at the client or server side, and a flag indicating if the created - * instance will be used for integrity-only mode or privacy-integrity mode. The - * ownership of gsec_aead_crypter instance is transferred to this new object. - * - * - crypter: a gsec_aead_crypter instance used to perform AEAD decryption. - * - overflow_size: overflow size of counter in bytes. - * - is_client: a flag indicating if the alts_iovec_record_protocol instance - * will be used at the client or server side. - * - is_integrity_only: a flag indicating if the alts_iovec_record_protocol - * instance will be used for integrity-only or privacy-integrity mode. - * - is_protect: a flag indicating if the alts_grpc_record_protocol instance - * will be used for protect or unprotect. - * - rp: an alts_iovec_record_protocol instance to be returned from - * the method. - * - error_details: a buffer containing an error message if the method does not - * function correctly. It is OK to pass nullptr into error_details. - * - * On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an - * error status code along with its details specified in error_details (if - * error_details is not nullptr). - */ +/// +/// This method creates an alts_iovec_record_protocol instance, given a +/// gsec_aead_crypter instance, a flag indicating if the created instance will +/// be used at the client or server side, and a flag indicating if the created +/// instance will be used for integrity-only mode or privacy-integrity mode. The +/// ownership of gsec_aead_crypter instance is transferred to this new object. +/// +///- crypter: a gsec_aead_crypter instance used to perform AEAD decryption. +///- overflow_size: overflow size of counter in bytes. +///- is_client: a flag indicating if the alts_iovec_record_protocol instance +/// will be used at the client or server side. +///- is_integrity_only: a flag indicating if the alts_iovec_record_protocol +/// instance will be used for integrity-only or privacy-integrity mode. +///- is_protect: a flag indicating if the alts_grpc_record_protocol instance +/// will be used for protect or unprotect. +///- rp: an alts_iovec_record_protocol instance to be returned from +/// the method. +///- error_details: a buffer containing an error message if the method does not +/// function correctly. It is OK to pass nullptr into error_details. +/// +/// On success, the method returns GRPC_STATUS_OK. Otherwise, it returns an +/// error status code along with its details specified in error_details (if +/// error_details is not nullptr). +/// grpc_status_code alts_iovec_record_protocol_create( gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_integrity_only, bool is_protect, alts_iovec_record_protocol** rp, char** error_details); -/** - * This method destroys an alts_iovec_record_protocol instance by de-allocating - * all of its occupied memory. A gsec_aead_crypter instance passed in at - * gsec_alts_crypter instance creation time will be destroyed in this method. - */ +/// +/// This method destroys an alts_iovec_record_protocol instance by de-allocating +/// all of its occupied memory. A gsec_aead_crypter instance passed in at +/// gsec_alts_crypter instance creation time will be destroyed in this method. +/// void alts_iovec_record_protocol_destroy(alts_iovec_record_protocol* rp); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_IOVEC_RECORD_PROTOCOL_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_IOVEC_RECORD_PROTOCOL_H diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc index ad35dacee2c..c9757152500 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -39,13 +39,13 @@ constexpr size_t kMinFrameLength = 1024; constexpr size_t kDefaultFrameLength = 16 * 1024; constexpr size_t kMaxFrameLength = 16 * 1024 * 1024; -/** - * Main struct for alts_zero_copy_grpc_protector. - * We choose to have two alts_grpc_record_protocol objects and two sets of slice - * buffers: one for protect and the other for unprotect, so that protect and - * unprotect can be executed in parallel. Implementations of this object must be - * thread compatible. - */ +/// +/// Main struct for alts_zero_copy_grpc_protector. +/// We choose to have two alts_grpc_record_protocol objects and two sets of +/// slice buffers: one for protect and the other for unprotect, so that protect +/// and unprotect can be executed in parallel. Implementations of this object +/// must be thread compatible. +/// typedef struct alts_zero_copy_grpc_protector { tsi_zero_copy_grpc_protector base; alts_grpc_record_protocol* record_protocol; @@ -58,12 +58,12 @@ typedef struct alts_zero_copy_grpc_protector { uint32_t parsed_frame_size; } alts_zero_copy_grpc_protector; -/** - * Given a slice buffer, parses the first 4 bytes little-endian unsigned frame - * size and returns the total frame size including the frame field. Caller - * needs to make sure the input slice buffer has at least 4 bytes. Returns true - * on success and false on failure. - */ +/// +/// Given a slice buffer, parses the first 4 bytes little-endian unsigned frame +/// size and returns the total frame size including the frame field. Caller +/// needs to make sure the input slice buffer has at least 4 bytes. Returns true +/// on success and false on failure. +/// static bool read_frame_size(const grpc_slice_buffer* sb, uint32_t* total_frame_size) { if (sb == nullptr || sb->length < kZeroCopyFrameLengthFieldSize) { @@ -71,7 +71,7 @@ static bool read_frame_size(const grpc_slice_buffer* sb, } uint8_t frame_size_buffer[kZeroCopyFrameLengthFieldSize]; uint8_t* buf = frame_size_buffer; - /* Copies the first 4 bytes to a temporary buffer. */ + // Copies the first 4 bytes to a temporary buffer. size_t remaining = kZeroCopyFrameLengthFieldSize; for (size_t i = 0; i < sb->count; i++) { size_t slice_length = GRPC_SLICE_LENGTH(sb->slices[i]); @@ -86,7 +86,7 @@ static bool read_frame_size(const grpc_slice_buffer* sb, } } GPR_ASSERT(remaining == 0); - /* Gets little-endian frame size. */ + // Gets little-endian frame size. uint32_t frame_size = (static_cast(frame_size_buffer[3]) << 24) | (static_cast(frame_size_buffer[2]) << 16) | (static_cast(frame_size_buffer[1]) << 8) | @@ -95,19 +95,19 @@ static bool read_frame_size(const grpc_slice_buffer* sb, gpr_log(GPR_ERROR, "Frame size is larger than maximum frame size"); return false; } - /* Returns frame size including frame length field. */ + // Returns frame size including frame length field. *total_frame_size = static_cast(frame_size + kZeroCopyFrameLengthFieldSize); return true; } -/** - * Creates an alts_grpc_record_protocol object, given key, key size, and flags - * to indicate whether the record_protocol object uses the rekeying AEAD, - * whether the object is for client or server, whether the object is for - * integrity-only or privacy-integrity mode, and whether the object is used - * for protect or unprotect. - */ +/// +/// Creates an alts_grpc_record_protocol object, given key, key size, and flags +/// to indicate whether the record_protocol object uses the rekeying AEAD, +/// whether the object is for client or server, whether the object is for +/// integrity-only or privacy-integrity mode, and whether the object is used +/// for protect or unprotect. +/// static tsi_result create_alts_grpc_record_protocol( const uint8_t* key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool is_protect, bool enable_extra_copy, @@ -128,8 +128,8 @@ static tsi_result create_alts_grpc_record_protocol( } size_t overflow_limit = is_rekey ? kAltsRecordProtocolRekeyFrameLimit : kAltsRecordProtocolFrameLimit; - /* Creates alts_grpc_record_protocol with AEAD crypter ownership transferred. - */ + // Creates alts_grpc_record_protocol with AEAD crypter ownership transferred. + // tsi_result result = is_integrity_only ? alts_grpc_integrity_only_record_protocol_create( crypter, overflow_limit, is_client, is_protect, @@ -144,7 +144,7 @@ static tsi_result create_alts_grpc_record_protocol( return TSI_OK; } -/* --- tsi_zero_copy_grpc_protector methods implementation. --- */ +// --- tsi_zero_copy_grpc_protector methods implementation. --- static tsi_result alts_zero_copy_grpc_protector_protect( tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices, @@ -156,7 +156,7 @@ static tsi_result alts_zero_copy_grpc_protector_protect( } alts_zero_copy_grpc_protector* protector = reinterpret_cast(self); - /* Calls alts_grpc_record_protocol protect repeatly. */ + // Calls alts_grpc_record_protocol protect repeatly. while (unprotected_slices->length > protector->max_unprotected_data_size) { grpc_slice_buffer_move_first(unprotected_slices, protector->max_unprotected_data_size, @@ -184,10 +184,10 @@ static tsi_result alts_zero_copy_grpc_protector_unprotect( alts_zero_copy_grpc_protector* protector = reinterpret_cast(self); grpc_slice_buffer_move_into(protected_slices, &protector->protected_sb); - /* Keep unprotecting each frame if possible. */ + // Keep unprotecting each frame if possible. while (protector->protected_sb.length >= kZeroCopyFrameLengthFieldSize) { if (protector->parsed_frame_size == 0) { - /* We have not parsed frame size yet. Parses frame size. */ + // We have not parsed frame size yet. Parses frame size. if (!read_frame_size(&protector->protected_sb, &protector->parsed_frame_size)) { grpc_slice_buffer_reset_and_unref(&protector->protected_sb); @@ -195,7 +195,7 @@ static tsi_result alts_zero_copy_grpc_protector_unprotect( } } if (protector->protected_sb.length < protector->parsed_frame_size) break; - /* At this point, protected_sb contains at least one frame of data. */ + // At this point, protected_sb contains at least one frame of data. tsi_result status; if (protector->protected_sb.length == protector->parsed_frame_size) { status = alts_grpc_record_protocol_unprotect(protector->unrecord_protocol, @@ -269,11 +269,11 @@ tsi_result alts_zero_copy_grpc_protector_create( "Invalid nullptr arguments to alts_zero_copy_grpc_protector create."); return TSI_INVALID_ARGUMENT; } - /* Creates alts_zero_copy_protector. */ + // Creates alts_zero_copy_protector. alts_zero_copy_grpc_protector* impl = static_cast( gpr_zalloc(sizeof(alts_zero_copy_grpc_protector))); - /* Creates alts_grpc_record_protocol objects. */ + // Creates alts_grpc_record_protocol objects. tsi_result status = create_alts_grpc_record_protocol( key, key_size, is_rekey, is_client, is_integrity_only, /*is_protect=*/true, enable_extra_copy, &impl->record_protocol); @@ -282,7 +282,7 @@ tsi_result alts_zero_copy_grpc_protector_create( key, key_size, is_rekey, is_client, is_integrity_only, /*is_protect=*/false, enable_extra_copy, &impl->unrecord_protocol); if (status == TSI_OK) { - /* Sets maximum frame size. */ + // Sets maximum frame size. size_t max_protected_frame_size_to_set = kDefaultFrameLength; if (max_protected_frame_size != nullptr) { *max_protected_frame_size = @@ -296,7 +296,7 @@ tsi_result alts_zero_copy_grpc_protector_create( alts_grpc_record_protocol_max_unprotected_data_size( impl->record_protocol, max_protected_frame_size_to_set); GPR_ASSERT(impl->max_unprotected_data_size > 0); - /* Allocates internal slice buffers. */ + // Allocates internal slice buffers. grpc_slice_buffer_init(&impl->unprotected_staging_sb); grpc_slice_buffer_init(&impl->protected_sb); grpc_slice_buffer_init(&impl->protected_staging_sb); @@ -307,7 +307,7 @@ tsi_result alts_zero_copy_grpc_protector_create( } } - /* Cleanup if create failed. */ + // Cleanup if create failed. alts_grpc_record_protocol_destroy(impl->record_protocol); alts_grpc_record_protocol_destroy(impl->unrecord_protocol); gpr_free(impl); diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h index 515c27ea052..cb381533786 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_ZERO_COPY_GRPC_PROTECTOR_H #define GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_ZERO_COPY_GRPC_PROTECTOR_H @@ -25,33 +25,32 @@ #include "src/core/tsi/transport_security_grpc.h" -/** - * This method creates an ALTS zero-copy grpc protector. - * - * - key: a symmetric key used to seal/unseal frames. - * - key_size: the size of symmetric key. - * - is_rekey: use rekeying AEAD crypter. - * - is_client: a flag indicating if the protector will be used at client or - * server side. - * - is_integrity_only: a flag indicating if the protector instance will be - * used for integrity-only or privacy-integrity mode. - * - enable_extra_copy: a flag indicating if the protector instance does one - * extra memory copy during the protect operation for integrity_only mode. - * For the unprotect operation, it is still zero-copy. If application intends - * to modify the data buffer after the protect operation, we can turn on this - * mode to avoid integrity check failure. - * - max_protected_frame_size: an in/out parameter indicating max frame size - * to be used by the protector. If it is nullptr, the default frame size will - * be used. Otherwise, the provided frame size will be adjusted (if not - * falling into a valid frame range) and used. - * - protector: a pointer to the zero-copy protector returned from the method. - * - * This method returns TSI_OK on success or a specific error code otherwise. - */ +/// +/// This method creates an ALTS zero-copy grpc protector. +/// +///- key: a symmetric key used to seal/unseal frames. +///- key_size: the size of symmetric key. +///- is_rekey: use rekeying AEAD crypter. +///- is_client: a flag indicating if the protector will be used at client or +/// server side. +///- is_integrity_only: a flag indicating if the protector instance will be +/// used for integrity-only or privacy-integrity mode. +///- enable_extra_copy: a flag indicating if the protector instance does one +/// extra memory copy during the protect operation for integrity_only mode. +/// For the unprotect operation, it is still zero-copy. If application intends +/// to modify the data buffer after the protect operation, we can turn on this +/// mode to avoid integrity check failure. +///- max_protected_frame_size: an in/out parameter indicating max frame size +/// to be used by the protector. If it is nullptr, the default frame size will +/// be used. Otherwise, the provided frame size will be adjusted (if not +/// falling into a valid frame range) and used. +///- protector: a pointer to the zero-copy protector returned from the method. +/// +/// This method returns TSI_OK on success or a specific error code otherwise. +/// tsi_result alts_zero_copy_grpc_protector_create( const uint8_t* key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool enable_extra_copy, size_t* max_protected_frame_size, tsi_zero_copy_grpc_protector** protector); -#endif /* GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_ZERO_COPY_GRPC_PROTECTOR_H \ - */ +#endif // GRPC_CORE_TSI_ALTS_ZERO_COPY_FRAME_PROTECTOR_ALTS_ZERO_COPY_GRPC_PROTECTOR_H diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc index c0d451701ac..4c81572009f 100644 --- a/src/core/tsi/fake_transport_security.cc +++ b/src/core/tsi/fake_transport_security.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -31,18 +31,18 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/tsi/transport_security_grpc.h" -/* --- Constants. ---*/ +// --- Constants. --- #define TSI_FAKE_FRAME_HEADER_SIZE 4 #define TSI_FAKE_FRAME_INITIAL_ALLOCATED_SIZE 64 #define TSI_FAKE_DEFAULT_FRAME_SIZE 16384 #define TSI_FAKE_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE 256 -/* --- Structure definitions. ---*/ +// --- Structure definitions. --- -/* a frame is encoded like this: - | size | data | - where the size field value is the size of the size field plus the size of - the data encoded in little endian on 4 bytes. */ +// a frame is encoded like this: +// | size | data | +// where the size field value is the size of the size field plus the size of +// the data encoded in little endian on 4 bytes. struct tsi_fake_frame { unsigned char* data; size_t size; @@ -82,7 +82,7 @@ struct tsi_fake_zero_copy_grpc_protector { size_t max_frame_size; size_t parsed_frame_size; }; -/* --- Utils. ---*/ +// --- Utils. --- static const char* tsi_fake_handshake_message_strings[] = { "CLIENT_INIT", "SERVER_INIT", "CLIENT_FINISHED", "SERVER_FINISHED"}; @@ -127,7 +127,7 @@ static uint32_t read_frame_size(const grpc_slice_buffer* sb) { GPR_ASSERT(sb != nullptr && sb->length >= TSI_FAKE_FRAME_HEADER_SIZE); uint8_t frame_size_buffer[TSI_FAKE_FRAME_HEADER_SIZE]; uint8_t* buf = frame_size_buffer; - /* Copies the first 4 bytes to a temporary buffer. */ + // Copies the first 4 bytes to a temporary buffer. size_t remaining = TSI_FAKE_FRAME_HEADER_SIZE; for (size_t i = 0; i < sb->count; i++) { size_t slice_length = GRPC_SLICE_LENGTH(sb->slices[i]); @@ -156,8 +156,8 @@ static void tsi_fake_frame_reset(tsi_fake_frame* frame, int needs_draining) { if (!needs_draining) frame->size = 0; } -/* Checks if the frame's allocated size is at least frame->size, and reallocs - * more memory if necessary. */ +// Checks if the frame's allocated size is at least frame->size, and reallocs +// more memory if necessary. static void tsi_fake_frame_ensure_size(tsi_fake_frame* frame) { if (frame->data == nullptr) { frame->allocated_size = frame->size; @@ -171,9 +171,9 @@ static void tsi_fake_frame_ensure_size(tsi_fake_frame* frame) { } } -/* Decodes the serialized fake frame contained in incoming_bytes, and fills - * frame with the contents of the decoded frame. - * This method should not be called if frame->needs_framing is not 0. */ +// Decodes the serialized fake frame contained in incoming_bytes, and fills +// frame with the contents of the decoded frame. +// This method should not be called if frame->needs_framing is not 0. static tsi_result tsi_fake_frame_decode(const unsigned char* incoming_bytes, size_t* incoming_bytes_size, tsi_fake_frame* frame, @@ -195,7 +195,7 @@ static tsi_result tsi_fake_frame_decode(const unsigned char* incoming_bytes, if (frame->offset < TSI_FAKE_FRAME_HEADER_SIZE) { to_read_size = TSI_FAKE_FRAME_HEADER_SIZE - frame->offset; if (to_read_size > available_size) { - /* Just fill what we can and exit. */ + // Just fill what we can and exit. memcpy(frame->data + frame->offset, bytes_cursor, available_size); bytes_cursor += available_size; frame->offset += available_size; @@ -225,9 +225,9 @@ static tsi_result tsi_fake_frame_decode(const unsigned char* incoming_bytes, return TSI_OK; } -/* Encodes a fake frame into its wire format and places the result in - * outgoing_bytes. outgoing_bytes_size indicates the size of the encoded frame. - * This method should not be called if frame->needs_framing is 0. */ +// Encodes a fake frame into its wire format and places the result in +// outgoing_bytes. outgoing_bytes_size indicates the size of the encoded frame. +// This method should not be called if frame->needs_framing is 0. static tsi_result tsi_fake_frame_encode(unsigned char* outgoing_bytes, size_t* outgoing_bytes_size, tsi_fake_frame* frame, @@ -248,8 +248,8 @@ static tsi_result tsi_fake_frame_encode(unsigned char* outgoing_bytes, return TSI_OK; } -/* Sets the payload of a fake frame to contain the given data blob, where - * data_size indicates the size of data. */ +// Sets the payload of a fake frame to contain the given data blob, where +// data_size indicates the size of data. static void tsi_fake_frame_set_data(unsigned char* data, size_t data_size, tsi_fake_frame* frame) { frame->offset = 0; @@ -260,12 +260,12 @@ static void tsi_fake_frame_set_data(unsigned char* data, size_t data_size, tsi_fake_frame_reset(frame, 1 /* needs draining */); } -/* Destroys the contents of a fake frame. */ +// Destroys the contents of a fake frame. static void tsi_fake_frame_destruct(tsi_fake_frame* frame) { if (frame->data != nullptr) gpr_free(frame->data); } -/* --- tsi_frame_protector methods implementation. ---*/ +// --- tsi_frame_protector methods implementation. --- static tsi_result fake_protector_protect(tsi_frame_protector* self, const unsigned char* unprotected_bytes, @@ -282,7 +282,7 @@ static tsi_result fake_protector_protect(tsi_frame_protector* self, size_t* num_bytes_written = protected_output_frames_size; *num_bytes_written = 0; - /* Try to drain first. */ + // Try to drain first. if (frame->needs_draining) { drained_size = saved_output_size - *num_bytes_written; result = tsi_fake_frame_encode(protected_output_frames, &drained_size, @@ -298,10 +298,10 @@ static tsi_result fake_protector_protect(tsi_frame_protector* self, } } - /* Now process the unprotected_bytes. */ + // Now process the unprotected_bytes. if (frame->needs_draining) return TSI_INTERNAL_ERROR; if (frame->size == 0) { - /* New frame, create a header. */ + // New frame, create a header. size_t written_in_frame_size = 0; store32_little_endian(static_cast(impl->max_frame_size), frame_header); @@ -322,7 +322,7 @@ static tsi_result fake_protector_protect(tsi_frame_protector* self, return result; } - /* Try to drain again. */ + // Try to drain again. if (!frame->needs_draining) return TSI_INTERNAL_ERROR; if (frame->offset != 0) return TSI_INTERNAL_ERROR; drained_size = saved_output_size - *num_bytes_written; @@ -341,12 +341,12 @@ static tsi_result fake_protector_protect_flush( reinterpret_cast(self); tsi_fake_frame* frame = &impl->protect_frame; if (!frame->needs_draining) { - /* Create a short frame. */ + // Create a short frame. frame->size = frame->offset; frame->offset = 0; frame->needs_draining = 1; store32_little_endian(static_cast(frame->size), - frame->data); /* Overwrite header. */ + frame->data); // Overwrite header. } result = tsi_fake_frame_encode(protected_output_frames, protected_output_frames_size, frame, @@ -369,9 +369,9 @@ static tsi_result fake_protector_unprotect( size_t* num_bytes_written = unprotected_bytes_size; *num_bytes_written = 0; - /* Try to drain first. */ + // Try to drain first. if (frame->needs_draining) { - /* Go past the header if needed. */ + // Go past the header if needed. if (frame->offset == 0) frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; drained_size = saved_output_size - *num_bytes_written; result = tsi_fake_frame_encode(unprotected_bytes, &drained_size, frame, @@ -387,7 +387,7 @@ static tsi_result fake_protector_unprotect( } } - /* Now process the protected_bytes. */ + // Now process the protected_bytes. if (frame->needs_draining) return TSI_INTERNAL_ERROR; result = tsi_fake_frame_decode(protected_frames_bytes, protected_frames_bytes_size, frame, @@ -397,10 +397,10 @@ static tsi_result fake_protector_unprotect( return result; } - /* Try to drain again. */ + // Try to drain again. if (!frame->needs_draining) return TSI_INTERNAL_ERROR; if (frame->offset != 0) return TSI_INTERNAL_ERROR; - frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; /* Go past the header. */ + frame->offset = TSI_FAKE_FRAME_HEADER_SIZE; // Go past the header. drained_size = saved_output_size - *num_bytes_written; result = tsi_fake_frame_encode(unprotected_bytes, &drained_size, frame, /*error=*/nullptr); @@ -424,7 +424,7 @@ static const tsi_frame_protector_vtable frame_protector_vtable = { fake_protector_destroy, }; -/* --- tsi_zero_copy_grpc_protector methods implementation. ---*/ +// --- tsi_zero_copy_grpc_protector methods implementation. --- static tsi_result fake_zero_copy_grpc_protector_protect( tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices, @@ -435,7 +435,7 @@ static tsi_result fake_zero_copy_grpc_protector_protect( } tsi_fake_zero_copy_grpc_protector* impl = reinterpret_cast(self); - /* Protects each frame. */ + // Protects each frame. while (unprotected_slices->length > 0) { size_t frame_length = std::min(impl->max_frame_size, @@ -461,7 +461,7 @@ static tsi_result fake_zero_copy_grpc_protector_unprotect( tsi_fake_zero_copy_grpc_protector* impl = reinterpret_cast(self); grpc_slice_buffer_move_into(protected_slices, &impl->protected_sb); - /* Unprotect each frame, if we get a full frame. */ + // Unprotect each frame, if we get a full frame. while (impl->protected_sb.length >= TSI_FAKE_FRAME_HEADER_SIZE) { if (impl->parsed_frame_size == 0) { impl->parsed_frame_size = read_frame_size(&impl->protected_sb); @@ -470,12 +470,12 @@ static tsi_result fake_zero_copy_grpc_protector_unprotect( return TSI_DATA_CORRUPTED; } } - /* If we do not have a full frame, return with OK status. */ + // If we do not have a full frame, return with OK status. if (impl->protected_sb.length < impl->parsed_frame_size) break; - /* Strips header bytes. */ + // Strips header bytes. grpc_slice_buffer_move_first(&impl->protected_sb, TSI_FAKE_FRAME_HEADER_SIZE, &impl->header_sb); - /* Moves data to unprotected slices. */ + // Moves data to unprotected slices. grpc_slice_buffer_move_first( &impl->protected_sb, impl->parsed_frame_size - TSI_FAKE_FRAME_HEADER_SIZE, @@ -520,7 +520,7 @@ static const tsi_zero_copy_grpc_protector_vtable fake_zero_copy_grpc_protector_max_frame_size, }; -/* --- tsi_handshaker_result methods implementation. ---*/ +// --- tsi_handshaker_result methods implementation. --- struct fake_handshaker_result { tsi_handshaker_result base; @@ -530,7 +530,7 @@ struct fake_handshaker_result { static tsi_result fake_handshaker_result_extract_peer( const tsi_handshaker_result* /*self*/, tsi_peer* peer) { - /* Construct a tsi_peer with 1 property: certificate type, security_level. */ + // Construct a tsi_peer with 1 property: certificate type, security_level. tsi_result result = tsi_construct_peer(2, peer); if (result != TSI_OK) return result; result = tsi_construct_string_peer_property_from_cstring( @@ -613,7 +613,7 @@ static tsi_result fake_handshaker_result_create( return TSI_OK; } -/* --- tsi_handshaker methods implementation. ---*/ +// --- tsi_handshaker methods implementation. --- static tsi_result fake_handshaker_get_bytes_to_send_to_peer( tsi_handshaker* self, unsigned char* bytes, size_t* bytes_size, @@ -648,7 +648,7 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( if (result != TSI_OK) return result; if (!impl->is_client && impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { - /* We're done. */ + // We're done. if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { gpr_log(GPR_INFO, "Server is done."); } @@ -676,7 +676,7 @@ static tsi_result fake_handshaker_process_bytes_from_peer( tsi_fake_frame_decode(bytes, bytes_size, &impl->incoming_frame, error); if (result != TSI_OK) return result; - /* We now have a complete frame. */ + // We now have a complete frame. result = tsi_fake_handshake_message_from_string( reinterpret_cast(impl->incoming_frame.data) + TSI_FAKE_FRAME_HEADER_SIZE, @@ -697,7 +697,7 @@ static tsi_result fake_handshaker_process_bytes_from_peer( tsi_fake_frame_reset(&impl->incoming_frame, 0 /* needs_draining */); impl->needs_incoming_message = 0; if (impl->next_message_to_send == TSI_FAKE_HANDSHAKE_MESSAGE_MAX) { - /* We're done. */ + // We're done. if (GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { gpr_log(GPR_INFO, "%s is done.", impl->is_client ? "Client" : "Server"); } @@ -725,7 +725,7 @@ static tsi_result fake_handshaker_next( size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result, tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/, std::string* error) { - /* Sanity check the arguments. */ + // Sanity check the arguments. if ((received_bytes_size > 0 && received_bytes == nullptr) || bytes_to_send == nullptr || bytes_to_send_size == nullptr || handshaker_result == nullptr) { @@ -736,7 +736,7 @@ static tsi_result fake_handshaker_next( reinterpret_cast(self); tsi_result result = TSI_OK; - /* Decode and process a handshake frame from the peer. */ + // Decode and process a handshake frame from the peer. size_t consumed_bytes_size = received_bytes_size; if (received_bytes_size > 0) { result = fake_handshaker_process_bytes_from_peer( @@ -744,8 +744,8 @@ static tsi_result fake_handshaker_next( if (result != TSI_OK) return result; } - /* Create a handshake message to send to the peer and encode it as a fake - * frame. */ + // Create a handshake message to send to the peer and encode it as a fake + // frame. size_t offset = 0; do { size_t sent_bytes_size = handshaker->outgoing_bytes_buffer_size - offset; @@ -764,23 +764,23 @@ static tsi_result fake_handshaker_next( *bytes_to_send = handshaker->outgoing_bytes_buffer; *bytes_to_send_size = offset; - /* Check if the handshake was completed. */ + // Check if the handshake was completed. if (fake_handshaker_get_result(self) == TSI_HANDSHAKE_IN_PROGRESS) { *handshaker_result = nullptr; } else { - /* Calculate the unused bytes. */ + // Calculate the unused bytes. const unsigned char* unused_bytes = nullptr; size_t unused_bytes_size = received_bytes_size - consumed_bytes_size; if (unused_bytes_size > 0) { unused_bytes = received_bytes + consumed_bytes_size; } - /* Create a handshaker_result containing the unused bytes. */ + // Create a handshaker_result containing the unused bytes. result = fake_handshaker_result_create(unused_bytes, unused_bytes_size, handshaker_result, error); if (result == TSI_OK) { - /* Indicate that the handshake has completed and that a handshaker_result - * has been created. */ + // Indicate that the handshake has completed and that a handshaker_result + // has been created. self->handshaker_result_created = true; } } @@ -788,14 +788,14 @@ static tsi_result fake_handshaker_next( } static const tsi_handshaker_vtable handshaker_vtable = { - nullptr, /* get_bytes_to_send_to_peer -- deprecated */ - nullptr, /* process_bytes_from_peer -- deprecated */ - nullptr, /* get_result -- deprecated */ - nullptr, /* extract_peer -- deprecated */ - nullptr, /* create_frame_protector -- deprecated */ + nullptr, // get_bytes_to_send_to_peer -- deprecated + nullptr, // process_bytes_from_peer -- deprecated + nullptr, // get_result -- deprecated + nullptr, // extract_peer -- deprecated + nullptr, // create_frame_protector -- deprecated fake_handshaker_destroy, fake_handshaker_next, - nullptr, /* shutdown */ + nullptr, // shutdown }; tsi_handshaker* tsi_create_fake_handshaker(int is_client) { diff --git a/src/core/tsi/fake_transport_security.h b/src/core/tsi/fake_transport_security.h index b2cf5ffc15a..ec877a0c455 100644 --- a/src/core/tsi/fake_transport_security.h +++ b/src/core/tsi/fake_transport_security.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_TSI_FAKE_TRANSPORT_SECURITY_H #define GRPC_CORE_TSI_FAKE_TRANSPORT_SECURITY_H @@ -24,30 +24,30 @@ #include "src/core/lib/slice/slice_internal.h" #include "src/core/tsi/transport_security_interface.h" -/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for FAKE certs. */ +// Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for FAKE certs. #define TSI_FAKE_CERTIFICATE_TYPE "FAKE" -/* Value of the TSI_SECURITY_LEVEL_PEER_PROPERTY property for FAKE certs. */ +// Value of the TSI_SECURITY_LEVEL_PEER_PROPERTY property for FAKE certs. #define TSI_FAKE_SECURITY_LEVEL "TSI_SECURITY_NONE" -/* Creates a fake handshaker that will create a fake frame protector. +// Creates a fake handshaker that will create a fake frame protector. - No cryptography is performed in these objects. They just simulate handshake - messages going back and forth for the handshaker and do some framing on - cleartext data for the protector. */ +// No cryptography is performed in these objects. They just simulate handshake +// messages going back and forth for the handshaker and do some framing on +// cleartext data for the protector. tsi_handshaker* tsi_create_fake_handshaker(int is_client); -/* Creates a protector directly without going through the handshake phase. */ +// Creates a protector directly without going through the handshake phase. tsi_frame_protector* tsi_create_fake_frame_protector( size_t* max_protected_frame_size); -/* Creates a zero-copy protector directly without going through the handshake - * phase. */ +// Creates a zero-copy protector directly without going through the handshake +// phase. tsi_zero_copy_grpc_protector* tsi_create_fake_zero_copy_grpc_protector( size_t* max_protected_frame_size); -/* Given a buffer containing slices encrypted by a fake_zero_copy_protector - * it parses these protected slices to return the total frame size of the first - * contained frame */ +// Given a buffer containing slices encrypted by a fake_zero_copy_protector +// it parses these protected slices to return the total frame size of the first +// contained frame uint32_t tsi_fake_zero_copy_grpc_protector_next_frame_size( const grpc_slice_buffer* protected_slices); -#endif /* GRPC_CORE_TSI_FAKE_TRANSPORT_SECURITY_H */ +#endif // GRPC_CORE_TSI_FAKE_TRANSPORT_SECURITY_H diff --git a/src/core/tsi/local_transport_security.cc b/src/core/tsi/local_transport_security.cc index 604840c3454..b93edcb7079 100644 --- a/src/core/tsi/local_transport_security.cc +++ b/src/core/tsi/local_transport_security.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -33,24 +33,24 @@ namespace { -/* Main struct for local TSI zero-copy frame protector. */ +// Main struct for local TSI zero-copy frame protector. typedef struct local_zero_copy_grpc_protector { tsi_zero_copy_grpc_protector base; } local_zero_copy_grpc_protector; -/* Main struct for local TSI handshaker result. */ +// Main struct for local TSI handshaker result. typedef struct local_tsi_handshaker_result { tsi_handshaker_result base; unsigned char* unused_bytes; size_t unused_bytes_size; } local_tsi_handshaker_result; -/* Main struct for local TSI handshaker. */ +// Main struct for local TSI handshaker. typedef struct local_tsi_handshaker { tsi_handshaker base; } local_tsi_handshaker; -/* --- tsi_handshaker_result methods implementation. --- */ +// --- tsi_handshaker_result methods implementation. --- tsi_result handshaker_result_extract_peer(const tsi_handshaker_result* /*self*/, tsi_peer* /*peer*/) { @@ -92,8 +92,8 @@ void handshaker_result_destroy(tsi_handshaker_result* self) { const tsi_handshaker_result_vtable result_vtable = { handshaker_result_extract_peer, handshaker_result_get_frame_protector_type, - nullptr, /* handshaker_result_create_zero_copy_grpc_protector */ - nullptr, /* handshaker_result_create_frame_protector */ + nullptr, // handshaker_result_create_zero_copy_grpc_protector + nullptr, // handshaker_result_create_frame_protector handshaker_result_get_unused_bytes, handshaker_result_destroy}; @@ -117,7 +117,7 @@ tsi_result create_handshaker_result(const unsigned char* received_bytes, return TSI_OK; } -/* --- tsi_handshaker methods implementation. --- */ +// --- tsi_handshaker methods implementation. --- tsi_result handshaker_next(tsi_handshaker* self, const unsigned char* received_bytes, @@ -132,9 +132,9 @@ tsi_result handshaker_next(tsi_handshaker* self, if (error != nullptr) *error = "invalid argument"; return TSI_INVALID_ARGUMENT; } - /* Note that there is no interaction between TSI peers, and all operations are - * local. - */ + // Note that there is no interaction between TSI peers, and all operations are + // local. + // *bytes_to_send_size = 0; create_handshaker_result(received_bytes, received_bytes_size, result); return TSI_OK; @@ -150,14 +150,14 @@ void handshaker_destroy(tsi_handshaker* self) { } const tsi_handshaker_vtable handshaker_vtable = { - nullptr, /* get_bytes_to_send_to_peer -- deprecated */ - nullptr, /* process_bytes_from_peer -- deprecated */ - nullptr, /* get_result -- deprecated */ - nullptr, /* extract_peer -- deprecated */ - nullptr, /* create_frame_protector -- deprecated */ + nullptr, // get_bytes_to_send_to_peer -- deprecated + nullptr, // process_bytes_from_peer -- deprecated + nullptr, // get_result -- deprecated + nullptr, // extract_peer -- deprecated + nullptr, // create_frame_protector -- deprecated handshaker_destroy, handshaker_next, - nullptr, /* shutdown */ + nullptr, // shutdown }; } // namespace diff --git a/src/core/tsi/local_transport_security.h b/src/core/tsi/local_transport_security.h index 79ed8f9c086..95347a81d93 100644 --- a/src/core/tsi/local_transport_security.h +++ b/src/core/tsi/local_transport_security.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_LOCAL_TRANSPORT_SECURITY_H #define GRPC_CORE_TSI_LOCAL_TRANSPORT_SECURITY_H @@ -29,19 +29,19 @@ #define TSI_LOCAL_NUM_OF_PEER_PROPERTIES 1 #define TSI_LOCAL_PROCESS_ID_PEER_PROPERTY "process_id" -/** - * This method creates a local TSI handshaker instance. - * - * - self: address of local TSI handshaker instance to be returned from the - * method. - * - * It returns TSI_OK on success and an error status code on failure. - * - * This handshaker is also being used as a minimalist handshaker for insecure - * security connector. If this handshaker ever needs to do anything more that - * does not fit with an insecure connector, we would need to add a separate - * handshaker for insecure connectors. - */ +/// +/// This method creates a local TSI handshaker instance. +/// +///- self: address of local TSI handshaker instance to be returned from the +/// method. +/// +/// It returns TSI_OK on success and an error status code on failure. +/// +/// This handshaker is also being used as a minimalist handshaker for insecure +/// security connector. If this handshaker ever needs to do anything more that +/// does not fit with an insecure connector, we would need to add a separate +/// handshaker for insecure connectors. +/// tsi_result tsi_local_handshaker_create(tsi_handshaker** self); -#endif /* GRPC_CORE_TSI_LOCAL_TRANSPORT_SECURITY_H */ +#endif // GRPC_CORE_TSI_LOCAL_TRANSPORT_SECURITY_H diff --git a/src/core/tsi/ssl/session_cache/ssl_session.h b/src/core/tsi/ssl/session_cache/ssl_session.h index 80dedfa9b3f..c76e3addbbe 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session.h +++ b/src/core/tsi/ssl/session_cache/ssl_session.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_H #define GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_H @@ -68,4 +68,4 @@ class SslCachedSession { } // namespace tsi -#endif /* GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_H */ +#endif // GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_H diff --git a/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc b/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc index 769971f4ead..742a5f15cf4 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc +++ b/src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -56,4 +56,4 @@ std::unique_ptr SslCachedSession::Create( } // namespace tsi -#endif /* OPENSSL_IS_BORINGSSL */ +#endif // OPENSSL_IS_BORINGSSL diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.cc b/src/core/tsi/ssl/session_cache/ssl_session_cache.cc index 5657fbc0f94..456f6f2fbcf 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.cc +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/src/core/tsi/ssl/session_cache/ssl_session_cache.h index 689ff05a629..a61e33bf7b7 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_cache.h +++ b/src/core/tsi/ssl/session_cache/ssl_session_cache.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_CACHE_H #define GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_CACHE_H @@ -96,4 +96,4 @@ class SslSessionLRUCache } // namespace tsi -#endif /* GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_CACHE_H */ +#endif // GRPC_CORE_TSI_SSL_SESSION_CACHE_SSL_SESSION_CACHE_H diff --git a/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc b/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc index 37b8ad25ad5..95befc80b7d 100644 --- a/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc +++ b/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -78,4 +78,4 @@ std::unique_ptr SslCachedSession::Create( } // namespace tsi -#endif /* OPENSSL_IS_BORINGSSL */ +#endif // OPENSSL_IS_BORINGSSL diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index 720c1b039a8..8ffcecd8de1 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -23,9 +23,9 @@ #include #include -/* TODO(jboeuf): refactor inet_ntop into a portability header. */ -/* Note: for whomever reads this and tries to refactor this, this - can't be in grpc, it has to be in gpr. */ +// TODO(jboeuf): refactor inet_ntop into a portability header. +// Note: for whomever reads this and tries to refactor this, this +// can't be in grpc, it has to be in gpr. #ifdef GPR_WINDOWS #include #else @@ -36,7 +36,7 @@ #include #include -#include /* For OPENSSL_free */ +#include // For OPENSSL_free #include #include #include @@ -62,26 +62,26 @@ #include "src/core/tsi/ssl_types.h" #include "src/core/tsi/transport_security.h" -/* --- Constants. ---*/ +// --- Constants. --- #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND 16384 #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024 #define TSI_SSL_HANDSHAKER_OUTGOING_BUFFER_INITIAL_SIZE 1024 -/* Putting a macro like this and littering the source file with #if is really - bad practice. - TODO(jboeuf): refactor all the #if / #endif in a separate module. */ +// Putting a macro like this and littering the source file with #if is really +// bad practice. +// TODO(jboeuf): refactor all the #if / #endif in a separate module. #ifndef TSI_OPENSSL_ALPN_SUPPORT #define TSI_OPENSSL_ALPN_SUPPORT 1 #endif -/* TODO(jboeuf): I have not found a way to get this number dynamically from the - SSL structure. This is what we would ultimately want though... */ +// TODO(jboeuf): I have not found a way to get this number dynamically from the +// SSL structure. This is what we would ultimately want though... #define TSI_SSL_MAX_PROTECTION_OVERHEAD 100 using TlsSessionKeyLogger = tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger; -/* --- Structure definitions. ---*/ +// --- Structure definitions. --- struct tsi_ssl_root_certs_store { X509_STORE* store; @@ -102,9 +102,9 @@ struct tsi_ssl_client_handshaker_factory { }; struct tsi_ssl_server_handshaker_factory { - /* Several contexts to support SNI. - The tsi_peer array contains the subject names of the server certificates - associated with the contexts at the same index. */ + // Several contexts to support SNI. + // The tsi_peer array contains the subject names of the server certificates + // associated with the contexts at the same index. tsi_ssl_handshaker_factory base; SSL_CTX** ssl_contexts; tsi_peer* ssl_context_x509_subject_names; @@ -138,7 +138,7 @@ struct tsi_ssl_frame_protector { size_t buffer_size; size_t buffer_offset; }; -/* --- Library Initialization. ---*/ +// --- Library Initialization. --- static gpr_once g_init_openssl_once = GPR_ONCE_INIT; static int g_ssl_ctx_ex_factory_index = -1; @@ -194,9 +194,9 @@ static void init_openssl(void) { GPR_ASSERT(g_ssl_ctx_ex_factory_index != -1); } -/* --- Ssl utils. ---*/ +// --- Ssl utils. --- -/* TODO(jboeuf): Remove when we are past the debugging phase with this code. */ +// TODO(jboeuf): Remove when we are past the debugging phase with this code. static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { if ((where & flag) && GRPC_TRACE_FLAG_ENABLED(tsi_tracing_enabled)) { @@ -205,7 +205,7 @@ static void ssl_log_where_info(const SSL* ssl, int where, int flag, } } -/* Used for debugging. TODO(jboeuf): Remove when code is mature enough. */ +// Used for debugging. TODO(jboeuf): Remove when code is mature enough. static void ssl_info_callback(const SSL* ssl, int where, int ret) { if (ret == 0) { gpr_log(GPR_ERROR, "ssl_info_callback: error occurred.\n"); @@ -217,14 +217,14 @@ static void ssl_info_callback(const SSL* ssl, int where, int ret) { ssl_log_where_info(ssl, where, SSL_CB_HANDSHAKE_DONE, "HANDSHAKE DONE"); } -/* Returns 1 if name looks like an IP address, 0 otherwise. - This is a very rough heuristic, and only handles IPv6 in hexadecimal form. */ +// Returns 1 if name looks like an IP address, 0 otherwise. +// This is a very rough heuristic, and only handles IPv6 in hexadecimal form. static int looks_like_ip_address(absl::string_view name) { size_t dot_count = 0; size_t num_size = 0; for (size_t i = 0; i < name.size(); ++i) { if (name[i] == ':') { - /* IPv6 Address in hexadecimal form, : is not allowed in DNS names. */ + // IPv6 Address in hexadecimal form, : is not allowed in DNS names. return 1; } if (name[i] >= '0' && name[i] <= '9') { @@ -242,7 +242,7 @@ static int looks_like_ip_address(absl::string_view name) { return 1; } -/* Gets the subject CN from an X509 cert. */ +// Gets the subject CN from an X509 cert. static tsi_result ssl_get_x509_common_name(X509* cert, unsigned char** utf8, size_t* utf8_size) { int common_name_index = -1; @@ -280,7 +280,7 @@ static tsi_result ssl_get_x509_common_name(X509* cert, unsigned char** utf8, return TSI_OK; } -/* Gets the subject CN of an X509 cert as a tsi_peer_property. */ +// Gets the subject CN of an X509 cert as a tsi_peer_property. static tsi_result peer_property_from_x509_common_name( X509* cert, tsi_peer_property* property) { unsigned char* common_name; @@ -303,7 +303,7 @@ static tsi_result peer_property_from_x509_common_name( return result; } -/* Gets the subject of an X509 cert as a tsi_peer_property. */ +// Gets the subject of an X509 cert as a tsi_peer_property. static tsi_result peer_property_from_x509_subject(X509* cert, tsi_peer_property* property) { X509_NAME* subject_name = X509_get_subject_name(cert); @@ -327,7 +327,7 @@ static tsi_result peer_property_from_x509_subject(X509* cert, return result; } -/* Gets the X509 cert in PEM format as a tsi_peer_property. */ +// Gets the X509 cert in PEM format as a tsi_peer_property. static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) { BIO* bio = BIO_new(BIO_s_mem()); if (!PEM_write_bio_X509(bio, cert)) { @@ -346,7 +346,7 @@ static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) { return result; } -/* Gets the subject SANs from an X509 cert as a tsi_peer_property. */ +// Gets the subject SANs from an X509 cert as a tsi_peer_property. static tsi_result add_subject_alt_names_properties_to_peer( tsi_peer* peer, GENERAL_NAMES* subject_alt_names, size_t subject_alt_name_count, int* current_insert_index) { @@ -429,10 +429,10 @@ static tsi_result add_subject_alt_names_properties_to_peer( return result; } -/* Gets information about the peer's X509 cert as a tsi_peer object. */ +// Gets information about the peer's X509 cert as a tsi_peer object. static tsi_result peer_from_x509(X509* cert, int include_certificate_type, tsi_peer* peer) { - /* TODO(jboeuf): Maybe add more properties. */ + // TODO(jboeuf): Maybe add more properties. GENERAL_NAMES* subject_alt_names = static_cast( X509_get_ext_d2i(cert, NID_subject_alt_name, nullptr, nullptr)); int subject_alt_name_count = @@ -499,7 +499,7 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type, return result; } -/* Loads an in-memory PEM certificate chain into the SSL context. */ +// Loads an in-memory PEM certificate chain into the SSL context. static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX* context, const char* pem_cert_chain, size_t pem_cert_chain_size) { @@ -526,17 +526,17 @@ static tsi_result ssl_ctx_use_certificate_chain(SSL_CTX* context, PEM_read_bio_X509(pem, nullptr, nullptr, const_cast("")); if (certificate_authority == nullptr) { ERR_clear_error(); - break; /* Done reading. */ + break; // Done reading. } if (!SSL_CTX_add_extra_chain_cert(context, certificate_authority)) { X509_free(certificate_authority); result = TSI_INVALID_ARGUMENT; break; } - /* We don't need to free certificate_authority as its ownership has been - transferred to the context. That is not the case for certificate - though. - */ + // We don't need to free certificate_authority as its ownership has been + // transferred to the context. That is not the case for certificate + // though. + // } } while (false); @@ -618,7 +618,7 @@ static tsi_result ssl_ctx_use_engine_private_key(SSL_CTX* context, if (engine_name != nullptr) gpr_free(engine_name); return result; } -#endif /* !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_NO_ENGINE) */ +#endif // !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_NO_ENGINE) static tsi_result ssl_ctx_use_pem_private_key(SSL_CTX* context, const char* pem_key, @@ -646,7 +646,7 @@ static tsi_result ssl_ctx_use_pem_private_key(SSL_CTX* context, return result; } -/* Loads an in-memory PEM private key into the SSL context. */ +// Loads an in-memory PEM private key into the SSL context. static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, const char* pem_key, size_t pem_key_size) { // BoringSSL does not have ENGINE support @@ -654,14 +654,14 @@ static tsi_result ssl_ctx_use_private_key(SSL_CTX* context, const char* pem_key, if (strncmp(pem_key, kSslEnginePrefix, strlen(kSslEnginePrefix)) == 0) { return ssl_ctx_use_engine_private_key(context, pem_key, pem_key_size); } else -#endif /* !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_NO_ENGINE) */ +#endif // !defined(OPENSSL_IS_BORINGSSL) && !defined(OPENSSL_NO_ENGINE) { return ssl_ctx_use_pem_private_key(context, pem_key, pem_key_size); } } -/* Loads in-memory PEM verification certs into the SSL context and optionally - returns the verification cert names (root_names can be NULL). */ +// Loads in-memory PEM verification certs into the SSL context and optionally +// returns the verification cert names (root_names can be NULL). static tsi_result x509_store_load_certs(X509_STORE* cert_store, const char* pem_roots, size_t pem_roots_size, @@ -684,7 +684,7 @@ static tsi_result x509_store_load_certs(X509_STORE* cert_store, root = PEM_read_bio_X509_AUX(pem, nullptr, nullptr, const_cast("")); if (root == nullptr) { ERR_clear_error(); - break; /* We're at the end of stream. */ + break; // We're at the end of stream. } if (root_names != nullptr) { root_name = X509_get_subject_name(root); @@ -743,8 +743,8 @@ static tsi_result ssl_ctx_load_verification_certs(SSL_CTX* context, root_name); } -/* Populates the SSL context with a private key and a cert chain, and sets the - cipher list and the ephemeral ECDH key. */ +// Populates the SSL context with a private key and a cert chain, and sets the +// cipher list and the ephemeral ECDH key. static tsi_result populate_ssl_context( SSL_CTX* context, const tsi_ssl_pem_key_cert_pair* key_cert_pair, const char* cipher_list) { @@ -785,7 +785,7 @@ static tsi_result populate_ssl_context( return TSI_OK; } -/* Extracts the CN and the SANs from an X509 cert as a peer object. */ +// Extracts the CN and the SANs from an X509 cert as a peer object. tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert( const char* pem_cert, tsi_peer* peer) { tsi_result result = TSI_OK; @@ -806,7 +806,7 @@ tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert( return result; } -/* Builds the alpn protocol name list according to rfc 7301. */ +// Builds the alpn protocol name list according to rfc 7301. static tsi_result build_alpn_protocol_name_list( const char** alpn_protocols, uint16_t num_alpn_protocols, unsigned char** protocol_name_list, size_t* protocol_name_list_length) { @@ -831,11 +831,11 @@ static tsi_result build_alpn_protocol_name_list( current = *protocol_name_list; for (i = 0; i < num_alpn_protocols; i++) { size_t length = strlen(alpn_protocols[i]); - *(current++) = static_cast(length); /* max checked above. */ + *(current++) = static_cast(length); // max checked above. memcpy(current, alpn_protocols[i], length); current += length; } - /* Safety check. */ + // Safety check. if ((current < *protocol_name_list) || (static_cast(current - *protocol_name_list) != *protocol_name_list_length)) { @@ -907,7 +907,7 @@ static tsi_result tsi_set_min_and_max_tls_versions( return TSI_OK; } -/* --- tsi_ssl_root_certs_store methods implementation. ---*/ +// --- tsi_ssl_root_certs_store methods implementation. --- tsi_ssl_root_certs_store* tsi_ssl_root_certs_store_create( const char* pem_roots) { @@ -944,15 +944,15 @@ void tsi_ssl_root_certs_store_destroy(tsi_ssl_root_certs_store* self) { gpr_free(self); } -/* --- tsi_ssl_session_cache methods implementation. ---*/ +// --- tsi_ssl_session_cache methods implementation. --- tsi_ssl_session_cache* tsi_ssl_session_cache_create_lru(size_t capacity) { - /* Pointer will be dereferenced by unref call. */ + // Pointer will be dereferenced by unref call. return tsi::SslSessionLRUCache::Create(capacity).release()->c_ptr(); } void tsi_ssl_session_cache_ref(tsi_ssl_session_cache* cache) { - /* Pointer will be dereferenced by unref call. */ + // Pointer will be dereferenced by unref call. tsi::SslSessionLRUCache::FromC(cache)->Ref().release(); } @@ -960,7 +960,7 @@ void tsi_ssl_session_cache_unref(tsi_ssl_session_cache* cache) { tsi::SslSessionLRUCache::FromC(cache)->Unref(); } -/* --- tsi_frame_protector methods implementation. ---*/ +// --- tsi_frame_protector methods implementation. --- static tsi_result ssl_protector_protect(tsi_frame_protector* self, const unsigned char* unprotected_bytes, @@ -1014,7 +1014,7 @@ static const tsi_frame_protector_vtable frame_protector_vtable = { ssl_protector_destroy, }; -/* --- tsi_server_handshaker_factory methods implementation. --- */ +// --- tsi_server_handshaker_factory methods implementation. --- static void tsi_ssl_handshaker_factory_destroy( tsi_ssl_handshaker_factory* factory) { @@ -1023,9 +1023,9 @@ static void tsi_ssl_handshaker_factory_destroy( if (factory->vtable != nullptr && factory->vtable->destroy != nullptr) { factory->vtable->destroy(factory); } - /* Note, we don't free(self) here because this object is always directly - * embedded in another object. If tsi_ssl_handshaker_factory_init allocates - * any memory, it should be free'd here. */ + // Note, we don't free(self) here because this object is always directly + // embedded in another object. If tsi_ssl_handshaker_factory_init allocates + // any memory, it should be free'd here. } static tsi_ssl_handshaker_factory* tsi_ssl_handshaker_factory_ref( @@ -1046,8 +1046,8 @@ static void tsi_ssl_handshaker_factory_unref( static tsi_ssl_handshaker_factory_vtable handshaker_factory_vtable = {nullptr}; -/* Initializes a tsi_ssl_handshaker_factory object. Caller is responsible for - * allocating memory for the factory. */ +// Initializes a tsi_ssl_handshaker_factory object. Caller is responsible for +// allocating memory for the factory. static void tsi_ssl_handshaker_factory_init( tsi_ssl_handshaker_factory* factory) { GPR_ASSERT(factory != nullptr); @@ -1056,7 +1056,7 @@ static void tsi_ssl_handshaker_factory_init( gpr_ref_init(&factory->refcount, 1); } -/* Gets the X509 cert chain in PEM format as a tsi_peer_property. */ +// Gets the X509 cert chain in PEM format as a tsi_peer_property. tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain, tsi_peer_property* property) { BIO* bio = BIO_new(BIO_s_mem()); @@ -1080,7 +1080,7 @@ tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain, return result; } -/* --- tsi_handshaker_result methods implementation. ---*/ +// --- tsi_handshaker_result methods implementation. --- static tsi_result ssl_handshaker_result_extract_peer( const tsi_handshaker_result* self, tsi_peer* peer) { tsi_result result = TSI_OK; @@ -1096,9 +1096,9 @@ static tsi_result ssl_handshaker_result_extract_peer( } #if TSI_OPENSSL_ALPN_SUPPORT SSL_get0_alpn_selected(impl->ssl, &alpn_selected, &alpn_selected_len); -#endif /* TSI_OPENSSL_ALPN_SUPPORT */ +#endif // TSI_OPENSSL_ALPN_SUPPORT if (alpn_selected == nullptr) { - /* Try npn. */ + // Try npn. SSL_get0_next_proto_negotiated(impl->ssl, &alpn_selected, &alpn_selected_len); } @@ -1190,7 +1190,7 @@ static tsi_result ssl_handshaker_result_create_frame_protector( return TSI_INTERNAL_ERROR; } - /* Transfer ownership of ssl and network_io to the frame protector. */ + // Transfer ownership of ssl and network_io to the frame protector. protector_impl->ssl = impl->ssl; impl->ssl = nullptr; protector_impl->network_io = impl->network_io; @@ -1222,7 +1222,7 @@ static void ssl_handshaker_result_destroy(tsi_handshaker_result* self) { static const tsi_handshaker_result_vtable handshaker_result_vtable = { ssl_handshaker_result_extract_peer, ssl_handshaker_result_get_frame_protector_type, - nullptr, /* create_zero_copy_grpc_protector */ + nullptr, // create_zero_copy_grpc_protector ssl_handshaker_result_create_frame_protector, ssl_handshaker_result_get_unused_bytes, ssl_handshaker_result_destroy, @@ -1240,19 +1240,19 @@ static tsi_result ssl_handshaker_result_create( tsi_ssl_handshaker_result* result = grpc_core::Zalloc(); result->base.vtable = &handshaker_result_vtable; - /* Transfer ownership of ssl and network_io to the handshaker result. */ + // Transfer ownership of ssl and network_io to the handshaker result. result->ssl = handshaker->ssl; handshaker->ssl = nullptr; result->network_io = handshaker->network_io; handshaker->network_io = nullptr; - /* Transfer ownership of |unused_bytes| to the handshaker result. */ + // Transfer ownership of |unused_bytes| to the handshaker result. result->unused_bytes = unused_bytes; result->unused_bytes_size = unused_bytes_size; *handshaker_result = &result->base; return TSI_OK; } -/* --- tsi_handshaker methods implementation. ---*/ +// --- tsi_handshaker methods implementation. --- static tsi_result ssl_handshaker_get_bytes_to_send_to_peer( tsi_ssl_handshaker* impl, unsigned char* bytes, size_t* bytes_size, @@ -1294,13 +1294,13 @@ static tsi_result ssl_handshaker_do_handshake(tsi_ssl_handshaker* impl, return impl->result; } else { ERR_clear_error(); - /* Get ready to get some bytes from SSL. */ + // Get ready to get some bytes from SSL. int ssl_result = SSL_do_handshake(impl->ssl); ssl_result = SSL_get_error(impl->ssl, ssl_result); switch (ssl_result) { case SSL_ERROR_WANT_READ: if (BIO_pending(impl->network_io) == 0) { - /* We need more data. */ + // We need more data. return TSI_INCOMPLETE_DATA; } else { return TSI_OK; @@ -1423,14 +1423,14 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self, tsi_handshaker_result** handshaker_result, tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/, std::string* error) { - /* Input sanity check. */ + // Input sanity check. if ((received_bytes_size > 0 && received_bytes == nullptr) || bytes_to_send == nullptr || bytes_to_send_size == nullptr || handshaker_result == nullptr) { if (error != nullptr) *error = "invalid argument"; return TSI_INVALID_ARGUMENT; } - /* If there are received bytes, process them first. */ + // If there are received bytes, process them first. tsi_ssl_handshaker* impl = reinterpret_cast(self); tsi_result status = TSI_OK; size_t bytes_consumed = received_bytes_size; @@ -1445,12 +1445,12 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self, } } if (status != TSI_OK) return status; - /* Get bytes to send to the peer, if available. */ + // Get bytes to send to the peer, if available. status = ssl_handshaker_write_output_buffer(self, &bytes_written, error); if (status != TSI_OK) return status; *bytes_to_send = impl->outgoing_bytes_buffer; *bytes_to_send_size = bytes_written; - /* If handshake completes, create tsi_handshaker_result. */ + // If handshake completes, create tsi_handshaker_result. if (ssl_handshaker_get_result(impl) == TSI_HANDSHAKE_IN_PROGRESS) { *handshaker_result = nullptr; } else { @@ -1472,8 +1472,8 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self, status = ssl_handshaker_result_create(impl, unused_bytes, unused_bytes_size, handshaker_result, error); if (status == TSI_OK) { - /* Indicates that the handshake has completed and that a handshaker_result - * has been created. */ + // Indicates that the handshake has completed and that a handshaker_result + // has been created. self->handshaker_result_created = true; } } @@ -1481,17 +1481,17 @@ static tsi_result ssl_handshaker_next(tsi_handshaker* self, } static const tsi_handshaker_vtable handshaker_vtable = { - nullptr, /* get_bytes_to_send_to_peer -- deprecated */ - nullptr, /* process_bytes_from_peer -- deprecated */ - nullptr, /* get_result -- deprecated */ - nullptr, /* extract_peer -- deprecated */ - nullptr, /* create_frame_protector -- deprecated */ + nullptr, // get_bytes_to_send_to_peer -- deprecated + nullptr, // process_bytes_from_peer -- deprecated + nullptr, // get_result -- deprecated + nullptr, // extract_peer -- deprecated + nullptr, // create_frame_protector -- deprecated ssl_handshaker_destroy, ssl_handshaker_next, - nullptr, /* shutdown */ + nullptr, // shutdown }; -/* --- tsi_ssl_handshaker_factory common methods. --- */ +// --- tsi_ssl_handshaker_factory common methods. --- static void tsi_ssl_handshaker_resume_session( SSL* ssl, tsi::SslSessionLRUCache* session_cache) { @@ -1608,7 +1608,7 @@ static int select_protocol_list(const unsigned char** out, return SSL_TLSEXT_ERR_NOACK; } -/* --- tsi_ssl_client_handshaker_factory methods implementation. --- */ +// --- tsi_ssl_client_handshaker_factory methods implementation. --- tsi_result tsi_ssl_client_handshaker_factory_create_handshaker( tsi_ssl_client_handshaker_factory* factory, @@ -1647,14 +1647,14 @@ static int client_handshaker_factory_npn_callback( factory->alpn_protocol_list_length, in, inlen); } -/* --- tsi_ssl_server_handshaker_factory methods implementation. --- */ +// --- tsi_ssl_server_handshaker_factory methods implementation. --- tsi_result tsi_ssl_server_handshaker_factory_create_handshaker( tsi_ssl_server_handshaker_factory* factory, size_t network_bio_buf_size, size_t ssl_bio_buf_size, tsi_handshaker** handshaker) { if (factory->ssl_context_count == 0) return TSI_INVALID_ARGUMENT; - /* Create the handshaker with the first context. We will switch if needed - because of SNI in ssl_server_handshaker_factory_servername_callback. */ + // Create the handshaker with the first context. We will switch if needed + // because of SNI in ssl_server_handshaker_factory_servername_callback. return create_tsi_ssl_handshaker(factory->ssl_contexts[0], 0, nullptr, network_bio_buf_size, ssl_bio_buf_size, &factory->base, handshaker); @@ -1691,7 +1691,7 @@ static int does_entry_match_name(absl::string_view entry, absl::string_view name) { if (entry.empty()) return 0; - /* Take care of '.' terminations. */ + // Take care of '.' terminations. if (name.back() == '.') { name.remove_suffix(1); } @@ -1701,12 +1701,12 @@ static int does_entry_match_name(absl::string_view entry, } if (absl::EqualsIgnoreCase(name, entry)) { - return 1; /* Perfect match. */ + return 1; // Perfect match. } if (entry.front() != '*') return 0; - /* Wildchar subdomain matching. */ - if (entry.size() < 3 || entry[1] != '.') { /* At least *.x */ + // Wildchar subdomain matching. + if (entry.size() < 3 || entry[1] != '.') { // At least *.x gpr_log(GPR_ERROR, "Invalid wildchar entry."); return 0; } @@ -1714,8 +1714,8 @@ static int does_entry_match_name(absl::string_view entry, if (name_subdomain_pos == absl::string_view::npos) return 0; if (name_subdomain_pos >= name.size() - 2) return 0; absl::string_view name_subdomain = - name.substr(name_subdomain_pos + 1); /* Starts after the dot. */ - entry.remove_prefix(2); /* Remove *. */ + name.substr(name_subdomain_pos + 1); // Starts after the dot. + entry.remove_prefix(2); // Remove *. size_t dot = name_subdomain.find('.'); if (dot == absl::string_view::npos || dot == name_subdomain.size() - 1) { gpr_log(GPR_ERROR, "Invalid toplevel subdomain: %s", @@ -1760,7 +1760,7 @@ static int server_handshaker_factory_alpn_callback( factory->alpn_protocol_list, factory->alpn_protocol_list_length); } -#endif /* TSI_OPENSSL_ALPN_SUPPORT */ +#endif // TSI_OPENSSL_ALPN_SUPPORT static int server_handshaker_factory_npn_advertised_callback( SSL* /*ssl*/, const unsigned char** out, unsigned int* outlen, void* arg) { @@ -1823,7 +1823,7 @@ static int verify_cb(int ok, X509_STORE_CTX* ctx) { return ok; } -/* --- tsi_ssl_handshaker_factory constructors. --- */ +// --- tsi_ssl_handshaker_factory constructors. --- static tsi_ssl_handshaker_factory_vtable client_handshaker_factory_vtable = { tsi_ssl_client_handshaker_factory_destroy}; @@ -1944,7 +1944,7 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options( result = TSI_INVALID_ARGUMENT; break; } -#endif /* TSI_OPENSSL_ALPN_SUPPORT */ +#endif // TSI_OPENSSL_ALPN_SUPPORT SSL_CTX_set_next_proto_select_cb( ssl_context, client_handshaker_factory_npn_callback, impl); } @@ -2172,13 +2172,13 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options( #if TSI_OPENSSL_ALPN_SUPPORT SSL_CTX_set_alpn_select_cb(impl->ssl_contexts[i], server_handshaker_factory_alpn_callback, impl); -#endif /* TSI_OPENSSL_ALPN_SUPPORT */ +#endif // TSI_OPENSSL_ALPN_SUPPORT SSL_CTX_set_next_protos_advertised_cb( impl->ssl_contexts[i], server_handshaker_factory_npn_advertised_callback, impl); #if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER) - /* Register factory at index */ + // Register factory at index if (options->key_logger != nullptr) { // Need to set factory at g_ssl_ctx_ex_factory_index SSL_CTX_set_ex_data(impl->ssl_contexts[i], g_ssl_ctx_ex_factory_index, @@ -2202,7 +2202,7 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options( return TSI_OK; } -/* --- tsi_ssl utils. --- */ +// --- tsi_ssl utils. --- int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name) { size_t i = 0; @@ -2210,7 +2210,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name) { const tsi_peer_property* cn_property = nullptr; int like_ip = looks_like_ip_address(name); - /* Check the SAN first. */ + // Check the SAN first. for (i = 0; i < peer->property_count; i++) { const tsi_peer_property* property = &peer->properties[i]; if (property->name == nullptr) continue; @@ -2222,7 +2222,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name) { if (!like_ip && does_entry_match_name(entry, name)) { return 1; } else if (like_ip && name == entry) { - /* IP Addresses are exact matches only. */ + // IP Addresses are exact matches only. return 1; } } else if (strcmp(property->name, @@ -2231,7 +2231,7 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name) { } } - /* If there's no SAN, try the CN, but only if its not like an IP Address */ + // If there's no SAN, try the CN, but only if its not like an IP Address if (san_count == 0 && cn_property != nullptr && !like_ip) { if (does_entry_match_name(absl::string_view(cn_property->value.data, cn_property->value.length), @@ -2240,10 +2240,10 @@ int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name) { } } - return 0; /* Not found. */ + return 0; // Not found. } -/* --- Testing support. --- */ +// --- Testing support. --- const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable( tsi_ssl_handshaker_factory* factory, tsi_ssl_handshaker_factory_vtable* new_vtable) { diff --git a/src/core/tsi/ssl_transport_security.h b/src/core/tsi/ssl_transport_security.h index a2b7a097b1a..61260c24d7f 100644 --- a/src/core/tsi/ssl_transport_security.h +++ b/src/core/tsi/ssl_transport_security.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H #define GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H @@ -31,10 +31,10 @@ #include "src/core/tsi/ssl_transport_security_utils.h" #include "src/core/tsi/transport_security_interface.h" -/* Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. */ +// Value for the TSI_CERTIFICATE_TYPE_PEER_PROPERTY property for X509 certs. #define TSI_X509_CERTIFICATE_TYPE "X509" -/* This property is of type TSI_PEER_PROPERTY_STRING. */ +// This property is of type TSI_PEER_PROPERTY_STRING. #define TSI_X509_SUBJECT_PEER_PROPERTY "x509_subject" #define TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY "x509_subject_common_name" #define TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY \ @@ -48,39 +48,39 @@ #define TSI_X509_EMAIL_PEER_PROPERTY "x509_email" #define TSI_X509_IP_PEER_PROPERTY "x509_ip" -/* --- tsi_ssl_root_certs_store object --- +// --- tsi_ssl_root_certs_store object --- - This object stores SSL root certificates. It can be shared by multiple SSL - context. */ +// This object stores SSL root certificates. It can be shared by multiple SSL +// context. typedef struct tsi_ssl_root_certs_store tsi_ssl_root_certs_store; -/* Given a NULL-terminated string containing the PEM encoding of the root - certificates, creates a tsi_ssl_root_certs_store object. */ +// Given a NULL-terminated string containing the PEM encoding of the root +// certificates, creates a tsi_ssl_root_certs_store object. tsi_ssl_root_certs_store* tsi_ssl_root_certs_store_create( const char* pem_roots); -/* Destroys the tsi_ssl_root_certs_store object. */ +// Destroys the tsi_ssl_root_certs_store object. void tsi_ssl_root_certs_store_destroy(tsi_ssl_root_certs_store* self); -/* --- tsi_ssl_session_cache object --- +// --- tsi_ssl_session_cache object --- - Cache for SSL sessions for sessions resumption. */ +// Cache for SSL sessions for sessions resumption. typedef struct tsi_ssl_session_cache tsi_ssl_session_cache; -/* Create LRU cache for SSL sessions with \a capacity. */ +// Create LRU cache for SSL sessions with \a capacity. tsi_ssl_session_cache* tsi_ssl_session_cache_create_lru(size_t capacity); -/* Increment reference counter of \a cache. */ +// Increment reference counter of \a cache. void tsi_ssl_session_cache_ref(tsi_ssl_session_cache* cache); -/* Decrement reference counter of \a cache. */ +// Decrement reference counter of \a cache. void tsi_ssl_session_cache_unref(tsi_ssl_session_cache* cache); -/* --- tsi_ssl_key_logger object --- +// --- tsi_ssl_key_logger object --- - Experimental SSL Key logging functionality to enable decryption of - packet captures. */ +// Experimental SSL Key logging functionality to enable decryption of +// packet captures. static constexpr bool tsi_tls_session_key_logging_supported() { // Supported only for open-ssl versions >= 1.1.1 #if OPENSSL_VERSION_NUMBER >= 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER) @@ -90,45 +90,45 @@ static constexpr bool tsi_tls_session_key_logging_supported() { #endif } -/* --- tsi_ssl_client_handshaker_factory object --- +// --- tsi_ssl_client_handshaker_factory object --- - This object creates a client tsi_handshaker objects implemented in terms of - the TLS 1.2 specificiation. */ +// This object creates a client tsi_handshaker objects implemented in terms of +// the TLS 1.2 specificiation. typedef struct tsi_ssl_client_handshaker_factory tsi_ssl_client_handshaker_factory; -/* Object that holds a private key / certificate chain pair in PEM format. */ +// Object that holds a private key / certificate chain pair in PEM format. struct tsi_ssl_pem_key_cert_pair { - /* private_key is the NULL-terminated string containing the PEM encoding of - the client's private key. */ + // private_key is the NULL-terminated string containing the PEM encoding of + // the client's private key. const char* private_key; - /* cert_chain is the NULL-terminated string containing the PEM encoding of - the client's certificate chain. */ + // cert_chain is the NULL-terminated string containing the PEM encoding of + // the client's certificate chain. const char* cert_chain; }; -/* TO BE DEPRECATED. - Creates a client handshaker factory. - - pem_key_cert_pair is a pointer to the object containing client's private - key and certificate chain. This parameter can be NULL if the client does - not have such a key/cert pair. - - pem_roots_cert is the NULL-terminated string containing the PEM encoding of - the server root certificates. - - cipher_suites contains an optional list of the ciphers that the client - supports. The format of this string is described in: - https://www.openssl.org/docs/apps/ciphers.html. - This parameter can be set to NULL to use the default set of ciphers. - TODO(jboeuf): Revisit the format of this parameter. - - alpn_protocols is an array containing the NULL terminated protocol names - that the handshakers created with this factory support. This parameter can - be NULL. - - num_alpn_protocols is the number of alpn protocols and associated lengths - specified. If this parameter is 0, the other alpn parameters must be NULL. - - factory is the address of the factory pointer to be created. - - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +// TO BE DEPRECATED. +// Creates a client handshaker factory. +// - pem_key_cert_pair is a pointer to the object containing client's private +// key and certificate chain. This parameter can be NULL if the client does +// not have such a key/cert pair. +// - pem_roots_cert is the NULL-terminated string containing the PEM encoding of +// the server root certificates. +// - cipher_suites contains an optional list of the ciphers that the client +// supports. The format of this string is described in: +// https://www.openssl.org/docs/apps/ciphers.html. +// This parameter can be set to NULL to use the default set of ciphers. +// TODO(jboeuf): Revisit the format of this parameter. +// - alpn_protocols is an array containing the NULL terminated protocol names +// that the handshakers created with this factory support. This parameter can +// be NULL. +// - num_alpn_protocols is the number of alpn protocols and associated lengths +// specified. If this parameter is 0, the other alpn parameters must be NULL. +// - factory is the address of the factory pointer to be created. + +// - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_create_ssl_client_handshaker_factory( const tsi_ssl_pem_key_cert_pair* pem_key_cert_pair, const char* pem_root_certs, const char* cipher_suites, @@ -136,48 +136,48 @@ tsi_result tsi_create_ssl_client_handshaker_factory( tsi_ssl_client_handshaker_factory** factory); struct tsi_ssl_client_handshaker_options { - /* pem_key_cert_pair is a pointer to the object containing client's private - key and certificate chain. This parameter can be NULL if the client does - not have such a key/cert pair. */ + // pem_key_cert_pair is a pointer to the object containing client's private + // key and certificate chain. This parameter can be NULL if the client does + // not have such a key/cert pair. const tsi_ssl_pem_key_cert_pair* pem_key_cert_pair; - /* pem_roots_cert is the NULL-terminated string containing the PEM encoding of - the client root certificates. */ + // pem_roots_cert is the NULL-terminated string containing the PEM encoding of + // the client root certificates. const char* pem_root_certs; - /* root_store is a pointer to the ssl_root_certs_store object. If root_store - is not nullptr and SSL implementation permits, root_store will be used as - root certificates. Otherwise, pem_roots_cert will be used to load server - root certificates. */ + // root_store is a pointer to the ssl_root_certs_store object. If root_store + // is not nullptr and SSL implementation permits, root_store will be used as + // root certificates. Otherwise, pem_roots_cert will be used to load server + // root certificates. const tsi_ssl_root_certs_store* root_store; - /* cipher_suites contains an optional list of the ciphers that the client - supports. The format of this string is described in: - https://www.openssl.org/docs/apps/ciphers.html. - This parameter can be set to NULL to use the default set of ciphers. - TODO(jboeuf): Revisit the format of this parameter. */ + // cipher_suites contains an optional list of the ciphers that the client + // supports. The format of this string is described in: + // https://www.openssl.org/docs/apps/ciphers.html. + // This parameter can be set to NULL to use the default set of ciphers. + // TODO(jboeuf): Revisit the format of this parameter. const char* cipher_suites; - /* alpn_protocols is an array containing the NULL terminated protocol names - that the handshakers created with this factory support. This parameter can - be NULL. */ + // alpn_protocols is an array containing the NULL terminated protocol names + // that the handshakers created with this factory support. This parameter can + // be NULL. const char** alpn_protocols; - /* num_alpn_protocols is the number of alpn protocols and associated lengths - specified. If this parameter is 0, the other alpn parameters must be - NULL. */ + // num_alpn_protocols is the number of alpn protocols and associated lengths + // specified. If this parameter is 0, the other alpn parameters must be + // NULL. size_t num_alpn_protocols; - /* ssl_session_cache is a cache for reusable client-side sessions. */ + // ssl_session_cache is a cache for reusable client-side sessions. tsi_ssl_session_cache* session_cache; - /* tsi_ssl_key_logger is an instance used to log SSL keys to a file. */ + // tsi_ssl_key_logger is an instance used to log SSL keys to a file. tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* key_logger; - /* skip server certificate verification. */ + // skip server certificate verification. bool skip_server_certificate_verification; - /* The min and max TLS versions that will be negotiated by the handshaker. */ + // The min and max TLS versions that will be negotiated by the handshaker. tsi_tls_version min_tls_version; tsi_tls_version max_tls_version; - /* The directory where all hashed CRL files enforced by the handshaker are - located. If the directory is invalid, CRL checking will fail open and just - log. An empty directory will not enable crl checking. Only OpenSSL version - > 1.1 is supported for CRL checking*/ + // The directory where all hashed CRL files enforced by the handshaker are + // located. If the directory is invalid, CRL checking will fail open and just + // log. An empty directory will not enable crl checking. Only OpenSSL version + // > 1.1 is supported for CRL checking const char* crl_directory; tsi_ssl_client_handshaker_options() @@ -195,67 +195,67 @@ struct tsi_ssl_client_handshaker_options { crl_directory(nullptr) {} }; -/* Creates a client handshaker factory. - - options is the options used to create a factory. - - factory is the address of the factory pointer to be created. +// Creates a client handshaker factory. +// - options is the options used to create a factory. +// - factory is the address of the factory pointer to be created. - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +// - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_create_ssl_client_handshaker_factory_with_options( const tsi_ssl_client_handshaker_options* options, tsi_ssl_client_handshaker_factory** factory); -/* Creates a client handshaker. - - factory is the factory from which the handshaker will be created. - - server_name_indication indicates the name of the server the client is - trying to connect to which will be relayed to the server using the SNI - extension. - - network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in - SSL. The buffer size being 0 translates to 17KB in boringSSL. - - handshaker is the address of the handshaker pointer to be created. - - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +// Creates a client handshaker. +//- factory is the factory from which the handshaker will be created. +//- server_name_indication indicates the name of the server the client is +// trying to connect to which will be relayed to the server using the SNI +// extension. +//- network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in +// SSL. The buffer size being 0 translates to 17KB in boringSSL. +//- handshaker is the address of the handshaker pointer to be created. + +//- This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_ssl_client_handshaker_factory_create_handshaker( tsi_ssl_client_handshaker_factory* factory, const char* server_name_indication, size_t network_bio_buf_size, size_t ssl_bio_buf_size, tsi_handshaker** handshaker); -/* Decrements reference count of the handshaker factory. Handshaker factory will - * be destroyed once no references exist. */ +// Decrements reference count of the handshaker factory. Handshaker factory will +// be destroyed once no references exist. void tsi_ssl_client_handshaker_factory_unref( tsi_ssl_client_handshaker_factory* factory); -/* --- tsi_ssl_server_handshaker_factory object --- +// --- tsi_ssl_server_handshaker_factory object --- - This object creates a client tsi_handshaker objects implemented in terms of - the TLS 1.2 specificiation. */ +// This object creates a client tsi_handshaker objects implemented in terms of +// the TLS 1.2 specificiation. typedef struct tsi_ssl_server_handshaker_factory tsi_ssl_server_handshaker_factory; -/* TO BE DEPRECATED. - Creates a server handshaker factory. - - pem_key_cert_pairs is an array private key / certificate chains of the - server. - - num_key_cert_pairs is the number of items in the pem_key_cert_pairs array. - - pem_root_certs is the NULL-terminated string containing the PEM encoding - of the client root certificates. This parameter may be NULL if the server - does not want the client to be authenticated with SSL. - - cipher_suites contains an optional list of the ciphers that the server - supports. The format of this string is described in: - https://www.openssl.org/docs/apps/ciphers.html. - This parameter can be set to NULL to use the default set of ciphers. - TODO(jboeuf): Revisit the format of this parameter. - - alpn_protocols is an array containing the NULL terminated protocol names - that the handshakers created with this factory support. This parameter can - be NULL. - - num_alpn_protocols is the number of alpn protocols and associated lengths - specified. If this parameter is 0, the other alpn parameters must be NULL. - - factory is the address of the factory pointer to be created. - - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +// TO BE DEPRECATED. +// Creates a server handshaker factory. +// - pem_key_cert_pairs is an array private key / certificate chains of the +// server. +// - num_key_cert_pairs is the number of items in the pem_key_cert_pairs array. +// - pem_root_certs is the NULL-terminated string containing the PEM encoding +// of the client root certificates. This parameter may be NULL if the server +// does not want the client to be authenticated with SSL. +// - cipher_suites contains an optional list of the ciphers that the server +// supports. The format of this string is described in: +// https://www.openssl.org/docs/apps/ciphers.html. +// This parameter can be set to NULL to use the default set of ciphers. +// TODO(jboeuf): Revisit the format of this parameter. +// - alpn_protocols is an array containing the NULL terminated protocol names +// that the handshakers created with this factory support. This parameter can +// be NULL. +// - num_alpn_protocols is the number of alpn protocols and associated lengths +// specified. If this parameter is 0, the other alpn parameters must be NULL. +// - factory is the address of the factory pointer to be created. + +// - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_create_ssl_server_handshaker_factory( const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs, const char* pem_client_root_certs, @@ -263,13 +263,13 @@ tsi_result tsi_create_ssl_server_handshaker_factory( const char** alpn_protocols, uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory); -/* TO BE DEPRECATED. - Same as tsi_create_ssl_server_handshaker_factory method except uses - tsi_client_certificate_request_type to support more ways to handle client - certificate authentication. - - client_certificate_request, if set to non-zero will force the client to - authenticate with an SSL cert. Note that this option is ignored if - pem_client_root_certs is NULL or pem_client_roots_certs_size is 0 */ +// TO BE DEPRECATED. +// Same as tsi_create_ssl_server_handshaker_factory method except uses +// tsi_client_certificate_request_type to support more ways to handle client +// certificate authentication. +// - client_certificate_request, if set to non-zero will force the client to +// authenticate with an SSL cert. Note that this option is ignored if +// pem_client_root_certs is NULL or pem_client_roots_certs_size is 0 tsi_result tsi_create_ssl_server_handshaker_factory_ex( const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs, size_t num_key_cert_pairs, const char* pem_client_root_certs, @@ -278,49 +278,49 @@ tsi_result tsi_create_ssl_server_handshaker_factory_ex( uint16_t num_alpn_protocols, tsi_ssl_server_handshaker_factory** factory); struct tsi_ssl_server_handshaker_options { - /* pem_key_cert_pairs is an array private key / certificate chains of the - server. */ + // pem_key_cert_pairs is an array private key / certificate chains of the + // server. const tsi_ssl_pem_key_cert_pair* pem_key_cert_pairs; - /* num_key_cert_pairs is the number of items in the pem_key_cert_pairs - array. */ + // num_key_cert_pairs is the number of items in the pem_key_cert_pairs + // array. size_t num_key_cert_pairs; - /* pem_root_certs is the NULL-terminated string containing the PEM encoding - of the server root certificates. This parameter may be NULL if the server - does not want the client to be authenticated with SSL. */ + // pem_root_certs is the NULL-terminated string containing the PEM encoding + // of the server root certificates. This parameter may be NULL if the server + // does not want the client to be authenticated with SSL. const char* pem_client_root_certs; - /* client_certificate_request, if set to non-zero will force the client to - authenticate with an SSL cert. Note that this option is ignored if - pem_client_root_certs is NULL or pem_client_roots_certs_size is 0. */ + // client_certificate_request, if set to non-zero will force the client to + // authenticate with an SSL cert. Note that this option is ignored if + // pem_client_root_certs is NULL or pem_client_roots_certs_size is 0. tsi_client_certificate_request_type client_certificate_request; - /* cipher_suites contains an optional list of the ciphers that the server - supports. The format of this string is described in: - https://www.openssl.org/docs/apps/ciphers.html. - This parameter can be set to NULL to use the default set of ciphers. - TODO(jboeuf): Revisit the format of this parameter. */ + // cipher_suites contains an optional list of the ciphers that the server + // supports. The format of this string is described in: + // https://www.openssl.org/docs/apps/ciphers.html. + // This parameter can be set to NULL to use the default set of ciphers. + // TODO(jboeuf): Revisit the format of this parameter. const char* cipher_suites; - /* alpn_protocols is an array containing the NULL terminated protocol names - that the handshakers created with this factory support. This parameter can - be NULL. */ + // alpn_protocols is an array containing the NULL terminated protocol names + // that the handshakers created with this factory support. This parameter can + // be NULL. const char** alpn_protocols; - /* num_alpn_protocols is the number of alpn protocols and associated lengths - specified. If this parameter is 0, the other alpn parameters must be - NULL. */ + // num_alpn_protocols is the number of alpn protocols and associated lengths + // specified. If this parameter is 0, the other alpn parameters must be + // NULL. uint16_t num_alpn_protocols; - /* session_ticket_key is optional key for encrypting session keys. If - parameter is not specified it must be NULL. */ + // session_ticket_key is optional key for encrypting session keys. If + // parameter is not specified it must be NULL. const char* session_ticket_key; - /* session_ticket_key_size is a size of session ticket encryption key. */ + // session_ticket_key_size is a size of session ticket encryption key. size_t session_ticket_key_size; - /* The min and max TLS versions that will be negotiated by the handshaker. */ + // The min and max TLS versions that will be negotiated by the handshaker. tsi_tls_version min_tls_version; tsi_tls_version max_tls_version; - /* tsi_ssl_key_logger is an instance used to log SSL keys to a file. */ + // tsi_ssl_key_logger is an instance used to log SSL keys to a file. tsi::TlsSessionKeyLoggerCache::TlsSessionKeyLogger* key_logger; - /* The directory where all hashed CRL files are cached in the x.509 store and - * enforced by the handshaker are located. If the directory is invalid, CRL - * checking will fail open and just log. An empty directory will not enable - * crl checking. Only OpenSSL version > 1.1 is supported for CRL checking */ + // The directory where all hashed CRL files are cached in the x.509 store and + // enforced by the handshaker are located. If the directory is invalid, CRL + // checking will fail open and just log. An empty directory will not enable + // crl checking. Only OpenSSL version > 1.1 is supported for CRL checking const char* crl_directory; tsi_ssl_server_handshaker_options() @@ -339,68 +339,68 @@ struct tsi_ssl_server_handshaker_options { crl_directory(nullptr) {} }; -/* Creates a server handshaker factory. - - options is the options used to create a factory. - - factory is the address of the factory pointer to be created. +// Creates a server handshaker factory. +// - options is the options used to create a factory. +// - factory is the address of the factory pointer to be created. - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +// - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_create_ssl_server_handshaker_factory_with_options( const tsi_ssl_server_handshaker_options* options, tsi_ssl_server_handshaker_factory** factory); -/* Creates a server handshaker. - - factory is the factory from which the handshaker will be created. - - network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in - SSL. The buffer size being 0 translates to 17KB in boringSSL. - - handshaker is the address of the handshaker pointer to be created. +// Creates a server handshaker. +//- factory is the factory from which the handshaker will be created. +//- network_bio_buf_size and ssl_bio_buf_size represent BIO pair buffers used in +// SSL. The buffer size being 0 translates to 17KB in boringSSL. +//- handshaker is the address of the handshaker pointer to be created. - - This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case - where a parameter is invalid. */ +//- This method returns TSI_OK on success or TSI_INVALID_PARAMETER in the case +// where a parameter is invalid. tsi_result tsi_ssl_server_handshaker_factory_create_handshaker( tsi_ssl_server_handshaker_factory* factory, size_t network_bio_buf_size, size_t ssl_bio_buf_size, tsi_handshaker** handshaker); -/* Decrements reference count of the handshaker factory. Handshaker factory will - * be destroyed once no references exist. */ +// Decrements reference count of the handshaker factory. Handshaker factory will +// be destroyed once no references exist. void tsi_ssl_server_handshaker_factory_unref( tsi_ssl_server_handshaker_factory* factory); -/* Util that checks that an ssl peer matches a specific name. - Still TODO(jboeuf): - - handle mixed case. - - handle %encoded chars. - - handle public suffix wildchar more strictly (e.g. *.co.uk) */ +// Util that checks that an ssl peer matches a specific name. +// Still TODO(jboeuf): +// - handle mixed case. +// - handle %encoded chars. +// - handle public suffix wildchar more strictly (e.g. *.co.uk) int tsi_ssl_peer_matches_name(const tsi_peer* peer, absl::string_view name); -/* --- Testing support. --- +// --- Testing support. --- - These functions and typedefs are not intended to be used outside of testing. - */ +// These functions and typedefs are not intended to be used outside of testing. +// -/* Base type of client and server handshaker factories. */ +// Base type of client and server handshaker factories. typedef struct tsi_ssl_handshaker_factory tsi_ssl_handshaker_factory; -/* Function pointer to handshaker_factory destructor. */ +// Function pointer to handshaker_factory destructor. typedef void (*tsi_ssl_handshaker_factory_destructor)( tsi_ssl_handshaker_factory* factory); -/* Virtual table for tsi_ssl_handshaker_factory. */ +// Virtual table for tsi_ssl_handshaker_factory. struct tsi_ssl_handshaker_factory_vtable { tsi_ssl_handshaker_factory_destructor destroy; }; -/* Set destructor of handshaker_factory to new_destructor, returns previous - destructor. */ +// Set destructor of handshaker_factory to new_destructor, returns previous +// destructor. const tsi_ssl_handshaker_factory_vtable* tsi_ssl_handshaker_factory_swap_vtable( tsi_ssl_handshaker_factory* factory, tsi_ssl_handshaker_factory_vtable* new_vtable); -/* Exposed for testing only. */ +// Exposed for testing only. tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert( const char* pem_cert, tsi_peer* peer); -/* Exposed for testing only. */ +// Exposed for testing only. tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) * peer_chain, tsi_peer_property* property); -#endif /* GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H */ +#endif // GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_H diff --git a/src/core/tsi/ssl_transport_security_utils.cc b/src/core/tsi/ssl_transport_security_utils.cc index 50a5d933f40..7d258046600 100644 --- a/src/core/tsi/ssl_transport_security_utils.cc +++ b/src/core/tsi/ssl_transport_security_utils.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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 @@ -92,8 +92,8 @@ tsi_result DoSslRead(SSL* ssl, unsigned char* unprotected_bytes, if (read_from_ssl <= 0) { read_from_ssl = SSL_get_error(ssl, read_from_ssl); switch (read_from_ssl) { - case SSL_ERROR_ZERO_RETURN: /* Received a close_notify alert. */ - case SSL_ERROR_WANT_READ: /* We need more data to finish the frame. */ + case SSL_ERROR_ZERO_RETURN: // Received a close_notify alert. + case SSL_ERROR_WANT_READ: // We need more data to finish the frame. *unprotected_bytes_size = 0; return TSI_OK; case SSL_ERROR_WANT_WRITE: @@ -115,7 +115,7 @@ tsi_result DoSslRead(SSL* ssl, unsigned char* unprotected_bytes, return TSI_OK; } -/* --- tsi_frame_protector util methods implementation. ---*/ +// --- tsi_frame_protector util methods implementation. --- tsi_result SslProtectorProtect(const unsigned char* unprotected_bytes, const size_t buffer_size, size_t& buffer_offset, unsigned char* buffer, SSL* ssl, BIO* network_io, @@ -126,7 +126,7 @@ tsi_result SslProtectorProtect(const unsigned char* unprotected_bytes, size_t available; tsi_result result = TSI_OK; - /* First see if we have some pending data in the SSL BIO. */ + // First see if we have some pending data in the SSL BIO. int pending_in_ssl = static_cast(BIO_pending(network_io)); if (pending_in_ssl > 0) { *unprotected_bytes_size = 0; @@ -142,17 +142,17 @@ tsi_result SslProtectorProtect(const unsigned char* unprotected_bytes, return TSI_OK; } - /* Now see if we can send a complete frame. */ + // Now see if we can send a complete frame. available = buffer_size - buffer_offset; if (available > *unprotected_bytes_size) { - /* If we cannot, just copy the data in our internal buffer. */ + // If we cannot, just copy the data in our internal buffer. memcpy(buffer + buffer_offset, unprotected_bytes, *unprotected_bytes_size); buffer_offset += *unprotected_bytes_size; *protected_output_frames_size = 0; return TSI_OK; } - /* If we can, prepare the buffer, send it to SSL_write and read. */ + // If we can, prepare the buffer, send it to SSL_write and read. memcpy(buffer + buffer_offset, unprotected_bytes, available); result = DoSslWrite(ssl, buffer, buffer_size); if (result != TSI_OK) return result; @@ -215,11 +215,11 @@ tsi_result SslProtectorUnprotect(const unsigned char* protected_frames_bytes, size_t output_bytes_size = *unprotected_bytes_size; size_t output_bytes_offset = 0; - /* First, try to read remaining data from ssl. */ + // First, try to read remaining data from ssl. result = DoSslRead(ssl, unprotected_bytes, unprotected_bytes_size); if (result != TSI_OK) return result; if (*unprotected_bytes_size == output_bytes_size) { - /* We have read everything we could and cannot process any more input. */ + // We have read everything we could and cannot process any more input. *protected_frames_bytes_size = 0; return TSI_OK; } @@ -227,7 +227,7 @@ tsi_result SslProtectorUnprotect(const unsigned char* protected_frames_bytes, unprotected_bytes += output_bytes_offset; *unprotected_bytes_size = output_bytes_size - output_bytes_offset; - /* Then, try to write some data to ssl. */ + // Then, try to write some data to ssl. GPR_ASSERT(*protected_frames_bytes_size <= INT_MAX); written_into_ssl = BIO_write(network_io, protected_frames_bytes, static_cast(*protected_frames_bytes_size)); @@ -238,10 +238,10 @@ tsi_result SslProtectorUnprotect(const unsigned char* protected_frames_bytes, } *protected_frames_bytes_size = static_cast(written_into_ssl); - /* Now try to read some data again. */ + // Now try to read some data again. result = DoSslRead(ssl, unprotected_bytes, unprotected_bytes_size); if (result == TSI_OK) { - /* Don't forget to output the total number of bytes read. */ + // Don't forget to output the total number of bytes read. *unprotected_bytes_size += output_bytes_offset; } return result; diff --git a/src/core/tsi/ssl_transport_security_utils.h b/src/core/tsi/ssl_transport_security_utils.h index becee21356d..6c2fd135f46 100644 --- a/src/core/tsi/ssl_transport_security_utils.h +++ b/src/core/tsi/ssl_transport_security_utils.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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. +// +// #ifndef GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_UTILS_H #define GRPC_CORE_TSI_SSL_TRANSPORT_SECURITY_UTILS_H diff --git a/src/core/tsi/ssl_types.h b/src/core/tsi/ssl_types.h index b15d02be390..2f5274bfaf6 100644 --- a/src/core/tsi/ssl_types.h +++ b/src/core/tsi/ssl_types.h @@ -1,31 +1,31 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_TSI_SSL_TYPES_H #define GRPC_CORE_TSI_SSL_TYPES_H -/* A collection of macros to cast between various integer types that are - * used differently between BoringSSL and OpenSSL: - * TSI_INT_AS_SIZE(x): convert 'int x' to a length parameter for an OpenSSL - * function - * TSI_SIZE_AS_SIZE(x): convert 'size_t x' to a length parameter for an OpenSSL - * function - */ +// A collection of macros to cast between various integer types that are +// used differently between BoringSSL and OpenSSL: +// TSI_INT_AS_SIZE(x): convert 'int x' to a length parameter for an OpenSSL +// function +// TSI_SIZE_AS_SIZE(x): convert 'size_t x' to a length parameter for an OpenSSL +// function +// #include @@ -39,4 +39,4 @@ #define TSI_SIZE_AS_SIZE(x) ((int)(x)) #endif -#endif /* GRPC_CORE_TSI_SSL_TYPES_H */ +#endif // GRPC_CORE_TSI_SSL_TYPES_H diff --git a/src/core/tsi/transport_security.cc b/src/core/tsi/transport_security.cc index a141ae6e1e4..f9b13ea7d36 100644 --- a/src/core/tsi/transport_security.cc +++ b/src/core/tsi/transport_security.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -26,11 +26,11 @@ #include #include -/* --- Tracing. --- */ +// --- Tracing. --- grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi"); -/* --- tsi_result common implementation. --- */ +// --- tsi_result common implementation. --- const char* tsi_result_to_string(tsi_result result) { switch (result) { @@ -80,9 +80,9 @@ const char* tsi_security_level_to_string(tsi_security_level security_level) { } } -/* --- tsi_frame_protector common implementation. --- +// --- tsi_frame_protector common implementation. --- - Calls specific implementation after state/input validation. */ +// Calls specific implementation after state/input validation. tsi_result tsi_frame_protector_protect(tsi_frame_protector* self, const unsigned char* unprotected_bytes, @@ -137,9 +137,9 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self) { self->vtable->destroy(self); } -/* --- tsi_handshaker common implementation. --- +// --- tsi_handshaker common implementation. --- - Calls specific implementation after state/input validation. */ +// Calls specific implementation after state/input validation. tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self, unsigned char* bytes, @@ -251,7 +251,7 @@ void tsi_handshaker_destroy(tsi_handshaker* self) { self->vtable->destroy(self); } -/* --- tsi_handshaker_result implementation. --- */ +// --- tsi_handshaker_result implementation. --- tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self, tsi_peer* peer) { @@ -302,7 +302,7 @@ void tsi_handshaker_result_destroy(tsi_handshaker_result* self) { self->vtable->destroy(self); } -/* --- tsi_peer implementation. --- */ +// --- tsi_peer implementation. --- tsi_peer_property tsi_init_peer_property(void) { tsi_peer_property property; @@ -326,7 +326,7 @@ void tsi_peer_property_destruct(tsi_peer_property* property) { if (property->value.data != nullptr) { gpr_free(property->value.data); } - *property = tsi_init_peer_property(); /* Reset everything to 0. */ + *property = tsi_init_peer_property(); // Reset everything to 0. } void tsi_peer_destruct(tsi_peer* self) { diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h index 9f4fded7896..71d42507a43 100644 --- a/src/core/tsi/transport_security.h +++ b/src/core/tsi/transport_security.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_TSI_TRANSPORT_SECURITY_H #define GRPC_CORE_TSI_TRANSPORT_SECURITY_H @@ -28,9 +28,9 @@ extern grpc_core::TraceFlag tsi_tracing_enabled; -/* Base for tsi_frame_protector implementations. - See transport_security_interface.h for documentation. - All methods must be implemented. */ +// Base for tsi_frame_protector implementations. +// See transport_security_interface.h for documentation. +// All methods must be implemented. struct tsi_frame_protector_vtable { tsi_result (*protect)(tsi_frame_protector* self, const unsigned char* unprotected_bytes, @@ -52,12 +52,12 @@ struct tsi_frame_protector { const tsi_frame_protector_vtable* vtable; }; -/* Base for tsi_handshaker implementations. - See transport_security_interface.h for documentation. */ +// Base for tsi_handshaker implementations. +// See transport_security_interface.h for documentation. struct tsi_handshaker_vtable { - /* Methods for supporting the old synchronous API. - These can be null if the TSI impl supports only the new - async-capable API. */ + // Methods for supporting the old synchronous API. + // These can be null if the TSI impl supports only the new + // async-capable API. tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker* self, unsigned char* bytes, size_t* bytes_size); @@ -69,10 +69,10 @@ struct tsi_handshaker_vtable { tsi_result (*create_frame_protector)(tsi_handshaker* self, size_t* max_protected_frame_size, tsi_frame_protector** protector); - /* Must be implemented by all TSI impls. */ + // Must be implemented by all TSI impls. void (*destroy)(tsi_handshaker* self); - /* Methods for supporting the new async-capable API. - These can be null if the TSI impl supports only the old sync API. */ + // Methods for supporting the new async-capable API. + // These can be null if the TSI impl supports only the old sync API. tsi_result (*next)(tsi_handshaker* self, const unsigned char* received_bytes, size_t received_bytes_size, const unsigned char** bytes_to_send, @@ -89,28 +89,28 @@ struct tsi_handshaker { bool handshake_shutdown; }; -/* Base for tsi_handshaker_result implementations. - See transport_security_interface.h for documentation. - The exec_ctx parameter in create_zero_copy_grpc_protector is supposed to be - of type grpc_exec_ctx*, but we're using void* instead to avoid making the TSI - API depend on grpc. The create_zero_copy_grpc_protector() method is only used - in grpc, where we do need the exec_ctx passed through, but the API still - needs to compile in other applications, where grpc_exec_ctx is not defined. - All methods must be non-null, except where noted below. -*/ +// Base for tsi_handshaker_result implementations. +// See transport_security_interface.h for documentation. +// The exec_ctx parameter in create_zero_copy_grpc_protector is supposed to be +// of type grpc_exec_ctx*, but we're using void* instead to avoid making the TSI +// API depend on grpc. The create_zero_copy_grpc_protector() method is only used +// in grpc, where we do need the exec_ctx passed through, but the API still +// needs to compile in other applications, where grpc_exec_ctx is not defined. +// All methods must be non-null, except where noted below. +// struct tsi_handshaker_result_vtable { tsi_result (*extract_peer)(const tsi_handshaker_result* self, tsi_peer* peer); tsi_result (*get_frame_protector_type)( const tsi_handshaker_result* self, tsi_frame_protector_type* frame_protector_type); - /* May be null if get_frame_protector_type() returns - TSI_FRAME_PROTECTOR_NORMAL or TSI_FRAME_PROTECTOR_NONE. */ + // May be null if get_frame_protector_type() returns + // TSI_FRAME_PROTECTOR_NORMAL or TSI_FRAME_PROTECTOR_NONE. tsi_result (*create_zero_copy_grpc_protector)( const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, tsi_zero_copy_grpc_protector** protector); - /* May be null if get_frame_protector_type() returns - TSI_FRAME_PROTECTOR_ZERO_COPY or TSI_FRAME_PROTECTOR_NONE. */ + // May be null if get_frame_protector_type() returns + // TSI_FRAME_PROTECTOR_ZERO_COPY or TSI_FRAME_PROTECTOR_NONE. tsi_result (*create_frame_protector)(const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, tsi_frame_protector** protector); @@ -123,7 +123,7 @@ struct tsi_handshaker_result { const tsi_handshaker_result_vtable* vtable; }; -/* Peer and property construction/destruction functions. */ +// Peer and property construction/destruction functions. tsi_result tsi_construct_peer(size_t property_count, tsi_peer* peer); tsi_peer_property tsi_init_peer_property(void); void tsi_peer_property_destruct(tsi_peer_property* property); @@ -137,7 +137,7 @@ tsi_result tsi_construct_string_peer_property_from_cstring( const char* name, const char* value, tsi_peer_property* property); const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* peer, const char* name); -/* Utils. */ -char* tsi_strdup(const char* src); /* Sadly, no strdup in C89. */ +// Utils. +char* tsi_strdup(const char* src); // Sadly, no strdup in C89. -#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_H */ +#endif // GRPC_CORE_TSI_TRANSPORT_SECURITY_H diff --git a/src/core/tsi/transport_security_grpc.cc b/src/core/tsi/transport_security_grpc.cc index f43994d1b5b..3f04ce99122 100644 --- a/src/core/tsi/transport_security_grpc.cc +++ b/src/core/tsi/transport_security_grpc.cc @@ -1,26 +1,26 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include "src/core/tsi/transport_security_grpc.h" -/* This method creates a tsi_zero_copy_grpc_protector object. */ +// This method creates a tsi_zero_copy_grpc_protector object. tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector( const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, tsi_zero_copy_grpc_protector** protector) { @@ -34,9 +34,9 @@ tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector( self, max_output_protected_frame_size, protector); } -/* --- tsi_zero_copy_grpc_protector common implementation. --- +// --- tsi_zero_copy_grpc_protector common implementation. --- - Calls specific implementation after state/input validation. */ +// Calls specific implementation after state/input validation. tsi_result tsi_zero_copy_grpc_protector_protect( tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices, diff --git a/src/core/tsi/transport_security_grpc.h b/src/core/tsi/transport_security_grpc.h index 0330d8fbbab..5cf6ada4a25 100644 --- a/src/core/tsi/transport_security_grpc.h +++ b/src/core/tsi/transport_security_grpc.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H #define GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H @@ -25,45 +25,45 @@ #include "src/core/tsi/transport_security.h" -/* This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK - assuming there is no fatal error. - The caller is responsible for destroying the protector. */ +// This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK +// assuming there is no fatal error. +// The caller is responsible for destroying the protector. tsi_result tsi_handshaker_result_create_zero_copy_grpc_protector( const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, tsi_zero_copy_grpc_protector** protector); -/* -- tsi_zero_copy_grpc_protector object -- */ +// -- tsi_zero_copy_grpc_protector object -- -/* Outputs protected frames. - - unprotected_slices is the unprotected data to be protected. - - protected_slices is the protected output frames. One or more frames - may be produced in this protect function. - - This method returns TSI_OK in case of success or a specific error code in - case of failure. */ +// Outputs protected frames. +// - unprotected_slices is the unprotected data to be protected. +// - protected_slices is the protected output frames. One or more frames +// may be produced in this protect function. +// - This method returns TSI_OK in case of success or a specific error code in +// case of failure. tsi_result tsi_zero_copy_grpc_protector_protect( tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices, grpc_slice_buffer* protected_slices); -/* Outputs unprotected bytes. - - protected_slices is the bytes of protected frames. - - unprotected_slices is the unprotected output data. - - if min_progress_size is not null, it returns the size of the last - incomplete frame which could not be fully unprotected. - - This method returns TSI_OK in case of success. Success includes cases where - there is not enough data to output in which case unprotected_slices has 0 - bytes. */ +// Outputs unprotected bytes. +// - protected_slices is the bytes of protected frames. +// - unprotected_slices is the unprotected output data. +// - if min_progress_size is not null, it returns the size of the last +// incomplete frame which could not be fully unprotected. +// - This method returns TSI_OK in case of success. Success includes cases where +// there is not enough data to output in which case unprotected_slices has 0 +// bytes. tsi_result tsi_zero_copy_grpc_protector_unprotect( tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* protected_slices, grpc_slice_buffer* unprotected_slices, int* min_progress_size); -/* Destroys the tsi_zero_copy_grpc_protector object. */ +// Destroys the tsi_zero_copy_grpc_protector object. void tsi_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector* self); -/* Returns value of max protected frame size. Useful for testing. */ +// Returns value of max protected frame size. Useful for testing. tsi_result tsi_zero_copy_grpc_protector_max_frame_size( tsi_zero_copy_grpc_protector* self, size_t* max_frame_size); -/* Base for tsi_zero_copy_grpc_protector implementations. */ +// Base for tsi_zero_copy_grpc_protector implementations. struct tsi_zero_copy_grpc_protector_vtable { tsi_result (*protect)(tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices, @@ -80,4 +80,4 @@ struct tsi_zero_copy_grpc_protector { const tsi_zero_copy_grpc_protector_vtable* vtable; }; -#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H */ +#endif // GRPC_CORE_TSI_TRANSPORT_SECURITY_GRPC_H diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h index 0be69b86a29..0dccb9c4380 100644 --- a/src/core/tsi/transport_security_interface.h +++ b/src/core/tsi/transport_security_interface.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H #define GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H @@ -28,7 +28,7 @@ #include "src/core/lib/debug/trace.h" -/* --- tsi result --- */ +// --- tsi result --- typedef enum { TSI_OK = 0, @@ -96,139 +96,139 @@ typedef enum { const char* tsi_result_to_string(tsi_result result); const char* tsi_security_level_to_string(tsi_security_level security_level); -/* --- tsi tracing --- */ +// --- tsi tracing --- extern grpc_core::TraceFlag tsi_tracing_enabled; -/* -- tsi_zero_copy_grpc_protector object -- +// -- tsi_zero_copy_grpc_protector object -- - This object protects and unprotects grpc slice buffers with zero or minimized - memory copy once the handshake is done. Implementations of this object must be - thread compatible. This object depends on grpc and the details of this object - is defined in transport_security_grpc.h. */ +// This object protects and unprotects grpc slice buffers with zero or minimized +// memory copy once the handshake is done. Implementations of this object must +// be thread compatible. This object depends on grpc and the details of this +// object is defined in transport_security_grpc.h. typedef struct tsi_zero_copy_grpc_protector tsi_zero_copy_grpc_protector; -/* --- tsi_frame_protector object --- +// --- tsi_frame_protector object --- - This object protects and unprotects buffers once the handshake is done. - Implementations of this object must be thread compatible. */ +// This object protects and unprotects buffers once the handshake is done. +// Implementations of this object must be thread compatible. typedef struct tsi_frame_protector tsi_frame_protector; -/* Outputs protected frames. - - unprotected_bytes is an input only parameter and points to the data - to be protected. - - unprotected_bytes_size is an input/output parameter used by the caller to - specify how many bytes are available in unprotected_bytes. The output - value is the number of bytes consumed during the call. - - protected_output_frames points to a buffer allocated by the caller that - will be written. - - protected_output_frames_size is an input/output parameter used by the - caller to specify how many bytes are available in protected_output_frames. - As an output, this value indicates the number of bytes written. - - This method returns TSI_OK in case of success or a specific error code in - case of failure. Note that even if all the input unprotected bytes are - consumed, they may not have been processed into the returned protected - output frames. The caller should call the protect_flush method - to make sure that there are no more protected bytes buffered in the - protector. - - A typical way to call this method would be: - - ------------------------------------------------------------------------ - unsigned char protected_buffer[4096]; - size_t protected_buffer_size = sizeof(protected_buffer); - tsi_result result = TSI_OK; - while (message_size > 0) { - size_t protected_buffer_size_to_send = protected_buffer_size; - size_t processed_message_size = message_size; - result = tsi_frame_protector_protect(protector, - message_bytes, - &processed_message_size, - protected_buffer, - &protected_buffer_size_to_send); - if (result != TSI_OK) break; - send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send); - message_bytes += processed_message_size; - message_size -= processed_message_size; - - // Don't forget to flush. - if (message_size == 0) { - size_t still_pending_size; - do { - protected_buffer_size_to_send = protected_buffer_size; - result = tsi_frame_protector_protect_flush( - protector, protected_buffer, - &protected_buffer_size_to_send, &still_pending_size); - if (result != TSI_OK) break; - send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send); - } while (still_pending_size > 0); - } - } - - if (result != TSI_OK) HandleError(result); - ------------------------------------------------------------------------ */ +// Outputs protected frames. +// - unprotected_bytes is an input only parameter and points to the data +// to be protected. +// - unprotected_bytes_size is an input/output parameter used by the caller to +// specify how many bytes are available in unprotected_bytes. The output +// value is the number of bytes consumed during the call. +// - protected_output_frames points to a buffer allocated by the caller that +// will be written. +// - protected_output_frames_size is an input/output parameter used by the +// caller to specify how many bytes are available in protected_output_frames. +// As an output, this value indicates the number of bytes written. +// - This method returns TSI_OK in case of success or a specific error code in +// case of failure. Note that even if all the input unprotected bytes are +// consumed, they may not have been processed into the returned protected +// output frames. The caller should call the protect_flush method +// to make sure that there are no more protected bytes buffered in the +// protector. + +// A typical way to call this method would be: + +// ------------------------------------------------------------------------ +// unsigned char protected_buffer[4096]; +// size_t protected_buffer_size = sizeof(protected_buffer); +// tsi_result result = TSI_OK; +// while (message_size > 0) { +// size_t protected_buffer_size_to_send = protected_buffer_size; +// size_t processed_message_size = message_size; +// result = tsi_frame_protector_protect(protector, +// message_bytes, +// &processed_message_size, +// protected_buffer, +// &protected_buffer_size_to_send); +// if (result != TSI_OK) break; +// send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send); +// message_bytes += processed_message_size; +// message_size -= processed_message_size; + +// // Don't forget to flush. +// if (message_size == 0) { +// size_t still_pending_size; +// do { +// protected_buffer_size_to_send = protected_buffer_size; +// result = tsi_frame_protector_protect_flush( +// protector, protected_buffer, +// &protected_buffer_size_to_send, &still_pending_size); +// if (result != TSI_OK) break; +// send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send); +// } while (still_pending_size > 0); +// } +// } + +// if (result != TSI_OK) HandleError(result); +// ------------------------------------------------------------------------ tsi_result tsi_frame_protector_protect(tsi_frame_protector* self, const unsigned char* unprotected_bytes, size_t* unprotected_bytes_size, unsigned char* protected_output_frames, size_t* protected_output_frames_size); -/* Indicates that we need to flush the bytes buffered in the protector and get - the resulting frame. - - protected_output_frames points to a buffer allocated by the caller that - will be written. - - protected_output_frames_size is an input/output parameter used by the - caller to specify how many bytes are available in protected_output_frames. - - still_pending_bytes is an output parameter indicating the number of bytes - that still need to be flushed from the protector.*/ +// Indicates that we need to flush the bytes buffered in the protector and get +// the resulting frame. +// - protected_output_frames points to a buffer allocated by the caller that +// will be written. +// - protected_output_frames_size is an input/output parameter used by the +// caller to specify how many bytes are available in protected_output_frames. +// - still_pending_bytes is an output parameter indicating the number of bytes +// that still need to be flushed from the protector. tsi_result tsi_frame_protector_protect_flush( tsi_frame_protector* self, unsigned char* protected_output_frames, size_t* protected_output_frames_size, size_t* still_pending_size); -/* Outputs unprotected bytes. - - protected_frames_bytes is an input only parameter and points to the - protected frames to be unprotected. - - protected_frames_bytes_size is an input/output only parameter used by the - caller to specify how many bytes are available in protected_bytes. The - output value is the number of bytes consumed during the call. - Implementations will buffer up to a frame of protected data. - - unprotected_bytes points to a buffer allocated by the caller that will be - written. - - unprotected_bytes_size is an input/output parameter used by the caller to - specify how many bytes are available in unprotected_bytes. This - value is expected to be at most max_protected_frame_size minus overhead - which means that max_protected_frame_size is a safe bet. The output value - is the number of bytes actually written. - If *unprotected_bytes_size is unchanged, there may be more data remaining - to unprotect, and the caller should call this function again. - - - This method returns TSI_OK in case of success. Success includes cases where - there is not enough data to output a frame in which case - unprotected_bytes_size will be set to 0 and cases where the internal buffer - needs to be read before new protected data can be processed in which case - protected_frames_size will be set to 0. */ +// Outputs unprotected bytes. +// - protected_frames_bytes is an input only parameter and points to the +// protected frames to be unprotected. +// - protected_frames_bytes_size is an input/output only parameter used by the +// caller to specify how many bytes are available in protected_bytes. The +// output value is the number of bytes consumed during the call. +// Implementations will buffer up to a frame of protected data. +// - unprotected_bytes points to a buffer allocated by the caller that will be +// written. +// - unprotected_bytes_size is an input/output parameter used by the caller to +// specify how many bytes are available in unprotected_bytes. This +// value is expected to be at most max_protected_frame_size minus overhead +// which means that max_protected_frame_size is a safe bet. The output value +// is the number of bytes actually written. +// If *unprotected_bytes_size is unchanged, there may be more data remaining +// to unprotect, and the caller should call this function again. + +// - This method returns TSI_OK in case of success. Success includes cases where +// there is not enough data to output a frame in which case +// unprotected_bytes_size will be set to 0 and cases where the internal buffer +// needs to be read before new protected data can be processed in which case +// protected_frames_size will be set to 0. tsi_result tsi_frame_protector_unprotect( tsi_frame_protector* self, const unsigned char* protected_frames_bytes, size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes, size_t* unprotected_bytes_size); -/* Destroys the tsi_frame_protector object. */ +// Destroys the tsi_frame_protector object. void tsi_frame_protector_destroy(tsi_frame_protector* self); -/* --- tsi_peer objects --- +// --- tsi_peer objects --- - tsi_peer objects are a set of properties. The peer owns the properties. */ +// tsi_peer objects are a set of properties. The peer owns the properties. -/* This property is of type TSI_PEER_PROPERTY_STRING. */ +// This property is of type TSI_PEER_PROPERTY_STRING. #define TSI_CERTIFICATE_TYPE_PEER_PROPERTY "certificate_type" -/* This property represents security level of a channel. */ +// This property represents security level of a channel. #define TSI_SECURITY_LEVEL_PEER_PROPERTY "security_level" -/* Property values may contain NULL characters just like C++ strings. - The length field gives the length of the string. */ +// Property values may contain NULL characters just like C++ strings. +// The length field gives the length of the string. typedef struct tsi_peer_property { char* name; struct { @@ -241,256 +241,256 @@ struct tsi_peer { tsi_peer_property* properties; size_t property_count; }; -/* Destructs the tsi_peer object. */ +// Destructs the tsi_peer object. void tsi_peer_destruct(tsi_peer* self); -/* --- tsi_handshaker_result object --- +// --- tsi_handshaker_result object --- - This object contains all necessary handshake results and data such as peer - info, negotiated keys, unused handshake bytes, when the handshake completes. - Implementations of this object must be thread compatible. */ +// This object contains all necessary handshake results and data such as peer +// info, negotiated keys, unused handshake bytes, when the handshake completes. +// Implementations of this object must be thread compatible. typedef struct tsi_handshaker_result tsi_handshaker_result; -/* This method extracts tsi peer. It returns TSI_OK assuming there is no fatal - error. - The caller is responsible for destructing the peer. */ +// This method extracts tsi peer. It returns TSI_OK assuming there is no fatal +// error. +// The caller is responsible for destructing the peer. tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self, tsi_peer* peer); -/* This method indicates what type of frame protector is provided by the - TSI implementation. */ +// This method indicates what type of frame protector is provided by the +// TSI implementation. tsi_result tsi_handshaker_result_get_frame_protector_type( const tsi_handshaker_result* self, tsi_frame_protector_type* frame_protector_type); -/* This method creates a tsi_frame_protector object. It returns TSI_OK assuming - there is no fatal error. - The caller is responsible for destroying the protector. */ +// This method creates a tsi_frame_protector object. It returns TSI_OK assuming +// there is no fatal error. +// The caller is responsible for destroying the protector. tsi_result tsi_handshaker_result_create_frame_protector( const tsi_handshaker_result* self, size_t* max_output_protected_frame_size, tsi_frame_protector** protector); -/* This method returns the unused bytes from the handshake. It returns TSI_OK - assuming there is no fatal error. - Ownership of the bytes is retained by the handshaker result. As a - consequence, the caller must not free the bytes. */ +// This method returns the unused bytes from the handshake. It returns TSI_OK +// assuming there is no fatal error. +// Ownership of the bytes is retained by the handshaker result. As a +// consequence, the caller must not free the bytes. tsi_result tsi_handshaker_result_get_unused_bytes( const tsi_handshaker_result* self, const unsigned char** bytes, size_t* bytes_size); -/* This method releases the tsi_handshaker_handshaker object. After this method - is called, no other method can be called on the object. */ +// This method releases the tsi_handshaker_handshaker object. After this method +// is called, no other method can be called on the object. void tsi_handshaker_result_destroy(tsi_handshaker_result* self); -/* --- tsi_handshaker objects ---- - - Implementations of this object must be thread compatible. - - ------------------------------------------------------------------------ - - A typical usage supporting both synchronous and asynchronous TSI handshaker - implementations would be: - - ------------------------------------------------------------------------ - - typedef struct { - tsi_handshaker *handshaker; - tsi_handshaker_result *handshaker_result; - unsigned char *handshake_buffer; - size_t handshake_buffer_size; - ... - } security_handshaker; - - void do_handshake(security_handshaker *h, ...) { - // Start the handshake by the calling do_handshake_next. - do_handshake_next(h, NULL, 0); - ... - } - - // This method is the callback function when data is received from the - // peer. This method will read bytes into the handshake buffer and call - // do_handshake_next. - void on_handshake_data_received_from_peer(void *user_data) { - security_handshaker *h = (security_handshaker *)user_data; - size_t bytes_received_size = h->handshake_buffer_size; - read_bytes_from_peer(h->handshake_buffer, &bytes_received_size); - do_handshake_next(h, h->handshake_buffer, bytes_received_size); - } - - // This method processes a step of handshake, calling tsi_handshaker_next. - void do_handshake_next(security_handshaker *h, - const unsigned char* bytes_received, - size_t bytes_received_size) { - tsi_result status = TSI_OK; - unsigned char *bytes_to_send = NULL; - size_t bytes_to_send_size = 0; - tsi_handshaker_result *result = NULL; - status = tsi_handshaker_next( - handshaker, bytes_received, bytes_received_size, &bytes_to_send, - &bytes_to_send_size, &result, on_handshake_next_done, h); - // If TSI handshaker is asynchronous, on_handshake_next_done will be - // executed inside tsi_handshaker_next. - if (status == TSI_ASYNC) return; - // If TSI handshaker is synchronous, invoke callback directly in this - // thread. - on_handshake_next_done(status, (void *)h, bytes_to_send, - bytes_to_send_size, result); - } - - // This is the callback function to execute after tsi_handshaker_next. - // It is passed to tsi_handshaker_next as a function parameter. - void on_handshake_next_done( - tsi_result status, void *user_data, const unsigned char *bytes_to_send, - size_t bytes_to_send_size, tsi_handshaker_result *result) { - security_handshaker *h = (security_handshaker *)user_data; - if (status == TSI_INCOMPLETE_DATA) { - // Schedule an asynchronous read from the peer. If handshake data are - // received, on_handshake_data_received_from_peer will be called. - async_read_from_peer(..., ..., on_handshake_data_received_from_peer); - return; - } - if (status != TSI_OK) return; - - if (bytes_to_send_size > 0) { - send_bytes_to_peer(bytes_to_send, bytes_to_send_size); - } - - if (result != NULL) { - // Handshake completed. - h->result = result; - // Check the Peer. - tsi_peer peer; - status = tsi_handshaker_result_extract_peer(result, &peer); - if (status != TSI_OK) return; - status = check_peer(&peer); - tsi_peer_destruct(&peer); - if (status != TSI_OK) return; - - // Create the protector. - tsi_frame_protector* protector = NULL; - status = tsi_handshaker_result_create_frame_protector(result, NULL, - &protector); - if (status != TSI_OK) return; - - // Do not forget to unprotect outstanding data if any. - .... - } - } - ------------------------------------------------------------------------ */ +// --- tsi_handshaker objects ---- + +// Implementations of this object must be thread compatible. + +// ------------------------------------------------------------------------ + +// A typical usage supporting both synchronous and asynchronous TSI handshaker +// implementations would be: + +// ------------------------------------------------------------------------ + +// typedef struct { +// tsi_handshaker *handshaker; +// tsi_handshaker_result *handshaker_result; +// unsigned char *handshake_buffer; +// size_t handshake_buffer_size; +// ... +// } security_handshaker; + +// void do_handshake(security_handshaker *h, ...) { +// // Start the handshake by the calling do_handshake_next. +// do_handshake_next(h, NULL, 0); +// ... +// } + +// // This method is the callback function when data is received from the +// // peer. This method will read bytes into the handshake buffer and call +// // do_handshake_next. +// void on_handshake_data_received_from_peer(void *user_data) { +// security_handshaker *h = (security_handshaker *)user_data; +// size_t bytes_received_size = h->handshake_buffer_size; +// read_bytes_from_peer(h->handshake_buffer, &bytes_received_size); +// do_handshake_next(h, h->handshake_buffer, bytes_received_size); +// } + +// // This method processes a step of handshake, calling tsi_handshaker_next. +// void do_handshake_next(security_handshaker *h, +// const unsigned char* bytes_received, +// size_t bytes_received_size) { +// tsi_result status = TSI_OK; +// unsigned char *bytes_to_send = NULL; +// size_t bytes_to_send_size = 0; +// tsi_handshaker_result *result = NULL; +// status = tsi_handshaker_next( +// handshaker, bytes_received, bytes_received_size, &bytes_to_send, +// &bytes_to_send_size, &result, on_handshake_next_done, h); +// // If TSI handshaker is asynchronous, on_handshake_next_done will be +// // executed inside tsi_handshaker_next. +// if (status == TSI_ASYNC) return; +// // If TSI handshaker is synchronous, invoke callback directly in this +// // thread. +// on_handshake_next_done(status, (void *)h, bytes_to_send, +// bytes_to_send_size, result); +// } + +// // This is the callback function to execute after tsi_handshaker_next. +// // It is passed to tsi_handshaker_next as a function parameter. +// void on_handshake_next_done( +// tsi_result status, void *user_data, const unsigned char *bytes_to_send, +// size_t bytes_to_send_size, tsi_handshaker_result *result) { +// security_handshaker *h = (security_handshaker *)user_data; +// if (status == TSI_INCOMPLETE_DATA) { +// // Schedule an asynchronous read from the peer. If handshake data are +// // received, on_handshake_data_received_from_peer will be called. +// async_read_from_peer(..., ..., on_handshake_data_received_from_peer); +// return; +// } +// if (status != TSI_OK) return; + +// if (bytes_to_send_size > 0) { +// send_bytes_to_peer(bytes_to_send, bytes_to_send_size); +// } + +// if (result != NULL) { +// // Handshake completed. +// h->result = result; +// // Check the Peer. +// tsi_peer peer; +// status = tsi_handshaker_result_extract_peer(result, &peer); +// if (status != TSI_OK) return; +// status = check_peer(&peer); +// tsi_peer_destruct(&peer); +// if (status != TSI_OK) return; + +// // Create the protector. +// tsi_frame_protector* protector = NULL; +// status = tsi_handshaker_result_create_frame_protector(result, NULL, +// &protector); +// if (status != TSI_OK) return; + +// // Do not forget to unprotect outstanding data if any. +// .... +// } +// } +// ------------------------------------------------------------------------ typedef struct tsi_handshaker tsi_handshaker; -/* TODO(jiangtaoli2016): Cleans up deprecated methods when we are ready. */ - -/* TO BE DEPRECATED SOON. Use tsi_handshaker_next instead. - Gets bytes that need to be sent to the peer. - - bytes is the buffer that will be written with the data to be sent to the - peer. - - bytes_size is an input/output parameter specifying the capacity of the - bytes parameter as input and the number of bytes written as output. - Returns TSI_OK if all the data to send to the peer has been written or if - nothing has to be sent to the peer (in which base bytes_size outputs to 0), - otherwise returns TSI_INCOMPLETE_DATA which indicates that this method - needs to be called again to get all the bytes to send to the peer (there - was more data to write than the specified bytes_size). In case of a fatal - error in the handshake, another specific error code is returned. */ +// TODO(jiangtaoli2016): Cleans up deprecated methods when we are ready. + +// TO BE DEPRECATED SOON. Use tsi_handshaker_next instead. +// Gets bytes that need to be sent to the peer. +// - bytes is the buffer that will be written with the data to be sent to the +// peer. +// - bytes_size is an input/output parameter specifying the capacity of the +// bytes parameter as input and the number of bytes written as output. +// Returns TSI_OK if all the data to send to the peer has been written or if +// nothing has to be sent to the peer (in which base bytes_size outputs to 0), +// otherwise returns TSI_INCOMPLETE_DATA which indicates that this method +// needs to be called again to get all the bytes to send to the peer (there +// was more data to write than the specified bytes_size). In case of a fatal +// error in the handshake, another specific error code is returned. tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self, unsigned char* bytes, size_t* bytes_size); -/* TO BE DEPRECATED SOON. Use tsi_handshaker_next instead. - Processes bytes received from the peer. - - bytes is the buffer containing the data. - - bytes_size is an input/output parameter specifying the size of the data as - input and the number of bytes consumed as output. - Return TSI_OK if the handshake has all the data it needs to process, - otherwise return TSI_INCOMPLETE_DATA which indicates that this method - needs to be called again to complete the data needed for processing. In - case of a fatal error in the handshake, another specific error code is - returned. */ +// TO BE DEPRECATED SOON. Use tsi_handshaker_next instead. +// Processes bytes received from the peer. +// - bytes is the buffer containing the data. +// - bytes_size is an input/output parameter specifying the size of the data as +// input and the number of bytes consumed as output. +// Return TSI_OK if the handshake has all the data it needs to process, +// otherwise return TSI_INCOMPLETE_DATA which indicates that this method +// needs to be called again to complete the data needed for processing. In +// case of a fatal error in the handshake, another specific error code is +// returned. tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self, const unsigned char* bytes, size_t* bytes_size); -/* TO BE DEPRECATED SOON. - Gets the result of the handshaker. - Returns TSI_OK if the hanshake completed successfully and there has been no - errors. Returns TSI_HANDSHAKE_IN_PROGRESS if the handshaker is not done yet - but no error has been encountered so far. Otherwise the handshaker failed - with the returned error. */ +// TO BE DEPRECATED SOON. +// Gets the result of the handshaker. +// Returns TSI_OK if the hanshake completed successfully and there has been no +// errors. Returns TSI_HANDSHAKE_IN_PROGRESS if the handshaker is not done yet +// but no error has been encountered so far. Otherwise the handshaker failed +// with the returned error. tsi_result tsi_handshaker_get_result(tsi_handshaker* self); -/* TO BE DEPRECATED SOON. - Returns 1 if the handshake is in progress, 0 otherwise. */ +// TO BE DEPRECATED SOON. +// Returns 1 if the handshake is in progress, 0 otherwise. #define tsi_handshaker_is_in_progress(h) \ (tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS) -/* TO BE DEPRECATED SOON. Use tsi_handshaker_result_extract_peer instead. - This method may return TSI_FAILED_PRECONDITION if - tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise - assuming the handshaker is not in a fatal error state. - The caller is responsible for destructing the peer. */ +// TO BE DEPRECATED SOON. Use tsi_handshaker_result_extract_peer instead. +// This method may return TSI_FAILED_PRECONDITION if +// tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise +// assuming the handshaker is not in a fatal error state. +// The caller is responsible for destructing the peer. tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer); -/* TO BE DEPRECATED SOON. Use tsi_handshaker_result_create_frame_protector - instead. - This method creates a tsi_frame_protector object after the handshake phase - is done. After this method has been called successfully, the only method - that can be called on this object is Destroy. - - max_output_protected_frame_size is an input/output parameter specifying the - desired max output protected frame size as input and outputing the actual - max output frame size as the output. Passing NULL is OK and will result in - the implementation choosing the default maximum protected frame size. Note - that this size only applies to outgoing frames (generated with - tsi_frame_protector_protect) and not incoming frames (input of - tsi_frame_protector_unprotect). - - protector is an output parameter pointing to the newly created - tsi_frame_protector object. - This method may return TSI_FAILED_PRECONDITION if - tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise assuming - the handshaker is not in a fatal error state. - The caller is responsible for destroying the protector. */ +// TO BE DEPRECATED SOON. Use tsi_handshaker_result_create_frame_protector +// instead. +// This method creates a tsi_frame_protector object after the handshake phase +// is done. After this method has been called successfully, the only method +// that can be called on this object is Destroy. +// - max_output_protected_frame_size is an input/output parameter specifying the +// desired max output protected frame size as input and outputing the actual +// max output frame size as the output. Passing NULL is OK and will result in +// the implementation choosing the default maximum protected frame size. Note +// that this size only applies to outgoing frames (generated with +// tsi_frame_protector_protect) and not incoming frames (input of +// tsi_frame_protector_unprotect). +// - protector is an output parameter pointing to the newly created +// tsi_frame_protector object. +// This method may return TSI_FAILED_PRECONDITION if +// tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise assuming +// the handshaker is not in a fatal error state. +// The caller is responsible for destroying the protector. tsi_result tsi_handshaker_create_frame_protector( tsi_handshaker* self, size_t* max_output_protected_frame_size, tsi_frame_protector** protector); -/* Callback function definition for tsi_handshaker_next. - - status indicates the status of the next operation. - - user_data is the argument to callback function passed from the caller. - - bytes_to_send is the data buffer to be sent to the peer. - - bytes_to_send_size is the size of data buffer to be sent to the peer. - - handshaker_result is the result of handshake when the handshake completes, - is NULL otherwise. */ +// Callback function definition for tsi_handshaker_next. +// - status indicates the status of the next operation. +// - user_data is the argument to callback function passed from the caller. +// - bytes_to_send is the data buffer to be sent to the peer. +// - bytes_to_send_size is the size of data buffer to be sent to the peer. +// - handshaker_result is the result of handshake when the handshake completes, +// is NULL otherwise. typedef void (*tsi_handshaker_on_next_done_cb)( tsi_result status, void* user_data, const unsigned char* bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result); -/* Conduct a next step of the handshake. - - received_bytes is the buffer containing the data received from the peer. - - received_bytes_size is the size of the data received from the peer. - - bytes_to_send is the data buffer to be sent to the peer. - - bytes_to_send_size is the size of data buffer to be sent to the peer. - - handshaker_result is the result of handshake if the handshake completes. - - cb is the callback function defined above. It can be NULL for synchronous - TSI handshaker implementation. - - user_data is the argument to callback function passed from the caller. - - error, if non-null, will be populated with a human-readable error - message whenever the result value is something other than TSI_OK, - TSI_ASYNC, or TSI_INCOMPLETE_DATA. The object pointed to by this - argument is owned by the caller and must continue to exist until after the - handshake is finished. Some TSI implementations cache this value, - so callers must pass the same value to all calls to tsi_handshaker_next() - for a given handshake. - This method returns TSI_ASYNC if the TSI handshaker implementation is - asynchronous, and in this case, the callback is guaranteed to run in another - thread owned by TSI. It returns TSI_OK if the handshake completes or if - there are data to send to the peer, otherwise returns TSI_INCOMPLETE_DATA - which indicates that this method needs to be called again with more data - from the peer. In case of a fatal error in the handshake, another specific - error code is returned. - The caller is responsible for destroying the handshaker_result. However, - the caller should not free bytes_to_send, as the buffer is owned by the - tsi_handshaker object. */ +// Conduct a next step of the handshake. +// - received_bytes is the buffer containing the data received from the peer. +// - received_bytes_size is the size of the data received from the peer. +// - bytes_to_send is the data buffer to be sent to the peer. +// - bytes_to_send_size is the size of data buffer to be sent to the peer. +// - handshaker_result is the result of handshake if the handshake completes. +// - cb is the callback function defined above. It can be NULL for synchronous +// TSI handshaker implementation. +// - user_data is the argument to callback function passed from the caller. +// - error, if non-null, will be populated with a human-readable error +// message whenever the result value is something other than TSI_OK, +// TSI_ASYNC, or TSI_INCOMPLETE_DATA. The object pointed to by this +// argument is owned by the caller and must continue to exist until after the +// handshake is finished. Some TSI implementations cache this value, +// so callers must pass the same value to all calls to tsi_handshaker_next() +// for a given handshake. +// This method returns TSI_ASYNC if the TSI handshaker implementation is +// asynchronous, and in this case, the callback is guaranteed to run in another +// thread owned by TSI. It returns TSI_OK if the handshake completes or if +// there are data to send to the peer, otherwise returns TSI_INCOMPLETE_DATA +// which indicates that this method needs to be called again with more data +// from the peer. In case of a fatal error in the handshake, another specific +// error code is returned. +// The caller is responsible for destroying the handshaker_result. However, +// the caller should not free bytes_to_send, as the buffer is owned by the +// tsi_handshaker object. tsi_result tsi_handshaker_next(tsi_handshaker* self, const unsigned char* received_bytes, size_t received_bytes_size, @@ -500,22 +500,22 @@ tsi_result tsi_handshaker_next(tsi_handshaker* self, tsi_handshaker_on_next_done_cb cb, void* user_data, std::string* error = nullptr); -/* This method shuts down a TSI handshake that is in progress. - * - * This method will be invoked when TSI handshake should be terminated before - * being finished in order to free any resources being used. - */ +// This method shuts down a TSI handshake that is in progress. +// +// This method will be invoked when TSI handshake should be terminated before +// being finished in order to free any resources being used. +// void tsi_handshaker_shutdown(tsi_handshaker* self); -/* This method releases the tsi_handshaker object. After this method is called, - no other method can be called on the object. */ +// This method releases the tsi_handshaker object. After this method is called, +// no other method can be called on the object. void tsi_handshaker_destroy(tsi_handshaker* self); -/* This method initializes the necessary shared objects used for tsi - implementation. */ +// This method initializes the necessary shared objects used for tsi +// implementation. void tsi_init(); -/* This method destroys the shared objects created by tsi_init. */ +// This method destroys the shared objects created by tsi_init. void tsi_destroy(); -#endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H */ +#endif // GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index 165056d11c3..818eedb68f2 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/client/channel_test_peer.cc b/src/cpp/client/channel_test_peer.cc index d91f692ea6e..e8b2f72c058 100644 --- a/src/cpp/client/channel_test_peer.cc +++ b/src/cpp/client/channel_test_peer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 #include diff --git a/src/cpp/client/client_callback.cc b/src/cpp/client/client_callback.cc index fe327314a16..32ed0ff6ec2 100644 --- a/src/cpp/client/client_callback.cc +++ b/src/cpp/client/client_callback.cc @@ -1,19 +1,19 @@ -/* - * Copyright 2019 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. - * - */ +// +// Copyright 2019 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 diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 05b6b2bc306..e13d363a740 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/client/client_interceptor.cc b/src/cpp/client/client_interceptor.cc index f4e4acbed19..f8c85330434 100644 --- a/src/cpp/client/client_interceptor.cc +++ b/src/cpp/client/client_interceptor.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/src/cpp/client/create_channel.cc b/src/cpp/client/create_channel.cc index 91e3c0cc087..a2db03ae9ea 100644 --- a/src/cpp/client/create_channel.cc +++ b/src/cpp/client/create_channel.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/client/create_channel_internal.cc b/src/cpp/client/create_channel_internal.cc index 06ccc0d5ad0..e54910f46a3 100644 --- a/src/cpp/client/create_channel_internal.cc +++ b/src/cpp/client/create_channel_internal.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/client/create_channel_internal.h" diff --git a/src/cpp/client/create_channel_internal.h b/src/cpp/client/create_channel_internal.h index 785a3bc38c2..d662cab1be4 100644 --- a/src/cpp/client/create_channel_internal.h +++ b/src/cpp/client/create_channel_internal.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_CLIENT_CREATE_CHANNEL_INTERNAL_H #define GRPC_INTERNAL_CPP_CLIENT_CREATE_CHANNEL_INTERNAL_H diff --git a/src/cpp/client/create_channel_posix.cc b/src/cpp/client/create_channel_posix.cc index 2e6a03f0cbf..d260f1c68c7 100644 --- a/src/cpp/client/create_channel_posix.cc +++ b/src/cpp/client/create_channel_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/src/cpp/client/insecure_credentials.cc b/src/cpp/client/insecure_credentials.cc index 87361a99588..3916f1ca0be 100644 --- a/src/cpp/client/insecure_credentials.cc +++ b/src/cpp/client/insecure_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include #include diff --git a/src/cpp/client/secure_credentials.cc b/src/cpp/client/secure_credentials.cc index 7b745c8906f..42f958ac3ed 100644 --- a/src/cpp/client/secure_credentials.cc +++ b/src/cpp/client/secure_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/client/secure_credentials.h" diff --git a/src/cpp/client/secure_credentials.h b/src/cpp/client/secure_credentials.h index 22400fc00b5..96a0f7a644e 100644 --- a/src/cpp/client/secure_credentials.h +++ b/src/cpp/client/secure_credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H #define GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index 3ac162c1807..c119d7eb904 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -1,19 +1,19 @@ -/* - * Copyright 2018 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. - * - */ +// +// Copyright 2018 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 diff --git a/src/cpp/common/alts_context.cc b/src/cpp/common/alts_context.cc index f48822ba37e..708c105a5d9 100644 --- a/src/cpp/common/alts_context.cc +++ b/src/cpp/common/alts_context.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/src/cpp/common/alts_util.cc b/src/cpp/common/alts_util.cc index d2a5b53de94..100e4c5cf49 100644 --- a/src/cpp/common/alts_util.cc +++ b/src/cpp/common/alts_util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/src/cpp/common/auth_property_iterator.cc b/src/cpp/common/auth_property_iterator.cc index 45d6db9c3cf..10e71d3a174 100644 --- a/src/cpp/common/auth_property_iterator.cc +++ b/src/cpp/common/auth_property_iterator.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc index bf0c3845ea3..d593b271db2 100644 --- a/src/cpp/common/channel_arguments.cc +++ b/src/cpp/common/channel_arguments.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include #include diff --git a/src/cpp/common/channel_filter.cc b/src/cpp/common/channel_filter.cc index cb40e01dfca..b10ed010ef8 100644 --- a/src/cpp/common/channel_filter.cc +++ b/src/cpp/common/channel_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/cpp/common/channel_filter.h" diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h index ba5f398851d..7c84e7cc84e 100644 --- a/src/cpp/common/channel_filter.h +++ b/src/cpp/common/channel_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPCXX_CHANNEL_FILTER_H #define GRPCXX_CHANNEL_FILTER_H diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index c2de58aed10..cc3af5786bd 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -1,19 +1,19 @@ -/* - * 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 - * - * 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. - * - */ +// +// 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 +// +// 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 diff --git a/src/cpp/common/insecure_create_auth_context.cc b/src/cpp/common/insecure_create_auth_context.cc index 4e5cbd03723..b4c02d39b36 100644 --- a/src/cpp/common/insecure_create_auth_context.cc +++ b/src/cpp/common/insecure_create_auth_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/common/resource_quota_cc.cc b/src/cpp/common/resource_quota_cc.cc index 00b6e2053cc..075a4f71d76 100644 --- a/src/cpp/common/resource_quota_cc.cc +++ b/src/cpp/common/resource_quota_cc.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/cpp/common/rpc_method.cc b/src/cpp/common/rpc_method.cc index a47dd3e4444..f12978dfc35 100644 --- a/src/cpp/common/rpc_method.cc +++ b/src/cpp/common/rpc_method.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/common/secure_auth_context.cc b/src/cpp/common/secure_auth_context.cc index 35795db5117..c1b69efe4d5 100644 --- a/src/cpp/common/secure_auth_context.cc +++ b/src/cpp/common/secure_auth_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/common/secure_auth_context.h" diff --git a/src/cpp/common/secure_auth_context.h b/src/cpp/common/secure_auth_context.h index 60873a72843..d2650c4d306 100644 --- a/src/cpp/common/secure_auth_context.h +++ b/src/cpp/common/secure_auth_context.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H #define GRPC_INTERNAL_CPP_COMMON_SECURE_AUTH_CONTEXT_H diff --git a/src/cpp/common/secure_channel_arguments.cc b/src/cpp/common/secure_channel_arguments.cc index 9c4035920bc..3ad0ff9fb7d 100644 --- a/src/cpp/common/secure_channel_arguments.cc +++ b/src/cpp/common/secure_channel_arguments.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/common/secure_create_auth_context.cc b/src/cpp/common/secure_create_auth_context.cc index 3fd4829ece4..4658321520f 100644 --- a/src/cpp/common/secure_create_auth_context.cc +++ b/src/cpp/common/secure_create_auth_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/common/tls_credentials_options.cc b/src/cpp/common/tls_credentials_options.cc index f2eb16aa8e6..c84bc6f8ff0 100644 --- a/src/cpp/common/tls_credentials_options.cc +++ b/src/cpp/common/tls_credentials_options.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/src/cpp/common/validate_service_config.cc b/src/cpp/common/validate_service_config.cc index 04f5a2a1c67..b606a33e0ba 100644 --- a/src/cpp/common/validate_service_config.cc +++ b/src/cpp/common/validate_service_config.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/src/cpp/common/version_cc.cc b/src/cpp/common/version_cc.cc index 9406b5c7ca3..44824d66f72 100644 --- a/src/cpp/common/version_cc.cc +++ b/src/cpp/common/version_cc.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/cpp/ext/filters/census/channel_filter.cc b/src/cpp/ext/filters/census/channel_filter.cc index b38129dfd9d..228cd48efbf 100644 --- a/src/cpp/ext/filters/census/channel_filter.cc +++ b/src/cpp/ext/filters/census/channel_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/channel_filter.h b/src/cpp/ext/filters/census/channel_filter.h index 176f17fe0a8..32a1ed3eba9 100644 --- a/src/cpp/ext/filters/census/channel_filter.h +++ b/src/cpp/ext/filters/census/channel_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H @@ -36,4 +36,4 @@ class CensusChannelData : public ChannelData { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CHANNEL_FILTER_H diff --git a/src/cpp/ext/filters/census/client_filter.cc b/src/cpp/ext/filters/census/client_filter.cc index c870dbd3f1c..0dfb63d32c2 100644 --- a/src/cpp/ext/filters/census/client_filter.cc +++ b/src/cpp/ext/filters/census/client_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/client_filter.h b/src/cpp/ext/filters/census/client_filter.h index e88cd69efc9..a2ce18c151f 100644 --- a/src/cpp/ext/filters/census/client_filter.h +++ b/src/cpp/ext/filters/census/client_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H @@ -55,4 +55,4 @@ class CensusClientChannelData : public ChannelData { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CLIENT_FILTER_H diff --git a/src/cpp/ext/filters/census/context.cc b/src/cpp/ext/filters/census/context.cc index 2e977d7993b..907bb4d03ff 100644 --- a/src/cpp/ext/filters/census/context.cc +++ b/src/cpp/ext/filters/census/context.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/context.h b/src/cpp/ext/filters/census/context.h index 0486283fdd7..a2f04a73237 100644 --- a/src/cpp/ext/filters/census/context.h +++ b/src/cpp/ext/filters/census/context.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H @@ -98,4 +98,4 @@ inline absl::string_view GetMethod(const grpc_core::Slice& path) { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_CONTEXT_H diff --git a/src/cpp/ext/filters/census/grpc_plugin.cc b/src/cpp/ext/filters/census/grpc_plugin.cc index 25afaf9306a..946474aac9e 100644 --- a/src/cpp/ext/filters/census/grpc_plugin.cc +++ b/src/cpp/ext/filters/census/grpc_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/grpc_plugin.h b/src/cpp/ext/filters/census/grpc_plugin.h index aab2897f10e..9675622ac9a 100644 --- a/src/cpp/ext/filters/census/grpc_plugin.h +++ b/src/cpp/ext/filters/census/grpc_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H @@ -126,4 +126,4 @@ bool OpenCensusTracingEnabled(); } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_GRPC_PLUGIN_H diff --git a/src/cpp/ext/filters/census/measures.cc b/src/cpp/ext/filters/census/measures.cc index b813db88182..d6026b2cf5b 100644 --- a/src/cpp/ext/filters/census/measures.cc +++ b/src/cpp/ext/filters/census/measures.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/measures.h b/src/cpp/ext/filters/census/measures.h index 06aae81d113..afe91de8714 100644 --- a/src/cpp/ext/filters/census/measures.h +++ b/src/cpp/ext/filters/census/measures.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H @@ -47,4 +47,4 @@ namespace grpc { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_MEASURES_H diff --git a/src/cpp/ext/filters/census/rpc_encoding.cc b/src/cpp/ext/filters/census/rpc_encoding.cc index 7ce3e940df7..b8a1313b5f1 100644 --- a/src/cpp/ext/filters/census/rpc_encoding.cc +++ b/src/cpp/ext/filters/census/rpc_encoding.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/rpc_encoding.h b/src/cpp/ext/filters/census/rpc_encoding.h index daec6e5ea79..ae11fa2aa37 100644 --- a/src/cpp/ext/filters/census/rpc_encoding.h +++ b/src/cpp/ext/filters/census/rpc_encoding.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H @@ -110,4 +110,4 @@ class RpcServerStatsEncoding { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_RPC_ENCODING_H diff --git a/src/cpp/ext/filters/census/server_filter.cc b/src/cpp/ext/filters/census/server_filter.cc index 71402df5094..50d79638d9b 100644 --- a/src/cpp/ext/filters/census/server_filter.cc +++ b/src/cpp/ext/filters/census/server_filter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/filters/census/server_filter.h b/src/cpp/ext/filters/census/server_filter.h index 9ce6dd67e83..059229ace5f 100644 --- a/src/cpp/ext/filters/census/server_filter.h +++ b/src/cpp/ext/filters/census/server_filter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H #define GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H @@ -110,4 +110,4 @@ class CensusServerCallData : public CallData { } // namespace grpc -#endif /* GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H */ +#endif // GRPC_INTERNAL_CPP_EXT_FILTERS_CENSUS_SERVER_FILTER_H diff --git a/src/cpp/ext/filters/census/views.cc b/src/cpp/ext/filters/census/views.cc index e58b498e000..905a9fff436 100644 --- a/src/cpp/ext/filters/census/views.cc +++ b/src/cpp/ext/filters/census/views.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/ext/proto_server_reflection.cc b/src/cpp/ext/proto_server_reflection.cc index eada009e3ae..674da4d130f 100644 --- a/src/cpp/ext/proto_server_reflection.cc +++ b/src/cpp/ext/proto_server_reflection.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/cpp/ext/proto_server_reflection.h" diff --git a/src/cpp/ext/proto_server_reflection.h b/src/cpp/ext/proto_server_reflection.h index a9b5db0b272..5ea6eedfe91 100644 --- a/src/cpp/ext/proto_server_reflection.h +++ b/src/cpp/ext/proto_server_reflection.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H #define GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H diff --git a/src/cpp/ext/proto_server_reflection_plugin.cc b/src/cpp/ext/proto_server_reflection_plugin.cc index ca844bcf0b1..4aae3ea17b4 100644 --- a/src/cpp/ext/proto_server_reflection_plugin.cc +++ b/src/cpp/ext/proto_server_reflection_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/server/async_generic_service.cc b/src/cpp/server/async_generic_service.cc index 15381fafef4..e5a5c7480dc 100644 --- a/src/cpp/server/async_generic_service.cc +++ b/src/cpp/server/async_generic_service.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/server/channel_argument_option.cc b/src/cpp/server/channel_argument_option.cc index 0f5c27a78da..759f19d299c 100644 --- a/src/cpp/server/channel_argument_option.cc +++ b/src/cpp/server/channel_argument_option.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/src/cpp/server/channelz/channelz_service.cc b/src/cpp/server/channelz/channelz_service.cc index fae8f2b9fb7..8ae823054e8 100644 --- a/src/cpp/server/channelz/channelz_service.cc +++ b/src/cpp/server/channelz/channelz_service.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/channelz/channelz_service.h b/src/cpp/server/channelz/channelz_service.h index 91936da959e..d3511fb63a5 100644 --- a/src/cpp/server/channelz/channelz_service.h +++ b/src/cpp/server/channelz/channelz_service.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_INTERNAL_CPP_SERVER_CHANNELZ_SERVICE_H #define GRPC_INTERNAL_CPP_SERVER_CHANNELZ_SERVICE_H diff --git a/src/cpp/server/channelz/channelz_service_plugin.cc b/src/cpp/server/channelz/channelz_service_plugin.cc index e514f9712e9..052a01068af 100644 --- a/src/cpp/server/channelz/channelz_service_plugin.cc +++ b/src/cpp/server/channelz/channelz_service_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/create_default_thread_pool.cc b/src/cpp/server/create_default_thread_pool.cc index 1087e982b66..6d906955c79 100644 --- a/src/cpp/server/create_default_thread_pool.cc +++ b/src/cpp/server/create_default_thread_pool.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/server/dynamic_thread_pool.h" #include "src/cpp/server/thread_pool_interface.h" diff --git a/src/cpp/server/dynamic_thread_pool.h b/src/cpp/server/dynamic_thread_pool.h index 19463fa9639..dd4dc303416 100644 --- a/src/cpp/server/dynamic_thread_pool.h +++ b/src/cpp/server/dynamic_thread_pool.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_DYNAMIC_THREAD_POOL_H #define GRPC_INTERNAL_CPP_DYNAMIC_THREAD_POOL_H diff --git a/src/cpp/server/external_connection_acceptor_impl.cc b/src/cpp/server/external_connection_acceptor_impl.cc index cdc66b24598..9f156e94957 100644 --- a/src/cpp/server/external_connection_acceptor_impl.cc +++ b/src/cpp/server/external_connection_acceptor_impl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "src/cpp/server/external_connection_acceptor_impl.h" diff --git a/src/cpp/server/external_connection_acceptor_impl.h b/src/cpp/server/external_connection_acceptor_impl.h index 8b727033fbe..9ecd3146b60 100644 --- a/src/cpp/server/external_connection_acceptor_impl.h +++ b/src/cpp/server/external_connection_acceptor_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_ #define SRC_CPP_SERVER_EXTERNAL_CONNECTION_ACCEPTOR_IMPL_H_ diff --git a/src/cpp/server/health/default_health_check_service.cc b/src/cpp/server/health/default_health_check_service.cc index 2cfd3554d80..f0abdf9e8f2 100644 --- a/src/cpp/server/health/default_health_check_service.cc +++ b/src/cpp/server/health/default_health_check_service.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/cpp/server/health/default_health_check_service.h" diff --git a/src/cpp/server/health/default_health_check_service.h b/src/cpp/server/health/default_health_check_service.h index f23ac5d4733..38a1dbd0188 100644 --- a/src/cpp/server/health/default_health_check_service.h +++ b/src/cpp/server/health/default_health_check_service.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H #define GRPC_INTERNAL_CPP_SERVER_DEFAULT_HEALTH_CHECK_SERVICE_H diff --git a/src/cpp/server/health/health_check_service.cc b/src/cpp/server/health/health_check_service.cc index a0fa2d62f58..8be791d6bfa 100644 --- a/src/cpp/server/health/health_check_service.cc +++ b/src/cpp/server/health/health_check_service.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/src/cpp/server/health/health_check_service_server_builder_option.cc b/src/cpp/server/health/health_check_service_server_builder_option.cc index bd32c327904..c4eac98b470 100644 --- a/src/cpp/server/health/health_check_service_server_builder_option.cc +++ b/src/cpp/server/health/health_check_service_server_builder_option.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/src/cpp/server/insecure_server_credentials.cc b/src/cpp/server/insecure_server_credentials.cc index a0ab9597160..920fe3a1a55 100644 --- a/src/cpp/server/insecure_server_credentials.cc +++ b/src/cpp/server/insecure_server_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/src/cpp/server/load_reporter/constants.h b/src/cpp/server/load_reporter/constants.h index 5dcbb7021a2..86f4bddaf6c 100644 --- a/src/cpp/server/load_reporter/constants.h +++ b/src/cpp/server/load_reporter/constants.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_UTIL_H diff --git a/src/cpp/server/load_reporter/get_cpu_stats.h b/src/cpp/server/load_reporter/get_cpu_stats.h index 54d44e4b238..a19c8625117 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats.h +++ b/src/cpp/server/load_reporter/get_cpu_stats.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_GET_CPU_STATS_H #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_GET_CPU_STATS_H diff --git a/src/cpp/server/load_reporter/get_cpu_stats_linux.cc b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc index f5fdbf865b5..ee2fa144c16 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_linux.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_linux.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/get_cpu_stats_macos.cc b/src/cpp/server/load_reporter/get_cpu_stats_macos.cc index dbdde304c20..d182adabe32 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_macos.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_macos.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc index 80fb8b6da1f..dd6417bf88b 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_unsupported.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/get_cpu_stats_windows.cc b/src/cpp/server/load_reporter/get_cpu_stats_windows.cc index c03daddb35b..defec9faddc 100644 --- a/src/cpp/server/load_reporter/get_cpu_stats_windows.cc +++ b/src/cpp/server/load_reporter/get_cpu_stats_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_data_store.cc b/src/cpp/server/load_reporter/load_data_store.cc index 629823f6642..5d475ca84b5 100644 --- a/src/cpp/server/load_reporter/load_data_store.cc +++ b/src/cpp/server/load_reporter/load_data_store.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_data_store.h b/src/cpp/server/load_reporter/load_data_store.h index cbdb9b4165f..5ef2aeb6015 100644 --- a/src/cpp/server/load_reporter/load_data_store.h +++ b/src/cpp/server/load_reporter/load_data_store.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_DATA_STORE_H #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_DATA_STORE_H diff --git a/src/cpp/server/load_reporter/load_reporter.cc b/src/cpp/server/load_reporter/load_reporter.cc index 03c89ffe394..eac1ea4e61c 100644 --- a/src/cpp/server/load_reporter/load_reporter.cc +++ b/src/cpp/server/load_reporter/load_reporter.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_reporter.h b/src/cpp/server/load_reporter/load_reporter.h index 91bd6551367..a1b1c7ec3ea 100644 --- a/src/cpp/server/load_reporter/load_reporter.h +++ b/src/cpp/server/load_reporter/load_reporter.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_REPORTER_H #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_LOAD_REPORTER_H diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc index b03105ef56b..63df2814e99 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h index 7b6155a65e2..b041e53d083 100644 --- a/src/cpp/server/load_reporter/load_reporter_async_service_impl.h +++ b/src/cpp/server/load_reporter/load_reporter_async_service_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_SERVER_LOAD_REPORTER_ASYNC_SERVICE_IMPL_H #define GRPC_SRC_CPP_SERVER_LOAD_REPORTER_ASYNC_SERVICE_IMPL_H diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc index 0fd44e5ae1b..a9405254301 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_option.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc index a7428908a42..edd3223f7f1 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h index 07bf6ffe2a8..fe5acbbb676 100644 --- a/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h +++ b/src/cpp/server/load_reporter/load_reporting_service_server_builder_plugin.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_SRC_CPP_LOAD_REPORTING_SERVICE_SERVER_BUILDER_PLUGIN_H #define GRPC_SRC_CPP_LOAD_REPORTING_SERVICE_SERVER_BUILDER_PLUGIN_H diff --git a/src/cpp/server/load_reporter/util.cc b/src/cpp/server/load_reporter/util.cc index c79711e9192..2237d9bce2a 100644 --- a/src/cpp/server/load_reporter/util.cc +++ b/src/cpp/server/load_reporter/util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/src/cpp/server/secure_server_credentials.cc b/src/cpp/server/secure_server_credentials.cc index ab20ec305df..8874700410d 100644 --- a/src/cpp/server/secure_server_credentials.cc +++ b/src/cpp/server/secure_server_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/server/secure_server_credentials.h" diff --git a/src/cpp/server/secure_server_credentials.h b/src/cpp/server/secure_server_credentials.h index 6e858e60ff6..3aa43c07f4b 100644 --- a/src/cpp/server/secure_server_credentials.h +++ b/src/cpp/server/secure_server_credentials.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H #define GRPC_INTERNAL_CPP_SERVER_SECURE_SERVER_CREDENTIALS_H diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index ef999fcddb4..d0c1bef4362 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 #include diff --git a/src/cpp/server/server_callback.cc b/src/cpp/server/server_callback.cc index 6b262436ea1..20d846fad64 100644 --- a/src/cpp/server/server_callback.cc +++ b/src/cpp/server/server_callback.cc @@ -1,19 +1,19 @@ -/* - * Copyright 2019 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. - * - */ +// +// Copyright 2019 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 "absl/status/status.h" diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 22e5d2f8d62..c08603bf70d 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -1,19 +1,19 @@ -/* - * 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 - * - * 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. - * - */ +// +// 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 +// +// 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 #include @@ -148,9 +148,9 @@ ServerInterface::BaseAsyncRequest::BaseAsyncRequest( delete_on_finalize_(delete_on_finalize), call_(nullptr), done_intercepting_(false) { - /* Set up interception state partially for the receive ops. call_wrapper_ is - * not filled at this point, but it will be filled before the interceptors are - * run. */ + // Set up interception state partially for the receive ops. call_wrapper_ is + // not filled at this point, but it will be filled before the interceptors are + // run. interceptor_methods_.SetCall(&call_wrapper_); interceptor_methods_.SetReverse(); call_cq_->RegisterAvalanching(); // This op will trigger more ops diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 57a4d82c205..6f3c9fd9eef 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -131,15 +131,15 @@ class ServerContextBase::CompletionOp final // This will be called while interceptors are run if the RPC is a hijacked // RPC. This should set hijacking state for each of the ops. void SetHijackingState() override { - /* Servers don't allow hijacking */ + // Servers don't allow hijacking GPR_ASSERT(false); } - /* Should be called after interceptors are done running */ + // Should be called after interceptors are done running void ContinueFillOpsAfterInterception() override {} - /* Should be called after interceptors are done running on the finalize result - * path */ + // Should be called after interceptors are done running on the finalize result + // path void ContinueFinalizeResultAfterInterception() override { done_intercepting_ = true; if (!has_tag_) { @@ -148,7 +148,7 @@ class ServerContextBase::CompletionOp final // Unref can delete this, so do not access anything from this afterward. return; } - /* Start a phony op so that we can return the tag */ + // Start a phony op so that we can return the tag GPR_ASSERT(grpc_call_start_batch(call_.call(), nullptr, 0, core_cq_tag_, nullptr) == GRPC_CALL_OK); } @@ -193,7 +193,7 @@ void ServerContextBase::CompletionOp::FillOps(internal::Call* call) { // explanatory log on failure. GPR_ASSERT(grpc_call_start_batch(call->call(), &ops, 1, core_cq_tag_, nullptr) == GRPC_CALL_OK); - /* No interceptors to run here */ + // No interceptors to run here } bool ServerContextBase::CompletionOp::FinalizeResult(void** tag, bool* status) { @@ -235,7 +235,7 @@ bool ServerContextBase::CompletionOp::FinalizeResult(void** tag, bool* status) { if (call_cancel && callback_controller_ != nullptr) { callback_controller_->MaybeCallOnCancel(); } - /* Add interception point and run through interceptors */ + // Add interception point and run through interceptors interceptor_methods_.AddInterceptionHookPoint( experimental::InterceptionHookPoints::POST_RECV_CLOSE); if (interceptor_methods_.RunInterceptors()) { diff --git a/src/cpp/server/server_posix.cc b/src/cpp/server/server_posix.cc index 01c75c25cd7..ecc1848a1fc 100644 --- a/src/cpp/server/server_posix.cc +++ b/src/cpp/server/server_posix.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/src/cpp/server/thread_pool_interface.h b/src/cpp/server/thread_pool_interface.h index 028842a776f..e4abd630593 100644 --- a/src/cpp/server/thread_pool_interface.h +++ b/src/cpp/server/thread_pool_interface.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_INTERNAL_CPP_THREAD_POOL_INTERFACE_H #define GRPC_INTERNAL_CPP_THREAD_POOL_INTERFACE_H diff --git a/src/cpp/thread_manager/thread_manager.cc b/src/cpp/thread_manager/thread_manager.cc index d6144f94094..f518482a79e 100644 --- a/src/cpp/thread_manager/thread_manager.cc +++ b/src/cpp/thread_manager/thread_manager.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/cpp/thread_manager/thread_manager.h" diff --git a/src/cpp/thread_manager/thread_manager.h b/src/cpp/thread_manager/thread_manager.h index b2bbba7c6ee..5c51a21c0b1 100644 --- a/src/cpp/thread_manager/thread_manager.h +++ b/src/cpp/thread_manager/thread_manager.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_INTERNAL_CPP_THREAD_MANAGER_H #define GRPC_INTERNAL_CPP_THREAD_MANAGER_H diff --git a/src/cpp/util/byte_buffer_cc.cc b/src/cpp/util/byte_buffer_cc.cc index 0a6ed416729..acb60921df9 100644 --- a/src/cpp/util/byte_buffer_cc.cc +++ b/src/cpp/util/byte_buffer_cc.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/util/error_details.cc b/src/cpp/util/error_details.cc index 0330f012c27..6bcb8474361 100644 --- a/src/cpp/util/error_details.cc +++ b/src/cpp/util/error_details.cc @@ -1,19 +1,19 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index 93696d81268..0a130bca845 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/util/string_ref.cc b/src/cpp/util/string_ref.cc index f7fbd613658..67b2e018a6f 100644 --- a/src/cpp/util/string_ref.cc +++ b/src/cpp/util/string_ref.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/src/cpp/util/time_cc.cc b/src/cpp/util/time_cc.cc index 5cf6c786556..458a0e0cf75 100644 --- a/src/cpp/util/time_cc.cc +++ b/src/cpp/util/time_cc.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/templates/include/grpcpp/version_info.h.template b/templates/include/grpcpp/version_info.h.template index 38415ce1fb8..4814d687c33 100644 --- a/templates/include/grpcpp/version_info.h.template +++ b/templates/include/grpcpp/version_info.h.template @@ -14,8 +14,8 @@ // See the License for the specific language governing permissions and // limitations under the License. - /* This file is autogenerated from: - templates/include/grpcpp/version_info.h.template */ + // This file is autogenerated from: + // templates/include/grpcpp/version_info.h.template #ifndef GRPCPP_VERSION_INFO_H #define GRPCPP_VERSION_INFO_H diff --git a/templates/src/core/lib/surface/version.cc.template b/templates/src/core/lib/surface/version.cc.template index 0cb31547258..6a0073fb137 100644 --- a/templates/src/core/lib/surface/version.cc.template +++ b/templates/src/core/lib/surface/version.cc.template @@ -1,25 +1,25 @@ %YAML 1.2 --- | - /* - * - * 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 - * - * 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. - * - */ + // + // + // 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 + // + // 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. + // + // - /* This file is autogenerated from: - templates/src/core/surface/version.c.template */ + // This file is autogenerated from: + // templates/src/core/surface/version.c.template #include diff --git a/templates/test/core/end2end/end2end_defs.include b/templates/test/core/end2end/end2end_defs.include index a0c53addcd2..2e84c48b7e1 100644 --- a/templates/test/core/end2end/end2end_defs.include +++ b/templates/test/core/end2end/end2end_defs.include @@ -1,24 +1,24 @@ <%def name="end2end_selector(tests)"> -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// <% tests = sorted(tests) %>\ -/* This file is auto-generated */ +// This file is auto-generated #include "test/core/end2end/end2end_tests.h" diff --git a/test/core/address_utils/parse_address_test.cc b/test/core/address_utils/parse_address_test.cc index 53dcad1e6c6..17c2ed0fa17 100644 --- a/test/core/address_utils/parse_address_test.cc +++ b/test/core/address_utils/parse_address_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/address_utils/parse_address.h" #ifdef GRPC_HAVE_UNIX_SOCKET @@ -72,13 +72,13 @@ static void test_grpc_parse_unix_abstract(const char* uri_text, ASSERT_TRUE(absl::StartsWith(addr_un->sun_path + 1, pathname)); } -#else /* GRPC_HAVE_UNIX_SOCKET */ +#else // GRPC_HAVE_UNIX_SOCKET static void test_grpc_parse_unix(const char* uri_text, const char* pathname) {} static void test_grpc_parse_unix_abstract(const char* uri_text, const char* pathname) {} -#endif /* GRPC_HAVE_UNIX_SOCKET */ +#endif // GRPC_HAVE_UNIX_SOCKET static void test_grpc_parse_ipv4(const char* uri_text, const char* host, unsigned short port) { @@ -120,7 +120,7 @@ static void test_grpc_parse_ipv6(const char* uri_text, const char* host, ASSERT_EQ(addr_in6->sin6_scope_id, scope_id); } -/* Test parsing invalid ipv6 addresses (valid uri_text but invalid ipv6 addr) */ +// Test parsing invalid ipv6 addresses (valid uri_text but invalid ipv6 addr) static void test_grpc_parse_ipv6_invalid(const char* uri_text) { grpc_core::ExecCtx exec_ctx; absl::StatusOr uri = grpc_core::URI::Parse(uri_text); @@ -141,7 +141,7 @@ TEST(ParseAddressTest, MainTest) { test_grpc_parse_ipv6("ipv6:[2001:db8::1]:12345", "2001:db8::1", 12345, 0); test_grpc_parse_ipv6("ipv6:[2001:db8::1%252]:12345", "2001:db8::1", 12345, 2); - /* Address length greater than GRPC_INET6_ADDRSTRLEN */ + // Address length greater than GRPC_INET6_ADDRSTRLEN test_grpc_parse_ipv6_invalid( "ipv6:WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW45%" "25v6:45%25x$1*"); diff --git a/test/core/address_utils/parse_address_with_named_scope_id_test.cc b/test/core/address_utils/parse_address_with_named_scope_id_test.cc index 8253fba034d..7faa8d497ee 100644 --- a/test/core/address_utils/parse_address_with_named_scope_id_test.cc +++ b/test/core/address_utils/parse_address_with_named_scope_id_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/address_utils/sockaddr_utils_test.cc b/test/core/address_utils/sockaddr_utils_test.cc index 7b342c6aa1d..015bf51640f 100644 --- a/test/core/address_utils/sockaddr_utils_test.cc +++ b/test/core/address_utils/sockaddr_utils_test.cc @@ -283,7 +283,7 @@ TEST(SockAddrUtilsTest, UnixSockAddrToUri) { "unix-abstract:path_%00with_null"); } -#endif /* GRPC_HAVE_UNIX_SOCKET */ +#endif // GRPC_HAVE_UNIX_SOCKET TEST(SockAddrUtilsTest, SockAddrSetGetPort) { grpc_resolved_address input4 = MakeAddr4(kIPv4, sizeof(kIPv4)); diff --git a/test/core/backoff/backoff_test.cc b/test/core/backoff/backoff_test.cc index ca4bb04adcf..2f4ed7de6ec 100644 --- a/test/core/backoff/backoff_test.cc +++ b/test/core/backoff/backoff_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/lib/backoff/backoff.h" diff --git a/test/core/bad_client/bad_client.cc b/test/core/bad_client/bad_client.cc index b55e5e48e65..2693d1aad47 100644 --- a/test/core/bad_client/bad_client.cc +++ b/test/core/bad_client/bad_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/bad_client/bad_client.h" @@ -46,7 +46,7 @@ #define MIN_HTTP2_FRAME_SIZE 9 -/* Args to provide to thread running server side validator */ +// Args to provide to thread running server side validator typedef struct { grpc_server* server; grpc_completion_queue* cq; @@ -55,7 +55,7 @@ typedef struct { gpr_event done_thd; } thd_args; -/* Run the server side validator and set done_thd once done */ +// Run the server side validator and set done_thd once done static void thd_func(void* arg) { thd_args* a = static_cast(arg); if (a->validator != nullptr) { @@ -64,7 +64,7 @@ static void thd_func(void* arg) { gpr_event_set(&a->done_thd, reinterpret_cast(1)); } -/* Sets the done_write event */ +// Sets the done_write event static void set_done_write(void* arg, grpc_error_handle /*error*/) { gpr_event* done_write = static_cast(arg); gpr_event_set(done_write, reinterpret_cast(1)); @@ -81,13 +81,13 @@ static void server_setup_transport(void* ts, grpc_transport* transport) { /*socket_node=*/nullptr))); } -/* Sets the read_done event */ +// Sets the read_done event static void set_read_done(void* arg, grpc_error_handle /*error*/) { gpr_event* read_done = static_cast(arg); gpr_event_set(read_done, reinterpret_cast(1)); } -/* shutdown client */ +// shutdown client static void shutdown_client(grpc_endpoint** client_fd) { if (*client_fd != nullptr) { grpc_endpoint_shutdown(*client_fd, GRPC_ERROR_CREATE("Forced Disconnect")); @@ -97,7 +97,7 @@ static void shutdown_client(grpc_endpoint** client_fd) { } } -/* Runs client side validator */ +// Runs client side validator void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, grpc_endpoint_pair* sfd, grpc_completion_queue* client_cq) { @@ -106,7 +106,7 @@ void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, if (arg->client_payload_length < 4 * 1024) { hex = gpr_dump(arg->client_payload, arg->client_payload_length, GPR_DUMP_HEX | GPR_DUMP_ASCII); - /* Add a debug log */ + // Add a debug log gpr_log(GPR_INFO, "TEST: %s", hex); gpr_free(hex); } else { @@ -125,13 +125,13 @@ void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, GRPC_CLOSURE_INIT(&done_write_closure, set_done_write, &done_write, grpc_schedule_on_exec_ctx); - /* Write data */ + // Write data grpc_endpoint_write(sfd->client, &outgoing, &done_write_closure, nullptr, /*max_frame_size=*/INT_MAX); grpc_core::ExecCtx::Get()->Flush(); - /* Await completion, unless the request is large and write may not finish - * before the peer shuts down. */ + // Await completion, unless the request is large and write may not finish + // before the peer shuts down. if (!(flags & GRPC_BAD_CLIENT_LARGE_REQUEST)) { GPR_ASSERT( gpr_event_wait(&done_write, grpc_timeout_seconds_to_deadline(5))); @@ -142,13 +142,13 @@ void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, } if (sfd->client != nullptr) { - /* Validate client stream, if requested. */ + // Validate client stream, if requested. if (arg->client_validator != nullptr) { gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); grpc_slice_buffer incoming; grpc_slice_buffer_init(&incoming); - /* We may need to do multiple reads to read the complete server - * response. */ + // We may need to do multiple reads to read the complete server + // response. while (true) { gpr_event read_done_event; gpr_event_init(&read_done_event); @@ -160,8 +160,8 @@ void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, grpc_core::ExecCtx::Get()->Flush(); do { GPR_ASSERT(gpr_time_cmp(deadline, gpr_now(deadline.clock_type)) > 0); - /* Perform a cq next just to provide a thread that can read incoming - bytes on the client fd */ + // Perform a cq next just to provide a thread that can read incoming + // bytes on the client fd GPR_ASSERT(grpc_completion_queue_next( client_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr) @@ -177,13 +177,13 @@ void grpc_run_client_side_validator(grpc_bad_client_arg* arg, uint32_t flags, grpc_core::ExecCtx::Get()->Flush(); } - /* If the request was too large, then we need to forcefully shut down the - * client, so that the write can be considered completed */ + // If the request was too large, then we need to forcefully shut down the + // client, so that the write can be considered completed if (flags & GRPC_BAD_CLIENT_LARGE_REQUEST) { shutdown_client(&sfd->client); } - /* Make sure that the client is done writing */ + // Make sure that the client is done writing while (!gpr_event_get(&done_write)) { GPR_ASSERT( grpc_completion_queue_next( @@ -205,11 +205,11 @@ void grpc_run_bad_client_test( grpc_completion_queue* shutdown_cq; grpc_completion_queue* client_cq; - /* Init grpc */ + // Init grpc grpc_init(); sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr); - /* Create server, completion events */ + // Create server, completion events a.server = grpc_server_create(nullptr, nullptr); a.cq = grpc_completion_queue_create_for_next(nullptr); client_cq = grpc_completion_queue_create_for_next(nullptr); @@ -227,16 +227,16 @@ void grpc_run_bad_client_test( server_setup_transport(&a, transport); grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr); - /* Bind fds to pollsets */ + // Bind fds to pollsets grpc_endpoint_add_to_pollset(sfd.client, grpc_cq_pollset(client_cq)); grpc_endpoint_add_to_pollset(sfd.server, grpc_cq_pollset(a.cq)); - /* Check a ground truth */ + // Check a ground truth GPR_ASSERT(grpc_core::Server::FromC(a.server)->HasOpenConnections()); gpr_event_init(&a.done_thd); a.validator = server_validator; - /* Start validator */ + // Start validator grpc_core::Thread server_validator_thd("grpc_bad_client", thd_func, &a); server_validator_thd.Start(); @@ -244,10 +244,10 @@ void grpc_run_bad_client_test( grpc_run_client_side_validator(&args[i], i == (num_args - 1) ? flags : 0, &sfd, client_cq); } - /* Wait for server thread to finish */ + // Wait for server thread to finish GPR_ASSERT(gpr_event_wait(&a.done_thd, grpc_timeout_seconds_to_deadline(1))); - /* Shutdown. */ + // Shutdown. shutdown_client(&sfd.client); server_validator_thd.Join(); shutdown_cq = grpc_completion_queue_create_for_pluck(nullptr); @@ -269,16 +269,16 @@ bool client_connection_preface_validator(grpc_slice_buffer* incoming, return false; } grpc_slice slice = incoming->slices[0]; - /* There should be at least one settings frame present */ + // There should be at least one settings frame present if (GRPC_SLICE_LENGTH(slice) < MIN_HTTP2_FRAME_SIZE) { return false; } const uint8_t* p = GRPC_SLICE_START_PTR(slice); - /* Check the frame type (SETTINGS) */ + // Check the frame type (SETTINGS) return *(p + 3) == 4; } -/* connection preface and settings frame to be sent by the client */ +// connection preface and settings frame to be sent by the client #define CONNECTION_PREFACE_FROM_CLIENT \ "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ "\x00\x00\x00\x04\x00\x00\x00\x00\x00" diff --git a/test/core/bad_client/bad_client.h b/test/core/bad_client/bad_client.h index 936d897e918..5e3d90ef379 100644 --- a/test/core/bad_client/bad_client.h +++ b/test/core/bad_client/bad_client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H #define GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H @@ -28,12 +28,12 @@ #define GRPC_BAD_CLIENT_REGISTERED_METHOD "/registered/bar" #define GRPC_BAD_CLIENT_REGISTERED_HOST "localhost" -/* The server side validator function to run */ +// The server side validator function to run typedef void (*grpc_bad_client_server_side_validator)(grpc_server* server, grpc_completion_queue* cq, void* registered_method); -/* Returns false if we need to read more data. */ +// Returns false if we need to read more data. typedef bool (*grpc_bad_client_client_stream_validator)( grpc_slice_buffer* incoming, void* arg); @@ -44,27 +44,27 @@ struct grpc_bad_client_arg { size_t client_payload_length; }; -/* Flags for grpc_run_bad_client_test */ +// Flags for grpc_run_bad_client_test #define GRPC_BAD_CLIENT_DISCONNECT 1 #define GRPC_BAD_CLIENT_LARGE_REQUEST 2 -/* Test runner. - * - * Create a server, and for each arg in \a args send client_payload. For each - * payload, run client_validator to make sure that the response is as expected. - * Also execute \a server_validator in a separate thread to assert that the - * bytes are handled as expected. - * - * The flags are only applicable to the last validator in the array. (This can - * be changed in the future if necessary) - */ +// Test runner. +// +// Create a server, and for each arg in \a args send client_payload. For each +// payload, run client_validator to make sure that the response is as expected. +// Also execute \a server_validator in a separate thread to assert that the +// bytes are handled as expected. +// +// The flags are only applicable to the last validator in the array. (This can +// be changed in the future if necessary) +// void grpc_run_bad_client_test( grpc_bad_client_server_side_validator server_validator, grpc_bad_client_arg args[], int num_args, uint32_t flags); -/* A hack to let old tests work as before. In these tests, instead of an array, - * the tests provide a single client_validator and payload - */ +// A hack to let old tests work as before. In these tests, instead of an array, +// the tests provide a single client_validator and payload +// #define COMBINE1(X, Y) X##Y #define COMBINE(X, Y) COMBINE1(X, Y) @@ -74,23 +74,23 @@ void grpc_run_bad_client_test( payload, sizeof(payload) - 1}; \ grpc_run_bad_client_test(server_validator, &COMBINE(bca, __LINE__), 1, flags) -/* Helper validator functions */ -/* Client side validator for connection preface from server. \a arg is unused */ +// Helper validator functions +// Client side validator for connection preface from server. \a arg is unused bool client_connection_preface_validator(grpc_slice_buffer* incoming, void* arg); -/* Client side validator for checking if reset stream is present at the end - * of the buffer. \a arg is unused. - */ +// Client side validator for checking if reset stream is present at the end +// of the buffer. \a arg is unused. +// bool rst_stream_client_validator(grpc_slice_buffer* incoming, void* arg); -/* Helper grpc_bad_client_arg arguments for direct use */ -/* Sends a connection preface from the client with an empty settings frame */ +// Helper grpc_bad_client_arg arguments for direct use +// Sends a connection preface from the client with an empty settings frame extern grpc_bad_client_arg connection_preface_arg; -/* Server side verifier function that performs a - * single grpc_server_request_call */ +// Server side verifier function that performs a +// single grpc_server_request_call void server_verifier_request_call(grpc_server* server, grpc_completion_queue* cq, void* registered_method); -#endif /* GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H */ +#endif // GRPC_TEST_CORE_BAD_CLIENT_BAD_CLIENT_H diff --git a/test/core/bad_client/tests/badreq.cc b/test/core/bad_client/tests/badreq.cc index 387037ed187..856e8851287 100644 --- a/test/core/bad_client/tests/badreq.cc +++ b/test/core/bad_client/tests/badreq.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -25,7 +25,7 @@ #define PFX_STR \ "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" \ - "\x00\x00\x00\x04\x00\x00\x00\x00\x00" /* settings frame */ + "\x00\x00\x00\x04\x00\x00\x00\x00\x00" // settings frame static void verifier(grpc_server* server, grpc_completion_queue* cq, void* /*registered_method*/) { @@ -40,7 +40,7 @@ int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); grpc_init(); - /* invalid content type */ + // invalid content type GRPC_RUN_BAD_CLIENT_TEST( verifier, nullptr, PFX_STR @@ -56,7 +56,7 @@ int main(int argc, char** argv) { "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)", GRPC_BAD_CLIENT_DISCONNECT); - /* invalid te */ + // invalid te GRPC_RUN_BAD_CLIENT_TEST( verifier, nullptr, PFX_STR @@ -74,7 +74,7 @@ int main(int argc, char** argv) { "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)", GRPC_BAD_CLIENT_DISCONNECT); - /* two path headers */ + // two path headers GRPC_RUN_BAD_CLIENT_TEST( verifier, nullptr, PFX_STR @@ -92,7 +92,7 @@ int main(int argc, char** argv) { "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)", GRPC_BAD_CLIENT_DISCONNECT); - /* bad accept-encoding algorithm */ + // bad accept-encoding algorithm GRPC_RUN_BAD_CLIENT_TEST( verifier, nullptr, PFX_STR @@ -109,7 +109,7 @@ int main(int argc, char** argv) { "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)", GRPC_BAD_CLIENT_DISCONNECT); - /* bad grpc-encoding algorithm */ + // bad grpc-encoding algorithm GRPC_RUN_BAD_CLIENT_TEST( verifier, nullptr, PFX_STR diff --git a/test/core/bad_client/tests/connection_prefix.cc b/test/core/bad_client/tests/connection_prefix.cc index a6a76359070..83b513b511c 100644 --- a/test/core/bad_client/tests/connection_prefix.cc +++ b/test/core/bad_client/tests/connection_prefix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/bad_client/tests/head_of_line_blocking.cc b/test/core/bad_client/tests/head_of_line_blocking.cc index 35537922f25..28841608f57 100644 --- a/test/core/bad_client/tests/head_of_line_blocking.cc +++ b/test/core/bad_client/tests/head_of_line_blocking.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/bad_client/tests/headers.cc b/test/core/bad_client/tests/headers.cc index 58c62f90df5..f1b4b14251e 100644 --- a/test/core/bad_client/tests/headers.cc +++ b/test/core/bad_client/tests/headers.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -40,7 +40,7 @@ int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); grpc_init(); - /* partial http2 header prefixes */ + // partial http2 header prefixes GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00", GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00", @@ -71,7 +71,7 @@ int main(int argc, char** argv) { PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x01", GRPC_BAD_CLIENT_DISCONNECT); - /* test adding prioritization data */ + // test adding prioritization data GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x01\x01\x24\x00\x00\x00\x01" @@ -123,7 +123,7 @@ int main(int argc, char** argv) { "\x00\x00\x00\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); - /* test looking up an invalid index */ + // test looking up an invalid index GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x01\x01\x04\x00\x00\x00\x01" @@ -147,7 +147,7 @@ int main(int argc, char** argv) { "\x1f\x7f\x01" "a", 0); - /* test nvr, not indexed in static table */ + // test nvr, not indexed in static table GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x03\x01\x04\x00\x00\x00\x01" @@ -160,13 +160,13 @@ int main(int argc, char** argv) { "\x11\x01" "a", GRPC_BAD_CLIENT_DISCONNECT); - /* illegal op code */ + // illegal op code GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x01\x01\x04\x00\x00\x00\x01" "\x80", 0); - /* parse some long indices */ + // parse some long indices GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x02\x01\x04\x00\x00\x00\x01" @@ -237,7 +237,7 @@ int main(int argc, char** argv) { "\x00\x00\x08\x01\x04\x00\x00\x00\x01" "\xff\x80\x80\x80\x80\x80\x80\x00", 0); - /* overflow on byte 4 */ + // overflow on byte 4 GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x06\x01\x04\x00\x00\x00\x01" @@ -248,68 +248,68 @@ int main(int argc, char** argv) { "\x00\x00\x06\x01\x04\x00\x00\x00\x01" "\xff\xff\xff\xff\xff\x0f", GRPC_BAD_CLIENT_DISCONNECT); - /* overflow after byte 4 */ + // overflow after byte 4 GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x08\x01\x04\x00\x00\x00\x01" "\xff\x80\x80\x80\x80\x80\x80\x02", 0); - /* end of headers mid-opcode */ + // end of headers mid-opcode GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x01\x01\x04\x00\x00\x00\x01" "\x01", GRPC_BAD_CLIENT_DISCONNECT); - /* dynamic table size update: set to default */ + // dynamic table size update: set to default GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x03\x01\x04\x00\x00\x00\x01" "\x3f\xe1\x1f", GRPC_BAD_CLIENT_DISCONNECT); - /* dynamic table size update: set too large */ + // dynamic table size update: set too large GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x03\x01\x04\x00\x00\x00\x01" "\x3f\xf1\x1f", 0); - /* dynamic table size update: set twice */ + // dynamic table size update: set twice GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x04\x01\x04\x00\x00\x00\x01" "\x20\x3f\xe1\x1f", GRPC_BAD_CLIENT_DISCONNECT); - /* dynamic table size update: set thrice */ + // dynamic table size update: set thrice GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x03\x01\x04\x00\x00\x00\x01" "\x20\x20\x20", 0); - /* non-ending header followed by continuation frame */ + // non-ending header followed by continuation frame GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x00\x00\x00\x00\x01" "\x00\x00\x00\x09\x04\x00\x00\x00\x01", GRPC_BAD_CLIENT_DISCONNECT); - /* non-ending header followed by non-continuation frame */ + // non-ending header followed by non-continuation frame GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x00\x00\x00\x00\x01" "\x00\x00\x00\x00\x04\x00\x00\x00\x01", 0); - /* non-ending header followed by a continuation frame for a different stream - */ + // non-ending header followed by a continuation frame for a different stream + // GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x01" "\x00\x00\x00\x01\x00\x00\x00\x00\x03" "\x00\x00\x00\x09\x04\x00\x00\x00\x01", 0); - /* opening with a continuation frame */ + // opening with a continuation frame GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x09\x04\x00\x00\x00\x01", 0); - /* three header frames */ + // three header frames GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x04\x00\x00\x00\x01" @@ -317,19 +317,19 @@ int main(int argc, char** argv) { "\x00\x00\x00\x01\x04\x00\x00\x00\x01", GRPC_BAD_CLIENT_DISCONNECT); - /* an invalid header found with fuzzing */ + // an invalid header found with fuzzing GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x01\x39\x67\xed\x1d\x64", GRPC_BAD_CLIENT_DISCONNECT); - /* a badly encoded timeout value */ + // a badly encoded timeout value GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x19\x01\x04\x00\x00\x00\x01" "\x10\x0cgrpc-timeout\x0a" "15 seconds", GRPC_BAD_CLIENT_DISCONNECT); - /* a badly encoded timeout value: twice (catches caching) */ + // a badly encoded timeout value: twice (catches caching) GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x19\x01\x04\x00\x00\x00\x01" diff --git a/test/core/bad_client/tests/initial_settings_frame.cc b/test/core/bad_client/tests/initial_settings_frame.cc index fcbccd6563f..842e298dfc7 100644 --- a/test/core/bad_client/tests/initial_settings_frame.cc +++ b/test/core/bad_client/tests/initial_settings_frame.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -39,7 +39,7 @@ int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); grpc_init(); - /* various partial prefixes */ + // various partial prefixes GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00", GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00", @@ -69,12 +69,12 @@ int main(int argc, char** argv) { GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); - /* must not send frames with stream id != 0 */ + // must not send frames with stream id != 0 GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00\x01", 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x40\x00\x00\x00", 0); - /* settings frame must be a multiple of six bytes long */ + // settings frame must be a multiple of six bytes long GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x01\x04\x00\x00\x00\x00\x00", 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, @@ -85,28 +85,28 @@ int main(int argc, char** argv) { PFX_STR "\x00\x00\x04\x04\x00\x00\x00\x00\x00", 0); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x05\x04\x00\x00\x00\x00\x00", 0); - /* some settings values are illegal */ - /* max frame size = 0 */ + // some settings values are illegal + // max frame size = 0 GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR ONE_SETTING_HDR "\x00\x05\x00\x00\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR ONE_SETTING_HDR "\x00\x06\xff\xff\xff\xff", GRPC_BAD_CLIENT_DISCONNECT); - /* update intiial window size */ + // update intiial window size GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR ONE_SETTING_HDR "\x00\x04\x00\x01\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); - /* ack with data */ + // ack with data GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x00\x00\x00\x00\x00" "\x00\x00\x01\x04\x01\x00\x00\x00\x00", 0); - /* settings frame with invalid flags */ + // settings frame with invalid flags GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR "\x00\x00\x00\x04\x10\x00\x00\x00\x00", 0); - /* unknown settings should be ignored */ + // unknown settings should be ignored GRPC_RUN_BAD_CLIENT_TEST(verifier, nullptr, PFX_STR ONE_SETTING_HDR "\x00\x99\x00\x00\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); diff --git a/test/core/bad_client/tests/large_metadata.cc b/test/core/bad_client/tests/large_metadata.cc index 074ea9c53ea..f829d8121bf 100644 --- a/test/core/bad_client/tests/large_metadata.cc +++ b/test/core/bad_client/tests/large_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -37,7 +37,7 @@ // be longer than the C99 string literal limit. Instead, we dynamically // construct it by adding the large headers one at a time. -/* headers: generated from large_metadata.headers in this directory */ +// headers: generated from large_metadata.headers in this directory #define PFX_TOO_MUCH_METADATA_FROM_CLIENT_REQUEST \ "\x00\x00\x00\x04\x01\x00\x00\x00\x00" \ "\x00" \ diff --git a/test/core/bad_client/tests/out_of_bounds.cc b/test/core/bad_client/tests/out_of_bounds.cc index 4c350d22910..00eda5db9b8 100644 --- a/test/core/bad_client/tests/out_of_bounds.cc +++ b/test/core/bad_client/tests/out_of_bounds.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/core/bad_client/tests/server_registered_method.cc b/test/core/bad_client/tests/server_registered_method.cc index c1afd9eeae8..f9c9e673ad9 100644 --- a/test/core/bad_client/tests/server_registered_method.cc +++ b/test/core/bad_client/tests/server_registered_method.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -83,8 +83,8 @@ int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); grpc_init(); - /* body generated with - * tools/codegen/core/gen_server_registered_method_bad_client_test_body.py */ + // body generated with + // tools/codegen/core/gen_server_registered_method_bad_client_test_body.py GRPC_RUN_BAD_CLIENT_TEST(verifier_fails, nullptr, PFX_STR "\x00\x00\x00\x00\x00\x00\x00\x00\x01", GRPC_BAD_CLIENT_DISCONNECT); diff --git a/test/core/bad_client/tests/unknown_frame.cc b/test/core/bad_client/tests/unknown_frame.cc index 136236203f7..6fa368870fc 100644 --- a/test/core/bad_client/tests/unknown_frame.cc +++ b/test/core/bad_client/tests/unknown_frame.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -41,7 +41,7 @@ static void verifier(grpc_server* server, grpc_completion_queue* cq, namespace { TEST(UnknownFrameType, Test) { - /* test that all invalid/unknown frame types are handled */ + // test that all invalid/unknown frame types are handled for (int i = 10; i <= 255; i++) { std::string unknown_frame_string; APPEND_BUFFER(unknown_frame_string, "\x00\x00\x00"); diff --git a/test/core/bad_connection/close_fd_test.cc b/test/core/bad_connection/close_fd_test.cc index 26357aef151..f5724bfd99c 100644 --- a/test/core/bad_connection/close_fd_test.cc +++ b/test/core/bad_connection/close_fd_test.cc @@ -1,26 +1,26 @@ -/* - * - * Copyright 2019 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. - * - * close_fd_test tests the behavior of grpc core when the transport gets - * disconnected. - * The test creates an http2 transport over a socket pair and closes the - * client or server file descriptor to simulate connection breakage while - * an RPC call is in progress. - * - */ +// +// +// Copyright 2019 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. +// +// close_fd_test tests the behavior of grpc core when the transport gets +// disconnected. +// The test creates an http2 transport over a socket pair and closes the +// client or server file descriptor to simulate connection breakage while +// an RPC call is in progress. +// +// #include #include @@ -64,26 +64,26 @@ static void* tag(intptr_t t) { return reinterpret_cast(t); } typedef struct test_ctx test_ctx; struct test_ctx { - /* completion queue for call notifications on the server */ + // completion queue for call notifications on the server grpc_completion_queue* cq; - /* completion queue registered to server for shutdown events */ + // completion queue registered to server for shutdown events grpc_completion_queue* shutdown_cq; - /* client's completion queue */ + // client's completion queue grpc_completion_queue* client_cq; - /* completion queue bound to call on the server */ + // completion queue bound to call on the server grpc_completion_queue* bound_cq; - /* Server responds to client calls */ + // Server responds to client calls grpc_server* server; - /* Client calls are sent over the channel */ + // Client calls are sent over the channel grpc_channel* client; - /* encapsulates client, server endpoints */ + // encapsulates client, server endpoints grpc_endpoint_pair* ep; }; static test_ctx g_ctx; -/* chttp2 transport that is immediately available (used for testing - connected_channel without a client_channel */ +// chttp2 transport that is immediately available (used for testing +// connected_channel without a client_channel static void server_setup_transport(grpc_transport* transport) { grpc_core::ExecCtx exec_ctx; @@ -104,8 +104,8 @@ static void client_setup_transport(grpc_transport* transport) { const_cast("test-authority")); grpc_channel_args* args = grpc_channel_args_copy_and_add(nullptr, &authority_arg, 1); - /* TODO (pjaikumar): use GRPC_CLIENT_CHANNEL instead of - * GRPC_CLIENT_DIRECT_CHANNEL */ + // TODO (pjaikumar): use GRPC_CLIENT_CHANNEL instead of + // GRPC_CLIENT_DIRECT_CHANNEL g_ctx.client = (*grpc_core::Channel::Create( "socketpair-target", grpc_core::ChannelArgs::FromC(args), GRPC_CLIENT_DIRECT_CHANNEL, transport)) @@ -146,9 +146,9 @@ static void test_init() { g_ctx.bound_cq = grpc_completion_queue_create_for_next(nullptr); g_ctx.client_cq = grpc_completion_queue_create_for_next(nullptr); - /* Create endpoints */ + // Create endpoints *sfd = grpc_iomgr_create_endpoint_pair("fixture", nullptr); - /* Create client, server and setup transport over endpoint pair */ + // Create client, server and setup transport over endpoint pair init_server(); init_client(); } @@ -316,7 +316,7 @@ static void _test_close_before_server_recv(fd_type fdtype) { GPR_ASSERT(fdtype == CLIENT_FD); fd = sfd->client->vtable->get_fd(sfd->client); } - /* Connection is closed before the server receives the client's message. */ + // Connection is closed before the server receives the client's message. close(fd); error = grpc_call_start_batch(server_call, ops, static_cast(op - ops), @@ -326,29 +326,29 @@ static void _test_close_before_server_recv(fd_type fdtype) { event = grpc_completion_queue_next( g_ctx.bound_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); - /* Batch operation completes on the server side. - * event.success will be true if the op completes successfully. - * event.success will be false if the op completes with an error. This can - * happen due to a race with closing the fd resulting in pending writes - * failing due to stream closure. - * */ + // Batch operation completes on the server side. + // event.success will be true if the op completes successfully. + // event.success will be false if the op completes with an error. This can + // happen due to a race with closing the fd resulting in pending writes + // failing due to stream closure. + // GPR_ASSERT(event.type == GRPC_OP_COMPLETE); GPR_ASSERT(event.tag == tag(102)); event = grpc_completion_queue_next( g_ctx.client_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); - /* When the client fd is closed, the server gets EPIPE. - * When server fd is closed, server gets EBADF. - * In both cases server sends GRPC_STATUS_UNAVALABLE to the client. However, - * the client may not receive this grpc_status as it's socket is being closed. - * If the client didn't get grpc_status from the server it will time out - * waiting on the completion queue. So there 2 2 possibilities: - * 1. client times out waiting for server's response - * 2. client receives GRPC_STATUS_UNAVAILABLE from server - */ + // When the client fd is closed, the server gets EPIPE. + // When server fd is closed, server gets EBADF. + // In both cases server sends GRPC_STATUS_UNAVALABLE to the client. However, + // the client may not receive this grpc_status as it's socket is being closed. + // If the client didn't get grpc_status from the server it will time out + // waiting on the completion queue. So there 2 2 possibilities: + // 1. client times out waiting for server's response + // 2. client receives GRPC_STATUS_UNAVAILABLE from server + // if (event.type == GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(event.success == 0); - /* status is not initialized */ + // status is not initialized GPR_ASSERT(status == GRPC_STATUS__DO_NOT_USE); } else { GPR_ASSERT(event.type == GRPC_OP_COMPLETE); @@ -374,11 +374,11 @@ static void _test_close_before_server_recv(fd_type fdtype) { } static void test_close_before_server_recv() { - /* Close client side of the connection before server receives message from - * client */ + // Close client side of the connection before server receives message from + // client _test_close_before_server_recv(CLIENT_FD); - /* Close server side of the connection before server receives message from - * client */ + // Close server side of the connection before server receives message from + // client _test_close_before_server_recv(SERVER_FD); } @@ -522,14 +522,14 @@ static void _test_close_before_server_send(fd_type fdtype) { fd = sfd->client->vtable->get_fd(sfd->client); } - /* Connection is closed before the server sends message and status to the - * client. */ + // Connection is closed before the server sends message and status to the + // client. close(fd); error = grpc_call_start_batch(server_call, ops, static_cast(op - ops), tag(103), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* Batch operation succeeds on the server side */ + // Batch operation succeeds on the server side event = grpc_completion_queue_next( g_ctx.bound_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); GPR_ASSERT(event.type == GRPC_OP_COMPLETE); @@ -538,11 +538,11 @@ static void _test_close_before_server_send(fd_type fdtype) { event = grpc_completion_queue_next( g_ctx.client_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); - /* In both cases server sends GRPC_STATUS_UNAVALABLE to the client. However, - * the client may not receive this grpc_status as it's socket is being closed. - * If the client didn't get grpc_status from the server it will time out - * waiting on the completion queue - */ + // In both cases server sends GRPC_STATUS_UNAVALABLE to the client. However, + // the client may not receive this grpc_status as it's socket is being closed. + // If the client didn't get grpc_status from the server it will time out + // waiting on the completion queue + // if (event.type == GRPC_OP_COMPLETE) { GPR_ASSERT(event.success == 1); GPR_ASSERT(event.tag == tag(1)); @@ -550,7 +550,7 @@ static void _test_close_before_server_send(fd_type fdtype) { } else { GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); GPR_ASSERT(event.success == 0); - /* status is not initialized */ + // status is not initialized GPR_ASSERT(status == GRPC_STATUS__DO_NOT_USE); } GPR_ASSERT(was_cancelled == 0); @@ -572,11 +572,11 @@ static void _test_close_before_server_send(fd_type fdtype) { } static void test_close_before_server_send() { - /* Close client side of the connection before server sends message to client - * */ + // Close client side of the connection before server sends message to client + // _test_close_before_server_send(CLIENT_FD); - /* Close server side of the connection before server sends message to client - * */ + // Close server side of the connection before server sends message to client + // _test_close_before_server_send(SERVER_FD); } @@ -661,15 +661,15 @@ static void _test_close_before_client_send(fd_type fdtype) { GPR_ASSERT(fdtype == CLIENT_FD); fd = sfd->client->vtable->get_fd(sfd->client); } - /* Connection is closed before the client sends a batch to the server */ + // Connection is closed before the client sends a batch to the server close(fd); error = grpc_call_start_batch(call, ops, static_cast(op - ops), tag(1), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* Status unavailable is returned to the client when client or server fd is - * closed */ + // Status unavailable is returned to the client when client or server fd is + // closed event = grpc_completion_queue_next( g_ctx.client_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); GPR_ASSERT(event.success == 1); @@ -677,7 +677,7 @@ static void _test_close_before_client_send(fd_type fdtype) { GPR_ASSERT(event.tag == tag(1)); GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); - /* No event is received on the server */ + // No event is received on the server event = grpc_completion_queue_next( g_ctx.cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); GPR_ASSERT(event.success == 0); @@ -699,11 +699,11 @@ static void _test_close_before_client_send(fd_type fdtype) { end_test(); } static void test_close_before_client_send() { - /* Close client side of the connection before client sends message to server - * */ + // Close client side of the connection before client sends message to server + // _test_close_before_client_send(CLIENT_FD); - /* Close server side of the connection before client sends message to server - * */ + // Close server side of the connection before client sends message to server + // _test_close_before_client_send(SERVER_FD); } @@ -723,7 +723,7 @@ static void _test_close_before_call_create(fd_type fdtype) { GPR_ASSERT(fdtype == CLIENT_FD); fd = sfd->client->vtable->get_fd(sfd->client); } - /* Connection is closed before the client creates a call */ + // Connection is closed before the client creates a call close(fd); call = grpc_channel_create_call( @@ -731,8 +731,8 @@ static void _test_close_before_call_create(fd_type fdtype) { grpc_slice_from_static_string("/foo"), nullptr, deadline, nullptr); GPR_ASSERT(call); - /* Client and server time out waiting on their completion queues and nothing - * is sent or received */ + // Client and server time out waiting on their completion queues and nothing + // is sent or received event = grpc_completion_queue_next( g_ctx.client_cq, grpc_timeout_milliseconds_to_deadline(100), nullptr); GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); @@ -748,15 +748,15 @@ static void _test_close_before_call_create(fd_type fdtype) { } static void test_close_before_call_create() { - /* Close client side of the connection before client creates a call */ + // Close client side of the connection before client creates a call _test_close_before_call_create(CLIENT_FD); - /* Close server side of the connection before client creates a call */ + // Close server side of the connection before client creates a call _test_close_before_call_create(SERVER_FD); } int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); - /* Init grpc */ + // Init grpc grpc_init(); int iterations = 10; @@ -772,8 +772,8 @@ int main(int argc, char** argv) { return 0; } -#else /* GRPC_POSIX_SOCKET_TCP */ +#else // GRPC_POSIX_SOCKET_TCP int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP diff --git a/test/core/bad_ssl/bad_ssl_test.cc b/test/core/bad_ssl/bad_ssl_test.cc index fccece412e5..0f86a8966e6 100644 --- a/test/core/bad_ssl/bad_ssl_test.cc +++ b/test/core/bad_ssl/bad_ssl_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -131,7 +131,7 @@ int main(int argc, char** argv) { int status; size_t i; gpr_subprocess* svr; - /* figure out where we are */ + // figure out where we are if (lslash) { memcpy(root, me, static_cast(lslash - me)); root[lslash - me] = 0; @@ -141,12 +141,12 @@ int main(int argc, char** argv) { if (argc == 2) { GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, argv[1]); } - /* figure out our test name */ + // figure out our test name tmp = lunder - 1; while (*tmp != '_') tmp--; tmp++; memcpy(test, tmp, static_cast(lunder - tmp)); - /* start the server */ + // start the server gpr_asprintf(&args[0], "%s/bad_ssl_%s_server%s", root, test, gpr_subprocess_binary_extension()); args[1] = const_cast("--bind"); diff --git a/test/core/bad_ssl/server_common.cc b/test/core/bad_ssl/server_common.cc index f3bd867569e..1c61031a860 100644 --- a/test/core/bad_ssl/server_common.cc +++ b/test/core/bad_ssl/server_common.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/bad_ssl/server_common.h" @@ -26,10 +26,10 @@ #include "test/core/util/cmdline.h" #include "test/core/util/test_config.h" -/* Common server implementation details for all servers in servers/. - * There's nothing *wrong* with these servers per-se, but they are - * configured to cause some failure case in the SSL connection path. - */ +// Common server implementation details for all servers in servers/. +// There's nothing *wrong* with these servers per-se, but they are +// configured to cause some failure case in the SSL connection path. +// static int got_sigint = 0; diff --git a/test/core/bad_ssl/server_common.h b/test/core/bad_ssl/server_common.h index e1933b973e5..8e05f9f7443 100644 --- a/test/core/bad_ssl/server_common.h +++ b/test/core/bad_ssl/server_common.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_BAD_SSL_SERVER_H #define GRPC_TEST_CORE_BAD_SSL_SERVER_H @@ -24,4 +24,4 @@ const char* bad_ssl_addr(int argc, char** argv); void bad_ssl_run(grpc_server* server); -#endif /* GRPC_TEST_CORE_BAD_SSL_SERVER_H */ +#endif // GRPC_TEST_CORE_BAD_SSL_SERVER_H diff --git a/test/core/bad_ssl/servers/alpn.cc b/test/core/bad_ssl/servers/alpn.cc index dc773fd504d..527bf4a9004 100644 --- a/test/core/bad_ssl/servers/alpn.cc +++ b/test/core/bad_ssl/servers/alpn.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/alpn/alpn.h" @@ -34,9 +34,9 @@ #define SERVER_CERT_PATH "src/core/tsi/test_creds/server1.pem" #define SERVER_KEY_PATH "src/core/tsi/test_creds/server1.key" -/* This test starts a server that is configured to advertise (via alpn and npn) - * a protocol that the connecting client does not support. It does this by - * overriding the functions declared in alpn.c from the core library. */ +// This test starts a server that is configured to advertise (via alpn and npn) +// a protocol that the connecting client does not support. It does this by +// overriding the functions declared in alpn.c from the core library. static const char* const fake_versions[] = {"not-h2"}; diff --git a/test/core/bad_ssl/servers/cert.cc b/test/core/bad_ssl/servers/cert.cc index 6737a318b8a..01e6f693fc1 100644 --- a/test/core/bad_ssl/servers/cert.cc +++ b/test/core/bad_ssl/servers/cert.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -25,8 +25,8 @@ #include "src/core/lib/iomgr/load_file.h" #include "test/core/bad_ssl/server_common.h" -/* This server will present an untrusted cert to the connecting client, - * causing the SSL handshake to fail */ +// This server will present an untrusted cert to the connecting client, +// causing the SSL handshake to fail int main(int argc, char** argv) { const char* addr = bad_ssl_addr(argc, argv); diff --git a/test/core/channel/channel_args_test.cc b/test/core/channel/channel_args_test.cc index 7388eec422b..ead8ecd4310 100644 --- a/test/core/channel/channel_args_test.cc +++ b/test/core/channel/channel_args_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/channel/channel_args.h" diff --git a/test/core/channel/channel_stack_builder_test.cc b/test/core/channel/channel_stack_builder_test.cc index 01741906ad9..ef1362628b8 100644 --- a/test/core/channel/channel_stack_builder_test.cc +++ b/test/core/channel/channel_stack_builder_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/channel/channel_stack_builder.h" diff --git a/test/core/channel/channel_stack_test.cc b/test/core/channel/channel_stack_test.cc index fff9904e0f9..0bcdd4c9b45 100644 --- a/test/core/channel/channel_stack_test.cc +++ b/test/core/channel/channel_stack_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/channel/channel_stack.h" @@ -127,14 +127,14 @@ TEST(ChannelStackTest, CreateChannelStack) { call_stack = static_cast(gpr_malloc(channel_stack->call_stack_size)); const grpc_call_element_args args = { - call_stack, /* call_stack */ - nullptr, /* server_transport_data */ - nullptr, /* context */ - path, /* path */ - gpr_get_cycle_counter(), /* start_time */ - grpc_core::Timestamp::InfFuture(), /* deadline */ - nullptr, /* arena */ - nullptr, /* call_combiner */ + call_stack, // call_stack + nullptr, // server_transport_data + nullptr, // context + path, // path + gpr_get_cycle_counter(), // start_time + grpc_core::Timestamp::InfFuture(), // deadline + nullptr, // arena + nullptr, // call_combiner }; grpc_error_handle error = grpc_call_stack_init(channel_stack, 1, free_call, call_stack, &args); diff --git a/test/core/channel/channel_trace_test.cc b/test/core/channel/channel_trace_test.cc index 636d5a5ad82..d2f9c1651b3 100644 --- a/test/core/channel/channel_trace_test.cc +++ b/test/core/channel/channel_trace_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/channel/channel_trace.h" diff --git a/test/core/channel/channelz_registry_test.cc b/test/core/channel/channelz_registry_test.cc index c4e5af9d7bf..4f9f23bd1d6 100644 --- a/test/core/channel/channelz_registry_test.cc +++ b/test/core/channel/channelz_registry_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/channel/channelz_registry.h" diff --git a/test/core/channel/channelz_test.cc b/test/core/channel/channelz_test.cc index c55a20bbc1d..dc9e242b515 100644 --- a/test/core/channel/channelz_test.cc +++ b/test/core/channel/channelz_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/channel/channelz.h" diff --git a/test/core/channel/minimal_stack_is_minimal_test.cc b/test/core/channel/minimal_stack_is_minimal_test.cc index 5c043e52dc0..4ae52273155 100644 --- a/test/core/channel/minimal_stack_is_minimal_test.cc +++ b/test/core/channel/minimal_stack_is_minimal_test.cc @@ -1,33 +1,33 @@ -/* - * - * 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. - * - */ - -/******************************************************************************* - * This test verifies that various stack configurations result in the set of - * filters that we expect. - * - * This is akin to a golden-file test, and suffers the same disadvantages and - * advantages: it reflects that the code as written has not been modified - and - * valid code modifications WILL break this test and it will need updating. - * - * The intent therefore is to allow code reviewers to more easily catch changes - * that perturb the generated list of channel filters in different - * configurations and assess whether such a change is correct and desirable. - */ +// +// +// 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. +// +// + +//****************************************************************************** +// This test verifies that various stack configurations result in the set of +// filters that we expect. +// +// This is akin to a golden-file test, and suffers the same disadvantages and +// advantages: it reflects that the code as written has not been modified - and +// valid code modifications WILL break this test and it will need updating. +// +// The intent therefore is to allow code reviewers to more easily catch changes +// that perturb the generated list of channel filters in different +// configurations and assess whether such a change is correct and desirable. +// #include diff --git a/test/core/channel/status_util_test.cc b/test/core/channel/status_util_test.cc index 0fffc934fa8..5a1a156b949 100644 --- a/test/core/channel/status_util_test.cc +++ b/test/core/channel/status_util_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/channel/status_util.h" diff --git a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc index 8fe88d068fa..5c00a0755de 100644 --- a/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_cooldown_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/client_channel/resolvers/dns_resolver_test.cc b/test/core/client_channel/resolvers/dns_resolver_test.cc index c3355bcb5f7..9ce8034e535 100644 --- a/test/core/client_channel/resolvers/dns_resolver_test.cc +++ b/test/core/client_channel/resolvers/dns_resolver_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/client_channel/resolvers/fake_resolver_test.cc b/test/core/client_channel/resolvers/fake_resolver_test.cc index 6ad97e2ae12..8fcbd628dba 100644 --- a/test/core/client_channel/resolvers/fake_resolver_test.cc +++ b/test/core/client_channel/resolvers/fake_resolver_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" diff --git a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc index 04bb19554f7..b600214ec30 100644 --- a/test/core/client_channel/resolvers/sockaddr_resolver_test.cc +++ b/test/core/client_channel/resolvers/sockaddr_resolver_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -63,8 +63,8 @@ static void test_succeeds(grpc_core::ResolverFactory* factory, factory->CreateResolver(std::move(args)); ASSERT_NE(resolver, nullptr); resolver->StartLocked(); - /* Flush ExecCtx to avoid stack-use-after-scope on on_res_arg which is - * accessed in the closure on_resolution_cb */ + // Flush ExecCtx to avoid stack-use-after-scope on on_res_arg which is + // accessed in the closure on_resolution_cb grpc_core::ExecCtx::Get()->Flush(); } diff --git a/test/core/client_channel/retry_throttle_test.cc b/test/core/client_channel/retry_throttle_test.cc index 307695d0aaa..0e9ad1e6f41 100644 --- a/test/core/client_channel/retry_throttle_test.cc +++ b/test/core/client_channel/retry_throttle_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/ext/filters/client_channel/retry_throttle.h" diff --git a/test/core/compression/compression_test.cc b/test/core/compression/compression_test.cc index 396e2ce9370..5b03f0a0953 100644 --- a/test/core/compression/compression_test.cc +++ b/test/core/compression/compression_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -56,7 +56,7 @@ TEST(CompressionTest, CompressionAlgorithmParse) { success = grpc_compression_algorithm_parse( grpc_slice_from_static_string(invalid_name), &algorithm); ASSERT_EQ(success, 0); - /* the value of "algorithm" is undefined upon failure */ + // the value of "algorithm" is undefined upon failure } } @@ -82,16 +82,16 @@ TEST(CompressionTest, CompressionAlgorithmName) { success = grpc_compression_algorithm_name(GRPC_COMPRESS_ALGORITHMS_COUNT, &name); ASSERT_EQ(success, 0); - /* the value of "name" is undefined upon failure */ + // the value of "name" is undefined upon failure } TEST(CompressionTest, CompressionAlgorithmForLevel) { gpr_log(GPR_DEBUG, "test_compression_algorithm_for_level"); { - /* accept only identity (aka none) */ + // accept only identity (aka none) uint32_t accepted_encodings = 0; - grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); // always ASSERT_EQ(GRPC_COMPRESS_NONE, grpc_compression_algorithm_for_level(GRPC_COMPRESS_LEVEL_NONE, @@ -111,9 +111,9 @@ TEST(CompressionTest, CompressionAlgorithmForLevel) { } { - /* accept only gzip */ + // accept only gzip uint32_t accepted_encodings = 0; - grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); // always grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_GZIP); ASSERT_EQ(GRPC_COMPRESS_NONE, @@ -134,9 +134,9 @@ TEST(CompressionTest, CompressionAlgorithmForLevel) { } { - /* accept only deflate */ + // accept only deflate uint32_t accepted_encodings = 0; - grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); // always grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_DEFLATE); ASSERT_EQ(GRPC_COMPRESS_NONE, @@ -157,9 +157,9 @@ TEST(CompressionTest, CompressionAlgorithmForLevel) { } { - /* accept gzip and deflate */ + // accept gzip and deflate uint32_t accepted_encodings = 0; - grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); // always grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_GZIP); grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_DEFLATE); @@ -181,9 +181,9 @@ TEST(CompressionTest, CompressionAlgorithmForLevel) { } { - /* accept all algorithms */ + // accept all algorithms uint32_t accepted_encodings = 0; - grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); /* always */ + grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_NONE); // always grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_GZIP); grpc_core::SetBit(&accepted_encodings, GRPC_COMPRESS_DEFLATE); @@ -216,11 +216,11 @@ TEST(CompressionTest, CompressionEnableDisableAlgorithm) { algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm = static_cast( static_cast(algorithm) + 1)) { - /* all algorithms are enabled by default */ + // all algorithms are enabled by default ASSERT_NE( grpc_compression_options_is_algorithm_enabled(&options, algorithm), 0); } - /* disable one by one */ + // disable one by one for (algorithm = GRPC_COMPRESS_NONE; algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm = static_cast( @@ -229,7 +229,7 @@ TEST(CompressionTest, CompressionEnableDisableAlgorithm) { ASSERT_EQ( grpc_compression_options_is_algorithm_enabled(&options, algorithm), 0); } - /* re-enable one by one */ + // re-enable one by one for (algorithm = GRPC_COMPRESS_NONE; algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT; algorithm = static_cast( diff --git a/test/core/compression/message_compress_fuzzer.cc b/test/core/compression/message_compress_fuzzer.cc index 19925ae4457..64abbf21a4f 100644 --- a/test/core/compression/message_compress_fuzzer.cc +++ b/test/core/compression/message_compress_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/core/compression/message_compress_test.cc b/test/core/compression/message_compress_test.cc index cf50e9cfee9..bae0122a03b 100644 --- a/test/core/compression/message_compress_test.cc +++ b/test/core/compression/message_compress_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/compression/message_compress.h" @@ -83,7 +83,7 @@ static void assert_passthrough(grpc_slice value, ASSERT_EQ(was_compressed, 1); break; case MAYBE_COMPRESSES: - /* no check */ + // no check break; } @@ -173,15 +173,15 @@ TEST(MessageCompressTest, BadDecompressionDataCrc) { grpc_slice_buffer_add(&input, create_test_value(ONE_MB_A)); grpc_core::ExecCtx exec_ctx; - /* compress it */ + // compress it grpc_msg_compress(GRPC_COMPRESS_GZIP, &input, &corrupted); - /* corrupt the output by smashing the CRC */ + // corrupt the output by smashing the CRC ASSERT_GT(corrupted.count, 1); ASSERT_GT(GRPC_SLICE_LENGTH(corrupted.slices[1]), 8); idx = GRPC_SLICE_LENGTH(corrupted.slices[1]) - 8; memcpy(GRPC_SLICE_START_PTR(corrupted.slices[1]) + idx, &bad, 4); - /* try (and fail) to decompress the corrupted compresed buffer */ + // try (and fail) to decompress the corrupted compresed buffer ASSERT_EQ(0, grpc_msg_decompress(GRPC_COMPRESS_GZIP, &corrupted, &output)); grpc_slice_buffer_destroy(&input); @@ -202,12 +202,12 @@ TEST(MessageCompressTest, BadDecompressionDataMissingTrailer) { grpc_slice_buffer_add(&input, create_test_value(ONE_MB_A)); grpc_core::ExecCtx exec_ctx; - /* compress it */ + // compress it grpc_msg_compress(GRPC_COMPRESS_GZIP, &input, &decompressed); ASSERT_GT(decompressed.length, 8); - /* Remove the footer from the decompressed message */ + // Remove the footer from the decompressed message grpc_slice_buffer_trim_end(&decompressed, 8, &garbage); - /* try (and fail) to decompress the compressed buffer without the footer */ + // try (and fail) to decompress the compressed buffer without the footer ASSERT_EQ(0, grpc_msg_decompress(GRPC_COMPRESS_GZIP, &decompressed, &output)); grpc_slice_buffer_destroy(&input); @@ -222,12 +222,12 @@ TEST(MessageCompressTest, BadDecompressionDataTrailingGarbage) { grpc_slice_buffer_init(&input); grpc_slice_buffer_init(&output); - /* append 0x99 to the end of an otherwise valid stream */ + // append 0x99 to the end of an otherwise valid stream grpc_slice_buffer_add( &input, grpc_slice_from_copied_buffer( "\x78\xda\x63\x60\x60\x60\x00\x00\x00\x04\x00\x01\x99", 13)); - /* try (and fail) to decompress the invalid compresed buffer */ + // try (and fail) to decompress the invalid compresed buffer grpc_core::ExecCtx exec_ctx; ASSERT_EQ(0, grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output)); @@ -244,7 +244,7 @@ TEST(MessageCompressTest, BadDecompressionDataStream) { grpc_slice_buffer_add(&input, grpc_slice_from_copied_buffer("\x78\xda\xff\xff", 4)); - /* try (and fail) to decompress the invalid compresed buffer */ + // try (and fail) to decompress the invalid compresed buffer grpc_core::ExecCtx exec_ctx; ASSERT_EQ(0, grpc_msg_decompress(GRPC_COMPRESS_DEFLATE, &input, &output)); diff --git a/test/core/compression/message_decompress_fuzzer.cc b/test/core/compression/message_decompress_fuzzer.cc index e95a44e9f91..4996705182b 100644 --- a/test/core/compression/message_decompress_fuzzer.cc +++ b/test/core/compression/message_decompress_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/core/debug/stats_test.cc b/test/core/debug/stats_test.cc index 754ac29d143..eb2b969d275 100644 --- a/test/core/debug/stats_test.cc +++ b/test/core/debug/stats_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/debug/stats.h" diff --git a/test/core/end2end/bad_server_response_test.cc b/test/core/end2end/bad_server_response_test.cc index 91a6b1d9c25..00d77b3141d 100644 --- a/test/core/end2end/bad_server_response_test.cc +++ b/test/core/end2end/bad_server_response_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -75,9 +75,9 @@ #define HTTP2_DETAIL_MSG(STATUS_CODE) \ "Received http2 header with status: " #STATUS_CODE -/* TODO(zyc) Check the content of incoming data instead of using this length */ -/* The 'bad' server will start sending responses after reading this amount of - * data from the client. */ +// TODO(zyc) Check the content of incoming data instead of using this length +// The 'bad' server will start sending responses after reading this amount of +// data from the client. #define SERVER_INCOMING_DATA_LENGTH_LOWER_THRESHOLD (size_t)200 struct rpc_state { @@ -335,15 +335,15 @@ static void run_test(bool http2_response, bool send_settings, state.response_payload = response_payload; state.response_payload_length = response_payload_length; - /* poll server until sending out the response */ + // poll server until sending out the response std::unique_ptr thdptr( poll_server_until_read_done(&test_server, &ev)); start_rpc(server_port, expected_status, expected_detail); gpr_event_wait(&ev, gpr_inf_future(GPR_CLOCK_REALTIME)); thdptr->Join(); - /* Proof that the server accepted the TCP connection. */ + // Proof that the server accepted the TCP connection. GPR_ASSERT(state.connection_attempt_made == true); - /* clean up */ + // clean up grpc_endpoint_shutdown(state.tcp, GRPC_ERROR_CREATE("Test Shutdown")); grpc_endpoint_destroy(state.tcp); cleanup_rpc(); @@ -356,7 +356,7 @@ static void run_test(bool http2_response, bool send_settings, int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); grpc_init(); - /* status defined in hpack static table */ + // status defined in hpack static table run_test(true, true, HTTP2_RESP(204), sizeof(HTTP2_RESP(204)) - 1, GRPC_STATUS_UNKNOWN, HTTP2_DETAIL_MSG(204)); run_test(true, true, HTTP2_RESP(206), sizeof(HTTP2_RESP(206)) - 1, @@ -370,7 +370,7 @@ int main(int argc, char** argv) { run_test(true, true, HTTP2_RESP(500), sizeof(HTTP2_RESP(500)) - 1, GRPC_STATUS_UNKNOWN, HTTP2_DETAIL_MSG(500)); - /* status not defined in hpack static table */ + // status not defined in hpack static table run_test(true, true, HTTP2_RESP(401), sizeof(HTTP2_RESP(401)) - 1, GRPC_STATUS_UNAUTHENTICATED, HTTP2_DETAIL_MSG(401)); run_test(true, true, HTTP2_RESP(403), sizeof(HTTP2_RESP(403)) - 1, @@ -385,19 +385,19 @@ int main(int argc, char** argv) { GRPC_STATUS_UNAVAILABLE, HTTP2_DETAIL_MSG(503)); run_test(true, true, HTTP2_RESP(504), sizeof(HTTP2_RESP(504)) - 1, GRPC_STATUS_UNAVAILABLE, HTTP2_DETAIL_MSG(504)); - /* unparseable response. RPC should fail immediately due to a connect - * failure. - */ + // unparseable response. RPC should fail immediately due to a connect + // failure. + // run_test(false, false, UNPARSEABLE_RESP, sizeof(UNPARSEABLE_RESP) - 1, GRPC_STATUS_UNAVAILABLE, nullptr); - /* http1 response. RPC should fail immediately due to a connect failure. */ + // http1 response. RPC should fail immediately due to a connect failure. run_test(false, false, HTTP1_RESP_400, sizeof(HTTP1_RESP_400) - 1, GRPC_STATUS_UNAVAILABLE, nullptr); - /* http2 response without sending a SETTINGs frame. RPC should fail with - * DEADLINE_EXCEEDED since the RPC deadline is lower than the connection - * attempt deadline. */ + // http2 response without sending a SETTINGs frame. RPC should fail with + // DEADLINE_EXCEEDED since the RPC deadline is lower than the connection + // attempt deadline. run_test(true, false, HTTP2_RESP(404), sizeof(HTTP2_RESP(404)) - 1, GRPC_STATUS_DEADLINE_EXCEEDED, nullptr); grpc_shutdown(); diff --git a/test/core/end2end/connection_refused_test.cc b/test/core/end2end/connection_refused_test.cc index 46a49eb1fe3..4e217eaefd5 100644 --- a/test/core/end2end/connection_refused_test.cc +++ b/test/core/end2end/connection_refused_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -58,7 +58,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { cq = grpc_completion_queue_create_for_next(nullptr); grpc_core::CqVerifier cqv(cq); - /* if using service config, create channel args */ + // if using service config, create channel args grpc_channel_args* args = nullptr; if (use_service_config) { GPR_ASSERT(wait_for_ready); @@ -77,7 +77,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { args = grpc_channel_args_copy_and_add(args, &arg, 1); } - /* create a call, channel to a port which will refuse connection */ + // create a call, channel to a port which will refuse connection int port = grpc_pick_unused_port_or_die(); std::string addr = grpc_core::JoinHostPort("127.0.0.1", port); gpr_log(GPR_INFO, "server: %s", addr.c_str()); @@ -110,7 +110,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call, ops, (size_t)(op - ops), tag(1), nullptr)); - /* verify that all tags get completed */ + // verify that all tags get completed cqv.Expect(tag(1), true); cqv.Verify(); diff --git a/test/core/end2end/cq_verifier.h b/test/core/end2end/cq_verifier.h index 5824f345029..5c01007528c 100644 --- a/test/core/end2end/cq_verifier.h +++ b/test/core/end2end/cq_verifier.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_END2END_CQ_VERIFIER_H #define GRPC_TEST_CORE_END2END_CQ_VERIFIER_H @@ -100,4 +100,4 @@ int contains_metadata(grpc_metadata_array* array, const char* key, int contains_metadata_slices(grpc_metadata_array* array, grpc_slice key, grpc_slice value); -#endif /* GRPC_TEST_CORE_END2END_CQ_VERIFIER_H */ +#endif // GRPC_TEST_CORE_END2END_CQ_VERIFIER_H diff --git a/test/core/end2end/data/client_certs.cc b/test/core/end2end/data/client_certs.cc index 8d9cb9129b9..e1316545acb 100644 --- a/test/core/end2end/data/client_certs.cc +++ b/test/core/end2end/data/client_certs.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// extern const char test_self_signed_client_cert[] = { 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, diff --git a/test/core/end2end/data/server1_cert.cc b/test/core/end2end/data/server1_cert.cc index b780a84d6d1..207d2dac09e 100644 --- a/test/core/end2end/data/server1_cert.cc +++ b/test/core/end2end/data/server1_cert.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// extern const char test_server1_cert[] = { 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, diff --git a/test/core/end2end/data/server1_key.cc b/test/core/end2end/data/server1_key.cc index c2b09d20d9a..21aa13d1ef8 100644 --- a/test/core/end2end/data/server1_key.cc +++ b/test/core/end2end/data/server1_key.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// extern const char test_server1_key[] = { 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x50, diff --git a/test/core/end2end/data/ssl_test_data.h b/test/core/end2end/data/ssl_test_data.h index c679ffaf131..60a9e4e6996 100644 --- a/test/core/end2end/data/ssl_test_data.h +++ b/test/core/end2end/data/ssl_test_data.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H #define GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H @@ -31,4 +31,4 @@ extern const char test_self_signed_client_key[]; extern const char test_signed_client_cert[]; extern const char test_signed_client_key[]; -#endif /* GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H */ +#endif // GRPC_TEST_CORE_END2END_DATA_SSL_TEST_DATA_H diff --git a/test/core/end2end/data/test_root_cert.cc b/test/core/end2end/data/test_root_cert.cc index 941ebc82dc8..6ebfdbce8ae 100644 --- a/test/core/end2end/data/test_root_cert.cc +++ b/test/core/end2end/data/test_root_cert.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// extern const char test_root_cert[] = { 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, diff --git a/test/core/end2end/dualstack_socket_test.cc b/test/core/end2end/dualstack_socket_test.cc index 02ad031fe6a..3fc6e00be72 100644 --- a/test/core/end2end/dualstack_socket_test.cc +++ b/test/core/end2end/dualstack_socket_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -59,7 +59,7 @@ #include "test/core/util/port.h" #include "test/core/util/test_config.h" -/* This test exercises IPv4, IPv6, and dualstack sockets in various ways. */ +// This test exercises IPv4, IPv6, and dualstack sockets in various ways. static void* tag(intptr_t t) { return reinterpret_cast(t); } @@ -118,7 +118,7 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); - /* Create server. */ + // Create server. cq = grpc_completion_queue_create_for_next(nullptr); server = grpc_server_create(nullptr, nullptr); grpc_server_register_completion_queue(server, cq, nullptr); @@ -135,10 +135,10 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_server_start(server); grpc_core::CqVerifier cqv(cq); - /* Create client. */ + // Create client. std::string client_hostport; if (client_host[0] == 'i') { - /* for ipv4:/ipv6: addresses, concatenate the port to each of the parts */ + // for ipv4:/ipv6: addresses, concatenate the port to each of the parts std::vector uri_parts = absl::StrSplit(client_host, ',', absl::SkipEmpty()); std::vector hosts_with_port; @@ -161,15 +161,15 @@ void test_connect(const char* server_host, const char* client_host, int port, log_resolved_addrs("client resolved addr", client_host); if (expect_ok) { - /* Normal deadline, shouldn't be reached. */ + // Normal deadline, shouldn't be reached. deadline = grpc_timeout_milliseconds_to_deadline(60000); } else { - /* Give up faster when failure is expected. - BUG: Setting this to 1000 reveals a memory leak (b/18608927). */ + // Give up faster when failure is expected. + // BUG: Setting this to 1000 reveals a memory leak (b/18608927). deadline = grpc_timeout_milliseconds_to_deadline(8000); } - /* Send a trivial request. */ + // Send a trivial request. grpc_slice host = grpc_slice_from_static_string("foo.test.google.fr"); c = grpc_channel_create_call(client, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), &host, @@ -204,7 +204,7 @@ void test_connect(const char* server_host, const char* client_host, int port, GPR_ASSERT(GRPC_CALL_OK == error); if (expect_ok) { - /* Check for a successful request. */ + // Check for a successful request. error = grpc_server_request_call(server, &s, &call_details, &request_metadata_recv, cq, cq, tag(101)); GPR_ASSERT(GRPC_CALL_OK == error); @@ -249,7 +249,7 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_call_unref(s); } else { - /* Check for a failed connection. */ + // Check for a failed connection. cqv.Expect(tag(1), true); cqv.Verify(); @@ -260,10 +260,10 @@ void test_connect(const char* server_host, const char* client_host, int port, grpc_call_unref(c); - /* Destroy client. */ + // Destroy client. grpc_channel_destroy(client); - /* Destroy server. */ + // Destroy server. grpc_server_shutdown_and_notify(server, cq, tag(1000)); grpc_event ev; do { @@ -324,11 +324,11 @@ int main(int argc, char** argv) { do_ipv6 = 0; } - /* For coverage, test with and without dualstack sockets. */ + // For coverage, test with and without dualstack sockets. for (grpc_forbid_dualstack_sockets_for_testing = 0; grpc_forbid_dualstack_sockets_for_testing <= 1; grpc_forbid_dualstack_sockets_for_testing++) { - /* :: and 0.0.0.0 are handled identically. */ + // :: and 0.0.0.0 are handled identically. test_connect("::", "127.0.0.1", 0, 1); test_connect("::", "::ffff:127.0.0.1", 0, 1); test_connect("::", "ipv4:127.0.0.1", 0, 1); @@ -347,7 +347,7 @@ int main(int argc, char** argv) { test_connect("0.0.0.0", "ipv6:[::1]", 0, 1); } - /* These only work when the families agree. */ + // These only work when the families agree. test_connect("127.0.0.1", "127.0.0.1", 0, 1); test_connect("127.0.0.1", "ipv4:127.0.0.1", 0, 1); if (do_ipv6) { @@ -385,8 +385,8 @@ int main(int argc, char** argv) { return 0; } -#else /* GRPC_POSIX_SOCKET_EV */ +#else // GRPC_POSIX_SOCKET_EV int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_SOCKET_EV */ +#endif // GRPC_POSIX_SOCKET_EV diff --git a/test/core/end2end/end2end_test_utils.cc b/test/core/end2end/end2end_test_utils.cc index 329dc833608..d16922583f5 100644 --- a/test/core/end2end/end2end_test_utils.cc +++ b/test/core/end2end/end2end_test_utils.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/end2end_tests.cc b/test/core/end2end/end2end_tests.cc index 5e1f9ff2a51..4865e2182f2 100644 --- a/test/core/end2end/end2end_tests.cc +++ b/test/core/end2end/end2end_tests.cc @@ -1,23 +1,23 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This file is auto-generated */ +// This file is auto-generated #include "test/core/end2end/end2end_tests.h" diff --git a/test/core/end2end/end2end_tests.h b/test/core/end2end/end2end_tests.h index a4f21283c04..388572cc704 100644 --- a/test/core/end2end/end2end_tests.h +++ b/test/core/end2end/end2end_tests.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_END2END_END2END_TESTS_H #define GRPC_TEST_CORE_END2END_END2END_TESTS_H @@ -27,7 +27,7 @@ typedef struct grpc_end2end_test_fixture grpc_end2end_test_fixture; typedef struct grpc_end2end_test_config grpc_end2end_test_config; -/* Test feature flags. */ +// Test feature flags. #define FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION 1 #define FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION 2 // Feature mask supports call credentials with a minimum security level of @@ -52,15 +52,15 @@ struct grpc_end2end_test_fixture { }; struct grpc_end2end_test_config { - /* A descriptive name for this test fixture. */ + // A descriptive name for this test fixture. const char* name; - /* Which features are supported by this fixture. See feature flags above. */ + // Which features are supported by this fixture. See feature flags above. uint32_t feature_mask; - /* If the call host is setup by the fixture (for example, via the - * GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg), which value should the test - * expect to find in call_details.host */ + // If the call host is setup by the fixture (for example, via the + // GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg), which value should the test + // expect to find in call_details.host const char* overridden_call_host; grpc_end2end_test_fixture (*create_fixture)( @@ -78,12 +78,12 @@ void grpc_end2end_tests(int argc, char** argv, grpc_end2end_test_config config); const char* get_host_override_string(const char* str, grpc_end2end_test_config config); -/* Returns a pointer to a statically allocated slice: future invocations - overwrite past invocations, not threadsafe, etc... */ +// Returns a pointer to a statically allocated slice: future invocations +// overwrite past invocations, not threadsafe, etc... const grpc_slice* get_host_override_slice(const char* str, grpc_end2end_test_config config); void validate_host_override_string(const char* pattern, grpc_slice str, grpc_end2end_test_config config); -#endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */ +#endif // GRPC_TEST_CORE_END2END_END2END_TESTS_H diff --git a/test/core/end2end/fixtures/h2_census.cc b/test/core/end2end/fixtures/h2_census.cc index e6553fbd147..6bb97d4b733 100644 --- a/test/core/end2end/fixtures/h2_census.cc +++ b/test/core/end2end/fixtures/h2_census.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -103,7 +103,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_compress.cc b/test/core/end2end/fixtures/h2_compress.cc index 023c6278afd..bd999301269 100644 --- a/test/core/end2end/fixtures/h2_compress.cc +++ b/test/core/end2end/fixtures/h2_compress.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -97,7 +97,7 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_fakesec.cc b/test/core/end2end/fixtures/h2_fakesec.cc index 506be9272bf..d317710893a 100644 --- a/test/core/end2end/fixtures/h2_fakesec.cc +++ b/test/core/end2end/fixtures/h2_fakesec.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -123,7 +123,7 @@ static void chttp2_init_server_fake_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, fake_ts_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fake_secure_fullstack", diff --git a/test/core/end2end/fixtures/h2_fd.cc b/test/core/end2end/fixtures/h2_fd.cc index a22aabd2dd5..1422d89f651 100644 --- a/test/core/end2end/fixtures/h2_fd.cc +++ b/test/core/end2end/fixtures/h2_fd.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "absl/status/status.h" @@ -101,7 +101,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fd", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, chttp2_create_fixture_socketpair, chttp2_init_client_socketpair, @@ -124,8 +124,8 @@ int main(int argc, char** argv) { return 0; } -#else /* GRPC_POSIX_SOCKET */ +#else // GRPC_POSIX_SOCKET int main(int /* argc */, char** /* argv */) { return 1; } -#endif /* GRPC_POSIX_SOCKET */ +#endif // GRPC_POSIX_SOCKET diff --git a/test/core/end2end/fixtures/h2_full+pipe.cc b/test/core/end2end/fixtures/h2_full+pipe.cc index 65670cf82ba..3546a684504 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.cc +++ b/test/core/end2end/fixtures/h2_full+pipe.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -89,7 +89,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | @@ -117,8 +117,8 @@ int main(int argc, char** argv) { return 0; } -#else /* GRPC_POSIX_WAKEUP_FD */ +#else // GRPC_POSIX_WAKEUP_FD int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_WAKEUP_FD */ +#endif // GRPC_POSIX_WAKEUP_FD diff --git a/test/core/end2end/fixtures/h2_full+trace.cc b/test/core/end2end/fixtures/h2_full+trace.cc index 0675cb485e0..b55f2e85703 100644 --- a/test/core/end2end/fixtures/h2_full+trace.cc +++ b/test/core/end2end/fixtures/h2_full+trace.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -93,7 +93,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | @@ -106,8 +106,8 @@ static grpc_end2end_test_config configs[] = { int main(int argc, char** argv) { size_t i; - /* force tracing on, with a value to force many - code paths in trace.c to be taken */ + // force tracing on, with a value to force many + // code paths in trace.c to be taken GPR_GLOBAL_CONFIG_SET(grpc_trace, "doesnt-exist,http,all"); #ifdef GRPC_POSIX_SOCKET @@ -117,11 +117,11 @@ int main(int argc, char** argv) { #endif #ifdef GPR_WINDOWS - /* on Windows, writing logs to stderr is very slow - when stderr is redirected to a disk file. - The "trace" tests fixtures generates large amount - of logs, so setting a buffer for stderr prevents certain - test cases from timing out. */ + // on Windows, writing logs to stderr is very slow + // when stderr is redirected to a disk file. + // The "trace" tests fixtures generates large amount + // of logs, so setting a buffer for stderr prevents certain + // test cases from timing out. setvbuf(stderr, NULL, _IOLBF, 1024); #endif diff --git a/test/core/end2end/fixtures/h2_full.cc b/test/core/end2end/fixtures/h2_full.cc index 4f4ec865aca..b4f9507e6ac 100644 --- a/test/core/end2end/fixtures/h2_full.cc +++ b/test/core/end2end/fixtures/h2_full.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -82,7 +82,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_full_no_retry.cc b/test/core/end2end/fixtures/h2_full_no_retry.cc index 820ae12781b..cb2dff3c042 100644 --- a/test/core/end2end/fixtures/h2_full_no_retry.cc +++ b/test/core/end2end/fixtures/h2_full_no_retry.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -87,7 +87,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_http_proxy.cc b/test/core/end2end/fixtures/h2_http_proxy.cc index 7646cb012c8..5b94b3dc856 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.cc +++ b/test/core/end2end/fixtures/h2_http_proxy.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -48,8 +48,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( const int server_port = grpc_pick_unused_port_or_die(); ffd->server_addr = grpc_core::JoinHostPort("localhost", server_port); - /* Passing client_args to proxy_create for the case of checking for proxy auth - */ + // Passing client_args to proxy_create for the case of checking for proxy auth + // ffd->proxy = grpc_end2end_http_proxy_create(client_args); f.fixture_data = ffd; @@ -62,7 +62,7 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, const grpc_channel_args* client_args) { fullstack_fixture_data* ffd = static_cast(f->fixture_data); - /* If testing for proxy auth, add credentials to proxy uri */ + // If testing for proxy auth, add credentials to proxy uri const char* proxy_auth_str = grpc_channel_args_find_string( client_args, GRPC_ARG_HTTP_PROXY_AUTH_CREDS); std::string proxy_uri; @@ -107,7 +107,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_insecure.cc b/test/core/end2end/fixtures/h2_insecure.cc index df8d529a6b7..936caf758c5 100644 --- a/test/core/end2end/fixtures/h2_insecure.cc +++ b/test/core/end2end/fixtures/h2_insecure.cc @@ -100,7 +100,7 @@ void Chttp2TearDownInsecureFullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations grpc_end2end_test_config configs[] = { {"chttp2/insecure_fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_local_abstract_uds_percent_encoded.cc b/test/core/end2end/fixtures/h2_local_abstract_uds_percent_encoded.cc index cfcbb63ba0d..aa44cfd839d 100644 --- a/test/core/end2end/fixtures/h2_local_abstract_uds_percent_encoded.cc +++ b/test/core/end2end/fixtures/h2_local_abstract_uds_percent_encoded.cc @@ -53,7 +53,7 @@ static void chttp2_init_server_fullstack_uds( grpc_end2end_local_chttp2_init_server_fullstack(f, client_args, UDS); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_local_abstract_uds_percent_encoded", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_local_ipv4.cc b/test/core/end2end/fixtures/h2_local_ipv4.cc index 0160253faf6..f7ca63dafd4 100644 --- a/test/core/end2end/fixtures/h2_local_ipv4.cc +++ b/test/core/end2end/fixtures/h2_local_ipv4.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -50,7 +50,7 @@ static void chttp2_init_server_fullstack_ipv4( grpc_end2end_local_chttp2_init_server_fullstack(f, client_args, LOCAL_TCP); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_local_ipv4", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_local_ipv6.cc b/test/core/end2end/fixtures/h2_local_ipv6.cc index c441391fc86..f234d464c18 100644 --- a/test/core/end2end/fixtures/h2_local_ipv6.cc +++ b/test/core/end2end/fixtures/h2_local_ipv6.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -50,7 +50,7 @@ static void chttp2_init_server_fullstack_ipv6( grpc_end2end_local_chttp2_init_server_fullstack(f, client_args, LOCAL_TCP); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_local_ipv6", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_local_uds.cc b/test/core/end2end/fixtures/h2_local_uds.cc index 792b3bc2c9a..a0d25ebb1e5 100644 --- a/test/core/end2end/fixtures/h2_local_uds.cc +++ b/test/core/end2end/fixtures/h2_local_uds.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -57,7 +57,7 @@ static void chttp2_init_server_fullstack_uds( grpc_end2end_local_chttp2_init_server_fullstack(f, client_args, UDS); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_local_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_local_uds_percent_encoded.cc b/test/core/end2end/fixtures/h2_local_uds_percent_encoded.cc index 7b4a4e4eef8..b0930550cf6 100644 --- a/test/core/end2end/fixtures/h2_local_uds_percent_encoded.cc +++ b/test/core/end2end/fixtures/h2_local_uds_percent_encoded.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -57,7 +57,7 @@ static void chttp2_init_server_fullstack_uds( grpc_end2end_local_chttp2_init_server_fullstack(f, client_args, UDS); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_local_uds_percent_encoded", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_oauth2_tls12.cc b/test/core/end2end/fixtures/h2_oauth2_tls12.cc index 29ec853a0cf..5d3681cdca8 100644 --- a/test/core/end2end/fixtures/h2_oauth2_tls12.cc +++ b/test/core/end2end/fixtures/h2_oauth2_tls12.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -256,7 +256,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_slice_unref(key_slice); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_with_oauth2_fullstack_tls1_2", diff --git a/test/core/end2end/fixtures/h2_oauth2_tls13.cc b/test/core/end2end/fixtures/h2_oauth2_tls13.cc index 52a5060a063..df8b3307f97 100644 --- a/test/core/end2end/fixtures/h2_oauth2_tls13.cc +++ b/test/core/end2end/fixtures/h2_oauth2_tls13.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -256,7 +256,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( grpc_slice_unref(key_slice); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_with_oauth2_fullstack_tls1_3", diff --git a/test/core/end2end/fixtures/h2_proxy.cc b/test/core/end2end/fixtures/h2_proxy.cc index a0cea0bd3bb..6df6d083f45 100644 --- a/test/core/end2end/fixtures/h2_proxy.cc +++ b/test/core/end2end/fixtures/h2_proxy.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -103,7 +103,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { gpr_free(ffd); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.cc b/test/core/end2end/fixtures/h2_sockpair+trace.cc index cc8cfa3c6cb..c9a2634ce3b 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.cc +++ b/test/core/end2end/fixtures/h2_sockpair+trace.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -52,8 +52,8 @@ #include #endif -/* chttp2 transport that is immediately available (used for testing - connected_channel without a client_channel */ +// chttp2 transport that is immediately available (used for testing +// connected_channel without a client_channel struct custom_fixture_data { grpc_endpoint_pair ep; @@ -150,7 +150,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, chttp2_create_fixture_socketpair, chttp2_init_client_socketpair, @@ -160,8 +160,8 @@ static grpc_end2end_test_config configs[] = { int main(int argc, char** argv) { size_t i; - /* force tracing on, with a value to force many - code paths in trace.c to be taken */ + // force tracing on, with a value to force many + // code paths in trace.c to be taken GPR_GLOBAL_CONFIG_SET(grpc_trace, "doesnt-exist,http,all"); #ifdef GRPC_POSIX_SOCKET @@ -171,11 +171,11 @@ int main(int argc, char** argv) { #endif #ifdef GPR_WINDOWS - /* on Windows, writing logs to stderr is very slow - when stderr is redirected to a disk file. - The "trace" tests fixtures generates large amount - of logs, so setting a buffer for stderr prevents certain - test cases from timing out. */ + // on Windows, writing logs to stderr is very slow + // when stderr is redirected to a disk file. + // The "trace" tests fixtures generates large amount + // of logs, so setting a buffer for stderr prevents certain + // test cases from timing out. setvbuf(stderr, NULL, _IOLBF, 1024); #endif diff --git a/test/core/end2end/fixtures/h2_sockpair.cc b/test/core/end2end/fixtures/h2_sockpair.cc index 3cfe5e37b13..37ec5bdf9c4 100644 --- a/test/core/end2end/fixtures/h2_sockpair.cc +++ b/test/core/end2end/fixtures/h2_sockpair.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -45,8 +45,8 @@ #include "test/core/end2end/end2end_tests.h" #include "test/core/util/test_config.h" -/* chttp2 transport that is immediately available (used for testing - connected_channel without a client_channel */ +// chttp2 transport that is immediately available (used for testing +// connected_channel without a client_channel struct custom_fixture_data { grpc_endpoint_pair ep; @@ -144,7 +144,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/socketpair", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, chttp2_create_fixture_socketpair, chttp2_init_client_socketpair, diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.cc b/test/core/end2end/fixtures/h2_sockpair_1byte.cc index e880e9294a0..e19d44d333b 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.cc +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -46,8 +46,8 @@ #include "test/core/end2end/end2end_tests.h" #include "test/core/util/test_config.h" -/* chttp2 transport that is immediately available (used for testing - connected_channel without a client_channel */ +// chttp2 transport that is immediately available (used for testing +// connected_channel without a client_channel struct custom_fixture_data { grpc_endpoint_pair ep; @@ -156,7 +156,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/socketpair_one_byte_at_a_time", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, diff --git a/test/core/end2end/fixtures/h2_sockpair_with_minstack.cc b/test/core/end2end/fixtures/h2_sockpair_with_minstack.cc index 52fce40a6a7..84c93922c5b 100644 --- a/test/core/end2end/fixtures/h2_sockpair_with_minstack.cc +++ b/test/core/end2end/fixtures/h2_sockpair_with_minstack.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -45,8 +45,8 @@ #include "test/core/end2end/end2end_tests.h" #include "test/core/util/test_config.h" -/* chttp2 transport that is immediately available (used for testing - connected_channel without a client_channel) */ +// chttp2 transport that is immediately available (used for testing +// connected_channel without a client_channel) struct custom_fixture_data { grpc_endpoint_pair ep; @@ -147,7 +147,7 @@ static void chttp2_tear_down_socketpair(grpc_end2end_test_fixture* f) { gpr_free(f->fixture_data); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/socketpair+minstack", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER | diff --git a/test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc b/test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc index 62e56acbc71..722fee88844 100644 --- a/test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc +++ b/test/core/end2end/fixtures/h2_ssl_cred_reload_tls12.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -208,7 +208,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_fullstack_tls1_2", diff --git a/test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc b/test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc index af21bb2e016..41ece7c2a97 100644 --- a/test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc +++ b/test/core/end2end/fixtures/h2_ssl_cred_reload_tls13.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -208,7 +208,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_fullstack_tls1_3", diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.cc b/test/core/end2end/fixtures/h2_ssl_proxy.cc index 10befbcc7db..7011efe52e8 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.cc +++ b/test/core/end2end/fixtures/h2_ssl_proxy.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -201,7 +201,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_fullstack", diff --git a/test/core/end2end/fixtures/h2_ssl_tls12.cc b/test/core/end2end/fixtures/h2_ssl_tls12.cc index 28d54ffc3e6..9f5079a6ca7 100644 --- a/test/core/end2end/fixtures/h2_ssl_tls12.cc +++ b/test/core/end2end/fixtures/h2_ssl_tls12.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -180,7 +180,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_fullstack_tls1_2", diff --git a/test/core/end2end/fixtures/h2_ssl_tls13.cc b/test/core/end2end/fixtures/h2_ssl_tls13.cc index eb2b22df32a..ca7a00c24a2 100644 --- a/test/core/end2end/fixtures/h2_ssl_tls13.cc +++ b/test/core/end2end/fixtures/h2_ssl_tls13.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -180,7 +180,7 @@ static void chttp2_init_server_simple_ssl_secure_fullstack( chttp2_init_server_secure_fullstack(f, server_args, ssl_creds); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/simple_ssl_fullstack_tls1_3", diff --git a/test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc b/test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc index 1b412e803f9..03a174f2eea 100644 --- a/test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc +++ b/test/core/end2end/fixtures/h2_tls_certwatch_async_tls1_3.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc b/test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc index 8c966b58861..8944b693c37 100644 --- a/test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc +++ b/test/core/end2end/fixtures/h2_tls_certwatch_sync_tls1_2.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/end2end/fixtures/h2_tls_common.h b/test/core/end2end/fixtures/h2_tls_common.h index eeb2d292bbe..0eb6365dc26 100644 --- a/test/core/end2end/fixtures/h2_tls_common.h +++ b/test/core/end2end/fixtures/h2_tls_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef H2_TLS_COMMON_H #define H2_TLS_COMMON_H @@ -229,7 +229,7 @@ inline grpc_channel_credentials* create_tls_channel_credentials( ffd->client_verifier); grpc_tls_credentials_options_set_check_call_host(options, ffd->check_call_host); - /* Create TLS channel credentials. */ + // Create TLS channel credentials. grpc_channel_credentials* creds = grpc_tls_credentials_create(options); return creds; } @@ -299,4 +299,4 @@ static const uint32_t kH2TLSFeatureMask = FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER; -#endif \ No newline at end of file +#endif diff --git a/test/core/end2end/fixtures/h2_tls_simple.cc b/test/core/end2end/fixtures/h2_tls_simple.cc index 97940627c8f..2ed084829da 100644 --- a/test/core/end2end/fixtures/h2_tls_simple.cc +++ b/test/core/end2end/fixtures/h2_tls_simple.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc b/test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc index a1b1ed57f41..e41b11a9c20 100644 --- a/test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc +++ b/test/core/end2end/fixtures/h2_tls_static_async_tls1_3.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/end2end/fixtures/h2_uds.cc b/test/core/end2end/fixtures/h2_uds.cc index 0f17b78371c..9ff10ccd552 100644 --- a/test/core/end2end/fixtures/h2_uds.cc +++ b/test/core/end2end/fixtures/h2_uds.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -95,7 +95,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/h2_uds_abstract.cc b/test/core/end2end/fixtures/h2_uds_abstract.cc index 9d22cd65a17..f77710fdeac 100644 --- a/test/core/end2end/fixtures/h2_uds_abstract.cc +++ b/test/core/end2end/fixtures/h2_uds_abstract.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -96,7 +96,7 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture* f) { delete ffd; } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"chttp2/fullstack_uds_abstract_namespace", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | diff --git a/test/core/end2end/fixtures/http_proxy_fixture.cc b/test/core/end2end/fixtures/http_proxy_fixture.cc index 28b7b181d4d..ddd5fb0a2e7 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.cc +++ b/test/core/end2end/fixtures/http_proxy_fixture.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/core/end2end/fixtures/http_proxy_fixture.h" @@ -465,11 +465,11 @@ static void on_server_connect_done(void* arg, grpc_error_handle error) { conn->proxy->combiner->Run(&conn->on_server_connect_done, error); } -/** - * Parses the proxy auth header value to check if it matches :- - * Basic - * Returns true if it matches, false otherwise - */ +/// +/// Parses the proxy auth header value to check if it matches :- +/// Basic +/// Returns true if it matches, false otherwise +/// static bool proxy_auth_header_matches(char* proxy_auth_header_val, char* expected_cred) { GPR_ASSERT(proxy_auth_header_val != nullptr); diff --git a/test/core/end2end/fixtures/http_proxy_fixture.h b/test/core/end2end/fixtures/http_proxy_fixture.h index 2bc20fa3c17..3f3cae838ac 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.h +++ b/test/core/end2end/fixtures/http_proxy_fixture.h @@ -1,33 +1,33 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CORE_END2END_FIXTURES_HTTP_PROXY_FIXTURE_H #define GRPC_TEST_CORE_END2END_FIXTURES_HTTP_PROXY_FIXTURE_H #include -/* The test credentials being used for HTTP Proxy Authorization */ +// The test credentials being used for HTTP Proxy Authorization #define GRPC_TEST_HTTP_PROXY_AUTH_CREDS "aladdin:opensesame" -/* A channel arg key used to indicate that the channel uses proxy authorization. - * The value (string) should be the proxy auth credentials that should be - * checked. - */ +// A channel arg key used to indicate that the channel uses proxy authorization. +// The value (string) should be the proxy auth credentials that should be +// checked. +// #define GRPC_ARG_HTTP_PROXY_AUTH_CREDS "grpc.test.proxy_auth" typedef struct grpc_end2end_http_proxy grpc_end2end_http_proxy; @@ -40,4 +40,4 @@ void grpc_end2end_http_proxy_destroy(grpc_end2end_http_proxy* proxy); const char* grpc_end2end_http_proxy_get_proxy_name( grpc_end2end_http_proxy* proxy); -#endif /* GRPC_TEST_CORE_END2END_FIXTURES_HTTP_PROXY_FIXTURE_H */ +#endif // GRPC_TEST_CORE_END2END_FIXTURES_HTTP_PROXY_FIXTURE_H diff --git a/test/core/end2end/fixtures/inproc.cc b/test/core/end2end/fixtures/inproc.cc index a375d49e904..c8992baf82f 100644 --- a/test/core/end2end/fixtures/inproc.cc +++ b/test/core/end2end/fixtures/inproc.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -65,7 +65,7 @@ void inproc_tear_down(grpc_end2end_test_fixture* f) { gpr_free(ffd); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"inproc", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, inproc_create_fixture, inproc_init_client, inproc_init_server, diff --git a/test/core/end2end/fixtures/local_util.cc b/test/core/end2end/fixtures/local_util.cc index 8416f1dd9e1..bff6fb6ce4e 100644 --- a/test/core/end2end/fixtures/local_util.cc +++ b/test/core/end2end/fixtures/local_util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/core/end2end/fixtures/local_util.h" @@ -45,11 +45,11 @@ void grpc_end2end_local_chttp2_init_client_fullstack( grpc_channel_credentials_release(creds); } -/* - * Check if server should fail auth check. If it is true, a different metadata - * processor will be installed that always fails in processing client's - * metadata. - */ +// +// Check if server should fail auth check. If it is true, a different metadata +// processor will be installed that always fails in processing client's +// metadata. +// static bool fail_server_auth_check(const grpc_channel_args* server_args) { size_t i; if (server_args == nullptr) return false; diff --git a/test/core/end2end/fixtures/local_util.h b/test/core/end2end/fixtures/local_util.h index dc9be0cba5a..e4573f6a126 100644 --- a/test/core/end2end/fixtures/local_util.h +++ b/test/core/end2end/fixtures/local_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -27,7 +27,7 @@ struct grpc_end2end_local_fullstack_fixture_data { std::string localaddr; }; -/* Utility functions shared by h2_local tests. */ +// Utility functions shared by h2_local tests. grpc_end2end_test_fixture grpc_end2end_local_chttp2_create_fixture_fullstack(); void grpc_end2end_local_chttp2_init_client_fullstack( diff --git a/test/core/end2end/fixtures/proxy.cc b/test/core/end2end/fixtures/proxy.cc index 482ed9f0400..2926dc2c4f4 100644 --- a/test/core/end2end/fixtures/proxy.cc +++ b/test/core/end2end/fixtures/proxy.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/end2end/fixtures/proxy.h" @@ -58,7 +58,7 @@ struct grpc_end2end_proxy { int shutdown; - /* requested call */ + // requested call grpc_call* new_call; grpc_call_details new_call_details; grpc_metadata_array new_call_metadata; diff --git a/test/core/end2end/fixtures/proxy.h b/test/core/end2end/fixtures/proxy.h index 8f18888e9bd..701ff4fef18 100644 --- a/test/core/end2end/fixtures/proxy.h +++ b/test/core/end2end/fixtures/proxy.h @@ -1,27 +1,27 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H #define GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H #include -/* proxy service for _with_proxy fixtures */ +// proxy service for _with_proxy fixtures typedef struct grpc_end2end_proxy grpc_end2end_proxy; @@ -40,4 +40,4 @@ void grpc_end2end_proxy_destroy(grpc_end2end_proxy* proxy); const char* grpc_end2end_proxy_get_client_target(grpc_end2end_proxy* proxy); const char* grpc_end2end_proxy_get_server_port(grpc_end2end_proxy* proxy); -#endif /* GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H */ +#endif // GRPC_TEST_CORE_END2END_FIXTURES_PROXY_H diff --git a/test/core/end2end/fuzzers/api_fuzzer.cc b/test/core/end2end/fuzzers/api_fuzzer.cc index 9b1b092632c..ce50dbdd5e4 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.cc +++ b/test/core/end2end/fuzzers/api_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -465,7 +465,7 @@ class Call : public std::enable_shared_from_this { memset(&op, 0, sizeof(op)); switch (batch_op.op_case()) { case api_fuzzer::BatchOp::OP_NOT_SET: - /* invalid value */ + // invalid value return {}; case api_fuzzer::BatchOp::kSendInitialMetadata: if (sent_initial_metadata_) { @@ -772,7 +772,7 @@ static grpc_call_credentials* ReadCallCreds( return grpc_google_iam_credentials_create( creds.iam().auth_token().c_str(), creds.iam().auth_selector().c_str(), nullptr); - /* TODO(ctiller): more cred types here */ + // TODO(ctiller): more cred types here } } diff --git a/test/core/end2end/fuzzers/client_fuzzer.cc b/test/core/end2end/fuzzers/client_fuzzer.cc index c746efb0fe1..f00e3347489 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.cc +++ b/test/core/end2end/fuzzers/client_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/end2end/fuzzers/server_fuzzer.cc b/test/core/end2end/fuzzers/server_fuzzer.cc index 48434d27906..adb1b1f224c 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.cc +++ b/test/core/end2end/fuzzers/server_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/end2end/goaway_server_test.cc b/test/core/end2end/goaway_server_test.cc index 082822d953e..1a5d8c6057b 100644 --- a/test/core/end2end/goaway_server_test.cc +++ b/test/core/end2end/goaway_server_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -245,7 +245,7 @@ int main(int argc, char** argv) { cq = grpc_completion_queue_create_for_next(nullptr); grpc_core::CqVerifier cqv(cq); - /* reserve two ports */ + // reserve two ports int port1 = grpc_pick_unused_port_or_die(); int port2 = grpc_pick_unused_port_or_die(); @@ -256,26 +256,26 @@ int main(int argc, char** argv) { .Set(GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS, 1000) .Set(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000) .Set(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, 5000) - /* When this test brings down server1 and then brings up server2, - * the targetted server port number changes, and the client channel - * needs to re-resolve to pick this up. This test requires that - * happen within 10 seconds, but gRPC's DNS resolvers rate limit - * resolution attempts to at most once every 30 seconds by default. - * So we tweak it for this test. */ + // When this test brings down server1 and then brings up server2, + // the targetted server port number changes, and the client channel + // needs to re-resolve to pick this up. This test requires that + // happen within 10 seconds, but gRPC's DNS resolvers rate limit + // resolution attempts to at most once every 30 seconds by default. + // So we tweak it for this test. .Set(GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS, 1000) .ToC(); - /* create a channel that picks first amongst the servers */ + // create a channel that picks first amongst the servers grpc_channel_credentials* creds = grpc_insecure_credentials_create(); grpc_channel* chan = grpc_channel_create("test", creds, client_args.get()); grpc_channel_credentials_release(creds); - /* and an initial call to them */ + // and an initial call to them grpc_slice host = grpc_slice_from_static_string("127.0.0.1"); grpc_call* call1 = grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), &host, grpc_timeout_seconds_to_deadline(20), nullptr); - /* send initial metadata to probe connectivity */ + // send initial metadata to probe connectivity memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -286,7 +286,7 @@ int main(int argc, char** argv) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call1, ops, (size_t)(op - ops), tag(0x101), nullptr)); - /* and receive status to probe termination */ + // and receive status to probe termination memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -300,7 +300,7 @@ int main(int argc, char** argv) { (size_t)(op - ops), tag(0x102), nullptr)); - /* bring a server up on the first port */ + // bring a server up on the first port grpc_server* server1 = grpc_server_create(nullptr, nullptr); addr = absl::StrCat("127.0.0.1:", port1); grpc_server_credentials* server_creds = @@ -310,7 +310,7 @@ int main(int argc, char** argv) { grpc_server_register_completion_queue(server1, cq, nullptr); grpc_server_start(server1); - /* request a call to the server */ + // request a call to the server grpc_call* server_call1; GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(server1, &server_call1, &request_details1, @@ -318,7 +318,7 @@ int main(int argc, char** argv) { set_resolve_port(port1); - /* first call should now start */ + // first call should now start cqv.Expect(tag(0x101), true); cqv.Expect(tag(0x301), true); cqv.Verify(); @@ -329,7 +329,7 @@ int main(int argc, char** argv) { gpr_inf_future(GPR_CLOCK_REALTIME), cq, tag(0x9999)); - /* listen for close on the server call to probe for finishing */ + // listen for close on the server call to probe for finishing memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; @@ -340,20 +340,20 @@ int main(int argc, char** argv) { (size_t)(op - ops), tag(0x302), nullptr)); - /* shutdown first server: - * we should see a connectivity change and then nothing */ + // shutdown first server: + // we should see a connectivity change and then nothing set_resolve_port(-1); grpc_server_shutdown_and_notify(server1, cq, tag(0xdead1)); cqv.Expect(tag(0x9999), true); cqv.Verify(); cqv.VerifyEmpty(); - /* and a new call: should go through to server2 when we start it */ + // and a new call: should go through to server2 when we start it grpc_call* call2 = grpc_channel_create_call(chan, nullptr, GRPC_PROPAGATE_DEFAULTS, cq, grpc_slice_from_static_string("/foo"), &host, grpc_timeout_seconds_to_deadline(20), nullptr); - /* send initial metadata to probe connectivity */ + // send initial metadata to probe connectivity memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; @@ -364,7 +364,7 @@ int main(int argc, char** argv) { GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call2, ops, (size_t)(op - ops), tag(0x201), nullptr)); - /* and receive status to probe termination */ + // and receive status to probe termination memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -378,7 +378,7 @@ int main(int argc, char** argv) { (size_t)(op - ops), tag(0x202), nullptr)); - /* and bring up second server */ + // and bring up second server set_resolve_port(port2); grpc_server* server2 = grpc_server_create(nullptr, nullptr); addr = absl::StrCat("127.0.0.1:", port2); @@ -389,18 +389,18 @@ int main(int argc, char** argv) { grpc_server_register_completion_queue(server2, cq, nullptr); grpc_server_start(server2); - /* request a call to the server */ + // request a call to the server grpc_call* server_call2; GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call(server2, &server_call2, &request_details2, &request_metadata2, cq, cq, tag(0x401))); - /* second call should now start */ + // second call should now start cqv.Expect(tag(0x201), true); cqv.Expect(tag(0x401), true); cqv.Verify(); - /* listen for close on the server call to probe for finishing */ + // listen for close on the server call to probe for finishing memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; @@ -411,14 +411,14 @@ int main(int argc, char** argv) { (size_t)(op - ops), tag(0x402), nullptr)); - /* shutdown second server: we should see nothing */ + // shutdown second server: we should see nothing grpc_server_shutdown_and_notify(server2, cq, tag(0xdead2)); cqv.VerifyEmpty(); grpc_call_cancel(call1, nullptr); grpc_call_cancel(call2, nullptr); - /* now everything else should finish */ + // now everything else should finish cqv.Expect(tag(0x102), true); cqv.Expect(tag(0x202), true); cqv.Expect(tag(0x302), true); diff --git a/test/core/end2end/h2_ssl_session_reuse_test.cc b/test/core/end2end/h2_ssl_session_reuse_test.cc index 83e124646bf..7a12b86a952 100644 --- a/test/core/end2end/h2_ssl_session_reuse_test.cc +++ b/test/core/end2end/h2_ssl_session_reuse_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/test/core/end2end/inproc_callback_test.cc b/test/core/end2end/inproc_callback_test.cc index 57d18a2bf50..c7b2566cc45 100644 --- a/test/core/end2end/inproc_callback_test.cc +++ b/test/core/end2end/inproc_callback_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include @@ -480,7 +480,7 @@ static void simple_request_pre_init() { gpr_cv_init(&tags_cv); } -/* All test configurations */ +// All test configurations static grpc_end2end_test_config configs[] = { {"inproc-callback", FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, nullptr, inproc_create_fixture, inproc_init_client, inproc_init_server, diff --git a/test/core/end2end/invalid_call_argument_test.cc b/test/core/end2end/invalid_call_argument_test.cc index be1ce47f74e..f51de742251 100644 --- a/test/core/end2end/invalid_call_argument_test.cc +++ b/test/core/end2end/invalid_call_argument_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -75,7 +75,7 @@ static void prepare_test(int is_client) { memset(g_state.ops, 0, sizeof(g_state.ops)); if (is_client) { - /* create a call, channel to a non existant server */ + // create a call, channel to a non existant server grpc_channel_credentials* creds = grpc_insecure_credentials_create(); g_state.chan = grpc_channel_create("nonexistant:54321", creds, nullptr); grpc_channel_credentials_release(creds); diff --git a/test/core/end2end/multiple_server_queues_test.cc b/test/core/end2end/multiple_server_queues_test.cc index 02887c6440c..daa8bb3c5fe 100644 --- a/test/core/end2end/multiple_server_queues_test.cc +++ b/test/core/end2end/multiple_server_queues_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -59,7 +59,7 @@ int main(int argc, char** argv) { grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq2, nullptr); grpc_completion_queue_next(cq2, gpr_inf_future(GPR_CLOCK_REALTIME), - nullptr); /* cue queue freeze */ + nullptr); // cue queue freeze grpc_completion_queue_shutdown(cq1); grpc_completion_queue_shutdown(cq2); grpc_completion_queue_shutdown(cq3); diff --git a/test/core/end2end/no_server_test.cc b/test/core/end2end/no_server_test.cc index 08d3fc6de93..b9e3c085d79 100644 --- a/test/core/end2end/no_server_test.cc +++ b/test/core/end2end/no_server_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -50,7 +50,7 @@ void run_test(bool wait_for_ready) { response_generator.get()); grpc_channel_args args = {1, &arg}; - /* create a call, channel to a non existant server */ + // create a call, channel to a non existant server grpc_channel_credentials* creds = grpc_insecure_credentials_create(); grpc_channel* chan = grpc_channel_create("fake:nonexistant", creds, &args); grpc_channel_credentials_release(creds); @@ -87,7 +87,7 @@ void run_test(bool wait_for_ready) { response_generator->SetFailure(); } - /* verify that all tags get completed */ + // verify that all tags get completed cqv.Expect(tag(1), true); cqv.Verify(); diff --git a/test/core/end2end/tests/authority_not_supported.cc b/test/core/end2end/tests/authority_not_supported.cc index 1736576fc9a..d06189dea88 100644 --- a/test/core/end2end/tests/authority_not_supported.cc +++ b/test/core/end2end/tests/authority_not_supported.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Request/response with metadata and payload.*/ +// Request/response with metadata and payload. static void test_with_authority_header(grpc_end2end_test_config config) { grpc_call* c; grpc_slice request_payload_slice = diff --git a/test/core/end2end/tests/bad_hostname.cc b/test/core/end2end/tests/bad_hostname.cc index 9a34c8f8ba4..ff606e4b66f 100644 --- a/test/core/end2end/tests/bad_hostname.cc +++ b/test/core/end2end/tests/bad_hostname.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/bad_ping.cc b/test/core/end2end/tests/bad_ping.cc index ae62891eeb4..69006781ac3 100644 --- a/test/core/end2end/tests/bad_ping.cc +++ b/test/core/end2end/tests/bad_ping.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/binary_metadata.cc b/test/core/end2end/tests/binary_metadata.cc index afaaac1ae75..3d2dfb20c0e 100644 --- a/test/core/end2end/tests/binary_metadata.cc +++ b/test/core/end2end/tests/binary_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -104,7 +104,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Request/response with metadata and payload.*/ +// Request/response with metadata and payload. static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call* c; diff --git a/test/core/end2end/tests/call_creds.cc b/test/core/end2end/tests/call_creds.cc index efe90b668c5..158aad05a34 100644 --- a/test/core/end2end/tests/call_creds.cc +++ b/test/core/end2end/tests/call_creds.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -266,7 +266,7 @@ static void request_response_with_payload_and_call_creds( print_auth_context(1, client_auth_context); grpc_auth_context_release(client_auth_context); - /* Cannot set creds on the server call object. */ + // Cannot set creds on the server call object. GPR_ASSERT(grpc_call_set_credentials(s, nullptr) != GRPC_CALL_OK); memset(ops, 0, sizeof(ops)); diff --git a/test/core/end2end/tests/call_host_override.cc b/test/core/end2end/tests/call_host_override.cc index 330a810b8dc..2192f3a6565 100644 --- a/test/core/end2end/tests/call_host_override.cc +++ b/test/core/end2end/tests/call_host_override.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/cancel_after_accept.cc b/test/core/end2end/tests/cancel_after_accept.cc index a94d7bef6ca..f70b599e3a8 100644 --- a/test/core/end2end/tests/cancel_after_accept.cc +++ b/test/core/end2end/tests/cancel_after_accept.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -94,7 +94,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel after accept, no payload */ +// Cancel after accept, no payload static void test_cancel_after_accept(grpc_end2end_test_config config, cancellation_mode mode, bool use_service_config) { diff --git a/test/core/end2end/tests/cancel_after_client_done.cc b/test/core/end2end/tests/cancel_after_client_done.cc index 7825cee5ccc..af3d8efc75f 100644 --- a/test/core/end2end/tests/cancel_after_client_done.cc +++ b/test/core/end2end/tests/cancel_after_client_done.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -91,7 +91,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel after accept with a writes closed, no payload */ +// Cancel after accept with a writes closed, no payload static void test_cancel_after_accept_and_writes_closed( grpc_end2end_test_config config, cancellation_mode mode) { grpc_op ops[6]; diff --git a/test/core/end2end/tests/cancel_after_invoke.cc b/test/core/end2end/tests/cancel_after_invoke.cc index 70e3415c412..036c18ab829 100644 --- a/test/core/end2end/tests/cancel_after_invoke.cc +++ b/test/core/end2end/tests/cancel_after_invoke.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -92,7 +92,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel after invoke, no payload */ +// Cancel after invoke, no payload static void test_cancel_after_invoke(grpc_end2end_test_config config, cancellation_mode mode, size_t test_ops) { grpc_op ops[6]; diff --git a/test/core/end2end/tests/cancel_after_round_trip.cc b/test/core/end2end/tests/cancel_after_round_trip.cc index dcd7ec9a7c7..f0307b640e4 100644 --- a/test/core/end2end/tests/cancel_after_round_trip.cc +++ b/test/core/end2end/tests/cancel_after_round_trip.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -94,7 +94,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel after accept, no payload */ +// Cancel after accept, no payload static void test_cancel_after_round_trip(grpc_end2end_test_config config, cancellation_mode mode, bool use_service_config) { diff --git a/test/core/end2end/tests/cancel_before_invoke.cc b/test/core/end2end/tests/cancel_before_invoke.cc index 9ee907cc754..f5d8580dd44 100644 --- a/test/core/end2end/tests/cancel_before_invoke.cc +++ b/test/core/end2end/tests/cancel_before_invoke.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -90,7 +90,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel before invoke */ +// Cancel before invoke static void test_cancel_before_invoke(grpc_end2end_test_config config, size_t test_ops) { grpc_op ops[6]; diff --git a/test/core/end2end/tests/cancel_in_a_vacuum.cc b/test/core/end2end/tests/cancel_in_a_vacuum.cc index 10d4090c743..be363f06d83 100644 --- a/test/core/end2end/tests/cancel_in_a_vacuum.cc +++ b/test/core/end2end/tests/cancel_in_a_vacuum.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Cancel and do nothing */ +// Cancel and do nothing static void test_cancel_in_a_vacuum(grpc_end2end_test_config config, cancellation_mode mode) { grpc_call* c; diff --git a/test/core/end2end/tests/cancel_test_helpers.h b/test/core/end2end/tests/cancel_test_helpers.h index 4616e17b7ac..82324a26d14 100644 --- a/test/core/end2end/tests/cancel_test_helpers.h +++ b/test/core/end2end/tests/cancel_test_helpers.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H #define GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H @@ -40,4 +40,4 @@ static const cancellation_mode cancellation_modes[] = { "Deadline Exceeded"}, }; -#endif /* GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H */ +#endif // GRPC_TEST_CORE_END2END_TESTS_CANCEL_TEST_HELPERS_H diff --git a/test/core/end2end/tests/cancel_with_status.cc b/test/core/end2end/tests/cancel_with_status.cc index 89e8ffc170b..75dca6a6af4 100644 --- a/test/core/end2end/tests/cancel_with_status.cc +++ b/test/core/end2end/tests/cancel_with_status.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/channelz.cc b/test/core/end2end/tests/channelz.cc index 50e55624a2b..0049c192bff 100644 --- a/test/core/end2end/tests/channelz.cc +++ b/test/core/end2end/tests/channelz.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/channel/channelz.h" diff --git a/test/core/end2end/tests/compressed_payload.cc b/test/core/end2end/tests/compressed_payload.cc index 4796065ec3b..40105863b09 100644 --- a/test/core/end2end/tests/compressed_payload.cc +++ b/test/core/end2end/tests/compressed_payload.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -240,16 +240,16 @@ static void request_for_disabled_algorithm( cqv.Expect(tag(103), true); cqv.Verify(); - /* call was cancelled (closed) ... */ + // call was cancelled (closed) ... GPR_ASSERT(was_cancelled != 0); - /* with a certain error */ + // with a certain error GPR_ASSERT(status == expected_error); const char* algo_name = nullptr; GPR_ASSERT(grpc_compression_algorithm_name(algorithm_to_disable, &algo_name)); std::string expected_details = absl::StrFormat("Compression algorithm '%s' is disabled.", algo_name); - /* and we expect a specific reason for it */ + // and we expect a specific reason for it GPR_ASSERT(0 == grpc_slice_str_cmp(details, expected_details.c_str())); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); @@ -642,21 +642,21 @@ static void test_invoke_request_with_compressed_payload_md_override( memset(&identity_compression_override.internal_data, 0, sizeof(identity_compression_override.internal_data)); - /* Channel default NONE (aka IDENTITY), call override to GZIP */ + // Channel default NONE (aka IDENTITY), call override to GZIP request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_1", 0, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_NONE, &gzip_compression_override, false, /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false); - /* Channel default DEFLATE, call override to GZIP */ + // Channel default DEFLATE, call override to GZIP request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_2", 0, GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_GZIP, GRPC_COMPRESS_NONE, &gzip_compression_override, false, /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false); - /* Channel default DEFLATE, call override to NONE (aka IDENTITY) */ + // Channel default DEFLATE, call override to NONE (aka IDENTITY) request_with_payload_template( config, "test_invoke_request_with_compressed_payload_md_override_3", 0, GRPC_COMPRESS_DEFLATE, GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, diff --git a/test/core/end2end/tests/connectivity.cc b/test/core/end2end/tests/connectivity.cc index 4f0279bce01..831b7ed2309 100644 --- a/test/core/end2end/tests/connectivity.cc +++ b/test/core/end2end/tests/connectivity.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -83,37 +83,37 @@ static void test_connectivity(grpc_end2end_test_config config) { gpr_event_wait(&ce.started, gpr_inf_future(GPR_CLOCK_MONOTONIC)); - /* channels should start life in IDLE, and stay there */ + // channels should start life in IDLE, and stay there GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == GRPC_CHANNEL_IDLE); gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100)); GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 0) == GRPC_CHANNEL_IDLE); - /* start watching for a change */ + // start watching for a change gpr_log(GPR_DEBUG, "watching"); grpc_channel_watch_connectivity_state( f.client, GRPC_CHANNEL_IDLE, gpr_now(GPR_CLOCK_MONOTONIC), f.cq, tag(1)); - /* eventually the child thread completion should trigger */ + // eventually the child thread completion should trigger thd.Join(); - /* check that we're still in idle, and start connecting */ + // check that we're still in idle, and start connecting GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == GRPC_CHANNEL_IDLE); - /* start watching for a change */ + // start watching for a change grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, grpc_timeout_seconds_to_deadline(10), f.cq, tag(2)); - /* and now the watch should trigger */ + // and now the watch should trigger cqv.Expect(tag(2), true); cqv.Verify(); state = grpc_channel_check_connectivity_state(f.client, 0); GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || state == GRPC_CHANNEL_CONNECTING); - /* quickly followed by a transition to TRANSIENT_FAILURE */ + // quickly followed by a transition to TRANSIENT_FAILURE grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_CONNECTING, grpc_timeout_seconds_to_deadline(10), f.cq, tag(3)); @@ -125,13 +125,13 @@ static void test_connectivity(grpc_end2end_test_config config) { gpr_log(GPR_DEBUG, "*** STARTING SERVER ***"); - /* now let's bring up a server to connect to */ + // now let's bring up a server to connect to config.init_server(&f, nullptr); gpr_log(GPR_DEBUG, "*** STARTED SERVER ***"); - /* we'll go through some set of transitions (some might be missed), until - READY is reached */ + // we'll go through some set of transitions (some might be missed), until + // READY is reached while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( f.client, state, grpc_timeout_seconds_to_deadline(10), f.cq, tag(4)); @@ -143,8 +143,8 @@ static void test_connectivity(grpc_end2end_test_config config) { state == GRPC_CHANNEL_TRANSIENT_FAILURE); } - /* bring down the server again */ - /* we should go immediately to TRANSIENT_FAILURE */ + // bring down the server again + // we should go immediately to TRANSIENT_FAILURE gpr_log(GPR_DEBUG, "*** SHUTTING DOWN SERVER ***"); grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_READY, @@ -160,7 +160,7 @@ static void test_connectivity(grpc_end2end_test_config config) { GPR_ASSERT(state == GRPC_CHANNEL_TRANSIENT_FAILURE || state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_IDLE); - /* cleanup server */ + // cleanup server grpc_server_destroy(f.server); gpr_log(GPR_DEBUG, "*** SHUTDOWN SERVER ***"); @@ -178,7 +178,7 @@ static void cb_watch_connectivity(grpc_completion_queue_functor* functor, gpr_log(GPR_DEBUG, "cb_watch_connectivity called, verifying"); - /* callback must not have errors */ + // callback must not have errors GPR_ASSERT(success != 0); gpr_event_set(&cb_ctx->finished, reinterpret_cast(1)); @@ -201,35 +201,35 @@ static void test_watch_connectivity_cq_callback( config.init_client(&f, nullptr); - /* start connecting */ + // start connecting grpc_channel_check_connectivity_state(f.client, 1); - /* create the cq callback */ + // create the cq callback cq = grpc_completion_queue_create_for_callback(&cb_shutdown_ctx.functor, nullptr); - /* start watching for any change, cb is immediately called - * and no dead lock should be raised */ + // start watching for any change, cb is immediately called + // and no dead lock should be raised grpc_channel_watch_connectivity_state(f.client, GRPC_CHANNEL_IDLE, grpc_timeout_seconds_to_deadline(3), cq, &cb_ctx.functor); - /* we just check that the callback was executed once notifying a connection - * transition */ + // we just check that the callback was executed once notifying a connection + // transition GPR_ASSERT(gpr_event_wait(&cb_ctx.finished, gpr_inf_future(GPR_CLOCK_MONOTONIC)) != nullptr); - /* shutdown, since shutdown cb might be executed in a background thread - * we actively wait till is executed. */ + // shutdown, since shutdown cb might be executed in a background thread + // we actively wait till is executed. grpc_completion_queue_shutdown(cq); gpr_event_wait(&cb_shutdown_ctx.finished, gpr_inf_future(GPR_CLOCK_MONOTONIC)); - /* cleanup */ + // cleanup grpc_channel_destroy(f.client); grpc_completion_queue_destroy(cq); - /* cq is not used in this test */ + // cq is not used in this test grpc_completion_queue_destroy(f.cq); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/default_host.cc b/test/core/end2end/tests/default_host.cc index b13e6951c8d..066ffd0f638 100644 --- a/test/core/end2end/tests/default_host.cc +++ b/test/core/end2end/tests/default_host.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/disappearing_server.cc b/test/core/end2end/tests/disappearing_server.cc index 16b5d358b5a..2c866faa330 100644 --- a/test/core/end2end/tests/disappearing_server.cc +++ b/test/core/end2end/tests/disappearing_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -129,8 +129,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/, cqv.Expect(tag(101), true); cqv.Verify(); - /* should be able to shut down the server early - - and still complete the request */ + // should be able to shut down the server early + // - and still complete the request grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); memset(ops, 0, sizeof(ops)); @@ -161,13 +161,13 @@ static void do_request_and_shutdown_server(grpc_end2end_test_config /*config*/, cqv.Expect(tag(1), true); cqv.Expect(tag(1000), true); cqv.Verify(); - /* Please refer https://github.com/grpc/grpc/issues/21221 for additional - * details. - * TODO(yashykt@) - The following line should be removeable after C-Core - * correctly handles GOAWAY frames. Internal Reference b/135458602. If this - * test remains flaky even after this, an alternative fix would be to send a - * request when the server is in the shut down state. - */ + // Please refer https://github.com/grpc/grpc/issues/21221 for additional + // details. + // TODO(yashykt@) - The following line should be removeable after C-Core + // correctly handles GOAWAY frames. Internal Reference b/135458602. If this + // test remains flaky even after this, an alternative fix would be to send a + // request when the server is in the shut down state. + // cqv.VerifyEmpty(); GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); @@ -197,7 +197,7 @@ static void disappearing_server_test(grpc_end2end_test_config config) { do_request_and_shutdown_server(config, &f, cqv); - /* now destroy and recreate the server */ + // now destroy and recreate the server config.init_server(&f, nullptr); do_request_and_shutdown_server(config, &f, cqv); @@ -208,9 +208,9 @@ static void disappearing_server_test(grpc_end2end_test_config config) { void disappearing_server(grpc_end2end_test_config config) { GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); -#ifndef GPR_WINDOWS /* b/148110727 for more details */ +#ifndef GPR_WINDOWS // b/148110727 for more details disappearing_server_test(config); -#endif /* GPR_WINDOWS */ +#endif // GPR_WINDOWS } void disappearing_server_pre_init(void) {} diff --git a/test/core/end2end/tests/empty_batch.cc b/test/core/end2end/tests/empty_batch.cc index 2d2fca517d5..192d114c6df 100644 --- a/test/core/end2end/tests/empty_batch.cc +++ b/test/core/end2end/tests/empty_batch.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/end2end/tests/filter_causes_close.cc b/test/core/end2end/tests/filter_causes_close.cc index 4d8d3793f26..e8bdbea900c 100644 --- a/test/core/end2end/tests/filter_causes_close.cc +++ b/test/core/end2end/tests/filter_causes_close.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -99,7 +99,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Simple request via a server filter that always closes the stream.*/ +// Simple request via a server filter that always closes the stream. static void test_request(grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; @@ -192,9 +192,9 @@ static void test_request(grpc_end2end_test_config config) { config.tear_down_data(&f); } -/******************************************************************************* - * Test filter - always closes incoming requests - */ +//****************************************************************************** +// Test filter - always closes incoming requests +// typedef struct { grpc_closure* recv_im_ready; @@ -258,9 +258,9 @@ static const grpc_channel_filter test_filter = { grpc_channel_next_get_info, "filter_causes_close"}; -/******************************************************************************* - * Registration - */ +//****************************************************************************** +// Registration +// void filter_causes_close(grpc_end2end_test_config config) { grpc_core::CoreConfiguration::RunWithSpecialConfiguration( diff --git a/test/core/end2end/tests/filter_context.cc b/test/core/end2end/tests/filter_context.cc index dae3cf3ec9b..dc894f09949 100644 --- a/test/core/end2end/tests/filter_context.cc +++ b/test/core/end2end/tests/filter_context.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include @@ -228,9 +228,9 @@ static void test_request(grpc_end2end_test_config config) { config.tear_down_data(&f); } -/******************************************************************************* - * Test context filter - */ +//****************************************************************************** +// Test context filter +// struct call_data { grpc_call_context_element* context; @@ -284,9 +284,9 @@ static const grpc_channel_filter test_filter = { grpc_channel_next_get_info, "filter_context"}; -/******************************************************************************* - * Registration - */ +//****************************************************************************** +// Registration +// void filter_context(grpc_end2end_test_config config) { grpc_core::CoreConfiguration::RunWithSpecialConfiguration( diff --git a/test/core/end2end/tests/filter_init_fails.cc b/test/core/end2end/tests/filter_init_fails.cc index 14ba95540f1..7665b72c703 100644 --- a/test/core/end2end/tests/filter_init_fails.cc +++ b/test/core/end2end/tests/filter_init_fails.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -420,9 +420,9 @@ static void test_client_subchannel_filter(grpc_end2end_test_config config) { config.tear_down_data(&f); } -/******************************************************************************* - * Test filter - always fails to initialize a call - */ +//****************************************************************************** +// Test filter - always fails to initialize a call +// static grpc_error_handle init_call_elem( grpc_call_element* /*elem*/, const grpc_call_element_args* /*args*/) { @@ -456,9 +456,9 @@ static const grpc_channel_filter test_filter = { destroy_channel_elem, grpc_channel_next_get_info, "filter_init_fails"}; -/******************************************************************************* - * Registration - */ +//****************************************************************************** +// Registration +// static void filter_init_fails_internal(grpc_end2end_test_config config) { gpr_log(GPR_INFO, "Testing SERVER_CHANNEL filter."); diff --git a/test/core/end2end/tests/filter_latency.cc b/test/core/end2end/tests/filter_latency.cc index 35bdaecee88..6bfdaa21ad6 100644 --- a/test/core/end2end/tests/filter_latency.cc +++ b/test/core/end2end/tests/filter_latency.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -253,9 +253,9 @@ static void test_request(grpc_end2end_test_config config) { gpr_mu_unlock(&g_mu); } -/******************************************************************************* - * Test latency filter - */ +//****************************************************************************** +// Test latency filter +// static grpc_error_handle init_call_elem( grpc_call_element* /*elem*/, const grpc_call_element_args* /*args*/) { @@ -303,9 +303,9 @@ static const grpc_channel_filter test_server_filter = { destroy_channel_elem, grpc_channel_next_get_info, "server_filter_latency"}; -/******************************************************************************* - * Registration - */ +//****************************************************************************** +// Registration +// void filter_latency(grpc_end2end_test_config config) { grpc_core::CoreConfiguration::RunWithSpecialConfiguration( diff --git a/test/core/end2end/tests/filter_status_code.cc b/test/core/end2end/tests/filter_status_code.cc index 54bb64e3175..bc79cb1f74e 100644 --- a/test/core/end2end/tests/filter_status_code.cc +++ b/test/core/end2end/tests/filter_status_code.cc @@ -1,28 +1,28 @@ -/* - * - * 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. - * - */ - -/* This test verifies - - * 1) grpc_call_final_info passed to the filters on destroying a call contains - * the proper status. - * 2) If the response has both an HTTP status code and a gRPC status code, then - * we should prefer the gRPC status code as mentioned in - * https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md - */ +// +// +// 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. +// +// + +// This test verifies - +// 1) grpc_call_final_info passed to the filters on destroying a call contains +// the proper status. +// 2) If the response has both an HTTP status code and a gRPC status code, then +// we should prefer the gRPC status code as mentioned in +// https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md +// #include #include @@ -263,9 +263,9 @@ static void test_request(grpc_end2end_test_config config) { gpr_mu_unlock(&g_mu); } -/******************************************************************************* - * Test status_code filter - */ +//****************************************************************************** +// Test status_code filter +// typedef struct final_status_data { grpc_call_stack* call; @@ -280,7 +280,7 @@ static void server_start_transport_stream_op_batch( auto* batch = op->payload->send_initial_metadata.send_initial_metadata; auto* status = batch->get_pointer(grpc_core::HttpStatusMetadata()); if (status != nullptr) { - /* Replace the HTTP status with 404 */ + // Replace the HTTP status with 404 *status = 404; } } @@ -363,9 +363,9 @@ static const grpc_channel_filter test_server_filter = { grpc_channel_next_get_info, "server_filter_status_code"}; -/******************************************************************************* - * Registration - */ +//****************************************************************************** +// Registration +// void filter_status_code(grpc_end2end_test_config config) { grpc_core::CoreConfiguration::RunWithSpecialConfiguration( diff --git a/test/core/end2end/tests/graceful_server_shutdown.cc b/test/core/end2end/tests/graceful_server_shutdown.cc index b1d4492bcd6..ba094ff47cf 100644 --- a/test/core/end2end/tests/graceful_server_shutdown.cc +++ b/test/core/end2end/tests/graceful_server_shutdown.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -145,7 +145,7 @@ static void test_early_server_shutdown_finishes_inflight_calls( cqv.Expect(tag(101), true); cqv.Verify(); - /* shutdown and destroy the server */ + // shutdown and destroy the server grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); cqv.VerifyEmpty(); diff --git a/test/core/end2end/tests/high_initial_seqno.cc b/test/core/end2end/tests/high_initial_seqno.cc index 8675b0a9c78..913b5d4b251 100644 --- a/test/core/end2end/tests/high_initial_seqno.cc +++ b/test/core/end2end/tests/high_initial_seqno.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -193,10 +193,10 @@ static void simple_request_body(grpc_end2end_test_config /*config*/, grpc_call_unref(c); grpc_call_unref(s); - /* TODO(ctiller): this rate limits the test, and it should be removed when - retry has been implemented; until then cross-thread chatter - may result in some requests needing to be cancelled due to - seqno exhaustion. */ + // TODO(ctiller): this rate limits the test, and it should be removed when + // retry has been implemented; until then cross-thread chatter + // may result in some requests needing to be cancelled due to + // seqno exhaustion. cqv.VerifyEmpty(); } diff --git a/test/core/end2end/tests/hpack_size.cc b/test/core/end2end/tests/hpack_size.cc index 440eca13cbd..30050ee755c 100644 --- a/test/core/end2end/tests/hpack_size.cc +++ b/test/core/end2end/tests/hpack_size.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -89,91 +89,91 @@ const char* hobbits[][2] = { {"Isengrim", "Took"}, {"Isengrim", "Took"}, {"Isumbras", "Took"}, {"Isumbras", "Took"}, {"Jolly", "Cotton"}, - /* - {"Lalia", "Took"}, - {"Largo", "Baggins"}, - {"Laura", "Baggins"}, - {"Lily", "Goodbody"}, - {"Lily", "Cotton"}, - {"Linda", "Proudfoot"}, - {"Lobelia", "Sackville-Baggins"}, - {"Longo", "Baggins"}, - {"Lotho", "Sackville-Baggins"}, - {"Madoc", "Brandybuck"}, - {"Malva", "Brandybuck"}, - {"Marigold", "Cotton"}, - {"Marmadas", "Brandybuck"}, - {"Marmadoc", "Brandybuck"}, - {"Marroc", "Brandybuck"}, - {"May", "Gamgee"}, - {"Melilot", "Brandybuck"}, - {"Menegilda", "Brandybuck"}, - {"Mentha", "Brandybuck"}, - {"Meriadoc", "Brandybuck"}, - {"Merimac", "Brandybuck"}, - {"Merimas", "Brandybuck"}, - {"Merry", "Gardner"}, - {"Milo", "Burrows"}, - {"Mimosa", "Baggins"}, - {"Minto", "Burrows"}, - {"Mirabella", "Brandybuck"}, - {"Moro", "Burrows"}, - {"Mosco", "Burrows"}, - {"Mungo", "Baggins"}, - {"Myrtle", "Burrows"}, - {"Odo", "Proudfoot"}, - {"Odovacar", "Bolger"}, - {"Olo", "Proudfoot"}, - {"Orgulas", "Brandybuck"}, - {"Otho", "Sackville-Baggins"}, - {"Paladin", "Took"}, - {"Pansy", "Bolger"}, - {"Pearl", "Took"}, - {"Peony", "Burrows"}, - {"Peregrin", "Took"}, - {"Pervinca", "Took"}, - {"Pimpernel", "Took"}, - {"Pippin", "Gardner"}, - {"Polo", "Baggins"}, - {"Ponto", "Baggins"}, - {"Porto", "Baggins"}, - {"Posco", "Baggins"}, - {"Poppy", "Bolger"}, - {"Primrose", "Gardner"}, - {"Primula", "Baggins"}, - {"Prisca", "Bolger"}, - {"Reginard", "Took"}, - {"Robin", "Smallburrow"}, - {"Robin", "Gardner"}, - {"Rorimac", "Brandybuck"}, - {"Rosa", "Took"}, - {"Rosamunda", "Bolger"}, - {"Rose", "Gardner"}, - {"Ruby", "Baggins"}, - {"Ruby", "Gardner"}, - {"Rudigar", "Bolger"}, - {"Rufus", "Burrows"}, - {"Sadoc", "Brandybuck"}, - {"Salvia", "Bolger"}, - {"Samwise", "Gamgee"}, - {"Sancho", "Proudfoot"}, - {"Saradas", "Brandybuck"}, - {"Saradoc", "Brandybuck"}, - {"Seredic", "Brandybuck"}, - {"Sigismond", "Took"}, - {"Smeagol", "Gollum"}, - {"Tanta", "Baggins"}, - {"Ted", "Sandyman"}, - {"Tobold", "Hornblower"}, - {"Togo", "Goodbody"}, - {"Tolman", "Cotton"}, - {"Tolman", "Gardner"}, - {"Widow", "Rumble"}, - {"Wilcome", "Cotton"}, - {"Wilcome", "Cotton"}, - {"Wilibald", "Bolger"}, - {"Will", "Whitfoot"}, - {"Wiseman", "Gamwich"}*/ + // + //{"Lalia", "Took"}, + //{"Largo", "Baggins"}, + //{"Laura", "Baggins"}, + //{"Lily", "Goodbody"}, + //{"Lily", "Cotton"}, + //{"Linda", "Proudfoot"}, + //{"Lobelia", "Sackville-Baggins"}, + //{"Longo", "Baggins"}, + //{"Lotho", "Sackville-Baggins"}, + //{"Madoc", "Brandybuck"}, + //{"Malva", "Brandybuck"}, + //{"Marigold", "Cotton"}, + //{"Marmadas", "Brandybuck"}, + //{"Marmadoc", "Brandybuck"}, + //{"Marroc", "Brandybuck"}, + //{"May", "Gamgee"}, + //{"Melilot", "Brandybuck"}, + //{"Menegilda", "Brandybuck"}, + //{"Mentha", "Brandybuck"}, + //{"Meriadoc", "Brandybuck"}, + //{"Merimac", "Brandybuck"}, + //{"Merimas", "Brandybuck"}, + //{"Merry", "Gardner"}, + //{"Milo", "Burrows"}, + //{"Mimosa", "Baggins"}, + //{"Minto", "Burrows"}, + //{"Mirabella", "Brandybuck"}, + //{"Moro", "Burrows"}, + //{"Mosco", "Burrows"}, + //{"Mungo", "Baggins"}, + //{"Myrtle", "Burrows"}, + //{"Odo", "Proudfoot"}, + //{"Odovacar", "Bolger"}, + //{"Olo", "Proudfoot"}, + //{"Orgulas", "Brandybuck"}, + //{"Otho", "Sackville-Baggins"}, + //{"Paladin", "Took"}, + //{"Pansy", "Bolger"}, + //{"Pearl", "Took"}, + //{"Peony", "Burrows"}, + //{"Peregrin", "Took"}, + //{"Pervinca", "Took"}, + //{"Pimpernel", "Took"}, + //{"Pippin", "Gardner"}, + //{"Polo", "Baggins"}, + //{"Ponto", "Baggins"}, + //{"Porto", "Baggins"}, + //{"Posco", "Baggins"}, + //{"Poppy", "Bolger"}, + //{"Primrose", "Gardner"}, + //{"Primula", "Baggins"}, + //{"Prisca", "Bolger"}, + //{"Reginard", "Took"}, + //{"Robin", "Smallburrow"}, + //{"Robin", "Gardner"}, + //{"Rorimac", "Brandybuck"}, + //{"Rosa", "Took"}, + //{"Rosamunda", "Bolger"}, + //{"Rose", "Gardner"}, + //{"Ruby", "Baggins"}, + //{"Ruby", "Gardner"}, + //{"Rudigar", "Bolger"}, + //{"Rufus", "Burrows"}, + //{"Sadoc", "Brandybuck"}, + //{"Salvia", "Bolger"}, + //{"Samwise", "Gamgee"}, + //{"Sancho", "Proudfoot"}, + //{"Saradas", "Brandybuck"}, + //{"Saradoc", "Brandybuck"}, + //{"Seredic", "Brandybuck"}, + //{"Sigismond", "Took"}, + //{"Smeagol", "Gollum"}, + //{"Tanta", "Baggins"}, + //{"Ted", "Sandyman"}, + //{"Tobold", "Hornblower"}, + //{"Togo", "Goodbody"}, + //{"Tolman", "Cotton"}, + //{"Tolman", "Gardner"}, + //{"Widow", "Rumble"}, + //{"Wilcome", "Cotton"}, + //{"Wilcome", "Cotton"}, + //{"Wilibald", "Bolger"}, + //{"Will", "Whitfoot"}, + //{"Wiseman", "Gamwich"} }; const char* dragons[] = {"Ancalagon", "Glaurung", "Scatha", diff --git a/test/core/end2end/tests/invoke_large_request.cc b/test/core/end2end/tests/invoke_large_request.cc index 5c92998759e..c1c853dca10 100644 --- a/test/core/end2end/tests/invoke_large_request.cc +++ b/test/core/end2end/tests/invoke_large_request.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/keepalive_timeout.cc b/test/core/end2end/tests/keepalive_timeout.cc index 4950a0d3abd..0e01cc1f462 100644 --- a/test/core/end2end/tests/keepalive_timeout.cc +++ b/test/core/end2end/tests/keepalive_timeout.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -96,8 +96,8 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client sends a request, then waits for the keepalive watchdog timeouts before - * returning status. */ +// Client sends a request, then waits for the keepalive watchdog timeouts before +// returning status. static void test_keepalive_timeout(grpc_end2end_test_config config) { grpc_call* c; @@ -125,7 +125,7 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { grpc_call_error error; grpc_slice details; - /* Disable ping ack to trigger the keepalive timeout */ + // Disable ping ack to trigger the keepalive timeout grpc_set_disable_ping_ack(true); gpr_timespec deadline = five_seconds_from_now(); @@ -172,14 +172,14 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { config.tear_down_data(&f); } -/* Verify that reads reset the keepalive ping timer. The client sends 30 pings - * with a sleep of 10ms in between. It has a configured keepalive timer of - * 200ms. In the success case, each ping ack should reset the keepalive timer so - * that the keepalive ping is never sent. */ +// Verify that reads reset the keepalive ping timer. The client sends 30 pings +// with a sleep of 10ms in between. It has a configured keepalive timer of +// 200ms. In the success case, each ping ack should reset the keepalive timer so +// that the keepalive ping is never sent. static void test_read_delays_keepalive(grpc_end2end_test_config config) { #ifdef GRPC_POSIX_SOCKET grpc_core::UniquePtr poller = GPR_GLOBAL_CONFIG_GET(grpc_poll_strategy); - /* It is hard to get the timing right for the polling engine poll. */ + // It is hard to get the timing right for the polling engine poll. if ((0 == strcmp(poller.get(), "poll"))) { return; } @@ -199,7 +199,7 @@ static void test_read_delays_keepalive(grpc_end2end_test_config config) { keepalive_arg_elems}; grpc_end2end_test_fixture f = begin_test(config, "test_read_delays_keepalive", &keepalive_args, nullptr); - /* Disable ping ack to trigger the keepalive timeout */ + // Disable ping ack to trigger the keepalive timeout grpc_set_disable_ping_ack(true); grpc_call* c; grpc_call* s; @@ -332,7 +332,7 @@ static void test_read_delays_keepalive(grpc_end2end_test_config config) { grpc_byte_buffer_destroy(response_payload); grpc_byte_buffer_destroy(request_payload_recv); grpc_byte_buffer_destroy(response_payload_recv); - /* Sleep for a short interval to check if the client sends any pings */ + // Sleep for a short interval to check if the client sends any pings gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(kPingIntervalMS)); } diff --git a/test/core/end2end/tests/large_metadata.cc b/test/core/end2end/tests/large_metadata.cc index f10f28ba38c..92405377cc5 100644 --- a/test/core/end2end/tests/large_metadata.cc +++ b/test/core/end2end/tests/large_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/max_concurrent_streams.cc b/test/core/end2end/tests/max_concurrent_streams.cc index 36b6397b159..702c67a1272 100644 --- a/test/core/end2end/tests/max_concurrent_streams.cc +++ b/test/core/end2end/tests/max_concurrent_streams.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -235,14 +235,14 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { grpc_metadata_array_init(&trailing_metadata_recv2); grpc_call_details_init(&call_details); - /* perform a ping-pong to ensure that settings have had a chance to round - trip */ + // perform a ping-pong to ensure that settings have had a chance to round + // trip simple_request_body(config, f); - /* perform another one to make sure that the one stream case still works */ + // perform another one to make sure that the one stream case still works simple_request_body(config, f); - /* start two requests - ensuring that the second is not accepted until - the first completes */ + // start two requests - ensuring that the second is not accepted until + // the first completes deadline = n_seconds_from_now(1000); c1 = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, grpc_slice_from_static_string("/alpha"), @@ -339,10 +339,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { } else { GPR_ASSERT(!got_client_start); GPR_ASSERT(ev.tag == tag(301) || ev.tag == tag(401)); - /* The /alpha or /beta calls started above could be invoked (but NOT - * both); - * check this here */ - /* We'll get tag 303 or 403, we want 300, 400 */ + // The /alpha or /beta calls started above could be invoked (but NOT + // both); + // check this here + // We'll get tag 303 or 403, we want 300, 400 live_call = (static_cast(reinterpret_cast(ev.tag))) - 1; got_client_start = 1; } @@ -375,7 +375,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) { cqv.Expect(tag(102), true); cqv.Expect(tag(live_call + 2), true); - /* first request is finished, we should be able to start the second */ + // first request is finished, we should be able to start the second live_call = (live_call == 300) ? 400 : 300; cqv.Expect(tag(live_call + 1), true); cqv.Verify(); @@ -475,14 +475,14 @@ static void test_max_concurrent_streams_with_timeout_on_first( grpc_metadata_array_init(&trailing_metadata_recv2); grpc_call_details_init(&call_details); - /* perform a ping-pong to ensure that settings have had a chance to round - trip */ + // perform a ping-pong to ensure that settings have had a chance to round + // trip simple_request_body(config, f); - /* perform another one to make sure that the one stream case still works */ + // perform another one to make sure that the one stream case still works simple_request_body(config, f); - /* start two requests - ensuring that the second is not accepted until - the first completes */ + // start two requests - ensuring that the second is not accepted until + // the first completes c1 = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, grpc_slice_from_static_string("/alpha"), nullptr, n_seconds_from_now(3), nullptr); @@ -575,7 +575,7 @@ static void test_max_concurrent_streams_with_timeout_on_first( &request_metadata_recv, f.cq, f.cq, tag(201))); cqv.Expect(tag(302), true); - /* first request is finished, we should be able to start the second */ + // first request is finished, we should be able to start the second cqv.Expect(tag(401), true); cqv.Expect(tag(201), true); cqv.Verify(); @@ -667,15 +667,15 @@ static void test_max_concurrent_streams_with_timeout_on_second( grpc_metadata_array_init(&trailing_metadata_recv2); grpc_call_details_init(&call_details); - /* perform a ping-pong to ensure that settings have had a chance to round - trip */ + // perform a ping-pong to ensure that settings have had a chance to round + // trip simple_request_body(config, f); - /* perform another one to make sure that the one stream case still works */ + // perform another one to make sure that the one stream case still works simple_request_body(config, f); - /* start two requests - ensuring that the second is not accepted until - the first completes , and the second request will timeout in the - concurrent_list */ + // start two requests - ensuring that the second is not accepted until + // the first completes , and the second request will timeout in the + // concurrent_list c1 = grpc_channel_create_call(f.client, nullptr, GRPC_PROPAGATE_DEFAULTS, f.cq, grpc_slice_from_static_string("/alpha"), nullptr, n_seconds_from_now(1000), nullptr); @@ -761,16 +761,16 @@ static void test_max_concurrent_streams_with_timeout_on_second( tag(402), nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* the second request is time out*/ + // the second request is time out cqv.Expect(tag(401), false); cqv.Expect(tag(402), true); cqv.Verify(); - /* second request is finished because of time out, so destroy the second call - */ + // second request is finished because of time out, so destroy the second call + // grpc_call_unref(c2); - /* now reply the first call */ + // now reply the first call memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; diff --git a/test/core/end2end/tests/max_connection_age.cc b/test/core/end2end/tests/max_connection_age.cc index 86031470861..02f6d959b9c 100644 --- a/test/core/end2end/tests/max_connection_age.cc +++ b/test/core/end2end/tests/max_connection_age.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -41,15 +41,15 @@ #define MAX_CONNECTION_AGE_JITTER_MULTIPLIER 1.1 #define CALL_DEADLINE_S 30 -/* The amount of time we wait for the connection to time out, but after it the - connection should not use up its grace period. It should be a number between - MAX_CONNECTION_AGE_MS and MAX_CONNECTION_AGE_MS + - MAX_CONNECTION_AGE_GRACE_MS */ +// The amount of time we wait for the connection to time out, but after it the +// connection should not use up its grace period. It should be a number between +// MAX_CONNECTION_AGE_MS and MAX_CONNECTION_AGE_MS + +// MAX_CONNECTION_AGE_GRACE_MS #define CQ_MAX_CONNECTION_AGE_WAIT_TIME_S 1 -/* The amount of time we wait after the connection reaches its max age, it - should be shorter than CALL_DEADLINE_S - CQ_MAX_CONNECTION_AGE_WAIT_TIME_S */ +// The amount of time we wait after the connection reaches its max age, it +// should be shorter than CALL_DEADLINE_S - CQ_MAX_CONNECTION_AGE_WAIT_TIME_S #define CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S 2 -/* The grace period for the test to observe the channel shutdown process */ +// The grace period for the test to observe the channel shutdown process #define IMMEDIATE_SHUTDOWN_GRACE_TIME_MS 3000 static void* tag(intptr_t t) { return reinterpret_cast(t); } @@ -165,12 +165,12 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { MAX_CONNECTION_AGE_JITTER_MULTIPLIER) + MAX_CONNECTION_AGE_GRACE_MS + IMMEDIATE_SHUTDOWN_GRACE_TIME_MS); - /* Wait for the channel to reach its max age */ + // Wait for the channel to reach its max age cqv->VerifyEmpty( grpc_core::Duration::Seconds(CQ_MAX_CONNECTION_AGE_WAIT_TIME_S)); - /* After the channel reaches its max age, we still do nothing here. And wait - for it to use up its max age grace period. */ + // After the channel reaches its max age, we still do nothing here. And wait + // for it to use up its max age grace period. cqv->Expect(tag(1), true); cqv->Verify(); @@ -209,8 +209,8 @@ static void test_max_age_forcibly_close(grpc_end2end_test_config config) { grpc_call_unref(s); - /* The connection should be closed immediately after the max age grace period, - the in-progress RPC should fail. */ + // The connection should be closed immediately after the max age grace period, + // the in-progress RPC should fail. GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); GPR_ASSERT(was_cancelled == 1); @@ -303,12 +303,12 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { cqv->Expect(tag(101), true); cqv->Verify(); - /* Wait for the channel to reach its max age */ + // Wait for the channel to reach its max age cqv->VerifyEmpty( grpc_core::Duration::Seconds(CQ_MAX_CONNECTION_AGE_WAIT_TIME_S)); - /* The connection is shutting down gracefully. In-progress rpc should not be - closed, hence the completion queue should see nothing here. */ + // The connection is shutting down gracefully. In-progress rpc should not be + // closed, hence the completion queue should see nothing here. cqv->VerifyEmpty( grpc_core::Duration::Seconds(CQ_MAX_CONNECTION_AGE_GRACE_WAIT_TIME_S)); @@ -346,8 +346,8 @@ static void test_max_age_gracefully_close(grpc_end2end_test_config config) { grpc_call_unref(s); - /* The connection is closed gracefully with goaway, the rpc should still be - completed. */ + // The connection is closed gracefully with goaway, the rpc should still be + // completed. GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED); GPR_ASSERT(0 == grpc_slice_str_cmp(details, "xyz")); GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); diff --git a/test/core/end2end/tests/max_connection_idle.cc b/test/core/end2end/tests/max_connection_idle.cc index a6d961538ec..f66716185be 100644 --- a/test/core/end2end/tests/max_connection_idle.cc +++ b/test/core/end2end/tests/max_connection_idle.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -188,11 +188,11 @@ static void test_max_connection_idle(grpc_end2end_test_config config) { config.init_client(&f, client_args.get()); config.init_server(&f, &server_args); - /* check that we're still in idle, and start connecting */ + // check that we're still in idle, and start connecting GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == GRPC_CHANNEL_IDLE); - /* we'll go through some set of transitions (some might be missed), until - READY is reached */ + // we'll go through some set of transitions (some might be missed), until + // READY is reached while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( f.client, state, grpc_timeout_seconds_to_deadline(10), f.cq, tag(99)); @@ -204,10 +204,10 @@ static void test_max_connection_idle(grpc_end2end_test_config config) { state == GRPC_CHANNEL_TRANSIENT_FAILURE); } - /* Use a simple request to cancel and reset the max idle timer */ + // Use a simple request to cancel and reset the max idle timer simple_request_body(config, &f); - /* wait for the channel to reach its maximum idle time */ + // wait for the channel to reach its maximum idle time grpc_channel_watch_connectivity_state( f.client, GRPC_CHANNEL_READY, gpr_time_add(grpc_timeout_milliseconds_to_deadline(3000), diff --git a/test/core/end2end/tests/max_message_length.cc b/test/core/end2end/tests/max_message_length.cc index 0dfc6cd44b6..d8f039d0bee 100644 --- a/test/core/end2end/tests/max_message_length.cc +++ b/test/core/end2end/tests/max_message_length.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -790,8 +790,8 @@ void max_message_length(grpc_end2end_test_config config) { test_max_message_length_on_response(config, false /* send_limit */, true /* use_service_config */, true /* use_string_json_value */); - /* The following tests are not useful for inproc transport and do not work - * with our simple proxy. */ + // The following tests are not useful for inproc transport and do not work + // with our simple proxy. if (strcmp(config.name, "inproc") != 0 && (config.feature_mask & FEATURE_MASK_SUPPORTS_REQUEST_PROXYING) == 0) { test_max_receive_message_length_on_compressed_request(config); diff --git a/test/core/end2end/tests/negative_deadline.cc b/test/core/end2end/tests/negative_deadline.cc index b7a747e472c..df601a7e6a4 100644 --- a/test/core/end2end/tests/negative_deadline.cc +++ b/test/core/end2end/tests/negative_deadline.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/no_logging.cc b/test/core/end2end/tests/no_logging.cc index 7cda412be67..771e04d748f 100644 --- a/test/core/end2end/tests/no_logging.cc +++ b/test/core/end2end/tests/no_logging.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/end2end/tests/no_op.cc b/test/core/end2end/tests/no_op.cc index 9f94cd262fd..e10d277aec7 100644 --- a/test/core/end2end/tests/no_op.cc +++ b/test/core/end2end/tests/no_op.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/end2end/tests/payload.cc b/test/core/end2end/tests/payload.cc index dc9a34102f6..35908363791 100644 --- a/test/core/end2end/tests/payload.cc +++ b/test/core/end2end/tests/payload.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -90,8 +90,8 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. - */ +// Creates and returns a grpc_slice containing random alphanumeric characters. +// static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; @@ -109,9 +109,9 @@ static grpc_slice generate_random_slice() { static void request_response_with_payload(grpc_end2end_test_config /*config*/, grpc_end2end_test_fixture f) { - /* Create large request and response bodies. These are big enough to require - * multiple round trips to deliver to the peer, and their exact contents of - * will be verified on completion. */ + // Create large request and response bodies. These are big enough to require + // multiple round trips to deliver to the peer, and their exact contents of + // will be verified on completion. grpc_slice request_payload_slice = generate_random_slice(); grpc_slice response_payload_slice = generate_random_slice(); @@ -260,8 +260,8 @@ static void request_response_with_payload(grpc_end2end_test_config /*config*/, grpc_byte_buffer_destroy(response_payload_recv); } -/* Client sends a request with payload, server reads then returns a response - payload and status. */ +// Client sends a request with payload, server reads then returns a response +// payload and status. static void test_invoke_request_response_with_payload( grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test( diff --git a/test/core/end2end/tests/ping.cc b/test/core/end2end/tests/ping.cc index 46f72aa1565..831725a5860 100644 --- a/test/core/end2end/tests/ping.cc +++ b/test/core/end2end/tests/ping.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -61,11 +61,11 @@ static void test_ping(grpc_end2end_test_config config, grpc_channel_ping(f.client, f.cq, tag(0), nullptr); cqv.Expect(tag(0), false); - /* check that we're still in idle, and start connecting */ + // check that we're still in idle, and start connecting GPR_ASSERT(grpc_channel_check_connectivity_state(f.client, 1) == GRPC_CHANNEL_IDLE); - /* we'll go through some set of transitions (some might be missed), until - READY is reached */ + // we'll go through some set of transitions (some might be missed), until + // READY is reached while (state != GRPC_CHANNEL_READY) { grpc_channel_watch_connectivity_state( f.client, state, @@ -91,7 +91,7 @@ static void test_ping(grpc_end2end_test_config config, cqv.Expect(tag(0xdead), true); cqv.Verify(); - /* cleanup server */ + // cleanup server grpc_server_destroy(f.server); grpc_channel_destroy(f.client); diff --git a/test/core/end2end/tests/ping_pong_streaming.cc b/test/core/end2end/tests/ping_pong_streaming.cc index 30ace3f6c28..ff8c43736cb 100644 --- a/test/core/end2end/tests/ping_pong_streaming.cc +++ b/test/core/end2end/tests/ping_pong_streaming.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client pings and server pongs. Repeat messages rounds before finishing. */ +// Client pings and server pongs. Repeat messages rounds before finishing. static void test_pingpong_streaming(grpc_end2end_test_config config, int messages) { grpc_end2end_test_fixture f = diff --git a/test/core/end2end/tests/proxy_auth.cc b/test/core/end2end/tests/proxy_auth.cc index cf4a8c1c67e..54dcb772446 100644 --- a/test/core/end2end/tests/proxy_auth.cc +++ b/test/core/end2end/tests/proxy_auth.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -208,7 +208,7 @@ static void simple_request_body(grpc_end2end_test_config /*config*/, } static void test_invoke_proxy_auth(grpc_end2end_test_config config) { - /* Indicate that the proxy requires user auth */ + // Indicate that the proxy requires user auth grpc_arg client_arg; client_arg.type = GRPC_ARG_STRING; client_arg.key = const_cast(GRPC_ARG_HTTP_PROXY_AUTH_CREDS); diff --git a/test/core/end2end/tests/registered_call.cc b/test/core/end2end/tests/registered_call.cc index f5f806c6efb..f547f8b07ad 100644 --- a/test/core/end2end/tests/registered_call.cc +++ b/test/core/end2end/tests/registered_call.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/request_with_flags.cc b/test/core/end2end/tests/request_with_flags.cc index b8a37ab7eb1..94557ddc153 100644 --- a/test/core/end2end/tests/request_with_flags.cc +++ b/test/core/end2end/tests/request_with_flags.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -196,8 +196,8 @@ void request_with_flags(grpc_end2end_test_config config) { uint32_t flags_for_op[GRPC_OP_RECV_CLOSE_ON_SERVER + 1]; { - /* check that all grpc_op_types fail when their flag value is set to an - * invalid value */ + // check that all grpc_op_types fail when their flag value is set to an + // invalid value int indices[] = {GRPC_OP_SEND_INITIAL_METADATA, GRPC_OP_SEND_MESSAGE, GRPC_OP_SEND_CLOSE_FROM_CLIENT, GRPC_OP_RECV_INITIAL_METADATA, @@ -210,7 +210,7 @@ void request_with_flags(grpc_end2end_test_config config) { } } { - /* check valid operation with allowed flags for GRPC_OP_SEND_BUFFER */ + // check valid operation with allowed flags for GRPC_OP_SEND_BUFFER uint32_t flags[] = {GRPC_WRITE_BUFFER_HINT, GRPC_WRITE_NO_COMPRESS, GRPC_WRITE_INTERNAL_COMPRESS}; for (i = 0; i < GPR_ARRAY_SIZE(flags); ++i) { diff --git a/test/core/end2end/tests/request_with_payload.cc b/test/core/end2end/tests/request_with_payload.cc index 045571bd6cd..2b390d931c2 100644 --- a/test/core/end2end/tests/request_with_payload.cc +++ b/test/core/end2end/tests/request_with_payload.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client sends a request with payload, server reads then returns status. */ +// Client sends a request with payload, server reads then returns status. static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; diff --git a/test/core/end2end/tests/resource_quota_server.cc b/test/core/end2end/tests/resource_quota_server.cc index 80b15d3260d..e400109a48d 100644 --- a/test/core/end2end/tests/resource_quota_server.cc +++ b/test/core/end2end/tests/resource_quota_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -89,8 +89,8 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Creates and returns a grpc_slice containing random alphanumeric characters. - */ +// Creates and returns a grpc_slice containing random alphanumeric characters. +// static grpc_slice generate_random_slice() { size_t i; static const char chars[] = "abcdefghijklmnopqrstuvwxyz1234567890"; @@ -127,9 +127,9 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_end2end_test_fixture f = begin_test(config, "resource_quota_server", nullptr, &args); - /* Create large request and response bodies. These are big enough to require - * multiple round trips to deliver to the peer, and their exact contents of - * will be verified on completion. */ + // Create large request and response bodies. These are big enough to require + // multiple round trips to deliver to the peer, and their exact contents of + // will be verified on completion. grpc_slice request_payload_slice = generate_random_slice(); grpc_call** client_calls = @@ -241,9 +241,9 @@ void resource_quota_server(grpc_end2end_test_config config) { int ev_tag = static_cast(reinterpret_cast(ev.tag)); if (ev_tag < CLIENT_BASE_TAG) { - abort(); /* illegal tag */ + abort(); // illegal tag } else if (ev_tag < SERVER_START_BASE_TAG) { - /* client call finished */ + // client call finished int call_id = ev_tag - CLIENT_BASE_TAG; GPR_ASSERT(call_id >= 0); GPR_ASSERT(call_id < NUM_CALLS); @@ -273,7 +273,7 @@ void resource_quota_server(grpc_end2end_test_config config) { pending_client_calls--; } else if (ev_tag < SERVER_RECV_BASE_TAG) { - /* new incoming call to the server */ + // new incoming call to the server int call_id = ev_tag - SERVER_START_BASE_TAG; GPR_ASSERT(call_id >= 0); GPR_ASSERT(call_id < NUM_CALLS); @@ -302,7 +302,7 @@ void resource_quota_server(grpc_end2end_test_config config) { grpc_call_details_destroy(&call_details[call_id]); grpc_metadata_array_destroy(&request_metadata_recv[call_id]); } else if (ev_tag < SERVER_END_BASE_TAG) { - /* finished read on the server */ + // finished read on the server int call_id = ev_tag - SERVER_RECV_BASE_TAG; GPR_ASSERT(call_id >= 0); GPR_ASSERT(call_id < NUM_CALLS); diff --git a/test/core/end2end/tests/retry.cc b/test/core/end2end/tests/retry.cc index b070d967e0a..e253607ddc8 100644 --- a/test/core/end2end/tests/retry.cc +++ b/test/core/end2end/tests/retry.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc index 7b559806f21..da730fa6377 100644 --- a/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc +++ b/test/core/end2end/tests/retry_cancel_with_multiple_send_batches.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_cancellation.cc b/test/core/end2end/tests/retry_cancellation.cc index 0f47508a34b..1f04ed69b1a 100644 --- a/test/core/end2end/tests/retry_cancellation.cc +++ b/test/core/end2end/tests/retry_cancellation.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_disabled.cc b/test/core/end2end/tests/retry_disabled.cc index bad0492da0e..32216ac129c 100644 --- a/test/core/end2end/tests/retry_disabled.cc +++ b/test/core/end2end/tests/retry_disabled.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc index 47fb390e817..23bc66cbbb6 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_initial_batch.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc index 37195915ba8..06c70a22c49 100644 --- a/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc +++ b/test/core/end2end/tests/retry_exceeds_buffer_size_in_subsequent_batch.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_non_retriable_status.cc b/test/core/end2end/tests/retry_non_retriable_status.cc index 5bfb7090a09..cda6f5f4601 100644 --- a/test/core/end2end/tests/retry_non_retriable_status.cc +++ b/test/core/end2end/tests/retry_non_retriable_status.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc index ad827cada38..b2776df823d 100644 --- a/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc +++ b/test/core/end2end/tests/retry_non_retriable_status_before_recv_trailing_metadata_started.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/test/core/end2end/tests/retry_recv_initial_metadata.cc b/test/core/end2end/tests/retry_recv_initial_metadata.cc index 683582cef41..2229734f34b 100644 --- a/test/core/end2end/tests/retry_recv_initial_metadata.cc +++ b/test/core/end2end/tests/retry_recv_initial_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_recv_message.cc b/test/core/end2end/tests/retry_recv_message.cc index ccfb9e0cae4..c04914a2557 100644 --- a/test/core/end2end/tests/retry_recv_message.cc +++ b/test/core/end2end/tests/retry_recv_message.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_recv_message_replay.cc b/test/core/end2end/tests/retry_recv_message_replay.cc index b53da858226..4914131982a 100644 --- a/test/core/end2end/tests/retry_recv_message_replay.cc +++ b/test/core/end2end/tests/retry_recv_message_replay.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc index ab982a3b313..98e229eef6e 100644 --- a/test/core/end2end/tests/retry_send_initial_metadata_refs.cc +++ b/test/core/end2end/tests/retry_send_initial_metadata_refs.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_send_op_fails.cc b/test/core/end2end/tests/retry_send_op_fails.cc index 2dddbf1a21e..7f252ca2d78 100644 --- a/test/core/end2end/tests/retry_send_op_fails.cc +++ b/test/core/end2end/tests/retry_send_op_fails.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_server_pushback_delay.cc b/test/core/end2end/tests/retry_server_pushback_delay.cc index 7cb6ad24b69..c3a89a6a850 100644 --- a/test/core/end2end/tests/retry_server_pushback_delay.cc +++ b/test/core/end2end/tests/retry_server_pushback_delay.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_server_pushback_disabled.cc b/test/core/end2end/tests/retry_server_pushback_disabled.cc index e002a89420d..fa37385d1b8 100644 --- a/test/core/end2end/tests/retry_server_pushback_disabled.cc +++ b/test/core/end2end/tests/retry_server_pushback_disabled.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_streaming.cc b/test/core/end2end/tests/retry_streaming.cc index 4a3b539de1a..a4c95107bcb 100644 --- a/test/core/end2end/tests/retry_streaming.cc +++ b/test/core/end2end/tests/retry_streaming.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_streaming_after_commit.cc b/test/core/end2end/tests/retry_streaming_after_commit.cc index 66f6dc1031f..323c4ae13bc 100644 --- a/test/core/end2end/tests/retry_streaming_after_commit.cc +++ b/test/core/end2end/tests/retry_streaming_after_commit.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc index c31030aabd5..73ca2f92924 100644 --- a/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc +++ b/test/core/end2end/tests/retry_streaming_succeeds_before_replay_finished.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_throttled.cc b/test/core/end2end/tests/retry_throttled.cc index d259ef17dbc..416bf0ccf53 100644 --- a/test/core/end2end/tests/retry_throttled.cc +++ b/test/core/end2end/tests/retry_throttled.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/retry_too_many_attempts.cc b/test/core/end2end/tests/retry_too_many_attempts.cc index 8471a26c9a1..1aab106b7b6 100644 --- a/test/core/end2end/tests/retry_too_many_attempts.cc +++ b/test/core/end2end/tests/retry_too_many_attempts.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/core/end2end/tests/server_finishes_request.cc b/test/core/end2end/tests/server_finishes_request.cc index 74693c39c86..8fa3ae15373 100644 --- a/test/core/end2end/tests/server_finishes_request.cc +++ b/test/core/end2end/tests/server_finishes_request.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/server_streaming.cc b/test/core/end2end/tests/server_streaming.cc index 955cbd0532b..f5b4e942918 100644 --- a/test/core/end2end/tests/server_streaming.cc +++ b/test/core/end2end/tests/server_streaming.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 #include @@ -89,9 +89,9 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client requests status along with the initial metadata. Server streams - * messages and ends with a non-OK status. Client reads after server is done - * writing, and expects to get the status after the messages. */ +// Client requests status along with the initial metadata. Server streams +// messages and ends with a non-OK status. Client reads after server is done +// writing, and expects to get the status after the messages. static void test_server_streaming(grpc_end2end_test_config config, int num_messages) { grpc_end2end_test_fixture f = diff --git a/test/core/end2end/tests/shutdown_finishes_calls.cc b/test/core/end2end/tests/shutdown_finishes_calls.cc index b7820584e35..8e4e3df26b5 100644 --- a/test/core/end2end/tests/shutdown_finishes_calls.cc +++ b/test/core/end2end/tests/shutdown_finishes_calls.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -149,14 +149,14 @@ static void test_early_server_shutdown_finishes_inflight_calls( nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* Make sure we don't shutdown the server while HTTP/2 PING frames are still - * being exchanged on the newly established connection. It can lead to - * failures when testing with HTTP proxy. See - * https://github.com/grpc/grpc/issues/14471 - */ + // Make sure we don't shutdown the server while HTTP/2 PING frames are still + // being exchanged on the newly established connection. It can lead to + // failures when testing with HTTP proxy. See + // https://github.com/grpc/grpc/issues/14471 + // gpr_sleep_until(n_seconds_from_now(1)); - /* shutdown and destroy the server */ + // shutdown and destroy the server grpc_server_shutdown_and_notify(f.server, f.cq, tag(1000)); grpc_server_cancel_all_calls(f.server); diff --git a/test/core/end2end/tests/shutdown_finishes_tags.cc b/test/core/end2end/tests/shutdown_finishes_tags.cc index d297d3d90a5..41ac51349a9 100644 --- a/test/core/end2end/tests/shutdown_finishes_tags.cc +++ b/test/core/end2end/tests/shutdown_finishes_tags.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -79,8 +79,8 @@ static void test_early_server_shutdown_finishes_tags( grpc_metadata_array_init(&request_metadata_recv); grpc_call_details_init(&call_details); - /* upon shutdown, the server should finish all requested calls indicating - no new call */ + // upon shutdown, the server should finish all requested calls indicating + // no new call GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( f.server, &s, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101))); diff --git a/test/core/end2end/tests/simple_delayed_request.cc b/test/core/end2end/tests/simple_delayed_request.cc index ea6d6be3fa4..f9a844c1df3 100644 --- a/test/core/end2end/tests/simple_delayed_request.cc +++ b/test/core/end2end/tests/simple_delayed_request.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -212,7 +212,7 @@ static void test_simple_delayed_request_long(grpc_end2end_test_config config) { gpr_log(GPR_INFO, "Running test: %s/%s", "test_simple_delayed_request_long", config.name); f = config.create_fixture(nullptr, nullptr); - /* This timeout should be longer than a single retry */ + // This timeout should be longer than a single retry simple_delayed_request_body(config, &f, client_args.get(), nullptr, 1500000); end_test(&f); config.tear_down_data(&f); diff --git a/test/core/end2end/tests/simple_metadata.cc b/test/core/end2end/tests/simple_metadata.cc index 1a1470eeeed..0b6e43073da 100644 --- a/test/core/end2end/tests/simple_metadata.cc +++ b/test/core/end2end/tests/simple_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Request/response with metadata and payload.*/ +// Request/response with metadata and payload. static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call* c; diff --git a/test/core/end2end/tests/simple_request.cc b/test/core/end2end/tests/simple_request.cc index 2dd1f7ba454..d8eeb2c5444 100644 --- a/test/core/end2end/tests/simple_request.cc +++ b/test/core/end2end/tests/simple_request.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/end2end/tests/streaming_error_response.cc b/test/core/end2end/tests/streaming_error_response.cc index eb1a254da7c..641549025b8 100644 --- a/test/core/end2end/tests/streaming_error_response.cc +++ b/test/core/end2end/tests/streaming_error_response.cc @@ -1,23 +1,23 @@ -/* - * - * Copyright 2016 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. - * - */ - -/** \file Verify that status ordering rules are obeyed. - \ref doc/status_ordering.md */ +// +// +// Copyright 2016 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. +// +// + +/// \file Verify that status ordering rules are obeyed. +/// \ref doc/status_ordering.md #include #include diff --git a/test/core/end2end/tests/trailing_metadata.cc b/test/core/end2end/tests/trailing_metadata.cc index f93cc49e021..5dab6532809 100644 --- a/test/core/end2end/tests/trailing_metadata.cc +++ b/test/core/end2end/tests/trailing_metadata.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Request/response with metadata and payload.*/ +// Request/response with metadata and payload. static void test_request_response_with_metadata_and_payload( grpc_end2end_test_config config) { grpc_call* c; diff --git a/test/core/end2end/tests/write_buffering.cc b/test/core/end2end/tests/write_buffering.cc index 4fb8c02a5e8..cb7b174c59a 100644 --- a/test/core/end2end/tests/write_buffering.cc +++ b/test/core/end2end/tests/write_buffering.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client sends a request with payload, server reads then returns status. */ +// Client sends a request with payload, server reads then returns status. static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; @@ -148,7 +148,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( f.server, &s, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101))); - cqv.Expect(tag(1), true); /* send message is buffered */ + cqv.Expect(tag(1), true); // send message is buffered cqv.Expect(tag(101), true); cqv.Verify(); @@ -171,7 +171,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* recv message should not succeed yet - it's buffered at the client still */ + // recv message should not succeed yet - it's buffered at the client still memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; @@ -186,7 +186,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { cqv.Expect(tag(102), true); cqv.Verify(); - /* send another message, this time not buffered */ + // send another message, this time not buffered memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_MESSAGE; @@ -197,12 +197,12 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* now the first send should match up with the first recv */ + // now the first send should match up with the first recv cqv.Expect(tag(103), true); cqv.Expect(tag(4), true); cqv.Verify(); - /* and the next recv should be ready immediately also */ + // and the next recv should be ready immediately also memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; diff --git a/test/core/end2end/tests/write_buffering_at_end.cc b/test/core/end2end/tests/write_buffering_at_end.cc index 8b586cd696e..7003cd692c0 100644 --- a/test/core/end2end/tests/write_buffering_at_end.cc +++ b/test/core/end2end/tests/write_buffering_at_end.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -87,7 +87,7 @@ static void end_test(grpc_end2end_test_fixture* f) { grpc_completion_queue_destroy(f->cq); } -/* Client sends a request with payload, server reads then returns status. */ +// Client sends a request with payload, server reads then returns status. static void test_invoke_request_with_payload(grpc_end2end_test_config config) { grpc_call* c; grpc_call* s; @@ -145,7 +145,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call( f.server, &s, &call_details, &request_metadata_recv, f.cq, f.cq, tag(101))); - cqv.Expect(tag(1), true); /* send message is buffered */ + cqv.Expect(tag(1), true); // send message is buffered cqv.Expect(tag(101), true); cqv.Verify(); @@ -168,7 +168,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* recv message should not succeed yet - it's buffered at the client still */ + // recv message should not succeed yet - it's buffered at the client still memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; @@ -183,7 +183,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { cqv.Expect(tag(102), true); cqv.Verify(); - /* send end of stream: should release the buffering */ + // send end of stream: should release the buffering memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; @@ -192,12 +192,12 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) { nullptr); GPR_ASSERT(GRPC_CALL_OK == error); - /* now the first send should match up with the first recv */ + // now the first send should match up with the first recv cqv.Expect(tag(103), true); cqv.Expect(tag(4), true); cqv.Verify(); - /* and the next recv should be ready immediately also (and empty) */ + // and the next recv should be ready immediately also (and empty) memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_RECV_MESSAGE; diff --git a/test/core/event_engine/posix/event_poller_posix_test.cc b/test/core/event_engine/posix/event_poller_posix_test.cc index 4ab8a8ca685..cff31c7fe11 100644 --- a/test/core/event_engine/posix/event_poller_posix_test.cc +++ b/test/core/event_engine/posix/event_poller_posix_test.cc @@ -134,9 +134,9 @@ void CreateTestSocket(int port, int* socket_fd, struct sockaddr_in6* sin) { // An upload server. typedef struct { - EventHandle* em_fd; /* listening fd */ - ssize_t read_bytes_total; /* total number of received bytes */ - int done; /* set to 1 when a server finishes serving */ + EventHandle* em_fd; // listening fd + ssize_t read_bytes_total; // total number of received bytes + int done; // set to 1 when a server finishes serving PosixEngineClosure* listen_closure; } server; @@ -148,9 +148,9 @@ void ServerInit(server* sv) { // An upload session. // Created when a new upload request arrives in the server. typedef struct { - server* sv; /* not owned by a single session */ - EventHandle* em_fd; /* fd to read upload bytes */ - char read_buf[BUF_SIZE]; /* buffer to store upload bytes */ + server* sv; // not owned by a single session + EventHandle* em_fd; // fd to read upload bytes + char read_buf[BUF_SIZE]; // buffer to store upload bytes PosixEngineClosure* session_read_closure; } session; @@ -726,8 +726,8 @@ int main(int argc, char** argv) { return r; } -#else /* GRPC_POSIX_SOCKET_EV */ +#else // GRPC_POSIX_SOCKET_EV int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_SOCKET_EV */ +#endif // GRPC_POSIX_SOCKET_EV diff --git a/test/core/event_engine/posix/posix_engine_listener_utils_test.cc b/test/core/event_engine/posix/posix_engine_listener_utils_test.cc index 8d490eecf1c..0e7a650b14f 100644 --- a/test/core/event_engine/posix/posix_engine_listener_utils_test.cc +++ b/test/core/event_engine/posix/posix_engine_listener_utils_test.cc @@ -152,8 +152,8 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#else // GRPC_POSIX_SOCKET_UTILS_COMMON int main(int argc, char** argv) { return 0; } -#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_UTILS_COMMON diff --git a/test/core/event_engine/posix/posix_engine_test_utils.h b/test/core/event_engine/posix/posix_engine_test_utils.h index 5e54a231205..79121d490c4 100644 --- a/test/core/event_engine/posix/posix_engine_test_utils.h +++ b/test/core/event_engine/posix/posix_engine_test_utils.h @@ -59,4 +59,4 @@ int ConnectToServerOrDie( server_address); } // namespace experimental -} // namespace grpc_event_engine \ No newline at end of file +} // namespace grpc_event_engine diff --git a/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc b/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc index 7bca86bd5d8..abc17c5520c 100644 --- a/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc +++ b/test/core/event_engine/posix/tcp_posix_socket_utils_test.cc @@ -178,8 +178,8 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#else // GRPC_POSIX_SOCKET_UTILS_COMMON int main(int argc, char** argv) { return 0; } -#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_UTILS_COMMON diff --git a/test/core/event_engine/posix/timer_heap_test.cc b/test/core/event_engine/posix/timer_heap_test.cc index e4728e4a4ef..6e51ccecd40 100644 --- a/test/core/event_engine/posix/timer_heap_test.cc +++ b/test/core/event_engine/posix/timer_heap_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/event_engine/posix_engine/timer_heap.h" @@ -81,8 +81,8 @@ TEST(TimerHeapTest, Basics) { inpq.set(i); } for (i = 0; i < num_test_elements; ++i) { - /* Test that check still succeeds even for element that wasn't just - inserted. */ + // Test that check still succeeds even for element that wasn't just + // inserted. EXPECT_THAT(pq.TestOnlyGetTimers(), Contains(&test_elements[i])); } @@ -92,7 +92,7 @@ TEST(TimerHeapTest, Basics) { for (i = 0; i < num_test_operations; ++i) { size_t elem_num = static_cast(rand()) % num_test_elements; Timer* el = &test_elements[elem_num]; - if (!inpq.is_set(elem_num)) { /* not in pq */ + if (!inpq.is_set(elem_num)) { // not in pq EXPECT_THAT(pq.TestOnlyGetTimers(), Not(Contains(el))); el->deadline = RandomDeadline(); pq.Add(el); @@ -144,7 +144,7 @@ TEST(TimerHeapTest, RandomMutations) { for (size_t round = 0; round < 10000; round++) { int r = rand() % 1000; if (r <= 550) { - /* 55% of the time we try to add something */ + // 55% of the time we try to add something ElemStruct* el = SearchElems(elems, false); if (el != nullptr) { el->elem.deadline = RandomDeadline(); @@ -154,7 +154,7 @@ TEST(TimerHeapTest, RandomMutations) { CheckValid(&pq); } } else if (r <= 650) { - /* 10% of the time we try to remove something */ + // 10% of the time we try to remove something ElemStruct* el = SearchElems(elems, true); if (el != nullptr) { pq.Remove(&el->elem); @@ -163,7 +163,7 @@ TEST(TimerHeapTest, RandomMutations) { CheckValid(&pq); } } else { - /* the remaining times we pop */ + // the remaining times we pop if (num_inserted > 0) { Timer* top = pq.Top(); pq.Pop(); diff --git a/test/core/event_engine/posix/timer_list_test.cc b/test/core/event_engine/posix/timer_list_test.cc index 8f04a2b5165..4d77f2a5e58 100644 --- a/test/core/event_engine/posix/timer_list_test.cc +++ b/test/core/event_engine/posix/timer_list_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -78,7 +78,7 @@ TEST(TimerListTest, Add) { EXPECT_CALL(host, Now()).WillOnce(Return(kStart)); TimerList timer_list(&host); - /* 10 ms timers. will expire in the current epoch */ + // 10 ms timers. will expire in the current epoch for (int i = 0; i < 10; i++) { EXPECT_CALL(host, Now()).WillOnce(Return(kStart)); timer_list.TimerInit(&timers[i], @@ -86,7 +86,7 @@ TEST(TimerListTest, Add) { &closures[i]); } - /* 1010 ms timers. will expire in the next epoch */ + // 1010 ms timers. will expire in the next epoch for (int i = 10; i < 20; i++) { EXPECT_CALL(host, Now()).WillOnce(Return(kStart)); timer_list.TimerInit(&timers[i], @@ -94,7 +94,7 @@ TEST(TimerListTest, Add) { &closures[i]); } - /* collect timers. Only the first batch should be ready. */ + // collect timers. Only the first batch should be ready. EXPECT_CALL(host, Now()) .WillOnce(Return(kStart + grpc_core::Duration::Milliseconds(500))); for (int i = 0; i < 10; i++) { @@ -111,7 +111,7 @@ TEST(TimerListTest, Add) { EXPECT_EQ(FinishCheck(timer_list.TimerCheck(nullptr)), CheckResult::kCheckedAndEmpty); - /* collect the rest of the timers */ + // collect the rest of the timers EXPECT_CALL(host, Now()) .WillOnce(Return(kStart + grpc_core::Duration::Milliseconds(1500))); for (int i = 10; i < 20; i++) { @@ -129,7 +129,7 @@ TEST(TimerListTest, Add) { CheckResult::kCheckedAndEmpty); } -/* Cleaning up a list with pending timers. */ +// Cleaning up a list with pending timers. TEST(TimerListTest, Destruction) { Timer timers[5]; StrictMock closures[5]; @@ -184,18 +184,18 @@ TEST(TimerListTest, Destruction) { EXPECT_TRUE(timer_list.TimerCancel(&timers[2])); } -/* Cleans up a list with pending timers that simulate long-running-services. - This test does the following: - 1) Simulates grpc server start time to 25 days in the past (completed in - `main` using TestOnlyGlobalInit()) - 2) Creates 4 timers - one with a deadline 25 days in the future, one just - 3 milliseconds in future, one way out in the future, and one using the - Timestamp::FromTimespecRoundUp function to compute a deadline of 25 - days in the future - 3) Simulates 4 milliseconds of elapsed time by changing `now` (cached at - step 1) to `now+4` - 4) Shuts down the timer list - https://github.com/grpc/grpc/issues/15904 */ +// Cleans up a list with pending timers that simulate long-running-services. +// This test does the following: +// 1) Simulates grpc server start time to 25 days in the past (completed in +// `main` using TestOnlyGlobalInit()) +// 2) Creates 4 timers - one with a deadline 25 days in the future, one just +// 3 milliseconds in future, one way out in the future, and one using the +// Timestamp::FromTimespecRoundUp function to compute a deadline of 25 +// days in the future +// 3) Simulates 4 milliseconds of elapsed time by changing `now` (cached at +// step 1) to `now+4` +// 4) Shuts down the timer list +// https://github.com/grpc/grpc/issues/15904 TEST(TimerListTest, LongRunningServiceCleanup) { Timer timers[4]; StrictMock closures[4]; @@ -221,8 +221,8 @@ TEST(TimerListTest, LongRunningServiceCleanup) { gpr_timespec deadline_spec = (kStart + k25Days).as_timespec(gpr_clock_type::GPR_CLOCK_MONOTONIC); - /* Timestamp::FromTimespecRoundUp is how users usually compute a millisecond - input value into grpc_timer_init, so we mimic that behavior here */ + // Timestamp::FromTimespecRoundUp is how users usually compute a millisecond + // input value into grpc_timer_init, so we mimic that behavior here EXPECT_CALL(host, Now()).WillOnce(Return(kStart)); timer_list.TimerInit(&timers[3], grpc_core::Timestamp::FromTimespecRoundUp(deadline_spec), diff --git a/test/core/event_engine/posix/traced_buffer_list_test.cc b/test/core/event_engine/posix/traced_buffer_list_test.cc index 2fbfcb8ccd4..bd816d4d239 100644 --- a/test/core/event_engine/posix/traced_buffer_list_test.cc +++ b/test/core/event_engine/posix/traced_buffer_list_test.cc @@ -278,8 +278,8 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE int main(int /*argc*/, char** /*argv*/) { return 0; } -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE diff --git a/test/core/gpr/alloc_test.cc b/test/core/gpr/alloc_test.cc index d36ed9fb033..e8dc5b9d08e 100644 --- a/test/core/gpr/alloc_test.cc +++ b/test/core/gpr/alloc_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/gpr/cpu_test.cc b/test/core/gpr/cpu_test.cc index e7e10a321ac..8717bef425e 100644 --- a/test/core/gpr/cpu_test.cc +++ b/test/core/gpr/cpu_test.cc @@ -1,25 +1,25 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* Test gpr per-cpu support: - gpr_cpu_num_cores() - gpr_cpu_current_cpu() -*/ +// Test gpr per-cpu support: +// gpr_cpu_num_cores() +// gpr_cpu_current_cpu() +// #include #include @@ -35,34 +35,34 @@ #include "src/core/lib/gprpp/thd.h" #include "test/core/util/test_config.h" -/* Test structure is essentially: - 1) Figure out how many cores are present on the test system - 2) Create 3 times that many threads - 3) Have each thread do some amount of work (basically want to - gaurantee that all threads are running at once, and enough of them - to run on all cores). - 4) Each thread checks what core it is running on, and marks that core - as "used" in the test. - 5) Count number of "used" cores. +// Test structure is essentially: +// 1) Figure out how many cores are present on the test system +// 2) Create 3 times that many threads +// 3) Have each thread do some amount of work (basically want to +// gaurantee that all threads are running at once, and enough of them +// to run on all cores). +// 4) Each thread checks what core it is running on, and marks that core +// as "used" in the test. +// 5) Count number of "used" cores. - The test will fail if: - 1) gpr_cpu_num_cores() == 0 - 2) Any result from gpr_cpu_current_cpu() >= gpr_cpu_num_cores() - 3) Ideally, we would fail if not all cores were seen as used. Unfortunately, - this is only probabilistically true, and depends on the OS, it's - scheduler, etc. So we just print out an indication of how many were seen; - hopefully developers can use this to sanity check their system. -*/ +// The test will fail if: +// 1) gpr_cpu_num_cores() == 0 +// 2) Any result from gpr_cpu_current_cpu() >= gpr_cpu_num_cores() +// 3) Ideally, we would fail if not all cores were seen as used. Unfortunately, +// this is only probabilistically true, and depends on the OS, it's +// scheduler, etc. So we just print out an indication of how many were seen; +// hopefully developers can use this to sanity check their system. +// -/* Status shared across threads */ +// Status shared across threads struct cpu_test { gpr_mu mu; int nthreads; uint32_t ncores; int is_done; gpr_cv done_cv; - int* used; /* is this core used? */ - unsigned r; /* random number */ + int* used; // is this core used? + unsigned r; // random number }; static void worker_thread(void* arg) { @@ -70,11 +70,11 @@ static void worker_thread(void* arg) { uint32_t cpu; unsigned r = 12345678; unsigned i, j; - /* Avoid repetitive division calculations */ + // Avoid repetitive division calculations int64_t max_i = 1000 / grpc_test_slowdown_factor(); int64_t max_j = 1000 / grpc_test_slowdown_factor(); for (i = 0; i < max_i; i++) { - /* run for a bit - just calculate something random. */ + // run for a bit - just calculate something random. for (j = 0; j < max_j; j++) { r = (r * 17) & ((r - i) | (r * i)); } @@ -87,11 +87,11 @@ static void worker_thread(void* arg) { } gpr_mu_unlock(&ct->mu); if (j == ct->ncores) { - break; /* all cpus have been used - no further use in running this test */ + break; // all cpus have been used - no further use in running this test } } gpr_mu_lock(&ct->mu); - ct->r = r; /* make it look like we care about r's value... */ + ct->r = r; // make it look like we care about r's value... ct->nthreads--; if (ct->nthreads == 0) { ct->is_done = 1; diff --git a/test/core/gpr/env_test.cc b/test/core/gpr/env_test.cc index e8ad3c48a65..cd341dde9d5 100644 --- a/test/core/gpr/env_test.cc +++ b/test/core/gpr/env_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/gprpp/env.h" diff --git a/test/core/gpr/log_test.cc b/test/core/gpr/log_test.cc index 2033ef67afe..c5bcdd72a4a 100644 --- a/test/core/gpr/log_test.cc +++ b/test/core/gpr/log_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -57,11 +57,11 @@ static void test_should_not_log(gpr_log_func_args* /*args*/) { gpr_set_log_function(nullptr); TEST(LogTest, Basic) { - /* test logging at various verbosity levels */ + // test logging at various verbosity levels gpr_log(GPR_DEBUG, "%s", "hello world"); gpr_log(GPR_INFO, "%s", "hello world"); gpr_log(GPR_ERROR, "%s", "hello world"); - /* should succeed */ + // should succeed GPR_ASSERT(1); gpr_set_log_function(test_callback); gpr_log_message(GPR_INFO, "hello 1 2 3"); diff --git a/test/core/gpr/spinlock_test.cc b/test/core/gpr/spinlock_test.cc index 7a55b33d034..f4159197416 100644 --- a/test/core/gpr/spinlock_test.cc +++ b/test/core/gpr/spinlock_test.cc @@ -1,22 +1,22 @@ -/* - * - * 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. - * - */ - -/* Test of gpr spin-lock support. */ +// +// +// 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. +// +// + +// Test of gpr spin-lock support. #include "src/core/lib/gpr/spinlock.h" @@ -31,20 +31,20 @@ #include "src/core/lib/gprpp/thd.h" #include "test/core/util/test_config.h" -/* ------------------------------------------------- */ -/* Tests for gpr_spinlock. */ +// ------------------------------------------------- +// Tests for gpr_spinlock. struct test { - int thread_count; /* number of threads */ + int thread_count; // number of threads grpc_core::Thread* threads; - int64_t iterations; /* number of iterations per thread */ + int64_t iterations; // number of iterations per thread int64_t counter; - int incr_step; /* how much to increment/decrement refcount each time */ + int incr_step; // how much to increment/decrement refcount each time - gpr_spinlock mu; /* protects iterations, counter */ + gpr_spinlock mu; // protects iterations, counter }; -/* Return pointer to a new struct test. */ +// Return pointer to a new struct test. static struct test* test_new(int threads, int64_t iterations, int incr_step) { struct test* m = static_cast(gpr_malloc(sizeof(*m))); m->thread_count = threads; @@ -58,13 +58,13 @@ static struct test* test_new(int threads, int64_t iterations, int incr_step) { return m; } -/* Return pointer to a new struct test. */ +// Return pointer to a new struct test. static void test_destroy(struct test* m) { gpr_free(m->threads); gpr_free(m); } -/* Create m->threads threads, each running (*body)(m) */ +// Create m->threads threads, each running (*body)(m) static void test_create_threads(struct test* m, void (*body)(void* arg)) { int i; for (i = 0; i != m->thread_count; i++) { @@ -73,7 +73,7 @@ static void test_create_threads(struct test* m, void (*body)(void* arg)) { } } -/* Wait until all threads report done. */ +// Wait until all threads report done. static void test_wait(struct test* m) { int i; for (i = 0; i != m->thread_count; i++) { @@ -81,12 +81,12 @@ static void test_wait(struct test* m) { } } -/* Test several threads running (*body)(struct test *m) for increasing settings - of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed. - If extra!=NULL, run (*extra)(m) in an additional thread. - incr_step controls by how much m->refcount should be incremented/decremented - (if at all) each time in the tests. - */ +// Test several threads running (*body)(struct test *m) for increasing settings +// of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed. +// If extra!=NULL, run (*extra)(m) in an additional thread. +// incr_step controls by how much m->refcount should be incremented/decremented +// (if at all) each time in the tests. +// static void test(void (*body)(void* m), int timeout_s, int incr_step) { int64_t iterations = 1024; struct test* m; @@ -118,7 +118,7 @@ static void test(void (*body)(void* m), int timeout_s, int incr_step) { fflush(stderr); } -/* Increment m->counter on each iteration; then mark thread as done. */ +// Increment m->counter on each iteration; then mark thread as done. static void inc(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -129,8 +129,8 @@ static void inc(void* v /*=m*/) { } } -/* Increment m->counter under lock acquired with trylock, m->iterations times; - then mark thread as done. */ +// Increment m->counter under lock acquired with trylock, m->iterations times; +// then mark thread as done. static void inctry(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -143,7 +143,7 @@ static void inctry(void* v /*=m*/) { } } -/* ------------------------------------------------- */ +// ------------------------------------------------- TEST(SpinlockTest, Spinlock) { test(&inc, 1, 1); } diff --git a/test/core/gpr/string_test.cc b/test/core/gpr/string_test.cc index 3432e986b86..e89b91aebd8 100644 --- a/test/core/gpr/string_test.cc +++ b/test/core/gpr/string_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/gpr/string.h" @@ -103,16 +103,16 @@ TEST(StringTest, Asprintf) { char* buf; int i, j; - /* Print an empty string. */ + // Print an empty string. ASSERT_EQ(gpr_asprintf(&buf, "%s", ""), 0); ASSERT_EQ(buf[0], '\0'); gpr_free(buf); - /* Print strings of various lengths. */ + // Print strings of various lengths. for (i = 1; i < 100; i++) { ASSERT_EQ(gpr_asprintf(&buf, "%0*d", i, 1), i); - /* The buffer should resemble "000001\0". */ + // The buffer should resemble "000001\0". for (j = 0; j < i - 2; j++) { ASSERT_EQ(buf[j], '0'); } @@ -149,17 +149,17 @@ TEST(StringTest, StrjoinSep) { ASSERT_STREQ("one, two, three, four", joined); gpr_free(joined); - /* empty separator */ + // empty separator joined = gpr_strjoin_sep(parts, 4, "", &joined_len); ASSERT_STREQ("onetwothreefour", joined); gpr_free(joined); - /* degenerated case specifying zero input parts */ + // degenerated case specifying zero input parts joined = gpr_strjoin_sep(parts, 0, ", ", &joined_len); ASSERT_STREQ("", joined); gpr_free(joined); - /* single part should have no separator */ + // single part should have no separator joined = gpr_strjoin_sep(parts, 1, ", ", &joined_len); ASSERT_STREQ("one", joined); gpr_free(joined); @@ -169,19 +169,19 @@ TEST(StringTest, Ltoa) { char* str; char buf[GPR_LTOA_MIN_BUFSIZE]; - /* zero */ + // zero ASSERT_EQ(1, gpr_ltoa(0, buf)); ASSERT_STREQ("0", buf); - /* positive number */ + // positive number ASSERT_EQ(3, gpr_ltoa(123, buf)); ASSERT_STREQ("123", buf); - /* negative number */ + // negative number ASSERT_EQ(6, gpr_ltoa(-12345, buf)); ASSERT_STREQ("-12345", buf); - /* large negative - we don't know the size of long in advance */ + // large negative - we don't know the size of long in advance ASSERT_TRUE(gpr_asprintf(&str, "%lld", (long long)LONG_MIN)); ASSERT_EQ(strlen(str), (size_t)gpr_ltoa(LONG_MIN, buf)); ASSERT_STREQ(str, buf); @@ -191,19 +191,19 @@ TEST(StringTest, Ltoa) { TEST(StringTest, Int64Toa) { char buf[GPR_INT64TOA_MIN_BUFSIZE]; - /* zero */ + // zero ASSERT_EQ(1, int64_ttoa(0, buf)); ASSERT_STREQ("0", buf); - /* positive */ + // positive ASSERT_EQ(3, int64_ttoa(123, buf)); ASSERT_STREQ("123", buf); - /* large positive */ + // large positive ASSERT_EQ(19, int64_ttoa(9223372036854775807LL, buf)); ASSERT_STREQ("9223372036854775807", buf); - /* large negative */ + // large negative ASSERT_EQ(20, int64_ttoa(-9223372036854775807LL - 1, buf)); ASSERT_STREQ("-9223372036854775808", buf); } diff --git a/test/core/gpr/sync_test.cc b/test/core/gpr/sync_test.cc index cebea86d13c..5f0343b3ed1 100644 --- a/test/core/gpr/sync_test.cc +++ b/test/core/gpr/sync_test.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Test of gpr synchronization support. */ +// +// +// 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 +// +// 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. +// +// + +// Test of gpr synchronization support. #include #include @@ -30,26 +30,26 @@ #include "src/core/lib/gprpp/thd.h" #include "test/core/util/test_config.h" -/* ==================Example use of interface=================== +// ==================Example use of interface=================== - A producer-consumer queue of up to N integers, - illustrating the use of the calls in this interface. */ +// A producer-consumer queue of up to N integers, +// illustrating the use of the calls in this interface. #define N 4 typedef struct queue { - gpr_cv non_empty; /* Signalled when length becomes non-zero. */ - gpr_cv non_full; /* Signalled when length becomes non-N. */ - gpr_mu mu; /* Protects all fields below. - (That is, except during initialization or - destruction, the fields below should be accessed - only by a thread that holds mu.) */ - int head; /* Index of head of queue 0..N-1. */ - int length; /* Number of valid elements in queue 0..N. */ - int elem[N]; /* elem[head .. head+length-1] are queue elements. */ + gpr_cv non_empty; // Signalled when length becomes non-zero. + gpr_cv non_full; // Signalled when length becomes non-N. + gpr_mu mu; // Protects all fields below. + // (That is, except during initialization or + // destruction, the fields below should be accessed + // only by a thread that holds mu.) + int head; // Index of head of queue 0..N-1. + int length; // Number of valid elements in queue 0..N. + int elem[N]; // elem[head .. head+length-1] are queue elements. } queue; -/* Initialize *q. */ +// Initialize *q. void queue_init(queue* q) { gpr_mu_init(&q->mu); gpr_cv_init(&q->non_empty); @@ -58,29 +58,29 @@ void queue_init(queue* q) { q->length = 0; } -/* Free storage associated with *q. */ +// Free storage associated with *q. void queue_destroy(queue* q) { gpr_mu_destroy(&q->mu); gpr_cv_destroy(&q->non_empty); gpr_cv_destroy(&q->non_full); } -/* Wait until there is room in *q, then append x to *q. */ +// Wait until there is room in *q, then append x to *q. void queue_append(queue* q, int x) { gpr_mu_lock(&q->mu); - /* To wait for a predicate without a deadline, loop on the negation of the - predicate, and use gpr_cv_wait(..., gpr_inf_future(GPR_CLOCK_REALTIME)) - inside the loop - to release the lock, wait, and reacquire on each iteration. Code that - makes the condition true should use gpr_cv_broadcast() on the - corresponding condition variable. The predicate must be on state - protected by the lock. */ + // To wait for a predicate without a deadline, loop on the negation of the + // predicate, and use gpr_cv_wait(..., gpr_inf_future(GPR_CLOCK_REALTIME)) + // inside the loop + // to release the lock, wait, and reacquire on each iteration. Code that + // makes the condition true should use gpr_cv_broadcast() on the + // corresponding condition variable. The predicate must be on state + // protected by the lock. while (q->length == N) { gpr_cv_wait(&q->non_full, &q->mu, gpr_inf_future(GPR_CLOCK_MONOTONIC)); } - if (q->length == 0) { /* Wake threads blocked in queue_remove(). */ - /* It's normal to use gpr_cv_broadcast() or gpr_signal() while - holding the lock. */ + if (q->length == 0) { // Wake threads blocked in queue_remove(). + // It's normal to use gpr_cv_broadcast() or gpr_signal() while + // holding the lock. gpr_cv_broadcast(&q->non_empty); } q->elem[(q->head + q->length) % N] = x; @@ -88,13 +88,13 @@ void queue_append(queue* q, int x) { gpr_mu_unlock(&q->mu); } -/* If it can be done without blocking, append x to *q and return non-zero. - Otherwise return 0. */ +// If it can be done without blocking, append x to *q and return non-zero. +// Otherwise return 0. int queue_try_append(queue* q, int x) { int result = 0; if (gpr_mu_trylock(&q->mu)) { if (q->length != N) { - if (q->length == 0) { /* Wake threads blocked in queue_remove(). */ + if (q->length == 0) { // Wake threads blocked in queue_remove(). gpr_cv_broadcast(&q->non_empty); } q->elem[(q->head + q->length) % N] = x; @@ -106,49 +106,49 @@ int queue_try_append(queue* q, int x) { return result; } -/* Wait until the *q is non-empty or deadline abs_deadline passes. If the - queue is non-empty, remove its head entry, place it in *head, and return - non-zero. Otherwise return 0. */ +// Wait until the *q is non-empty or deadline abs_deadline passes. If the +// queue is non-empty, remove its head entry, place it in *head, and return +// non-zero. Otherwise return 0. int queue_remove(queue* q, int* head, gpr_timespec abs_deadline) { int result = 0; gpr_mu_lock(&q->mu); - /* To wait for a predicate with a deadline, loop on the negation of the - predicate or until gpr_cv_wait() returns true. Code that makes - the condition true should use gpr_cv_broadcast() on the corresponding - condition variable. The predicate must be on state protected by the - lock. */ + // To wait for a predicate with a deadline, loop on the negation of the + // predicate or until gpr_cv_wait() returns true. Code that makes + // the condition true should use gpr_cv_broadcast() on the corresponding + // condition variable. The predicate must be on state protected by the + // lock. while (q->length == 0 && !gpr_cv_wait(&q->non_empty, &q->mu, abs_deadline)) { } - if (q->length != 0) { /* Queue is non-empty. */ + if (q->length != 0) { // Queue is non-empty. result = 1; - if (q->length == N) { /* Wake threads blocked in queue_append(). */ + if (q->length == N) { // Wake threads blocked in queue_append(). gpr_cv_broadcast(&q->non_full); } *head = q->elem[q->head]; q->head = (q->head + 1) % N; q->length--; - } /* else deadline exceeded */ + } // else deadline exceeded gpr_mu_unlock(&q->mu); return result; } -/* ------------------------------------------------- */ -/* Tests for gpr_mu and gpr_cv, and the queue example. */ +// ------------------------------------------------- +// Tests for gpr_mu and gpr_cv, and the queue example. struct test { - int nthreads; /* number of threads */ + int nthreads; // number of threads grpc_core::Thread* threads; - int64_t iterations; /* number of iterations per thread */ + int64_t iterations; // number of iterations per thread int64_t counter; - int thread_count; /* used to allocate thread ids */ - int done; /* threads not yet completed */ - int incr_step; /* how much to increment/decrement refcount each time */ + int thread_count; // used to allocate thread ids + int done; // threads not yet completed + int incr_step; // how much to increment/decrement refcount each time - gpr_mu mu; /* protects iterations, counter, thread_count, done */ + gpr_mu mu; // protects iterations, counter, thread_count, done - gpr_cv cv; /* signalling depends on test */ + gpr_cv cv; // signalling depends on test - gpr_cv done_cv; /* signalled when done == 0 */ + gpr_cv done_cv; // signalled when done == 0 queue q; @@ -159,7 +159,7 @@ struct test { gpr_event event; }; -/* Return pointer to a new struct test. */ +// Return pointer to a new struct test. static struct test* test_new(int nthreads, int64_t iterations, int incr_step) { struct test* m = static_cast(gpr_malloc(sizeof(*m))); m->nthreads = nthreads; @@ -181,7 +181,7 @@ static struct test* test_new(int nthreads, int64_t iterations, int incr_step) { return m; } -/* Return pointer to a new struct test. */ +// Return pointer to a new struct test. static void test_destroy(struct test* m) { gpr_mu_destroy(&m->mu); gpr_cv_destroy(&m->cv); @@ -191,7 +191,7 @@ static void test_destroy(struct test* m) { gpr_free(m); } -/* Create m->nthreads threads, each running (*body)(m) */ +// Create m->nthreads threads, each running (*body)(m) static void test_create_threads(struct test* m, void (*body)(void* arg)) { int i; for (i = 0; i != m->nthreads; i++) { @@ -200,7 +200,7 @@ static void test_create_threads(struct test* m, void (*body)(void* arg)) { } } -/* Wait until all threads report done. */ +// Wait until all threads report done. static void test_wait(struct test* m) { gpr_mu_lock(&m->mu); while (m->done != 0) { @@ -212,7 +212,7 @@ static void test_wait(struct test* m) { } } -/* Get an integer thread id in the raneg 0..nthreads-1 */ +// Get an integer thread id in the raneg 0..nthreads-1 static int thread_id(struct test* m) { int id; gpr_mu_lock(&m->mu); @@ -221,8 +221,8 @@ static int thread_id(struct test* m) { return id; } -/* Indicate that a thread is done, by decrementing m->done - and signalling done_cv if m->done==0. */ +// Indicate that a thread is done, by decrementing m->done +// and signalling done_cv if m->done==0. static void mark_thread_done(struct test* m) { gpr_mu_lock(&m->mu); ASSERT_NE(m->done, 0); @@ -233,12 +233,12 @@ static void mark_thread_done(struct test* m) { gpr_mu_unlock(&m->mu); } -/* Test several threads running (*body)(struct test *m) for increasing settings - of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed. - If extra!=NULL, run (*extra)(m) in an additional thread. - incr_step controls by how much m->refcount should be incremented/decremented - (if at all) each time in the tests. - */ +// Test several threads running (*body)(struct test *m) for increasing settings +// of m->iterations, until about timeout_s to 2*timeout_s seconds have elapsed. +// If extra!=NULL, run (*extra)(m) in an additional thread. +// incr_step controls by how much m->refcount should be incremented/decremented +// (if at all) each time in the tests. +// static void test(const char* name, void (*body)(void* m), void (*extra)(void* m), int timeout_s, int incr_step) { int64_t iterations = 8; @@ -258,7 +258,7 @@ static void test(const char* name, void (*body)(void* m), if (extra != nullptr) { extra_thd = grpc_core::Thread(name, extra, m); extra_thd.Start(); - m->done++; /* one more thread to wait for */ + m->done++; // one more thread to wait for } test_create_threads(m, body); test_wait(m); @@ -282,7 +282,7 @@ static void test(const char* name, void (*body)(void* m), fflush(stderr); } -/* Increment m->counter on each iteration; then mark thread as done. */ +// Increment m->counter on each iteration; then mark thread as done. static void inc(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -294,8 +294,8 @@ static void inc(void* v /*=m*/) { mark_thread_done(m); } -/* Increment m->counter under lock acquired with trylock, m->iterations times; - then mark thread as done. */ +// Increment m->counter under lock acquired with trylock, m->iterations times; +// then mark thread as done. static void inctry(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -309,8 +309,8 @@ static void inctry(void* v /*=m*/) { mark_thread_done(m); } -/* Increment counter only when (m->counter%m->nthreads)==m->thread_id; then mark - thread as done. */ +// Increment counter only when (m->counter%m->nthreads)==m->thread_id; then mark +// thread as done. static void inc_by_turns(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -327,8 +327,8 @@ static void inc_by_turns(void* v /*=m*/) { mark_thread_done(m); } -/* Wait a millisecond and increment counter on each iteration; - then mark thread as done. */ +// Wait a millisecond and increment counter on each iteration; +// then mark thread as done. static void inc_with_1ms_delay(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -345,8 +345,8 @@ static void inc_with_1ms_delay(void* v /*=m*/) { mark_thread_done(m); } -/* Wait a millisecond and increment counter on each iteration, using an event - for timing; then mark thread as done. */ +// Wait a millisecond and increment counter on each iteration, using an event +// for timing; then mark thread as done. static void inc_with_1ms_delay_event(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -362,9 +362,9 @@ static void inc_with_1ms_delay_event(void* v /*=m*/) { mark_thread_done(m); } -/* Produce m->iterations elements on queue m->q, then mark thread as done. - Even threads use queue_append(), and odd threads use queue_try_append() - until it succeeds. */ +// Produce m->iterations elements on queue m->q, then mark thread as done. +// Even threads use queue_append(), and odd threads use queue_try_append() +// until it succeeds. static void many_producers(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -382,9 +382,9 @@ static void many_producers(void* v /*=m*/) { mark_thread_done(m); } -/* Consume elements from m->q until m->nthreads*m->iterations are seen, - wait an extra second to confirm that no more elements are arriving, - then mark thread as done. */ +// Consume elements from m->q until m->nthreads*m->iterations are seen, +// wait an extra second to confirm that no more elements are arriving, +// then mark thread as done. static void consumer(void* v /*=m*/) { struct test* m = static_cast(v); int64_t n = m->iterations * m->nthreads; @@ -403,8 +403,8 @@ static void consumer(void* v /*=m*/) { mark_thread_done(m); } -/* Increment m->stats_counter m->iterations times, transfer counter value to - m->counter, then mark thread as done. */ +// Increment m->stats_counter m->iterations times, transfer counter value to +// m->counter, then mark thread as done. static void statsinc(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -417,9 +417,9 @@ static void statsinc(void* v /*=m*/) { mark_thread_done(m); } -/* Increment m->refcount by m->incr_step for m->iterations times. Decrement - m->thread_refcount once, and if it reaches zero, set m->event to (void*)1; - then mark thread as done. */ +// Increment m->refcount by m->incr_step for m->iterations times. Decrement +// m->thread_refcount once, and if it reaches zero, set m->event to (void*)1; +// then mark thread as done. static void refinc(void* v /*=m*/) { struct test* m = static_cast(v); int64_t i; @@ -436,9 +436,9 @@ static void refinc(void* v /*=m*/) { mark_thread_done(m); } -/* Wait until m->event is set to (void *)1, then decrement m->refcount by 1 - (m->nthreads * m->iterations * m->incr_step) times, and ensure that the last - decrement caused the counter to reach zero, then mark thread as done. */ +// Wait until m->event is set to (void *)1, then decrement m->refcount by 1 +// (m->nthreads * m->iterations * m->incr_step) times, and ensure that the last +// decrement caused the counter to reach zero, then mark thread as done. static void refcheck(void* v /*=m*/) { struct test* m = static_cast(v); int64_t n = m->iterations * m->nthreads * m->incr_step; @@ -455,7 +455,7 @@ static void refcheck(void* v /*=m*/) { mark_thread_done(m); } -/* ------------------------------------------------- */ +// ------------------------------------------------- TEST(SyncTest, MainTest) { test("mutex", &inc, nullptr, 1, 1); @@ -465,9 +465,9 @@ TEST(SyncTest, MainTest) { test("queue", &many_producers, &consumer, 10, 1); test("stats_counter", &statsinc, nullptr, 1, 1); test("refcount by 1", &refinc, &refcheck, 1, 1); - test("refcount by 3", &refinc, &refcheck, 1, 3); /* incr_step of 3 is an - arbitrary choice. Any - number > 1 is okay here */ + test("refcount by 3", &refinc, &refcheck, 1, 3); // incr_step of 3 is an + // arbitrary choice. Any + // number > 1 is okay here test("timedevent", &inc_with_1ms_delay_event, nullptr, 1, 1); } diff --git a/test/core/gpr/time_test.cc b/test/core/gpr/time_test.cc index ee0f9d65f62..a69a598b42e 100644 --- a/test/core/gpr/time_test.cc +++ b/test/core/gpr/time_test.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* Test of gpr time support. */ +// Test of gpr time support. #include #include @@ -32,8 +32,8 @@ static void to_fp(void* arg, const char* buf, size_t len) { fwrite(buf, 1, len, static_cast(arg)); } -/* Convert gpr_intmax x to ascii base b (2..16), and write with - (*writer)(arg, ...), zero padding to "chars" digits). */ +// Convert gpr_intmax x to ascii base b (2..16), and write with +// (*writer)(arg, ...), zero padding to "chars" digits). static void i_to_s(intmax_t x, int base, int chars, void (*writer)(void* arg, const char* buf, size_t len), void* arg) { @@ -45,7 +45,7 @@ static void i_to_s(intmax_t x, int base, int chars, (*writer)(arg, buf, strlen(buf)); } -/* Convert ts to ascii, and write with (*writer)(arg, ...). */ +// Convert ts to ascii, and write with (*writer)(arg, ...). static void ts_to_s(gpr_timespec t, void (*writer)(void* arg, const char* buf, size_t len), void* arg) { @@ -101,7 +101,7 @@ TEST(TimeTest, Values) { x.tv_nsec == (i % GPR_MS_PER_SEC) * GPR_NS_PER_MS); } - /* Test possible overflow in conversion of -ve values. */ + // Test possible overflow in conversion of -ve values. x = gpr_time_from_micros(-(INT64_MAX - 999997), GPR_TIMESPAN); ASSERT_LT(x.tv_sec, 0); ASSERT_TRUE(x.tv_nsec >= 0 && x.tv_nsec < GPR_NS_PER_SEC); @@ -121,7 +121,7 @@ TEST(TimeTest, Values) { x.tv_nsec / (GPR_NS_PER_SEC / GPR_MS_PER_SEC)), -(INT64_MAX - 997)); - /* Test general -ve values. */ + // Test general -ve values. for (i = -1; i > -1000 * 1000 * 1000; i *= 7) { x = gpr_time_from_micros(i, GPR_TIMESPAN); ASSERT_EQ(x.tv_sec * GPR_US_PER_SEC + x.tv_nsec / GPR_NS_PER_US, i); @@ -136,7 +136,7 @@ TEST(TimeTest, AddSub) { int i; int j; int k; - /* Basic addition and subtraction. */ + // Basic addition and subtraction. for (i = -100; i <= 100; i++) { for (j = -100; j <= 100; j++) { for (k = 1; k <= 10000000; k *= 10) { @@ -170,7 +170,7 @@ TEST(TimeTest, AddSub) { } TEST(TimeTest, Overflow) { - /* overflow */ + // overflow gpr_timespec x = gpr_time_from_micros(1, GPR_TIMESPAN); do { x = gpr_time_add(x, x); @@ -195,7 +195,7 @@ TEST(TimeTest, StickyInfinities) { addend[1] = gpr_inf_past(GPR_TIMESPAN); addend[2] = gpr_time_0(GPR_TIMESPAN); - /* Infinities are sticky */ + // Infinities are sticky for (i = 0; i != sizeof(infinity) / sizeof(infinity[0]); i++) { for (j = 0; j != sizeof(addend) / sizeof(addend[0]); j++) { gpr_timespec x = gpr_time_add(infinity[i], addend[j]); diff --git a/test/core/gpr/useful_test.cc b/test/core/gpr/useful_test.cc index 381112d8f31..358396db204 100644 --- a/test/core/gpr/useful_test.cc +++ b/test/core/gpr/useful_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/gprpp/examine_stack_test.cc b/test/core/gprpp/examine_stack_test.cc index b274fbc8cac..d9616cfe839 100644 --- a/test/core/gprpp/examine_stack_test.cc +++ b/test/core/gprpp/examine_stack_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 "src/core/lib/gprpp/examine_stack.h" diff --git a/test/core/gprpp/fork_test.cc b/test/core/gprpp/fork_test.cc index d28625bbba5..bca749cf10f 100644 --- a/test/core/gprpp/fork_test.cc +++ b/test/core/gprpp/fork_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/gprpp/fork.h" diff --git a/test/core/gprpp/global_config_env_test.cc b/test/core/gprpp/global_config_env_test.cc index 4510bece705..917457edf13 100644 --- a/test/core/gprpp/global_config_env_test.cc +++ b/test/core/gprpp/global_config_env_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "src/core/lib/gprpp/global_config_env.h" diff --git a/test/core/gprpp/global_config_test.cc b/test/core/gprpp/global_config_test.cc index 47950b47d5e..26e2a20413a 100644 --- a/test/core/gprpp/global_config_test.cc +++ b/test/core/gprpp/global_config_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "src/core/lib/gprpp/global_config.h" diff --git a/test/core/gprpp/host_port_test.cc b/test/core/gprpp/host_port_test.cc index 681eb6d407a..3914ffbd19a 100644 --- a/test/core/gprpp/host_port_test.cc +++ b/test/core/gprpp/host_port_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/gprpp/host_port.h" @@ -35,7 +35,7 @@ TEST(HostPortTest, JoinHostPort) { join_host_port_expect("[::1]", 104, "[::1]:104"); } -/* Garbage in, garbage out. */ +// Garbage in, garbage out. TEST(HostPortTest, JoinHostPortGarbage) { join_host_port_expect("[foo]", 105, "[foo]:105"); join_host_port_expect("[::", 106, "[:::106"); diff --git a/test/core/gprpp/mpscq_test.cc b/test/core/gprpp/mpscq_test.cc index e1bbd705f25..409144b9d53 100644 --- a/test/core/gprpp/mpscq_test.cc +++ b/test/core/gprpp/mpscq_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/lib/gprpp/mpscq.h" diff --git a/test/core/gprpp/orphanable_test.cc b/test/core/gprpp/orphanable_test.cc index d736d5a825b..e5b74146661 100644 --- a/test/core/gprpp/orphanable_test.cc +++ b/test/core/gprpp/orphanable_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/gprpp/orphanable.h" diff --git a/test/core/gprpp/ref_counted_ptr_test.cc b/test/core/gprpp/ref_counted_ptr_test.cc index ed51851eace..d1f1da8a8aa 100644 --- a/test/core/gprpp/ref_counted_ptr_test.cc +++ b/test/core/gprpp/ref_counted_ptr_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/gprpp/ref_counted_ptr.h" diff --git a/test/core/gprpp/ref_counted_test.cc b/test/core/gprpp/ref_counted_test.cc index 65df584def4..990acf243fa 100644 --- a/test/core/gprpp/ref_counted_test.cc +++ b/test/core/gprpp/ref_counted_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/gprpp/ref_counted.h" diff --git a/test/core/gprpp/thd_test.cc b/test/core/gprpp/thd_test.cc index cff48fd9f82..7561965fd98 100644 --- a/test/core/gprpp/thd_test.cc +++ b/test/core/gprpp/thd_test.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* Test of gpr thread support. */ +// Test of gpr thread support. #include "src/core/lib/gprpp/thd.h" @@ -36,7 +36,7 @@ struct test { gpr_cv done_cv; }; -/* A Thread body. Decrement t->n, and if is becomes zero, set t->done. */ +// A Thread body. Decrement t->n, and if is becomes zero, set t->done. static void thd_body1(void* v) { struct test* t = static_cast(v); gpr_mu_lock(&t->mu); @@ -48,7 +48,7 @@ static void thd_body1(void* v) { gpr_mu_unlock(&t->mu); } -/* Test that we can create a number of threads, wait for them, and join them. */ +// Test that we can create a number of threads, wait for them, and join them. static void test1(void) { grpc_core::Thread thds[NUM_THREADS]; struct test t; @@ -75,7 +75,7 @@ static void test1(void) { static void thd_body2(void* /*v*/) {} -/* Test that we can create a number of threads and join them. */ +// Test that we can create a number of threads and join them. static void test2(void) { grpc_core::Thread thds[NUM_THREADS]; for (auto& th : thds) { @@ -89,7 +89,7 @@ static void test2(void) { } } -/* ------------------------------------------------- */ +// ------------------------------------------------- TEST(ThdTest, MainTest) { test1(); diff --git a/test/core/gprpp/work_serializer_test.cc b/test/core/gprpp/work_serializer_test.cc index 62498767ab3..b73b725e788 100644 --- a/test/core/gprpp/work_serializer_test.cc +++ b/test/core/gprpp/work_serializer_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "src/core/lib/gprpp/work_serializer.h" diff --git a/test/core/handshake/client_ssl.cc b/test/core/handshake/client_ssl.cc index 2aba4d2c57b..4f88b3fc48c 100644 --- a/test/core/handshake/client_ssl.cc +++ b/test/core/handshake/client_ssl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -413,7 +413,7 @@ TEST(ClientSslTest, MainTest) { EVP_cleanup(); } -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); diff --git a/test/core/handshake/readahead_handshaker_server_ssl.cc b/test/core/handshake/readahead_handshaker_server_ssl.cc index 1c4217c0da6..f09dff35ce4 100644 --- a/test/core/handshake/readahead_handshaker_server_ssl.cc +++ b/test/core/handshake/readahead_handshaker_server_ssl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -36,14 +36,14 @@ #include "test/core/handshake/server_ssl_common.h" #include "test/core/util/test_config.h" -/* The purpose of this test is to exercise the case when a - * grpc *security_handshaker* begins its handshake with data already - * in the read buffer of the handshaker arg. This scenario is created by - * adding a fake "readahead" handshaker at the beginning of the server's - * handshaker list, which just reads from the connection and then places - * read bytes into the read buffer of the handshake arg (to be passed down - * to the security_handshaker). This test is meant to protect code relying on - * this functionality that lives outside of this repo. */ +// The purpose of this test is to exercise the case when a +// grpc *security_handshaker* begins its handshake with data already +// in the read buffer of the handshaker arg. This scenario is created by +// adding a fake "readahead" handshaker at the beginning of the server's +// handshaker list, which just reads from the connection and then places +// read bytes into the read buffer of the handshake arg (to be passed down +// to the security_handshaker). This test is meant to protect code relying on +// this functionality that lives outside of this repo. namespace grpc_core { diff --git a/test/core/handshake/server_ssl.cc b/test/core/handshake/server_ssl.cc index 5148796304c..318f8d79614 100644 --- a/test/core/handshake/server_ssl.cc +++ b/test/core/handshake/server_ssl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "gtest/gtest.h" diff --git a/test/core/handshake/server_ssl_common.cc b/test/core/handshake/server_ssl_common.cc index 1564332a977..e09c2692d3b 100644 --- a/test/core/handshake/server_ssl_common.cc +++ b/test/core/handshake/server_ssl_common.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/core/handshake/server_ssl_common.h" diff --git a/test/core/handshake/server_ssl_common.h b/test/core/handshake/server_ssl_common.h index a23c2e11697..aac88bfefec 100644 --- a/test/core/handshake/server_ssl_common.h +++ b/test/core/handshake/server_ssl_common.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_SERVER_SSL_COMMON_H #define GRPC_SERVER_SSL_COMMON_H @@ -22,9 +22,9 @@ bool server_ssl_test(const char* alpn_list[], unsigned int alpn_list_len, const char* alpn_expected); -/** Cleans up the SSL library. To be called after the last call to - * server_ssl_test returns. This is a NO-OP when gRPC is built against OpenSSL - * versions > 1.0.2. */ +/// Cleans up the SSL library. To be called after the last call to +/// server_ssl_test returns. This is a NO-OP when gRPC is built against OpenSSL +/// versions > 1.0.2. void CleanupSslLibrary(); #endif // GRPC_SERVER_SSL_COMMON_H diff --git a/test/core/http/format_request_test.cc b/test/core/http/format_request_test.cc index f7e8cb7dd29..4f87367139a 100644 --- a/test/core/http/format_request_test.cc +++ b/test/core/http/format_request_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/http/format_request.h" diff --git a/test/core/http/httpcli_test.cc b/test/core/http/httpcli_test.cc index 1f40cd16baf..52d82ea5e53 100644 --- a/test/core/http/httpcli_test.cc +++ b/test/core/http/httpcli_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/http/httpcli.h" diff --git a/test/core/http/httpscli_test.cc b/test/core/http/httpscli_test.cc index d6e5d309f24..407c6e2ed30 100644 --- a/test/core/http/httpscli_test.cc +++ b/test/core/http/httpscli_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/http/parser_test.cc b/test/core/http/parser_test.cc index 329c28417ee..ebe8995057b 100644 --- a/test/core/http/parser_test.cc +++ b/test/core/http/parser_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/http/parser.h" diff --git a/test/core/http/request_fuzzer.cc b/test/core/http/request_fuzzer.cc index 079c516b4c1..2272d0427e3 100644 --- a/test/core/http/request_fuzzer.cc +++ b/test/core/http/request_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/http/response_fuzzer.cc b/test/core/http/response_fuzzer.cc index ee5a6efd398..8310028c455 100644 --- a/test/core/http/response_fuzzer.cc +++ b/test/core/http/response_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/iomgr/buffer_list_test.cc b/test/core/iomgr/buffer_list_test.cc index 384845833ee..14bca99661b 100644 --- a/test/core/iomgr/buffer_list_test.cc +++ b/test/core/iomgr/buffer_list_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/lib/iomgr/buffer_list.h" @@ -82,10 +82,10 @@ static void TestVerifierCalledOnDelayedAckVerifier(void* arg, gpr_atm_rel_store(done, static_cast(1)); } -/** Tests that all TracedBuffer elements in the list are flushed out on - * shutdown. - * Also tests that arg is passed correctly. - */ +/// Tests that all TracedBuffer elements in the list are flushed out on +/// shutdown. +/// Also tests that arg is passed correctly. +/// TEST(BufferListTest, Testshutdownflusheslist) { grpc_core::grpc_tcp_set_write_timestamps_callback( TestShutdownFlushesListVerifier); @@ -115,8 +115,8 @@ static void TestVerifierCalledOnAckVerifier(void* arg, gpr_atm_rel_store(done, gpr_atm{1}); } -/** Tests that the timestamp verifier is called on an ACK timestamp. - */ +/// Tests that the timestamp verifier is called on an ACK timestamp. +/// TEST(BufferListTest, Testverifiercalledonack) { struct sock_extended_err serr; serr.ee_data = 213; @@ -135,8 +135,8 @@ TEST(BufferListTest, Testverifiercalledonack) { tb_list.Shutdown(nullptr, absl::OkStatus()); } -/** Tests that shutdown can be called repeatedly. - */ +/// Tests that shutdown can be called repeatedly. +/// TEST(BufferListTest, Testrepeatedshutdown) { struct sock_extended_err serr; serr.ee_data = 213; @@ -271,8 +271,8 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else /* GRPC_LINUX_ERRQUEUE */ +#else // GRPC_LINUX_ERRQUEUE int main(int /*argc*/, char** /*argv*/) { return 0; } -#endif /* GRPC_LINUX_ERRQUEUE */ +#endif // GRPC_LINUX_ERRQUEUE diff --git a/test/core/iomgr/combiner_test.cc b/test/core/iomgr/combiner_test.cc index 855592dbe23..7b515e862fe 100644 --- a/test/core/iomgr/combiner_test.cc +++ b/test/core/iomgr/combiner_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/combiner.h" diff --git a/test/core/iomgr/endpoint_pair_test.cc b/test/core/iomgr/endpoint_pair_test.cc index 3eeb79b72f4..877982164b3 100644 --- a/test/core/iomgr/endpoint_pair_test.cc +++ b/test/core/iomgr/endpoint_pair_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/endpoint_pair.h" diff --git a/test/core/iomgr/endpoint_tests.cc b/test/core/iomgr/endpoint_tests.cc index 638dc336bab..5624b17742d 100644 --- a/test/core/iomgr/endpoint_tests.cc +++ b/test/core/iomgr/endpoint_tests.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/iomgr/endpoint_tests.h" @@ -32,21 +32,21 @@ #include "src/core/lib/slice/slice_internal.h" #include "test/core/util/test_config.h" -/* - General test notes: +// +// General test notes: - All tests which write data into an endpoint write i%256 into byte i, which - is verified by readers. +// All tests which write data into an endpoint write i%256 into byte i, which +// is verified by readers. - In general there are a few interesting things to vary which may lead to - exercising different codepaths in an implementation: - 1. Total amount of data written to the endpoint - 2. Size of slice allocations - 3. Amount of data we read from or write to the endpoint at once +// In general there are a few interesting things to vary which may lead to +// exercising different codepaths in an implementation: +// 1. Total amount of data written to the endpoint +// 2. Size of slice allocations +// 3. Amount of data we read from or write to the endpoint at once - The tests here tend to parameterize these where applicable. +// The tests here tend to parameterize these where applicable. -*/ +// static gpr_mu* g_mu; static grpc_pollset* g_pollset; @@ -142,9 +142,9 @@ static void read_and_write_test_read_handler(void* data, GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, nullptr)); gpr_mu_unlock(g_mu); } else if (error.ok()) { - /* We perform many reads one after another. If grpc_endpoint_read and the - * read_handler are both run inline, we might end up growing the stack - * beyond the limit. Schedule the read on ExecCtx to avoid this. */ + // We perform many reads one after another. If grpc_endpoint_read and the + // read_handler are both run inline, we might end up growing the stack + // beyond the limit. Schedule the read on ExecCtx to avoid this. grpc_core::ExecCtx::Run(DEBUG_LOCATION, &state->read_scheduler, absl::OkStatus()); } @@ -175,9 +175,9 @@ static void read_and_write_test_write_handler(void* data, &state->current_write_data); grpc_slice_buffer_reset_and_unref(&state->outgoing); grpc_slice_buffer_addn(&state->outgoing, slices, nslices); - /* We perform many writes one after another. If grpc_endpoint_write and - * the write_handler are both run inline, we might end up growing the - * stack beyond the limit. Schedule the write on ExecCtx to avoid this. */ + // We perform many writes one after another. If grpc_endpoint_write and + // the write_handler are both run inline, we might end up growing the + // stack beyond the limit. Schedule the write on ExecCtx to avoid this. grpc_core::ExecCtx::Run(DEBUG_LOCATION, &state->write_scheduler, absl::OkStatus()); gpr_free(slices); @@ -192,10 +192,10 @@ static void read_and_write_test_write_handler(void* data, gpr_mu_unlock(g_mu); } -/* Do both reading and writing using the grpc_endpoint API. +// Do both reading and writing using the grpc_endpoint API. - This also includes a test of the shutdown behavior. - */ +// This also includes a test of the shutdown behavior. +// static void read_and_write_test(grpc_endpoint_test_config config, size_t num_bytes, size_t write_size, size_t slice_size, int max_write_frame_size, @@ -242,10 +242,10 @@ static void read_and_write_test(grpc_endpoint_test_config config, grpc_slice_buffer_init(&state.outgoing); grpc_slice_buffer_init(&state.incoming); - /* Get started by pretending an initial write completed */ - /* NOTE: Sets up initial conditions so we can have the same write handler - for the first iteration as for later iterations. It does the right thing - even when bytes_written is unsigned. */ + // Get started by pretending an initial write completed + // NOTE: Sets up initial conditions so we can have the same write handler + // for the first iteration as for later iterations. It does the right thing + // even when bytes_written is unsigned. state.bytes_written -= state.current_write_size; read_and_write_test_write_handler(&state, absl::OkStatus()); grpc_core::ExecCtx::Get()->Flush(); diff --git a/test/core/iomgr/endpoint_tests.h b/test/core/iomgr/endpoint_tests.h index 227eeb997c3..9fba1ac2094 100644 --- a/test/core/iomgr/endpoint_tests.h +++ b/test/core/iomgr/endpoint_tests.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H #define GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H @@ -40,4 +40,4 @@ struct grpc_endpoint_test_config { void grpc_endpoint_tests(grpc_endpoint_test_config config, grpc_pollset* pollset, gpr_mu* mu); -#endif /* GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H */ +#endif // GRPC_TEST_CORE_IOMGR_ENDPOINT_TESTS_H diff --git a/test/core/iomgr/error_test.cc b/test/core/iomgr/error_test.cc index e2e91b9de21..98256960c9f 100644 --- a/test/core/iomgr/error_test.cc +++ b/test/core/iomgr/error_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/iomgr/error.h" diff --git a/test/core/iomgr/fd_conservation_posix_test.cc b/test/core/iomgr/fd_conservation_posix_test.cc index 4bfcdf05d99..3d020d7d963 100644 --- a/test/core/iomgr/fd_conservation_posix_test.cc +++ b/test/core/iomgr/fd_conservation_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -35,9 +35,9 @@ int main(int argc, char** argv) { { grpc_core::ExecCtx exec_ctx; - /* set max # of file descriptors to a low value, and - verify we can create and destroy many more than this number - of descriptors */ + // set max # of file descriptors to a low value, and + // verify we can create and destroy many more than this number + // of descriptors rlim.rlim_cur = rlim.rlim_max = 10; GPR_ASSERT(0 == setrlimit(RLIMIT_NOFILE, &rlim)); for (i = 0; i < 100; i++) { diff --git a/test/core/iomgr/fd_posix_test.cc b/test/core/iomgr/fd_posix_test.cc index ddaf4e6eb30..b6d7e2dca97 100644 --- a/test/core/iomgr/fd_posix_test.cc +++ b/test/core/iomgr/fd_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -50,13 +50,13 @@ static gpr_mu* g_mu; static grpc_pollset* g_pollset; -/* buffer size used to send and receive data. - 1024 is the minimal value to set TCP send and receive buffer. */ +// buffer size used to send and receive data. +// 1024 is the minimal value to set TCP send and receive buffer. #define BUF_SIZE 1024 -/* Create a test socket with the right properties for testing. - port is the TCP port to listen or connect to. - Return a socket FD and sockaddr_in. */ +// Create a test socket with the right properties for testing. +// port is the TCP port to listen or connect to. +// Return a socket FD and sockaddr_in. static void create_test_socket(int port, int* socket_fd, struct sockaddr_in* sin) { int fd; @@ -66,16 +66,16 @@ static void create_test_socket(int port, int* socket_fd, fd = socket(AF_INET, SOCK_STREAM, 0); setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); - /* Reset the size of socket send buffer to the minimal value to facilitate - buffer filling up and triggering notify_on_write */ + // Reset the size of socket send buffer to the minimal value to facilitate + // buffer filling up and triggering notify_on_write ASSERT_EQ(grpc_set_socket_sndbuf(fd, buffer_size_bytes), absl::OkStatus()); ASSERT_EQ(grpc_set_socket_rcvbuf(fd, buffer_size_bytes), absl::OkStatus()); - /* Make fd non-blocking */ + // Make fd non-blocking flags = fcntl(fd, F_GETFL, 0); ASSERT_EQ(fcntl(fd, F_SETFL, flags | O_NONBLOCK), 0); *socket_fd = fd; - /* Use local address for test */ + // Use local address for test sin->sin_family = AF_INET; sin->sin_addr.s_addr = htonl(0x7f000001); ASSERT_GE(port, 0); @@ -83,17 +83,17 @@ static void create_test_socket(int port, int* socket_fd, sin->sin_port = htons(static_cast(port)); } -/* Phony gRPC callback */ +// Phony gRPC callback void no_op_cb(void* /*arg*/, int /*success*/) {} -/* =======An upload server to test notify_on_read=========== - The server simply reads and counts a stream of bytes. */ +// =======An upload server to test notify_on_read=========== +// The server simply reads and counts a stream of bytes. -/* An upload server. */ +// An upload server. typedef struct { - grpc_fd* em_fd; /* listening fd */ - ssize_t read_bytes_total; /* total number of received bytes */ - int done; /* set to 1 when a server finishes serving */ + grpc_fd* em_fd; // listening fd + ssize_t read_bytes_total; // total number of received bytes + int done; // set to 1 when a server finishes serving grpc_closure listen_closure; } server; @@ -102,29 +102,29 @@ static void server_init(server* sv) { sv->done = 0; } -/* An upload session. - Created when a new upload request arrives in the server. */ +// An upload session. +// Created when a new upload request arrives in the server. typedef struct { - server* sv; /* not owned by a single session */ - grpc_fd* em_fd; /* fd to read upload bytes */ - char read_buf[BUF_SIZE]; /* buffer to store upload bytes */ + server* sv; // not owned by a single session + grpc_fd* em_fd; // fd to read upload bytes + char read_buf[BUF_SIZE]; // buffer to store upload bytes grpc_closure session_read_closure; } session; -/* Called when an upload session can be safely shutdown. - Close session FD and start to shutdown listen FD. */ -static void session_shutdown_cb(void* arg, /*session */ +// Called when an upload session can be safely shutdown. +// Close session FD and start to shutdown listen FD. +static void session_shutdown_cb(void* arg, // session bool /*success*/) { session* se = static_cast(arg); server* sv = se->sv; grpc_fd_orphan(se->em_fd, nullptr, nullptr, "a"); gpr_free(se); - /* Start to shutdown listen fd. */ + // Start to shutdown listen fd. grpc_fd_shutdown(sv->em_fd, GRPC_ERROR_CREATE("session_shutdown_cb")); } -/* Called when data become readable in a session. */ -static void session_read_cb(void* arg, /*session */ +// Called when data become readable in a session. +static void session_read_cb(void* arg, // session grpc_error_handle error) { session* se = static_cast(arg); int fd = grpc_fd_wrapped_fd(se->em_fd); @@ -143,22 +143,22 @@ static void session_read_cb(void* arg, /*session */ } while (read_once > 0); se->sv->read_bytes_total += read_total; - /* read() returns 0 to indicate the TCP connection was closed by the client. - read(fd, read_buf, 0) also returns 0 which should never be called as such. - It is possible to read nothing due to spurious edge event or data has - been drained, In such a case, read() returns -1 and set errno to EAGAIN. */ + // read() returns 0 to indicate the TCP connection was closed by the client. + // read(fd, read_buf, 0) also returns 0 which should never be called as such. + // It is possible to read nothing due to spurious edge event or data has + // been drained, In such a case, read() returns -1 and set errno to EAGAIN. if (read_once == 0) { session_shutdown_cb(arg, true); } else if (read_once == -1) { if (errno == EAGAIN) { - /* An edge triggered event is cached in the kernel until next poll. - In the current single thread implementation, session_read_cb is called - in the polling thread, such that polling only happens after this - callback, and will catch read edge event if data is available again - before notify_on_read. - TODO(chenw): in multi-threaded version, callback and polling can be - run in different threads. polling may catch a persist read edge event - before notify_on_read is called. */ + // An edge triggered event is cached in the kernel until next poll. + // In the current single thread implementation, session_read_cb is called + // in the polling thread, such that polling only happens after this + // callback, and will catch read edge event if data is available again + // before notify_on_read. + // TODO(chenw): in multi-threaded version, callback and polling can be + // run in different threads. polling may catch a persist read edge event + // before notify_on_read is called. grpc_fd_notify_on_read(se->em_fd, &se->session_read_closure); } else { gpr_log(GPR_ERROR, "Unhandled read error %s", @@ -168,8 +168,8 @@ static void session_read_cb(void* arg, /*session */ } } -/* Called when the listen FD can be safely shutdown. - Close listen FD and signal that server can be shutdown. */ +// Called when the listen FD can be safely shutdown. +// Close listen FD and signal that server can be shutdown. static void listen_shutdown_cb(void* arg /*server*/, int /*success*/) { server* sv = static_cast(arg); @@ -182,8 +182,8 @@ static void listen_shutdown_cb(void* arg /*server*/, int /*success*/) { gpr_mu_unlock(g_mu); } -/* Called when a new TCP connection request arrives in the listening port. */ -static void listen_cb(void* arg, /*=sv_arg*/ +// Called when a new TCP connection request arrives in the listening port. +static void listen_cb(void* arg, //=sv_arg grpc_error_handle error) { server* sv = static_cast(arg); int fd; @@ -215,13 +215,13 @@ static void listen_cb(void* arg, /*=sv_arg*/ grpc_fd_notify_on_read(listen_em_fd, &sv->listen_closure); } -/* Max number of connections pending to be accepted by listen(). */ +// Max number of connections pending to be accepted by listen(). #define MAX_NUM_FD 1024 -/* Start a test server, return the TCP listening port bound to listen_fd. - listen_cb() is registered to be interested in reading from listen_fd. - When connection request arrives, listen_cb() is called to accept the - connection request. */ +// Start a test server, return the TCP listening port bound to listen_fd. +// listen_cb() is registered to be interested in reading from listen_fd. +// When connection request arrives, listen_cb() is called to accept the +// connection request. static int server_start(server* sv) { int port = 0; int fd; @@ -237,7 +237,7 @@ static int server_start(server* sv) { sv->em_fd = grpc_fd_create(fd, "server", false); grpc_pollset_add_fd(g_pollset, sv->em_fd); - /* Register to be interested in reading from listen_fd. */ + // Register to be interested in reading from listen_fd. GRPC_CLOSURE_INIT(&sv->listen_closure, listen_cb, sv, grpc_schedule_on_exec_ctx); grpc_fd_notify_on_read(sv->em_fd, &sv->listen_closure); @@ -245,7 +245,7 @@ static int server_start(server* sv) { return port; } -/* Wait and shutdown a sever. */ +// Wait and shutdown a sever. static void server_wait_and_shutdown(server* sv) { gpr_mu_lock(g_mu); while (!sv->done) { @@ -261,23 +261,23 @@ static void server_wait_and_shutdown(server* sv) { gpr_mu_unlock(g_mu); } -/* ===An upload client to test notify_on_write=== */ +// ===An upload client to test notify_on_write=== -/* Client write buffer size */ +// Client write buffer size #define CLIENT_WRITE_BUF_SIZE 10 -/* Total number of times that the client fills up the write buffer */ +// Total number of times that the client fills up the write buffer #define CLIENT_TOTAL_WRITE_CNT 3 -/* An upload client. */ +// An upload client. typedef struct { grpc_fd* em_fd; char write_buf[CLIENT_WRITE_BUF_SIZE]; ssize_t write_bytes_total; - /* Number of times that the client fills up the write buffer and calls - notify_on_write to schedule another write. */ + // Number of times that the client fills up the write buffer and calls + // notify_on_write to schedule another write. int client_write_cnt; - int done; /* set to 1 when a client finishes sending */ + int done; // set to 1 when a client finishes sending grpc_closure write_closure; } client; @@ -288,7 +288,7 @@ static void client_init(client* cl) { cl->done = 0; } -/* Called when a client upload session is ready to shutdown. */ +// Called when a client upload session is ready to shutdown. static void client_session_shutdown_cb(void* arg /*client*/, int /*success*/) { client* cl = static_cast(arg); grpc_fd_orphan(cl->em_fd, nullptr, nullptr, "c"); @@ -297,8 +297,8 @@ static void client_session_shutdown_cb(void* arg /*client*/, int /*success*/) { GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, nullptr))); } -/* Write as much as possible, then register notify_on_write. */ -static void client_session_write(void* arg, /*client */ +// Write as much as possible, then register notify_on_write. +static void client_session_write(void* arg, // client grpc_error_handle error) { client* cl = static_cast(arg); int fd = grpc_fd_wrapped_fd(cl->em_fd); @@ -333,7 +333,7 @@ static void client_session_write(void* arg, /*client */ } } -/* Start a client to send a stream of bytes. */ +// Start a client to send a stream of bytes. static void client_start(client* cl, int port) { int fd; struct sockaddr_in sin; @@ -361,7 +361,7 @@ static void client_start(client* cl, int port) { client_session_write(cl, absl::OkStatus()); } -/* Wait for the signal to shutdown a client. */ +// Wait for the signal to shutdown a client. static void client_wait_and_shutdown(client* cl) { gpr_mu_lock(g_mu); while (!cl->done) { @@ -377,9 +377,9 @@ static void client_wait_and_shutdown(client* cl) { gpr_mu_unlock(g_mu); } -/* Test grpc_fd. Start an upload server and client, upload a stream of - bytes from the client to the server, and verify that the total number of - sent bytes is equal to the total number of received bytes. */ +// Test grpc_fd. Start an upload server and client, upload a stream of +// bytes from the client to the server, and verify that the total number of +// sent bytes is equal to the total number of received bytes. static void test_grpc_fd(void) { server sv; client cl; @@ -427,10 +427,10 @@ static void second_read_callback(void* arg /* fd_change_data */, gpr_mu_unlock(g_mu); } -/* Test that changing the callback we use for notify_on_read actually works. - Note that we have two different but almost identical callbacks above -- the - point is to have two different function pointers and two different data - pointers and make sure that changing both really works. */ +// Test that changing the callback we use for notify_on_read actually works. +// Note that we have two different but almost identical callbacks above -- the +// point is to have two different function pointers and two different data +// pointers and make sure that changing both really works. static void test_grpc_fd_change(void) { grpc_fd* em_fd; fd_change_data a, b; @@ -459,13 +459,13 @@ static void test_grpc_fd_change(void) { em_fd = grpc_fd_create(sv[0], "test_grpc_fd_change", false); grpc_pollset_add_fd(g_pollset, em_fd); - /* Register the first callback, then make its FD readable */ + // Register the first callback, then make its FD readable grpc_fd_notify_on_read(em_fd, &first_closure); data = 0; result = write(sv[1], &data, 1); ASSERT_EQ(result, 1); - /* And now wait for it to run. */ + // And now wait for it to run. gpr_mu_lock(g_mu); while (a.cb_that_ran == nullptr) { grpc_pollset_worker* worker = nullptr; @@ -479,12 +479,12 @@ static void test_grpc_fd_change(void) { ASSERT_EQ(a.cb_that_ran, first_read_callback); gpr_mu_unlock(g_mu); - /* And drain the socket so we can generate a new read edge */ + // And drain the socket so we can generate a new read edge result = read(sv[0], &data, 1); ASSERT_EQ(result, 1); - /* Now register a second callback with distinct change data, and do the same - thing again. */ + // Now register a second callback with distinct change data, and do the same + // thing again. grpc_fd_notify_on_read(em_fd, &second_closure); data = 0; result = write(sv[1], &data, 1); @@ -500,7 +500,7 @@ static void test_grpc_fd_change(void) { gpr_mu_lock(g_mu); } - /* Except now we verify that second_read_callback ran instead */ + // Except now we verify that second_read_callback ran instead ASSERT_EQ(b.cb_that_ran, second_read_callback); gpr_mu_unlock(g_mu); @@ -533,7 +533,7 @@ TEST(FdPosixTest, MainTest) { grpc_shutdown(); } -#endif /* GRPC_POSIX_SOCKET_EV */ +#endif // GRPC_POSIX_SOCKET_EV int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); diff --git a/test/core/iomgr/grpc_ipv6_loopback_available_test.cc b/test/core/iomgr/grpc_ipv6_loopback_available_test.cc index 9224f55d75f..9cfc8e2e980 100644 --- a/test/core/iomgr/grpc_ipv6_loopback_available_test.cc +++ b/test/core/iomgr/grpc_ipv6_loopback_available_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/iomgr/load_file_test.cc b/test/core/iomgr/load_file_test.cc index 867549b4a28..2cf1a6d008d 100644 --- a/test/core/iomgr/load_file_test.cc +++ b/test/core/iomgr/load_file_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/load_file.h" diff --git a/test/core/iomgr/pollset_windows_starvation_test.cc b/test/core/iomgr/pollset_windows_starvation_test.cc index cad5fe0006f..ee0a762bb73 100644 --- a/test/core/iomgr/pollset_windows_starvation_test.cc +++ b/test/core/iomgr/pollset_windows_starvation_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include @@ -140,6 +140,6 @@ int main(int argc, char** argv) { for (auto& t : threads) t.Join(); return EXIT_SUCCESS; } -#else /* defined(GRPC_WINSOCK_SOCKET) */ +#else // defined(GRPC_WINSOCK_SOCKET) int main(int /*argc*/, char** /*argv*/) { return 0; } #endif diff --git a/test/core/iomgr/resolve_address_posix_test.cc b/test/core/iomgr/resolve_address_posix_test.cc index 02009e45070..1369bc00c90 100644 --- a/test/core/iomgr/resolve_address_posix_test.cc +++ b/test/core/iomgr/resolve_address_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/iomgr/resolve_address_test.cc b/test/core/iomgr/resolve_address_test.cc index 0caa1d2c11a..32b751dcec9 100644 --- a/test/core/iomgr/resolve_address_test.cc +++ b/test/core/iomgr/resolve_address_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/resolve_address.h" diff --git a/test/core/iomgr/socket_utils_test.cc b/test/core/iomgr/socket_utils_test.cc index 96461ea305b..7bcd09f8975 100644 --- a/test/core/iomgr/socket_utils_test.cc +++ b/test/core/iomgr/socket_utils_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/port.h" @@ -169,8 +169,8 @@ int main(int argc, char** argv) { return RUN_ALL_TESTS(); } -#else /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#else // GRPC_POSIX_SOCKET_UTILS_COMMON int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_SOCKET_UTILS_COMMON */ +#endif // GRPC_POSIX_SOCKET_UTILS_COMMON diff --git a/test/core/iomgr/stranded_event_test.cc b/test/core/iomgr/stranded_event_test.cc index 8ee1e9c41c7..e154cd7838e 100644 --- a/test/core/iomgr/stranded_event_test.cc +++ b/test/core/iomgr/stranded_event_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 @@ -313,9 +313,9 @@ grpc_core::Resolver::Result BuildResolverResponse( // grpc_call_cancel_with_status TEST(Pollers, TestReadabilityNotificationsDontGetStrandedOnOneCq) { gpr_log(GPR_DEBUG, "test thread"); - /* 64 is a somewhat arbitary number, the important thing is that it - * exceeds the value of MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL (16), which - * is enough to repro a bug at time of writing. */ + // 64 is a somewhat arbitary number, the important thing is that it + // exceeds the value of MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL (16), which + // is enough to repro a bug at time of writing. const int kNumCalls = 32; size_t ping_pong_round = 0; size_t ping_pongs_done = 0; diff --git a/test/core/iomgr/tcp_client_posix_test.cc b/test/core/iomgr/tcp_client_posix_test.cc index aa1e6c66dea..c8127b81927 100644 --- a/test/core/iomgr/tcp_client_posix_test.cc +++ b/test/core/iomgr/tcp_client_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -101,7 +101,7 @@ void test_succeeds(void) { resolved_addr.len = static_cast(sizeof(struct sockaddr_in)); addr->sin_family = AF_INET; - /* create a phony server */ + // create a phony server svr_fd = socket(AF_INET, SOCK_STREAM, 0); ASSERT_GE(svr_fd, 0); ASSERT_EQ(bind(svr_fd, (struct sockaddr*)addr, (socklen_t)resolved_addr.len), @@ -112,7 +112,7 @@ void test_succeeds(void) { connections_complete_before = g_connections_complete; gpr_mu_unlock(g_mu); - /* connect to it */ + // connect to it ASSERT_EQ(getsockname(svr_fd, (struct sockaddr*)addr, (socklen_t*)&resolved_addr.len), 0); @@ -124,7 +124,7 @@ void test_succeeds(void) { &done, &g_connecting, g_pollset_set, grpc_event_engine::experimental::ChannelArgsEndpointConfig(args), &resolved_addr, grpc_core::Timestamp::InfFuture()); - /* await the connection */ + // await the connection do { resolved_addr.len = static_cast(sizeof(addr)); r = accept(svr_fd, reinterpret_cast(addr), @@ -172,7 +172,7 @@ void test_fails(void) { connections_complete_before = g_connections_complete; gpr_mu_unlock(g_mu); - /* connect to a broken address */ + // connect to a broken address GRPC_CLOSURE_INIT(&done, must_fail, nullptr, grpc_schedule_on_exec_ctx); int64_t connection_handle = grpc_tcp_client_connect( &done, &g_connecting, g_pollset_set, @@ -180,7 +180,7 @@ void test_fails(void) { &resolved_addr, grpc_core::Timestamp::InfFuture()); gpr_mu_lock(g_mu); - /* wait for the connection callback to finish */ + // wait for the connection callback to finish while (g_connections_complete == connections_complete_before) { grpc_pollset_worker* worker = nullptr; grpc_core::Timestamp polling_deadline = test_deadline(); @@ -226,7 +226,7 @@ void test_connect_cancellation_succeeds(void) { bind(sock, reinterpret_cast(resolved_addr.addr), resolved_addr.len) == 0); }; - /* create a phony server */ + // create a phony server svr_fd = socket(AF_INET6, SOCK_STREAM, 0); // Try ipv6 if (!try_bind(svr_fd)) { @@ -386,7 +386,7 @@ TEST(TcpClientPosixTest, MainTest) { gpr_free(g_pollset); } -#endif /* GRPC_POSIX_SOCKET_CLIENT */ +#endif // GRPC_POSIX_SOCKET_CLIENT int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); diff --git a/test/core/iomgr/tcp_posix_test.cc b/test/core/iomgr/tcp_posix_test.cc index 64278bdf15f..e869c195790 100644 --- a/test/core/iomgr/tcp_posix_test.cc +++ b/test/core/iomgr/tcp_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/channel/channel_args.h" #include "src/core/lib/gprpp/time.h" @@ -51,21 +51,21 @@ static gpr_mu* g_mu; static grpc_pollset* g_pollset; -/* - General test notes: +// +// General test notes: - All tests which write data into a socket write i%256 into byte i, which is - verified by readers. +// All tests which write data into a socket write i%256 into byte i, which is +// verified by readers. - In general there are a few interesting things to vary which may lead to - exercising different codepaths in an implementation: - 1. Total amount of data written to the socket - 2. Size of slice allocations - 3. Amount of data we read from or write to the socket at once +// In general there are a few interesting things to vary which may lead to +// exercising different codepaths in an implementation: +// 1. Total amount of data written to the socket +// 2. Size of slice allocations +// 3. Amount of data we read from or write to the socket at once - The tests here tend to parameterize these where applicable. +// The tests here tend to parameterize these where applicable. - */ +// static void create_sockets(int sv[2]) { int flags; @@ -77,7 +77,7 @@ static void create_sockets(int sv[2]) { } static void create_inet_sockets(int sv[2]) { - /* Prepare listening socket */ + // Prepare listening socket struct sockaddr_in addr; memset(&addr, 0, sizeof(struct sockaddr_in)); addr.sin_family = AF_INET; @@ -86,7 +86,7 @@ static void create_inet_sockets(int sv[2]) { GPR_ASSERT(bind(sock, (sockaddr*)&addr, sizeof(sockaddr_in)) == 0); listen(sock, 1); - /* Prepare client socket and connect to server */ + // Prepare client socket and connect to server socklen_t len = sizeof(sockaddr_in); GPR_ASSERT(getsockname(sock, (sockaddr*)&addr, &len) == 0); @@ -98,7 +98,7 @@ static void create_inet_sockets(int sv[2]) { sizeof(sockaddr_in)); } while (ret == -1 && errno == EINTR); - /* Accept client connection */ + // Accept client connection len = sizeof(socklen_t); int server; do { @@ -210,7 +210,7 @@ static void read_cb(void* user_data, grpc_error_handle error) { } } -/* Write to a socket, then read from it using the grpc_tcp API. */ +// Write to a socket, then read from it using the grpc_tcp API. static void read_test(size_t num_bytes, size_t slice_size, int min_progress_size) { int sv[2]; @@ -275,8 +275,8 @@ static void read_test(size_t num_bytes, size_t slice_size, static_cast(a[1].value.pointer.p)); } -/* Write to a socket until it fills up, then read from it using the grpc_tcp - API. */ +// Write to a socket until it fills up, then read from it using the grpc_tcp +// API. static void large_read_test(size_t slice_size, int min_progress_size) { int sv[2]; grpc_endpoint* ep; @@ -420,7 +420,7 @@ void drain_socket_blocking(int fd, size_t num_bytes, size_t read_size) { gpr_free(buf); } -/* Verifier for timestamps callback for write_test */ +// Verifier for timestamps callback for write_test void timestamps_verifier(void* arg, grpc_core::Timestamps* ts, grpc_error_handle error) { GPR_ASSERT(error.ok()); @@ -432,10 +432,10 @@ void timestamps_verifier(void* arg, grpc_core::Timestamps* ts, gpr_atm_rel_store(done_timestamps, gpr_atm{1}); } -/* Write to a socket using the grpc_tcp API, then drain it directly. - Note that if the write does not complete immediately we need to drain the - socket in parallel with the read. If collect_timestamps is true, it will - try to get timestamps for the write. */ +// Write to a socket using the grpc_tcp API, then drain it directly. +// Note that if the write does not complete immediately we need to drain the +// socket in parallel with the read. If collect_timestamps is true, it will +// try to get timestamps for the write. static void write_test(size_t num_bytes, size_t slice_size, bool collect_timestamps) { int sv[2]; @@ -530,8 +530,8 @@ void on_fd_released(void* arg, grpc_error_handle /*errors*/) { GRPC_LOG_IF_ERROR("pollset_kick", grpc_pollset_kick(g_pollset, nullptr))); } -/* Do a read_test, then release fd and try to read/write again. Verify that - grpc_tcp_fd() is available before the fd is released. */ +// Do a read_test, then release fd and try to read/write again. Verify that +// grpc_tcp_fd() is available before the fd is released. static void release_fd_test(size_t num_bytes, size_t slice_size) { int sv[2]; grpc_endpoint* ep; @@ -719,8 +719,8 @@ int main(int argc, char** argv) { return 0; } -#else /* GRPC_POSIX_SOCKET_TCP */ +#else // GRPC_POSIX_SOCKET_TCP int main(int argc, char** argv) { return 1; } -#endif /* GRPC_POSIX_SOCKET_TCP */ +#endif // GRPC_POSIX_SOCKET_TCP diff --git a/test/core/iomgr/tcp_server_posix_test.cc b/test/core/iomgr/tcp_server_posix_test.cc index 6f1b196ecb3..50b94d7a2bb 100644 --- a/test/core/iomgr/tcp_server_posix_test.cc +++ b/test/core/iomgr/tcp_server_posix_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -60,7 +60,7 @@ static grpc_pollset* g_pollset; static int g_nconnects = 0; typedef struct { - /* Owns a ref to server. */ + // Owns a ref to server. grpc_tcp_server* server; unsigned port_index; unsigned fd_index; @@ -70,7 +70,7 @@ typedef struct { typedef struct { grpc_tcp_server* server; - /* arg is this server_weak_ref. */ + // arg is this server_weak_ref. grpc_closure server_shutdown; } server_weak_ref; @@ -129,11 +129,11 @@ static void server_weak_ref_init(server_weak_ref* weak_ref) { weak_ref, grpc_schedule_on_exec_ctx); } -/* Make weak_ref->server_shutdown a shutdown_starting cb on server. - grpc_tcp_server promises that the server object will live until - weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server - should be held until server_weak_ref_set() returns to avoid a race where the - server is deleted before the shutdown_starting cb is added. */ +// Make weak_ref->server_shutdown a shutdown_starting cb on server. +// grpc_tcp_server promises that the server object will live until +// weak_ref->server_shutdown has returned. A strong ref on grpc_tcp_server +// should be held until server_weak_ref_set() returns to avoid a race where the +// server is deleted before the shutdown_starting cb is added. static void server_weak_ref_set(server_weak_ref* weak_ref, grpc_tcp_server* server) { grpc_tcp_server_shutdown_starting_add(server, &weak_ref->server_shutdown); @@ -313,12 +313,12 @@ static grpc_error_handle tcp_connect(const test_addr* remote, return absl::OkStatus(); } -/* Tests a tcp server on "::" listeners with multiple ports. If channel_args is - non-NULL, pass them to the server. If dst_addrs is non-NULL, use valid addrs - as destination addrs (port is not set). If dst_addrs is NULL, use listener - addrs as destination addrs. If test_dst_addrs is true, test connectivity with - each destination address, set grpc_resolved_address::len=0 for failures, but - don't fail the overall unitest. */ +// Tests a tcp server on "::" listeners with multiple ports. If channel_args is +// non-NULL, pass them to the server. If dst_addrs is non-NULL, use valid addrs +// as destination addrs (port is not set). If dst_addrs is NULL, use listener +// addrs as destination addrs. If test_dst_addrs is true, test connectivity with +// each destination address, set grpc_resolved_address::len=0 for failures, but +// don't fail the overall unitest. static void test_connect(size_t num_connects, const grpc_channel_args* channel_args, test_addrs* dst_addrs, bool test_dst_addrs) { @@ -366,8 +366,8 @@ static void test_connect(size_t num_connects, grpc_tcp_server_add_port(s, &resolved_addr, &svr_port))); gpr_log(GPR_INFO, "Allocated port %d", svr_port); ASSERT_GT(svr_port, 0); - /* Cannot use wildcard (port==0), because add_port() will try to reuse the - same port as a previous add_port(). */ + // Cannot use wildcard (port==0), because add_port() will try to reuse the + // same port as a previous add_port(). svr1_port = grpc_pick_unused_port_or_die(); ASSERT_GT(svr1_port, 0); gpr_log(GPR_INFO, "Picked unused port %d", svr1_port); @@ -376,15 +376,15 @@ static void test_connect(size_t num_connects, absl::OkStatus()); ASSERT_EQ(port, svr1_port); - /* Bad port_index. */ + // Bad port_index. ASSERT_EQ(grpc_tcp_server_port_fd_count(s, 2), 0); ASSERT_LT(grpc_tcp_server_port_fd(s, 2, 0), 0); - /* Bad fd_index. */ + // Bad fd_index. ASSERT_LT(grpc_tcp_server_port_fd(s, 0, 100), 0); ASSERT_LT(grpc_tcp_server_port_fd(s, 1, 100), 0); - /* Got at least one fd per port. */ + // Got at least one fd per port. svr_fd_count = grpc_tcp_server_port_fd_count(s, 0); ASSERT_GE(svr_fd_count, 1); svr1_fd_count = grpc_tcp_server_port_fd_count(s, 1); @@ -456,14 +456,14 @@ static void test_connect(size_t num_connects, } } } - /* Weak ref to server valid until final unref. */ + // Weak ref to server valid until final unref. ASSERT_NE(weak_ref.server, nullptr); ASSERT_GE(grpc_tcp_server_port_fd(s, 0, 0), 0); grpc_tcp_server_unref(s); grpc_core::ExecCtx::Get()->Flush(); - /* Weak ref lost. */ + // Weak ref lost. ASSERT_EQ(weak_ref.server, nullptr); } @@ -525,17 +525,17 @@ TEST(TcpServerPosixTest, MainTest) { freeifaddrs(ifa); ifa = nullptr; - /* Connect to same addresses as listeners. */ + // Connect to same addresses as listeners. test_connect(1, nullptr, nullptr, false); test_connect(10, nullptr, nullptr, false); - /* Set dst_addrs->addrs[i].len=0 for dst_addrs that are unreachable with a - "::" listener. */ + // Set dst_addrs->addrs[i].len=0 for dst_addrs that are unreachable with a + // "::" listener. test_connect(1, nullptr, dst_addrs, true); - /* Test connect(2) with dst_addrs. */ + // Test connect(2) with dst_addrs. test_connect(1, &channel_args, dst_addrs, false); - /* Test connect(2) with dst_addrs. */ + // Test connect(2) with dst_addrs. test_connect(10, &channel_args, dst_addrs, false); GRPC_CLOSURE_INIT(&destroyed, destroy_pollset, g_pollset, @@ -547,7 +547,7 @@ TEST(TcpServerPosixTest, MainTest) { gpr_free(g_pollset); } -#endif /* GRPC_POSIX_SOCKET_SERVER */ +#endif // GRPC_POSIX_SOCKET_SERVER int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); diff --git a/test/core/iomgr/timer_heap_test.cc b/test/core/iomgr/timer_heap_test.cc index 10edea7fe27..70e907a309b 100644 --- a/test/core/iomgr/timer_heap_test.cc +++ b/test/core/iomgr/timer_heap_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/timer_heap.h" @@ -64,9 +64,9 @@ static void check_valid(grpc_timer_heap* pq) { } } -/******************************************************************************* - * test1 - */ +//****************************************************************************** +// test1 +// static void test1(void) { grpc_timer_heap pq; @@ -90,8 +90,8 @@ static void test1(void) { inpq[i] = 1; } for (i = 0; i < num_test_elements; ++i) { - /* Test that check still succeeds even for element that wasn't just - inserted. */ + // Test that check still succeeds even for element that wasn't just + // inserted. ASSERT_TRUE(contains(&pq, &test_elements[i])); } @@ -102,7 +102,7 @@ static void test1(void) { for (i = 0; i < num_test_operations; ++i) { size_t elem_num = static_cast(rand()) % num_test_elements; grpc_timer* el = &test_elements[elem_num]; - if (!inpq[elem_num]) { /* not in pq */ + if (!inpq[elem_num]) { // not in pq ASSERT_FALSE(contains(&pq, el)); el->deadline = random_deadline(); grpc_timer_heap_add(&pq, el); @@ -123,9 +123,9 @@ static void test1(void) { gpr_free(inpq); } -/******************************************************************************* - * test2 - */ +//****************************************************************************** +// test2 +// typedef struct { grpc_timer elem; @@ -170,7 +170,7 @@ static void test2(void) { for (size_t round = 0; round < 10000; round++) { int r = rand() % 1000; if (r <= 550) { - /* 55% of the time we try to add something */ + // 55% of the time we try to add something elem_struct* el = search_elems(elems, elems_size, false); if (el != nullptr) { el->elem.deadline = random_deadline(); @@ -180,7 +180,7 @@ static void test2(void) { check_valid(&pq); } } else if (r <= 650) { - /* 10% of the time we try to remove something */ + // 10% of the time we try to remove something elem_struct* el = search_elems(elems, elems_size, true); if (el != nullptr) { grpc_timer_heap_remove(&pq, &el->elem); @@ -189,7 +189,7 @@ static void test2(void) { check_valid(&pq); } } else { - /* the remaining times we pop */ + // the remaining times we pop if (num_inserted > 0) { grpc_timer* top = grpc_timer_heap_top(&pq); grpc_timer_heap_pop(&pq); @@ -232,20 +232,20 @@ static void shrink_test(void) { size_t i; size_t expected_size; - /* A large random number to allow for multiple shrinkages, at least 512. */ + // A large random number to allow for multiple shrinkages, at least 512. const size_t num_elements = static_cast(rand()) % 2000 + 512; grpc_timer_heap_init(&pq); - /* Create a priority queue with many elements. Make sure the Size() is - correct. */ + // Create a priority queue with many elements. Make sure the Size() is + // correct. for (i = 0; i < num_elements; ++i) { ASSERT_EQ(i, pq.timer_count); grpc_timer_heap_add(&pq, create_test_elements(1)); } ASSERT_EQ(num_elements, pq.timer_count); - /* Remove elements until the Size is 1/4 the original size. */ + // Remove elements until the Size is 1/4 the original size. while (pq.timer_count > num_elements / 4) { grpc_timer* const te = pq.timers[pq.timer_count - 1]; grpc_timer_heap_remove(&pq, te); @@ -253,14 +253,14 @@ static void shrink_test(void) { } ASSERT_EQ(num_elements / 4, pq.timer_count); - /* Expect that Capacity is in the right range: - Size * 2 <= Capacity <= Size * 4 */ + // Expect that Capacity is in the right range: + // Size * 2 <= Capacity <= Size * 4 ASSERT_LE(pq.timer_count * 2, pq.timer_capacity); ASSERT_LE(pq.timer_capacity, pq.timer_count * 4); check_valid(&pq); - /* Remove the rest of the elements. Check that the Capacity is not more than - 4 times the Size and not less than 2 times, but never goes below 16. */ + // Remove the rest of the elements. Check that the Capacity is not more than + // 4 times the Size and not less than 2 times, but never goes below 16. expected_size = pq.timer_count; while (pq.timer_count > 0) { const size_t which = static_cast(rand()) % pq.timer_count; diff --git a/test/core/iomgr/timer_list_test.cc b/test/core/iomgr/timer_list_test.cc index db829b38db4..b71456b10e1 100644 --- a/test/core/iomgr/timer_list_test.cc +++ b/test/core/iomgr/timer_list_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -60,21 +60,21 @@ static void add_test(void) { grpc_core::Timestamp start = grpc_core::Timestamp::Now(); - /* 10 ms timers. will expire in the current epoch */ + // 10 ms timers. will expire in the current epoch for (i = 0; i < 10; i++) { grpc_timer_init( &timers[i], start + grpc_core::Duration::Milliseconds(10), GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)i, grpc_schedule_on_exec_ctx)); } - /* 1010 ms timers. will expire in the next epoch */ + // 1010 ms timers. will expire in the next epoch for (i = 10; i < 20; i++) { grpc_timer_init( &timers[i], start + grpc_core::Duration::Milliseconds(1010), GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)i, grpc_schedule_on_exec_ctx)); } - /* collect timers. Only the first batch should be ready. */ + // collect timers. Only the first batch should be ready. grpc_core::ExecCtx::Get()->TestOnlySetNow( start + grpc_core::Duration::Milliseconds(500)); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_FIRED); @@ -93,7 +93,7 @@ static void add_test(void) { GPR_ASSERT(cb_called[i][0] == 0); } - /* collect the rest of the timers */ + // collect the rest of the timers grpc_core::ExecCtx::Get()->TestOnlySetNow( start + grpc_core::Duration::Milliseconds(1500)); GPR_ASSERT(grpc_timer_check(nullptr) == GRPC_TIMERS_FIRED); @@ -114,7 +114,7 @@ static void add_test(void) { grpc_timer_list_shutdown(); } -/* Cleaning up a list with pending timers. */ +// Cleaning up a list with pending timers. void destruction_test(void) { grpc_timer timers[5]; grpc_core::ExecCtx exec_ctx; @@ -160,18 +160,18 @@ void destruction_test(void) { GPR_ASSERT(1 == cb_called[2][0]); } -/* Cleans up a list with pending timers that simulate long-running-services. - This test does the following: - 1) Simulates grpc server start time to 25 days in the past (completed in - `main` using TestOnlyGlobalInit()) - 2) Creates 4 timers - one with a deadline 25 days in the future, one just - 3 milliseconds in future, one way out in the future, and one using the - grpc_timespec_to_millis_round_up function to compute a deadline of 25 - days in the future - 3) Simulates 4 milliseconds of elapsed time by changing `now` (cached at - step 1) to `now+4` - 4) Shuts down the timer list - https://github.com/grpc/grpc/issues/15904 */ +// Cleans up a list with pending timers that simulate long-running-services. +// This test does the following: +// 1) Simulates grpc server start time to 25 days in the past (completed in +// `main` using TestOnlyGlobalInit()) +// 2) Creates 4 timers - one with a deadline 25 days in the future, one just +// 3 milliseconds in future, one way out in the future, and one using the +// grpc_timespec_to_millis_round_up function to compute a deadline of 25 +// days in the future +// 3) Simulates 4 milliseconds of elapsed time by changing `now` (cached at +// step 1) to `now+4` +// 4) Shuts down the timer list +// https://github.com/grpc/grpc/issues/15904 void long_running_service_cleanup_test(void) { grpc_timer timers[4]; grpc_core::ExecCtx exec_ctx; @@ -200,8 +200,8 @@ void long_running_service_cleanup_test(void) { gpr_timespec deadline_spec = (now + k25Days).as_timespec(gpr_clock_type::GPR_CLOCK_MONOTONIC); - /* grpc_timespec_to_millis_round_up is how users usually compute a millisecond - input value into grpc_timer_init, so we mimic that behavior here */ + // grpc_timespec_to_millis_round_up is how users usually compute a millisecond + // input value into grpc_timer_init, so we mimic that behavior here grpc_timer_init( &timers[3], grpc_core::Timestamp::FromTimespecRoundUp(deadline_spec), GRPC_CLOSURE_CREATE(cb, (void*)(intptr_t)3, grpc_schedule_on_exec_ctx)); @@ -221,7 +221,7 @@ void long_running_service_cleanup_test(void) { grpc_timer_list_shutdown(); grpc_core::ExecCtx::Get()->Flush(); - /* Timers 0, 2, and 3 were fired with an error during cleanup */ + // Timers 0, 2, and 3 were fired with an error during cleanup GPR_ASSERT(1 == cb_called[0][0]); GPR_ASSERT(0 == cb_called[1][0]); GPR_ASSERT(1 == cb_called[2][0]); @@ -231,7 +231,7 @@ void long_running_service_cleanup_test(void) { int main(int argc, char** argv) { gpr_time_init(); - /* Tests with default g_start_time */ + // Tests with default g_start_time { grpc::testing::TestEnvironment env(&argc, argv); grpc_core::ExecCtx exec_ctx; @@ -243,12 +243,12 @@ int main(int argc, char** argv) { grpc_iomgr_platform_shutdown(); } - /* Begin long running service tests */ + // Begin long running service tests { grpc::testing::TestEnvironment env(&argc, argv); - /* Set g_start_time back 25 days. */ - /* We set g_start_time here in case there are any initialization - dependencies that use g_start_time. */ + // Set g_start_time back 25 days. + // We set g_start_time here in case there are any initialization + // dependencies that use g_start_time. grpc_core::TestOnlySetProcessEpoch(gpr_time_sub( gpr_now(gpr_clock_type::GPR_CLOCK_MONOTONIC), gpr_time_add(gpr_time_from_hours(kHoursIn25Days, GPR_TIMESPAN), diff --git a/test/core/json/fuzzer.cc b/test/core/json/fuzzer.cc index 6953da70bc9..bb08a25255b 100644 --- a/test/core/json/fuzzer.cc +++ b/test/core/json/fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/memory_usage/callback_client.cc b/test/core/memory_usage/callback_client.cc index 314cd190a30..f460ff460f8 100644 --- a/test/core/memory_usage/callback_client.cc +++ b/test/core/memory_usage/callback_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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 #include diff --git a/test/core/memory_usage/callback_server.cc b/test/core/memory_usage/callback_server.cc index df82601c238..c2decb9154b 100644 --- a/test/core/memory_usage/callback_server.cc +++ b/test/core/memory_usage/callback_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2022 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. - * - */ +// +// +// Copyright 2022 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 #include @@ -66,8 +66,8 @@ class ServerCallbackImpl final long before_server_create; }; -/* We have some sort of deadlock, so let's not exit gracefully for now. - TODO(chennancy) Add graceful shutdown */ +// We have some sort of deadlock, so let's not exit gracefully for now. +// TODO(chennancy) Add graceful shutdown static void sigint_handler(int /*x*/) { _exit(0); } ABSL_FLAG(std::string, bind, "", "Bind host:port"); diff --git a/test/core/memory_usage/client.cc b/test/core/memory_usage/client.cc index 23485370207..43bcf44b2ec 100644 --- a/test/core/memory_usage/client.cc +++ b/test/core/memory_usage/client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/memory_usage/memory_usage_test.cc b/test/core/memory_usage/memory_usage_test.cc index 838f9063e8c..0e9523e9397 100644 --- a/test/core/memory_usage/memory_usage_test.cc +++ b/test/core/memory_usage/memory_usage_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -72,13 +72,13 @@ class Subprocess { gpr_subprocess* process_; }; -/* per-call memory usage benchmark */ +// per-call memory usage benchmark int RunCallBenchmark(char* root, std::vector server_scenario_flags, std::vector client_scenario_flags) { int status; int port = grpc_pick_unused_port_or_die(); - /* start the server */ + // start the server std::vector server_flags = { absl::StrCat(root, "/memory_usage_server", gpr_subprocess_binary_extension()), @@ -87,7 +87,7 @@ int RunCallBenchmark(char* root, std::vector server_scenario_flags, absl::c_move(server_scenario_flags, std::back_inserter(server_flags)); Subprocess svr(server_flags); - /* start the client */ + // start the client std::vector client_flags = { absl::StrCat(root, "/memory_usage_client", gpr_subprocess_binary_extension()), @@ -97,7 +97,7 @@ int RunCallBenchmark(char* root, std::vector server_scenario_flags, // Add scenario-specific client flags to the end of the client_flags absl::c_move(client_scenario_flags, std::back_inserter(client_flags)); Subprocess cli(client_flags); - /* wait for completion */ + // wait for completion if ((status = cli.Join()) != 0) { printf("client failed with: %d", status); return 1; @@ -107,13 +107,13 @@ int RunCallBenchmark(char* root, std::vector server_scenario_flags, return svr.Join() == 0 ? 0 : 2; } -/* Per-channel benchmark*/ +// Per-channel benchmark int RunChannelBenchmark(char* root) { // TODO(chennancy) Add the scenario specific flags int status; int port = grpc_pick_unused_port_or_die(); - /* start the server */ + // start the server std::vector server_flags = { absl::StrCat(root, "/memory_usage_callback_server", gpr_subprocess_binary_extension()), @@ -124,7 +124,7 @@ int RunChannelBenchmark(char* root) { // of client sending an RPC before the server is set up gpr_sleep_until(grpc_timeout_seconds_to_deadline(1)); - /* start the client */ + // start the client std::vector client_flags = { absl::StrCat(root, "/memory_usage_callback_client", gpr_subprocess_binary_extension()), @@ -134,7 +134,7 @@ int RunChannelBenchmark(char* root) { absl::StrCat("--server_pid=", svr.GetPID()), absl::StrCat("--size=", absl::GetFlag(FLAGS_size))}; Subprocess cli(client_flags); - /* wait for completion */ + // wait for completion if ((status = cli.Join()) != 0) { printf("client failed with: %d", status); return 1; @@ -164,7 +164,7 @@ int main(int argc, char** argv) { char root[1024]; std::vector args; - /* figure out where we are */ + // figure out where we are if (lslash) { memcpy(root, me, static_cast(lslash - me)); root[lslash - me] = 0; @@ -172,7 +172,7 @@ int main(int argc, char** argv) { strcpy(root, "."); } - /* Set configurations based off scenario_config*/ + // Set configurations based off scenario_config struct ScenarioArgs { std::vector client; std::vector server; diff --git a/test/core/memory_usage/server.cc b/test/core/memory_usage/server.cc index 92b61360bac..23eb9ee8659 100644 --- a/test/core/memory_usage/server.cc +++ b/test/core/memory_usage/server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -38,7 +38,7 @@ #include "test/core/memory_usage/memstats.h" #ifndef _WIN32 -/* This is for _exit() below, which is temporary. */ +// This is for _exit() below, which is temporary. #include #endif @@ -150,8 +150,8 @@ static void send_snapshot(void* tag, MemStats* snapshot) { grpc_call_start_batch((*(fling_call*)tag).call, snapshot_ops, (size_t)(op - snapshot_ops), tag, nullptr)); } -/* We have some sort of deadlock, so let's not exit gracefully for now. - When that is resolved, please remove the #include above. */ +// We have some sort of deadlock, so let's not exit gracefully for now. +// When that is resolved, please remove the #include above. static void sigint_handler(int /*x*/) { _exit(0); } ABSL_FLAG(std::string, bind, "", "Bind host:port"); diff --git a/test/core/nanopb/fuzzer_response.cc b/test/core/nanopb/fuzzer_response.cc index 038f2331fa3..72d72039396 100644 --- a/test/core/nanopb/fuzzer_response.cc +++ b/test/core/nanopb/fuzzer_response.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -32,12 +32,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/, grpc_init(); if (squelch) gpr_set_log_function(dont_log); // TODO(veblush): Convert this to upb. - /* - grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); - upb::Arena arena; - grpc_core::grpc_grpclb_initial_response_parse(slice, arena.ptr()); - grpc_slice_unref(slice); - */ + // + // grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); + // upb::Arena arena; + // grpc_core::grpc_grpclb_initial_response_parse(slice, arena.ptr()); + // grpc_slice_unref(slice); + // grpc_shutdown(); return 0; } diff --git a/test/core/nanopb/fuzzer_serverlist.cc b/test/core/nanopb/fuzzer_serverlist.cc index 0a4dccc2ca9..5d36655a972 100644 --- a/test/core/nanopb/fuzzer_serverlist.cc +++ b/test/core/nanopb/fuzzer_serverlist.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include @@ -32,14 +32,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* /*data*/, grpc_init(); if (squelch) gpr_set_log_function(dont_log); // TODO(veblush): Convert this to upb. - /* - grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); - grpc_core::grpc_grpclb_serverlist* serverlist; - if ((serverlist = grpc_core::grpc_grpclb_response_parse_serverlist(slice))) { - grpc_grpclb_destroy_serverlist(serverlist); - } - grpc_slice_unref(slice); - */ + // + // grpc_slice slice = grpc_slice_from_copied_buffer((const char*)data, size); + // grpc_core::grpc_grpclb_serverlist* serverlist; + // if ((serverlist = grpc_core::grpc_grpclb_response_parse_serverlist(slice))) + // { grpc_grpclb_destroy_serverlist(serverlist); + //} + // grpc_slice_unref(slice); + // grpc_shutdown(); return 0; } diff --git a/test/core/network_benchmarks/low_level_ping_pong.cc b/test/core/network_benchmarks/low_level_ping_pong.cc index 77b4af3a480..aeb139a5acf 100644 --- a/test/core/network_benchmarks/low_level_ping_pong.cc +++ b/test/core/network_benchmarks/low_level_ping_pong.cc @@ -1,28 +1,28 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* - Basic I/O ping-pong benchmarks. - - The goal here is to establish lower bounds on how fast the stack could get by - measuring the cost of using various I/O strategies to do a basic - request-response loop. - */ +// +// +// 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 +// +// 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. +// +// + +// +// Basic I/O ping-pong benchmarks. + +// The goal here is to establish lower bounds on how fast the stack could get by +// measuring the cost of using various I/O strategies to do a basic +// request-response loop. +// #include #include @@ -64,14 +64,14 @@ typedef struct thread_args { const char* strategy_name; } thread_args; -/* - Read strategies +// +// Read strategies - There are a number of read strategies, each of which has a blocking and - non-blocking version. - */ +// There are a number of read strategies, each of which has a blocking and +// non-blocking version. +// -/* Basic call to read() */ +// Basic call to read() static int read_bytes(int fd, char* buf, size_t read_size, int spin) { size_t bytes_read = 0; ssize_t err; @@ -103,7 +103,7 @@ static int spin_read_bytes(thread_args* args, char* buf) { return read_bytes(args->fds.read_fd, buf, args->msg_size, 1); } -/* Call poll() to monitor a non-blocking fd */ +// Call poll() to monitor a non-blocking fd static int poll_read_bytes(int fd, char* buf, size_t read_size, int spin) { struct pollfd pfd; size_t bytes_read = 0; @@ -147,7 +147,7 @@ static int poll_read_bytes_spin(struct thread_args* args, char* buf) { } #ifdef __linux__ -/* Call epoll_wait() to monitor a non-blocking fd */ +// Call epoll_wait() to monitor a non-blocking fd static int epoll_read_bytes(struct thread_args* args, char* buf, int spin) { struct epoll_event ev; size_t bytes_read = 0; @@ -174,8 +174,8 @@ static int epoll_read_bytes(struct thread_args* args, char* buf, int spin) { } while (err2 < 0 && errno == EINTR); if (errno == EAGAIN) break; bytes_read += static_cast(err2); - /* TODO(klempner): This should really be doing an extra call after we are - done to ensure we see an EAGAIN */ + // TODO(klempner): This should really be doing an extra call after we are + // done to ensure we see an EAGAIN } while (bytes_read < read_size); } while (bytes_read < read_size); GPR_ASSERT(bytes_read == read_size); @@ -189,12 +189,12 @@ static int epoll_read_bytes_blocking(struct thread_args* args, char* buf) { static int epoll_read_bytes_spin(struct thread_args* args, char* buf) { return epoll_read_bytes(args, buf, 1); } -#endif /* __linux__ */ +#endif // __linux__ -/* Write out bytes. - At this point we only have one strategy, since in the common case these - writes go directly out to the kernel. - */ +// Write out bytes. +// At this point we only have one strategy, since in the common case these +// writes go directly out to the kernel. +// static int blocking_write_bytes(struct thread_args* args, char* buf) { size_t bytes_written = 0; ssize_t err; @@ -217,12 +217,12 @@ static int blocking_write_bytes(struct thread_args* args, char* buf) { return 0; } -/* - Initialization code +// +// Initialization code - These are called at the beginning of the client and server thread, depending - on the scenario we're using. - */ +// These are called at the beginning of the client and server thread, depending +// on the scenario we're using. +// static int set_socket_nonblocking(thread_args* args) { if (!GRPC_LOG_IF_ERROR("Unable to set read socket nonblocking", grpc_set_socket_nonblocking(args->fds.read_fd, 1))) { @@ -238,7 +238,7 @@ static int set_socket_nonblocking(thread_args* args) { static int do_nothing(thread_args* /*args*/) { return 0; } #ifdef __linux__ -/* Special case for epoll, where we need to create the fd ahead of time. */ +// Special case for epoll, where we need to create the fd ahead of time. static int epoll_setup(thread_args* args) { int epoll_fd; struct epoll_event ev; @@ -285,8 +285,8 @@ static void server_thread_wrap(void* arg) { } static void print_histogram(grpc_histogram* histogram) { - /* TODO(klempner): Print more detailed information, such as detailed histogram - buckets */ + // TODO(klempner): Print more detailed information, such as detailed histogram + // buckets gpr_log(GPR_INFO, "latency (50/95/99/99.9): %f/%f/%f/%f", grpc_histogram_percentile(histogram, 50), grpc_histogram_percentile(histogram, 95), @@ -334,7 +334,7 @@ error: grpc_histogram_destroy(histogram); } -/* This roughly matches tcp_server's create_listening_socket */ +// This roughly matches tcp_server's create_listening_socket static int create_listening_socket(struct sockaddr* port, socklen_t len) { int fd = socket(port->sa_family, SOCK_STREAM, 0); if (fd < 0) { @@ -561,7 +561,7 @@ static test_strategy test_strategies[] = { #ifdef __linux__ {"same_thread_epoll", epoll_read_bytes_blocking, epoll_setup}, {"spin_epoll", epoll_read_bytes_spin, epoll_setup}, -#endif /* __linux__ */ +#endif // __linux__ {"spin_read", spin_read_bytes, set_socket_nonblocking}, {"spin_poll", poll_read_bytes_spin, set_socket_nonblocking}}; diff --git a/test/core/promise/seq_test.cc b/test/core/promise/seq_test.cc index 993aad8070b..61ae888599f 100644 --- a/test/core/promise/seq_test.cc +++ b/test/core/promise/seq_test.cc @@ -42,15 +42,15 @@ TEST(SeqTest, TwoTypedThens) { EXPECT_FALSE(absl::holds_alternative(Seq(initial, next1, next2)())); } -/* This does not compile, but is useful for testing error messages generated -TEST(SeqTest, MisTypedThen) { - struct A {}; - struct B {}; - auto initial = [] { return A{}; }; - auto next = [](B) { return []() { return B{}; }; }; - Seq(initial, next)().take(); -} -*/ +// This does not compile, but is useful for testing error messages generated +// TEST(SeqTest, MisTypedThen) { +// struct A {}; +// struct B {}; +// auto initial = [] { return A{}; }; +// auto next = [](B) { return []() { return B{}; }; }; +// Seq(initial, next)().take(); +//} +// TEST(SeqTest, TwoThens) { auto initial = [] { return std::string("a"); }; diff --git a/test/core/resource_quota/arena_test.cc b/test/core/resource_quota/arena_test.cc index ecc4f423462..be23aaad935 100644 --- a/test/core/resource_quota/arena_test.cc +++ b/test/core/resource_quota/arena_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/resource_quota/arena.h" diff --git a/test/core/security/alts_credentials_fuzzer.cc b/test/core/security/alts_credentials_fuzzer.cc index 3420432ae6d..eaf60c92020 100644 --- a/test/core/security/alts_credentials_fuzzer.cc +++ b/test/core/security/alts_credentials_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/security/alts_security_connector_test.cc b/test/core/security/alts_security_connector_test.cc index 0551b62325c..77a3b1f06e7 100644 --- a/test/core/security/alts_security_connector_test.cc +++ b/test/core/security/alts_security_connector_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/lib/security/security_connector/alts/alts_security_connector.h" @@ -35,7 +35,7 @@ using grpc_core::internal::grpc_alts_auth_context_from_tsi_peer; -/* This file contains unit tests of grpc_alts_auth_context_from_tsi_peer(). */ +// This file contains unit tests of grpc_alts_auth_context_from_tsi_peer(). TEST(AltsSecurityConnectorTest, InvalidInputFailure) { grpc_core::RefCountedPtr ctx = grpc_alts_auth_context_from_tsi_peer(nullptr); diff --git a/test/core/security/auth_context_test.cc b/test/core/security/auth_context_test.cc index f57030ac275..029e2968122 100644 --- a/test/core/security/auth_context_test.cc +++ b/test/core/security/auth_context_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/security/check_gcp_environment_linux_test.cc b/test/core/security/check_gcp_environment_linux_test.cc index ec8a047f13b..c3d1fea3731 100644 --- a/test/core/security/check_gcp_environment_linux_test.cc +++ b/test/core/security/check_gcp_environment_linux_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -32,7 +32,7 @@ #if GPR_LINUX static bool check_bios_data_linux_test(const char* data) { - /* Create a file with contents data. */ + // Create a file with contents data. char* filename = nullptr; FILE* fp = gpr_tmpfile("check_gcp_environment_test", &filename); EXPECT_NE(filename, nullptr); @@ -41,24 +41,24 @@ static bool check_bios_data_linux_test(const char* data) { fclose(fp); bool result = grpc_core::internal::check_bios_data( reinterpret_cast(filename)); - /* Cleanup. */ + // Cleanup. remove(filename); gpr_free(filename); return result; } TEST(CheckGcpEnvironmentLinuxTest, GcpEnvironmentCheckSuccess) { - /* Exact match. */ + // Exact match. ASSERT_TRUE(check_bios_data_linux_test("Google")); ASSERT_TRUE(check_bios_data_linux_test("Google Compute Engine")); - /* With leading and trailing whitespaces. */ + // With leading and trailing whitespaces. ASSERT_TRUE(check_bios_data_linux_test(" Google ")); ASSERT_TRUE(check_bios_data_linux_test("Google ")); ASSERT_TRUE(check_bios_data_linux_test(" Google")); ASSERT_TRUE(check_bios_data_linux_test(" Google Compute Engine ")); ASSERT_TRUE(check_bios_data_linux_test("Google Compute Engine ")); ASSERT_TRUE(check_bios_data_linux_test(" Google Compute Engine")); - /* With leading and trailing \t and \n. */ + // With leading and trailing \t and \n. ASSERT_TRUE(check_bios_data_linux_test("\t\tGoogle Compute Engine\t")); ASSERT_TRUE(check_bios_data_linux_test("Google Compute Engine\n")); ASSERT_TRUE(check_bios_data_linux_test("\n\n\tGoogle Compute Engine \n\t\t")); diff --git a/test/core/security/check_gcp_environment_windows_test.cc b/test/core/security/check_gcp_environment_windows_test.cc index c5e44651044..d2423ec2807 100644 --- a/test/core/security/check_gcp_environment_windows_test.cc +++ b/test/core/security/check_gcp_environment_windows_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/security/create_jwt.cc b/test/core/security/create_jwt.cc index a82e07a86af..19c397ce1bb 100644 --- a/test/core/security/create_jwt.cc +++ b/test/core/security/create_jwt.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/security/credentials_test.cc b/test/core/security/credentials_test.cc index 69f4a586bc5..8e89311c015 100644 --- a/test/core/security/credentials_test.cc +++ b/test/core/security/credentials_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -78,15 +78,15 @@ using internal::set_gce_tenancy_checker_for_testing; namespace { -/* -- Constants. -- */ +// -- Constants. -- const char test_google_iam_authorization_token[] = "blahblahblhahb"; const char test_google_iam_authority_selector[] = "respectmyauthoritah"; const char test_oauth2_bearer_token[] = "Bearer blaaslkdjfaslkdfasdsfasf"; -/* This JSON key was generated with the GCE console and revoked immediately. - The identifiers have been changed as well. - Maximum size for a string literal is 509 chars in C89, yay! */ +// This JSON key was generated with the GCE console and revoked immediately. +// The identifiers have been changed as well. +// Maximum size for a string literal is 509 chars in C89, yay! const char test_json_key_str_part1[] = "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----" "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE" @@ -118,14 +118,14 @@ const char test_json_key_str_part3[] = "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent." "com\", \"type\": \"service_account\" }"; -/* Test refresh token. */ +// Test refresh token. const char test_refresh_token_str[] = "{ \"client_id\": \"32555999999.apps.googleusercontent.com\"," " \"client_secret\": \"EmssLNjJy1332hD4KFsecret\"," " \"refresh_token\": \"1/Blahblasj424jladJDSGNf-u4Sua3HDA2ngjd42\"," " \"type\": \"authorized_user\"}"; -/* Test external account credentials. */ +// Test external account credentials. const char test_external_account_credentials_str[] = "{\"type\":\"external_account\",\"audience\":\"audience\",\"subject_" "token_type\":\"subject_token_type\",\"service_account_impersonation_" @@ -348,13 +348,13 @@ const char "\"regional_cred_verification_url\":\"https://foo.com:5555/" "regional_cred_verification_url_{region}\"}"; -/* -- Global state flags. -- */ +// -- Global state flags. -- bool g_test_is_on_gce = false; bool g_test_gce_tenancy_checker_called = false; -/* -- Utils. -- */ +// -- Utils. -- char* test_json_key_str(void) { size_t result_len = strlen(test_json_key_str_part1) + @@ -379,7 +379,7 @@ grpc_http_response http_response(int status, const char* body) { return response; } -/* -- Tests. -- */ +// -- Tests. -- TEST(CredentialsTest, TestOauth2TokenFetcherCredsParsingOk) { ExecCtx exec_ctx; @@ -600,7 +600,7 @@ TEST(CredentialsTest, TestGoogleIamCreds) { grpc_call_credentials* creds = grpc_google_iam_credentials_create( test_google_iam_authorization_token, test_google_iam_authority_selector, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority, kTestPath); @@ -614,7 +614,7 @@ TEST(CredentialsTest, TestAccessTokenCreds) { grpc_call_credentials* creds = grpc_access_token_credentials_create("blah", nullptr); GPR_ASSERT(creds->type() == grpc_access_token_credentials::Type()); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority, kTestPath); @@ -675,7 +675,7 @@ TEST(CredentialsTest, TestOauth2GoogleIamCompositeCreds) { grpc_call_credentials* oauth2_creds = grpc_md_only_test_credentials_create( "authorization", test_oauth2_bearer_token); - /* Check security level of fake credentials. */ + // Check security level of fake credentials. GPR_ASSERT(oauth2_creds->min_security_level() == GRPC_SECURITY_NONE); grpc_call_credentials* google_iam_creds = grpc_google_iam_credentials_create( @@ -684,7 +684,7 @@ TEST(CredentialsTest, TestOauth2GoogleIamCompositeCreds) { grpc_call_credentials* composite_creds = grpc_composite_call_credentials_create(oauth2_creds, google_iam_creds, nullptr); - /* Check security level of composite credentials. */ + // Check security level of composite credentials. GPR_ASSERT(composite_creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); @@ -831,10 +831,10 @@ TEST(CredentialsTest, TestComputeEngineCredsSuccess) { "OAuth2TokenFetcherCredentials}"; grpc_call_credentials* creds = grpc_google_compute_engine_credentials_create(nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http get should be called. */ + // First request: http get should be called. auto state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(compute_engine_httpcli_get_success_override, httpcli_post_should_not_be_called, @@ -843,7 +843,7 @@ TEST(CredentialsTest, TestComputeEngineCredsSuccess) { kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, httpcli_post_should_not_be_called, @@ -881,7 +881,7 @@ TEST(CredentialsTest, TestComputeEngineCredsFailure) { void validate_refresh_token_http_request(const grpc_http_request* request, const char* host, const char* path, const char* body, size_t body_size) { - /* The content of the assertion is tested extensively in json_token_test. */ + // The content of the assertion is tested extensively in json_token_test. GPR_ASSERT(body != nullptr); GPR_ASSERT(body_size != 0); std::string expected_body = absl::StrFormat( @@ -929,10 +929,10 @@ TEST(CredentialsTest, TestRefreshTokenCredsSuccess) { grpc_call_credentials* creds = grpc_google_refresh_token_credentials_create( test_refresh_token_str, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http put should be called. */ + // First request: http put should be called. auto state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, refresh_token_httpcli_post_success, @@ -941,7 +941,7 @@ TEST(CredentialsTest, TestRefreshTokenCredsSuccess) { kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, httpcli_post_should_not_be_called, @@ -1178,10 +1178,10 @@ TEST(CredentialsTest, TestStsCredsSuccess) { grpc_call_credentials* creds = grpc_sts_credentials_create(&valid_options, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http put should be called. */ + // First request: http put should be called. auto state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, sts_token_httpcli_post_success, @@ -1190,7 +1190,7 @@ TEST(CredentialsTest, TestStsCredsSuccess) { kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, httpcli_post_should_not_be_called, @@ -1223,7 +1223,7 @@ TEST(CredentialsTest, TestStsCredsTokenFileNotFound) { grpc_call_credentials* creds = grpc_sts_credentials_create(&valid_options, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); auto state = RequestMetadataState::NewInstance( @@ -1235,7 +1235,7 @@ TEST(CredentialsTest, TestStsCredsTokenFileNotFound) { kTestPath); ExecCtx::Get()->Flush(); - /* Cleanup. */ + // Cleanup. creds->Unref(); HttpRequest::SetOverride(nullptr, nullptr, nullptr); } @@ -1261,10 +1261,10 @@ TEST(CredentialsTest, TestStsCredsNoActorTokenSuccess) { grpc_call_credentials* creds = grpc_sts_credentials_create(&valid_options, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http put should be called. */ + // First request: http put should be called. auto state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, sts_token_httpcli_post_success_no_actor_token, @@ -1273,7 +1273,7 @@ TEST(CredentialsTest, TestStsCredsNoActorTokenSuccess) { kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); HttpRequest::SetOverride(httpcli_get_should_not_be_called, httpcli_post_should_not_be_called, @@ -1423,7 +1423,7 @@ TEST(CredentialsTest, TestJwtCredsLifetime) { json_key_string, grpc_max_auth_token_lifetime(), nullptr); GPR_ASSERT(gpr_time_cmp(creds_as_jwt(jwt_creds)->jwt_lifetime(), grpc_max_auth_token_lifetime()) == 0); - /* Check security level. */ + // Check security level. GPR_ASSERT(jwt_creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); GPR_ASSERT(strncmp(expected_creds_debug_string_prefix, jwt_creds->debug_string().c_str(), @@ -1479,14 +1479,14 @@ TEST(CredentialsTest, TestJwtCredsSuccess) { grpc_service_account_jwt_access_credentials_create( json_key_string, grpc_max_auth_token_lifetime(), nullptr); - /* First request: jwt_encode_and_sign should be called. */ + // First request: jwt_encode_and_sign should be called. auto state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success); state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority, kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); grpc_jwt_encode_and_sign_set_override( encode_and_sign_jwt_should_not_be_called); @@ -1494,8 +1494,8 @@ TEST(CredentialsTest, TestJwtCredsSuccess) { kTestPath); ExecCtx::Get()->Flush(); - /* Third request: Different service url so jwt_encode_and_sign should be - called again (no caching). */ + // Third request: Different service url so jwt_encode_and_sign should be + // called again (no caching). state = RequestMetadataState::NewInstance(absl::OkStatus(), emd); grpc_jwt_encode_and_sign_set_override(encode_and_sign_jwt_success); state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestOtherAuthority, @@ -1582,7 +1582,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsAuthKey) { 0); GPR_ASSERT(g_test_gce_tenancy_checker_called == false); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1606,7 +1606,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsRefreshToken) { GPR_ASSERT(strcmp(refresh->refresh_token().client_id, "32555999999.apps.googleusercontent.com") == 0); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1629,7 +1629,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsExternalAccountCredentials) { reinterpret_cast(creds->call_creds()); GPR_ASSERT(external != nullptr); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1653,7 +1653,7 @@ TEST(CredentialsTest, reinterpret_cast(creds->call_creds()); GPR_ASSERT(external != nullptr); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1677,7 +1677,7 @@ TEST(CredentialsTest, reinterpret_cast(creds->call_creds()); GPR_ASSERT(external != nullptr); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1700,7 +1700,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsExternalAccountCredentialsPscSts) { reinterpret_cast(creds->call_creds()); GPR_ASSERT(external != nullptr); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1723,7 +1723,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsExternalAccountCredentialsPscIam) { reinterpret_cast(creds->call_creds()); GPR_ASSERT(external != nullptr); creds->Unref(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter(nullptr); } @@ -1750,19 +1750,19 @@ TEST(CredentialsTest, TestGoogleDefaultCredsGce) { absl::OkStatus(), "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"); grpc_flush_cached_google_default_credentials(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter( null_well_known_creds_path_getter); set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker); g_test_gce_tenancy_checker_called = false; g_test_is_on_gce = true; - /* Simulate a successful detection of GCE. */ + // Simulate a successful detection of GCE. grpc_composite_channel_credentials* creds = reinterpret_cast( grpc_google_default_credentials_create(nullptr)); - /* Verify that the default creds actually embeds a GCE creds. */ + // Verify that the default creds actually embeds a GCE creds. GPR_ASSERT(creds != nullptr); GPR_ASSERT(creds->call_creds() != nullptr); HttpRequest::SetOverride(compute_engine_httpcli_get_success_override, @@ -1774,7 +1774,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsGce) { GPR_ASSERT(g_test_gce_tenancy_checker_called == true); - /* Cleanup. */ + // Cleanup. creds->Unref(); HttpRequest::SetOverride(nullptr, nullptr, nullptr); grpc_override_well_known_credentials_path_getter(nullptr); @@ -1786,20 +1786,20 @@ TEST(CredentialsTest, TestGoogleDefaultCredsNonGce) { absl::OkStatus(), "authorization: Bearer ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_"); grpc_flush_cached_google_default_credentials(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter( null_well_known_creds_path_getter); set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker); g_test_gce_tenancy_checker_called = false; g_test_is_on_gce = false; - /* Simulate a successful detection of metadata server. */ + // Simulate a successful detection of metadata server. HttpRequest::SetOverride( default_creds_metadata_server_detection_httpcli_get_success_override, httpcli_post_should_not_be_called, httpcli_put_should_not_be_called); grpc_composite_channel_credentials* creds = reinterpret_cast( grpc_google_default_credentials_create(nullptr)); - /* Verify that the default creds actually embeds a GCE creds. */ + // Verify that the default creds actually embeds a GCE creds. GPR_ASSERT(creds != nullptr); GPR_ASSERT(creds->call_creds() != nullptr); HttpRequest::SetOverride(compute_engine_httpcli_get_success_override, @@ -1809,7 +1809,7 @@ TEST(CredentialsTest, TestGoogleDefaultCredsNonGce) { kTestAuthority, kTestPath); ExecCtx::Get()->Flush(); GPR_ASSERT(g_test_gce_tenancy_checker_called == true); - /* Cleanup. */ + // Cleanup. creds->Unref(); HttpRequest::SetOverride(nullptr, nullptr, nullptr); grpc_override_well_known_credentials_path_getter(nullptr); @@ -1819,7 +1819,7 @@ int default_creds_gce_detection_httpcli_get_failure_override( const grpc_http_request* /*request*/, const char* host, const char* path, Timestamp /*deadline*/, grpc_closure* on_done, grpc_http_response* response) { - /* No magic header. */ + // No magic header. GPR_ASSERT(strcmp(path, "/") == 0); GPR_ASSERT(strcmp(host, "metadata.google.internal.") == 0); *response = http_response(200, ""); @@ -1829,7 +1829,7 @@ int default_creds_gce_detection_httpcli_get_failure_override( TEST(CredentialsTest, TestNoGoogleDefaultCreds) { grpc_flush_cached_google_default_credentials(); - SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); /* Reset. */ + SetEnv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR, ""); // Reset. grpc_override_well_known_credentials_path_getter( null_well_known_creds_path_getter); set_gce_tenancy_checker_for_testing(test_gce_tenancy_checker); @@ -1838,13 +1838,13 @@ TEST(CredentialsTest, TestNoGoogleDefaultCreds) { HttpRequest::SetOverride( default_creds_gce_detection_httpcli_get_failure_override, httpcli_post_should_not_be_called, httpcli_put_should_not_be_called); - /* Simulate a successful detection of GCE. */ + // Simulate a successful detection of GCE. GPR_ASSERT(grpc_google_default_credentials_create(nullptr) == nullptr); - /* Try a second one. GCE detection should occur again. */ + // Try a second one. GCE detection should occur again. g_test_gce_tenancy_checker_called = false; GPR_ASSERT(grpc_google_default_credentials_create(nullptr) == nullptr); GPR_ASSERT(g_test_gce_tenancy_checker_called == true); - /* Cleanup. */ + // Cleanup. grpc_override_well_known_credentials_path_getter(nullptr); HttpRequest::SetOverride(nullptr, nullptr, nullptr); } @@ -2019,7 +2019,7 @@ TEST(CredentialsTest, TestMetadataPluginSuccess) { grpc_call_credentials* creds = grpc_metadata_credentials_create_from_plugin( plugin, GRPC_PRIVACY_AND_INTEGRITY, nullptr); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds->min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); GPR_ASSERT(state == PLUGIN_INITIAL_STATE); md_state->RunRequestMetadataTest(creds, kTestUrlScheme, kTestAuthority, @@ -2072,8 +2072,8 @@ TEST(CredentialsTest, TestGetWellKnownGoogleCredentialsFilePath) { // so we set it to some fake value restore_home_env = true; SetEnv("HOME", "/fake/home/for/bazel"); -#endif /* defined(GRPC_BAZEL_BUILD) && (defined(GPR_POSIX_ENV) || \ - defined(GPR_LINUX_ENV)) */ +#endif // defined(GRPC_BAZEL_BUILD) && (defined(GPR_POSIX_ENV) || \ + // defined(GPR_LINUX_ENV)) std::string path = grpc_get_well_known_google_credentials_file_path(); GPR_ASSERT(!path.empty()); #if defined(GPR_POSIX_ENV) || defined(GPR_LINUX_ENV) @@ -2081,7 +2081,7 @@ TEST(CredentialsTest, TestGetWellKnownGoogleCredentialsFilePath) { UnsetEnv("HOME"); path = grpc_get_well_known_google_credentials_file_path(); GPR_ASSERT(path.empty()); -#endif /* GPR_POSIX_ENV || GPR_LINUX_ENV */ +#endif // GPR_POSIX_ENV || GPR_LINUX_ENV if (restore_home_env) { SetOrUnsetEnv("HOME", home); } @@ -2147,7 +2147,7 @@ void auth_metadata_context_build(const char* url_scheme, } char* host_and_port = grpc_slice_to_c_string(call_host); if (url_scheme != nullptr && strcmp(url_scheme, GRPC_SSL_URL_SCHEME) == 0) { - /* Remove the port if it is 443. */ + // Remove the port if it is 443. char* port_delimiter = strrchr(host_and_port, ':'); if (port_delimiter != nullptr && strcmp(port_delimiter + 1, "443") == 0) { *port_delimiter = '\0'; @@ -2499,9 +2499,9 @@ TEST(CredentialsTest, TestExternalAccountCredsSuccess) { "", // workforce_pool_user_project; }; TestExternalAccountCredentials creds(options, {}); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds.min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http put should be called. */ + // First request: http put should be called. auto state = RequestMetadataState::NewInstance( absl::OkStatus(), "authorization: Bearer token_exchange_access_token"); HttpRequest::SetOverride(httpcli_get_should_not_be_called, @@ -2510,7 +2510,7 @@ TEST(CredentialsTest, TestExternalAccountCredsSuccess) { state->RunRequestMetadataTest(&creds, kTestUrlScheme, kTestAuthority, kTestPath); ExecCtx::Get()->Flush(); - /* Second request: the cached token should be served directly. */ + // Second request: the cached token should be served directly. state = RequestMetadataState::NewInstance( absl::OkStatus(), "authorization: Bearer token_exchange_access_token"); HttpRequest::SetOverride(httpcli_get_should_not_be_called, @@ -2570,9 +2570,9 @@ TEST(CredentialsTest, "", // workforce_pool_user_project; }; TestExternalAccountCredentials creds(options, {"scope_1", "scope_2"}); - /* Check security level. */ + // Check security level. GPR_ASSERT(creds.min_security_level() == GRPC_PRIVACY_AND_INTEGRITY); - /* First request: http put should be called. */ + // First request: http put should be called. auto state = RequestMetadataState::NewInstance( absl::OkStatus(), "authorization: Bearer service_account_impersonation_access_token"); diff --git a/test/core/security/fetch_oauth2.cc b/test/core/security/fetch_oauth2.cc index e72a007cc87..67c99bd2f0c 100644 --- a/test/core/security/fetch_oauth2.cc +++ b/test/core/security/fetch_oauth2.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/security/grpc_alts_credentials_options_test.cc b/test/core/security/grpc_alts_credentials_options_test.cc index aa9d90a6121..b6c6255e7e8 100644 --- a/test/core/security/grpc_alts_credentials_options_test.cc +++ b/test/core/security/grpc_alts_credentials_options_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h" @@ -33,12 +33,12 @@ const size_t kTargetServiceAccountNum = 2; TEST(GrpcAltsCredentialsOptionsTest, CopyClientOptionsFailure) { - /* Initialization. */ + // Initialization. grpc_alts_credentials_options* options = grpc_alts_credentials_client_options_create(); - /* Test. */ + // Test. ASSERT_EQ(grpc_alts_credentials_options_copy(nullptr), nullptr); - /* Cleanup. */ + // Cleanup. grpc_alts_credentials_options_destroy(options); } @@ -56,15 +56,15 @@ static size_t get_target_service_account_num( } TEST(GrpcAltsCredentialsOptionsTest, ClientOptionsApiSuccess) { - /* Initialization. */ + // Initialization. grpc_alts_credentials_options* options = grpc_alts_credentials_client_options_create(); - /* Set client options fields. */ + // Set client options fields. grpc_alts_credentials_client_options_add_target_service_account( options, ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_1); grpc_alts_credentials_client_options_add_target_service_account( options, ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_2); - /* Validate client option fields. */ + // Validate client option fields. ASSERT_EQ(get_target_service_account_num(options), kTargetServiceAccountNum); auto client_options = reinterpret_cast(options); @@ -72,7 +72,7 @@ TEST(GrpcAltsCredentialsOptionsTest, ClientOptionsApiSuccess) { ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_2); ASSERT_STREQ(client_options->target_account_list_head->next->data, ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_1); - /* Perform a copy operation and validate its correctness. */ + // Perform a copy operation and validate its correctness. grpc_alts_credentials_options* new_options = grpc_alts_credentials_options_copy(options); ASSERT_EQ(get_target_service_account_num(new_options), @@ -83,7 +83,7 @@ TEST(GrpcAltsCredentialsOptionsTest, ClientOptionsApiSuccess) { ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_2); ASSERT_STREQ(new_client_options->target_account_list_head->next->data, ALTS_CLIENT_OPTIONS_TEST_TARGET_SERVICE_ACCOUNT_1); - /* Cleanup.*/ + // Cleanup. grpc_alts_credentials_options_destroy(options); grpc_alts_credentials_options_destroy(new_options); } diff --git a/test/core/security/grpc_tls_credentials_options_test.cc b/test/core/security/grpc_tls_credentials_options_test.cc index 97c9e94eb2a..ce23b6cff3f 100644 --- a/test/core/security/grpc_tls_credentials_options_test.cc +++ b/test/core/security/grpc_tls_credentials_options_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h" diff --git a/test/core/security/json_token_test.cc b/test/core/security/json_token_test.cc index 133bccc1f35..fd76fd666db 100644 --- a/test/core/security/json_token_test.cc +++ b/test/core/security/json_token_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/security/credentials/jwt/json_token.h" @@ -36,9 +36,9 @@ using grpc_core::Json; -/* This JSON key was generated with the GCE console and revoked immediately. - The identifiers have been changed as well. - Maximum size for a string literal is 509 chars in C89, yay! */ +// This JSON key was generated with the GCE console and revoked immediately. +// The identifiers have been changed as well. +// Maximum size for a string literal is 509 chars in C89, yay! static const char test_json_key_str_part1[] = "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----" "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE" @@ -70,7 +70,7 @@ static const char test_json_key_str_part3[] = "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent." "com\", \"type\": \"service_account\" }"; -/* Test refresh token. */ +// Test refresh token. static const char test_refresh_token_str[] = "{ \"client_id\": \"32555999999.apps.googleusercontent.com\"," " \"client_secret\": \"EmssLNjJy1332hD4KFsecret\"," @@ -257,7 +257,7 @@ static void check_jwt_claim(const Json& claim, const char* expected_audience, ASSERT_EQ(value.type(), Json::Type::STRING); ASSERT_EQ(value.string_value(), expected_scope); } else { - /* Claims without scope must have a sub. */ + // Claims without scope must have a sub. ASSERT_EQ(object.find("scope"), object.end()); value = object["sub"]; ASSERT_EQ(value.type(), Json::Type::STRING); @@ -355,7 +355,7 @@ static void test_jwt_encode_and_sign( offset = static_cast(dot - jwt) + 1; dot = strchr(jwt + offset, '.'); - ASSERT_EQ(dot, nullptr); /* no more part. */ + ASSERT_EQ(dot, nullptr); // no more part. b64_signature = jwt + offset; check_jwt_signature(b64_signature, json_key.private_key, jwt, offset - 1); diff --git a/test/core/security/jwt_verifier_test.cc b/test/core/security/jwt_verifier_test.cc index 69ed89e0f8b..d48d20c8a07 100644 --- a/test/core/security/jwt_verifier_test.cc +++ b/test/core/security/jwt_verifier_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/security/credentials/jwt/jwt_verifier.h" @@ -35,9 +35,9 @@ using grpc_core::Json; -/* This JSON key was generated with the GCE console and revoked immediately. - The identifiers have been changed as well. - Maximum size for a string literal is 509 chars in C89, yay! */ +// This JSON key was generated with the GCE console and revoked immediately. +// The identifiers have been changed as well. +// Maximum size for a string literal is 509 chars in C89, yay! static const char json_key_str_part1[] = "{ \"private_key\": \"-----BEGIN PRIVATE KEY-----" "\\nMIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOEvJsnoHnyHkXcp\\n7mJE" @@ -68,7 +68,7 @@ static const char json_key_str_part3_for_google_email_issuer[] = "com\", \"client_id\": " "\"777-abaslkan11hlb6nmim3bpspl31ud.apps.googleusercontent." "com\", \"type\": \"service_account\" }"; -/* Trick our JWT library into issuing a JWT with iss=accounts.google.com. */ +// Trick our JWT library into issuing a JWT with iss=accounts.google.com. static const char json_key_str_part3_for_url_issuer[] = "\"private_key_id\": \"e6b5137873db8d2ef81e06a47289e6434ec8a165\", " "\"client_email\": \"accounts.google.com\", " @@ -142,7 +142,7 @@ static const char expired_claims[] = " \"iss\": \"blah.foo.com\"," " \"sub\": \"juju@blah.foo.com\"," " \"jti\": \"jwtuniqueid\"," - " \"iat\": 100," /* Way back in the past... */ + " \"iat\": 100," // Way back in the past... " \"exp\": 120," " \"nbf\": 60," " \"foo\": \"bar\"}"; @@ -163,7 +163,7 @@ static const char claims_with_bad_subject[] = static const char invalid_claims[] = "{ \"aud\": \"https://foo.com\"," - " \"iss\": 46," /* Issuer cannot be a number. */ + " \"iss\": 46," // Issuer cannot be a number. " \"sub\": \"juju@blah.foo.com\"," " \"jti\": \"jwtuniqueid\"," " \"foo\": \"bar\"}"; @@ -194,8 +194,8 @@ TEST(JwtVerifierTest, JwtIssuerEmailDomain) { d = grpc_jwt_issuer_email_domain("bar.blah@baz.blah.foo.com"); ASSERT_STREQ(d, "foo.com"); - /* This is not a very good parser but make sure we do not crash on these weird - inputs. */ + // This is not a very good parser but make sure we do not crash on these weird + // inputs. d = grpc_jwt_issuer_email_domain("@foo"); ASSERT_STREQ(d, "foo"); d = grpc_jwt_issuer_email_domain("bar@."); @@ -545,7 +545,7 @@ static void corrupt_jwt_sig(char* jwt) { } ASSERT_FALSE(GRPC_SLICE_IS_EMPTY(sig)); sig_bytes = GRPC_SLICE_START_PTR(sig); - (*sig_bytes)++; /* Corrupt first byte. */ + (*sig_bytes)++; // Corrupt first byte. bad_b64_sig = grpc_base64_encode(GRPC_SLICE_START_PTR(sig), GRPC_SLICE_LENGTH(sig), 1, 0); memcpy(last_dot + 1, bad_b64_sig, strlen(bad_b64_sig)); @@ -616,9 +616,9 @@ TEST(JwtVerifierTest, JwtVerifierBadFormat) { grpc_core::HttpRequest::SetOverride(nullptr, nullptr, nullptr); } -/* find verification key: bad jks, cannot find key in jks */ -/* bad signature custom provided email*/ -/* bad key */ +// find verification key: bad jks, cannot find key in jks +// bad signature custom provided email +// bad key int main(int argc, char** argv) { grpc::testing::TestEnvironment env(&argc, argv); diff --git a/test/core/security/oauth2_utils.cc b/test/core/security/oauth2_utils.cc index f1af8e37948..0c7ccd3f030 100644 --- a/test/core/security/oauth2_utils.cc +++ b/test/core/security/oauth2_utils.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/security/oauth2_utils.h" diff --git a/test/core/security/oauth2_utils.h b/test/core/security/oauth2_utils.h index 5ad2e398e18..99dce1ab024 100644 --- a/test/core/security/oauth2_utils.h +++ b/test/core/security/oauth2_utils.h @@ -1,29 +1,29 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_SECURITY_OAUTH2_UTILS_H #define GRPC_TEST_CORE_SECURITY_OAUTH2_UTILS_H #include "src/core/lib/security/credentials/credentials.h" -/* Fetch oauth2 access token with a credentials object. Does not take ownership. - Returns NULL on a failure. The caller should call gpr_free on the token. */ +// Fetch oauth2 access token with a credentials object. Does not take ownership. +// Returns NULL on a failure. The caller should call gpr_free on the token. char* grpc_test_fetch_oauth2_token_with_credentials( grpc_call_credentials* creds); -#endif /* GRPC_TEST_CORE_SECURITY_OAUTH2_UTILS_H */ +#endif // GRPC_TEST_CORE_SECURITY_OAUTH2_UTILS_H diff --git a/test/core/security/secure_endpoint_test.cc b/test/core/security/secure_endpoint_test.cc index 7fc424ba693..9e84b2f68e7 100644 --- a/test/core/security/secure_endpoint_test.cc +++ b/test/core/security/secure_endpoint_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/security/transport/secure_endpoint.h" diff --git a/test/core/security/security_connector_test.cc b/test/core/security/security_connector_test.cc index 3e4e0571a2a..48a08009d97 100644 --- a/test/core/security/security_connector_test.cc +++ b/test/core/security/security_connector_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/security/security_connector/security_connector.h" @@ -55,12 +55,12 @@ static int check_peer_property(const tsi_peer* peer, return 1; } } - return 0; /* Not found... */ + return 0; // Not found... } static int check_ssl_peer_equivalence(const tsi_peer* original, const tsi_peer* reconstructed) { - /* The reconstructed peer only has CN, SAN and pem cert properties. */ + // The reconstructed peer only has CN, SAN and pem cert properties. size_t i; for (i = 0; i < original->property_count; i++) { const tsi_peer_property* prop = &original->properties[i]; @@ -663,8 +663,8 @@ static void test_default_ssl_roots(void) { fwrite(roots_for_env_var, 1, strlen(roots_for_env_var), roots_env_var_file); fclose(roots_env_var_file); - /* First let's get the root through the override: set the env to an invalid - value. */ + // First let's get the root through the override: set the env to an invalid + // value. GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, ""); grpc_set_ssl_roots_override_callback(override_roots_success); grpc_slice roots = @@ -674,8 +674,8 @@ static void test_default_ssl_roots(void) { ASSERT_STREQ(roots_contents, roots_for_override_api); gpr_free(roots_contents); - /* Now let's set the env var: We should get the contents pointed value - instead. */ + // Now let's set the env var: We should get the contents pointed value + // instead. GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, roots_env_var_file_path); roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting(); @@ -684,8 +684,8 @@ static void test_default_ssl_roots(void) { ASSERT_STREQ(roots_contents, roots_for_env_var); gpr_free(roots_contents); - /* Now reset the env var. We should fall back to the value overridden using - the api. */ + // Now reset the env var. We should fall back to the value overridden using + // the api. GPR_GLOBAL_CONFIG_SET(grpc_default_ssl_roots_file_path, ""); roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting(); roots_contents = grpc_slice_to_c_string(roots); @@ -693,8 +693,8 @@ static void test_default_ssl_roots(void) { ASSERT_STREQ(roots_contents, roots_for_override_api); gpr_free(roots_contents); - /* Now setup a permanent failure for the overridden roots and we should get - an empty slice. */ + // Now setup a permanent failure for the overridden roots and we should get + // an empty slice. GPR_GLOBAL_CONFIG_SET(grpc_not_use_system_ssl_roots, true); grpc_set_ssl_roots_override_callback(override_roots_permanent_failure); roots = grpc_core::TestDefaultSslRootStore::ComputePemRootCertsForTesting(); @@ -703,7 +703,7 @@ static void test_default_ssl_roots(void) { grpc_core::TestDefaultSslRootStore::GetRootStore(); ASSERT_EQ(root_store, nullptr); - /* Cleanup. */ + // Cleanup. remove(roots_env_var_file_path); gpr_free(roots_env_var_file_path); } diff --git a/test/core/security/ssl_credentials_test.cc b/test/core/security/ssl_credentials_test.cc index 7b2b4c04c8d..7c16c2188d5 100644 --- a/test/core/security/ssl_credentials_test.cc +++ b/test/core/security/ssl_credentials_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/lib/security/credentials/ssl/ssl_credentials.h" diff --git a/test/core/security/ssl_server_fuzzer.cc b/test/core/security/ssl_server_fuzzer.cc index f7374aee70a..7ee10037c46 100644 --- a/test/core/security/ssl_server_fuzzer.cc +++ b/test/core/security/ssl_server_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/security/system_roots_test.cc b/test/core/security/system_roots_test.cc index ef0a96dc819..bbf23832d4a 100644 --- a/test/core/security/system_roots_test.cc +++ b/test/core/security/system_roots_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/core/security/tls_security_connector_test.cc b/test/core/security/tls_security_connector_test.cc index 6bdad0819c8..7803f84c107 100644 --- a/test/core/security/tls_security_connector_test.cc +++ b/test/core/security/tls_security_connector_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/lib/security/security_connector/tls/tls_security_connector.h" diff --git a/test/core/security/verify_jwt.cc b/test/core/security/verify_jwt.cc index 3f2c54a36ff..c8b8d29c6f3 100644 --- a/test/core/security/verify_jwt.cc +++ b/test/core/security/verify_jwt.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/slice/b64_decode_fuzzer.cc b/test/core/slice/b64_decode_fuzzer.cc index 17965fc90c0..cd0996b11f6 100644 --- a/test/core/slice/b64_decode_fuzzer.cc +++ b/test/core/slice/b64_decode_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/core/slice/b64_encode_fuzzer.cc b/test/core/slice/b64_encode_fuzzer.cc index 055ed7272e5..76baafd0f0c 100644 --- a/test/core/slice/b64_encode_fuzzer.cc +++ b/test/core/slice/b64_encode_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/core/slice/b64_test.cc b/test/core/slice/b64_test.cc index a6b4b457548..d6615b3dc0c 100644 --- a/test/core/slice/b64_test.cc +++ b/test/core/slice/b64_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/slice/b64.h" @@ -51,7 +51,7 @@ static void test_full_range_encode_decode_b64(int url_safe, int multiline) { grpc_slice orig_decoded; for (i = 0; i < sizeof(orig); i++) orig[i] = static_cast(i); - /* Try all the different paddings. */ + // Try all the different paddings. for (i = 0; i < 3; i++) { grpc_core::ExecCtx exec_ctx; b64 = grpc_base64_encode(orig, sizeof(orig) - i, url_safe, multiline); diff --git a/test/core/slice/c_slice_buffer_test.cc b/test/core/slice/c_slice_buffer_test.cc index 3ec3f764ac3..53a697c25eb 100644 --- a/test/core/slice/c_slice_buffer_test.cc +++ b/test/core/slice/c_slice_buffer_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -110,13 +110,13 @@ void test_slice_buffer_move_first() { grpc_slice_buffer_init(&dst); for (idx = 0; idx < 3; idx++) { grpc_slice_ref(slices[idx]); - /* For this test, it is important that we add each slice at a new - slice index */ + // For this test, it is important that we add each slice at a new + // slice index grpc_slice_buffer_add_indexed(&src, slices[idx]); grpc_slice_buffer_add_indexed(&dst, slices[idx]); } - /* Case 1: Move more than the first slice's length from src to dst */ + // Case 1: Move more than the first slice's length from src to dst src_len = src.length; dst_len = dst.length; grpc_slice_buffer_move_first(&src, 4, &dst); @@ -125,16 +125,16 @@ void test_slice_buffer_move_first() { ASSERT_EQ(src.length, src_len); ASSERT_EQ(dst.length, dst_len); - /* src now has two slices ["bbb"] and ["ccc"] */ - /* Case 2: Move the first slice from src to dst */ + // src now has two slices ["bbb"] and ["ccc"] + // Case 2: Move the first slice from src to dst grpc_slice_buffer_move_first(&src, 3, &dst); src_len -= 3; dst_len += 3; ASSERT_EQ(src.length, src_len); ASSERT_EQ(dst.length, dst_len); - /* src now has one slice ["ccc"] */ - /* Case 3: Move less than the first slice's length from src to dst*/ + // src now has one slice ["ccc"] + // Case 3: Move less than the first slice's length from src to dst grpc_slice_buffer_move_first(&src, 2, &dst); src_len -= 2; dst_len += 2; diff --git a/test/core/slice/percent_decode_fuzzer.cc b/test/core/slice/percent_decode_fuzzer.cc index 1942af01bb3..9124c042434 100644 --- a/test/core/slice/percent_decode_fuzzer.cc +++ b/test/core/slice/percent_decode_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/slice/percent_encode_fuzzer.cc b/test/core/slice/percent_encode_fuzzer.cc index 5fb8c47c9b8..2e8f5fc7fa9 100644 --- a/test/core/slice/percent_encode_fuzzer.cc +++ b/test/core/slice/percent_encode_fuzzer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/slice/percent_encoding_test.cc b/test/core/slice/percent_encoding_test.cc index 81777db8d93..e1821ed75f4 100644 --- a/test/core/slice/percent_encoding_test.cc +++ b/test/core/slice/percent_encoding_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/lib/slice/percent_encoding.h" diff --git a/test/core/slice/slice_string_helpers_test.cc b/test/core/slice/slice_string_helpers_test.cc index f195bfef186..3184af11689 100644 --- a/test/core/slice/slice_string_helpers_test.cc +++ b/test/core/slice/slice_string_helpers_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/slice/slice_string_helpers.h" diff --git a/test/core/slice/slice_test.cc b/test/core/slice/slice_test.cc index 451f026388d..b4abce706f8 100644 --- a/test/core/slice/slice_test.cc +++ b/test/core/slice/slice_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -40,26 +40,26 @@ #include "test/core/util/build.h" TEST(GrpcSliceTest, MallocReturnsSomethingSensible) { - /* Calls grpc_slice_create for various lengths and verifies the internals for - consistency. */ + // Calls grpc_slice_create for various lengths and verifies the internals for + // consistency. size_t length; size_t i; grpc_slice slice; for (length = 0; length <= 1024; length++) { slice = grpc_slice_malloc(length); - /* If there is a length, slice.data must be non-NULL. If length is zero - we don't care. */ + // If there is a length, slice.data must be non-NULL. If length is zero + // we don't care. if (length > GRPC_SLICE_INLINED_SIZE) { EXPECT_NE(slice.data.refcounted.bytes, nullptr); } - /* Returned slice length must be what was requested. */ + // Returned slice length must be what was requested. EXPECT_EQ(GRPC_SLICE_LENGTH(slice), length); - /* We must be able to write to every byte of the data */ + // We must be able to write to every byte of the data for (i = 0; i < length; i++) { GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } - /* And finally we must succeed in destroying the slice */ + // And finally we must succeed in destroying the slice grpc_slice_unref(slice); } } @@ -76,7 +76,7 @@ TEST(GrpcSliceTest, SliceNewReturnsSomethingSensible) { grpc_slice_unref(slice); } -/* destroy function that sets a mark to indicate it was called. */ +// destroy function that sets a mark to indicate it was called. static void set_mark(void* p) { *(static_cast(p)) = 1; } TEST(GrpcSliceTest, SliceNewWithUserData) { @@ -92,7 +92,7 @@ TEST(GrpcSliceTest, SliceNewWithUserData) { EXPECT_EQ(GRPC_SLICE_START_PTR(slice)[0], 0); EXPECT_EQ(GRPC_SLICE_START_PTR(slice)[1], 1); - /* unref should cause destroy function to run. */ + // unref should cause destroy function to run. grpc_slice_unref(slice); EXPECT_EQ(marker, 1); } @@ -106,28 +106,28 @@ static void do_nothing_with_len_1(void* /*ignored*/, size_t len) { TEST(GrpcSliceTest, SliceNewWithLenReturnsSomethingSensible) { uint8_t x; - int num_refs = 5; /* To test adding/removing an arbitrary number of refs */ + int num_refs = 5; // To test adding/removing an arbitrary number of refs int i; grpc_slice slice = grpc_slice_new_with_len(&x, 1, do_nothing_with_len_1); EXPECT_NE(slice.refcount, - nullptr); /* ref count is initialized to 1 at this point */ + nullptr); // ref count is initialized to 1 at this point EXPECT_EQ(slice.data.refcounted.bytes, &x); EXPECT_EQ(slice.data.refcounted.length, 1); EXPECT_EQ(do_nothing_with_len_1_calls, 0); - /* Add an arbitrary number of refs to the slice and remoe the refs. This is to - make sure that that the destroy callback (i.e do_nothing_with_len_1()) is - not called until the last unref operation */ + // Add an arbitrary number of refs to the slice and remoe the refs. This is to + // make sure that that the destroy callback (i.e do_nothing_with_len_1()) is + // not called until the last unref operation for (i = 0; i < num_refs; i++) { grpc_slice_ref(slice); } for (i = 0; i < num_refs; i++) { grpc_slice_unref(slice); } - EXPECT_EQ(do_nothing_with_len_1_calls, 0); /* Shouldn't be called yet */ + EXPECT_EQ(do_nothing_with_len_1_calls, 0); // Shouldn't be called yet - /* last unref */ + // last unref grpc_slice_unref(slice); EXPECT_EQ(do_nothing_with_len_1_calls, 1); } @@ -141,15 +141,15 @@ TEST_P(GrpcSliceSizedTest, SliceSubWorks) { grpc_slice sub; unsigned i, j, k; - /* Create a slice in which each byte is equal to the distance from it to the - beginning of the slice. */ + // Create a slice in which each byte is equal to the distance from it to the + // beginning of the slice. slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } - /* Ensure that for all subsets length is correct and that we start on the - correct byte. Additionally check that no copies were made. */ + // Ensure that for all subsets length is correct and that we start on the + // correct byte. Additionally check that no copies were made. for (i = 0; i < length; i++) { for (j = i; j < length; j++) { sub = grpc_slice_sub(slice, i, j); @@ -182,15 +182,15 @@ TEST_P(GrpcSliceSizedTest, SliceSplitHeadWorks) { gpr_log(GPR_INFO, "length=%" PRIuPTR, length); - /* Create a slice in which each byte is equal to the distance from it to the - beginning of the slice. */ + // Create a slice in which each byte is equal to the distance from it to the + // beginning of the slice. slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } - /* Ensure that for all subsets length is correct and that we start on the - correct byte. Additionally check that no copies were made. */ + // Ensure that for all subsets length is correct and that we start on the + // correct byte. Additionally check that no copies were made. for (i = 0; i < length; i++) { tail = grpc_slice_ref(slice); head = grpc_slice_split_head(&tail, i); @@ -211,15 +211,15 @@ TEST_P(GrpcSliceSizedTest, SliceSplitTailWorks) { gpr_log(GPR_INFO, "length=%" PRIuPTR, length); - /* Create a slice in which each byte is equal to the distance from it to the - beginning of the slice. */ + // Create a slice in which each byte is equal to the distance from it to the + // beginning of the slice. slice = grpc_slice_malloc(length); for (i = 0; i < length; i++) { GRPC_SLICE_START_PTR(slice)[i] = static_cast(i); } - /* Ensure that for all subsets length is correct and that we start on the - correct byte. Additionally check that no copies were made. */ + // Ensure that for all subsets length is correct and that we start on the + // correct byte. Additionally check that no copies were made. for (i = 0; i < length; i++) { head = grpc_slice_ref(slice); tail = grpc_slice_split_tail(&head, i); diff --git a/test/core/surface/byte_buffer_reader_test.cc b/test/core/surface/byte_buffer_reader_test.cc index 34f522d19cf..65e19b03ee1 100644 --- a/test/core/surface/byte_buffer_reader_test.cc +++ b/test/core/surface/byte_buffer_reader_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -203,7 +203,7 @@ TEST(GrpcByteBufferReaderTest, TestReadall) { memset(lotsa_as, 'a', 512 * sizeof(lotsa_as[0])); memset(lotsa_bs, 'b', 1024 * sizeof(lotsa_bs[0])); - /* use slices large enough to overflow inlining */ + // use slices large enough to overflow inlining slices[0] = grpc_slice_malloc(512); memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512); slices[1] = grpc_slice_malloc(1024); @@ -237,7 +237,7 @@ TEST(GrpcByteBufferReaderTest, TestByteBufferCopy) { memset(lotsa_as, 'a', 512 * sizeof(lotsa_as[0])); memset(lotsa_bs, 'b', 1024 * sizeof(lotsa_bs[0])); - /* use slices large enough to overflow inlining */ + // use slices large enough to overflow inlining slices[0] = grpc_slice_malloc(512); memcpy(GRPC_SLICE_START_PTR(slices[0]), lotsa_as, 512); slices[1] = grpc_slice_malloc(1024); diff --git a/test/core/surface/completion_queue_test.cc b/test/core/surface/completion_queue_test.cc index 4c653bb3d94..1a428997813 100644 --- a/test/core/surface/completion_queue_test.cc +++ b/test/core/surface/completion_queue_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/surface/completion_queue.h" @@ -39,7 +39,7 @@ static void* create_test_tag(void) { return reinterpret_cast(++i); } -/* helper for tests to shutdown correctly and tersely */ +// helper for tests to shutdown correctly and tersely static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); @@ -71,7 +71,7 @@ static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_completion_queue_destroy(cc); } -/* ensure we can create and destroy a completion channel */ +// ensure we can create and destroy a completion channel TEST(GrpcCompletionQueueTest, TestNoOp) { grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; grpc_cq_polling_type polling_types[] = { diff --git a/test/core/surface/completion_queue_threading_test.cc b/test/core/surface/completion_queue_threading_test.cc index e87dc8f049d..87f1e20e968 100644 --- a/test/core/surface/completion_queue_threading_test.cc +++ b/test/core/surface/completion_queue_threading_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -41,7 +41,7 @@ static void* create_test_tag(void) { return reinterpret_cast(++i); } -/* helper for tests to shutdown correctly and tersely */ +// helper for tests to shutdown correctly and tersely static void shutdown_and_destroy(grpc_completion_queue* cc) { grpc_event ev; grpc_completion_queue_shutdown(cc); @@ -107,7 +107,7 @@ static void test_too_many_plucks(void) { threads[i].Start(); } - /* wait until all other threads are plucking */ + // wait until all other threads are plucking gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(1000)); ev = grpc_completion_queue_pluck(cc, create_test_tag(), @@ -226,7 +226,7 @@ static void test_threading(size_t producers, size_t consumers) { gpr_log(GPR_INFO, "%s: %" PRIuPTR " producers, %" PRIuPTR " consumers", "test_threading", producers, consumers); - /* start all threads: they will wait for phase1 */ + // start all threads: they will wait for phase1 grpc_core::Thread* threads = static_cast( gpr_malloc(sizeof(*threads) * (producers + consumers))); for (i = 0; i < producers + consumers; i++) { @@ -248,8 +248,8 @@ static void test_threading(size_t producers, size_t consumers) { gpr_event_wait(&options[i].on_started, ten_seconds_time()); } - /* start phase1: producers will pre-declare all operations they will - complete */ + // start phase1: producers will pre-declare all operations they will + // complete gpr_log(GPR_INFO, "start phase 1"); gpr_event_set(&phase1, reinterpret_cast(1)); @@ -259,22 +259,22 @@ static void test_threading(size_t producers, size_t consumers) { } gpr_log(GPR_INFO, "done phase 1"); - /* start phase2: operations will complete, and consumers will consume them */ + // start phase2: operations will complete, and consumers will consume them gpr_log(GPR_INFO, "start phase 2"); gpr_event_set(&phase2, reinterpret_cast(1)); - /* in parallel, we shutdown the completion channel - all events should still - be consumed */ + // in parallel, we shutdown the completion channel - all events should still + // be consumed grpc_completion_queue_shutdown(cc); - /* join all threads */ + // join all threads gpr_log(GPR_INFO, "wait phase 2"); for (i = 0; i < producers + consumers; i++) { ASSERT_TRUE(gpr_event_wait(&options[i].on_finished, ten_seconds_time())); } gpr_log(GPR_INFO, "done phase 2"); - /* destroy the completion channel */ + // destroy the completion channel grpc_completion_queue_destroy(cc); for (i = 0; i < producers + consumers; i++) { @@ -282,7 +282,7 @@ static void test_threading(size_t producers, size_t consumers) { } gpr_free(threads); - /* verify that everything was produced and consumed */ + // verify that everything was produced and consumed for (i = 0; i < producers + consumers; i++) { if (i < producers) { ASSERT_EQ(options[i].events_triggered, TEST_THREAD_EVENTS); diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc index 1fda9756dc0..89aa91ab612 100644 --- a/test/core/surface/concurrent_connectivity_test.cc +++ b/test/core/surface/concurrent_connectivity_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -50,13 +50,13 @@ #include "test/core/util/port.h" #include "test/core/util/test_config.h" -/* TODO(yashykt): When our macos testing infrastructure becomes good enough, we - * wouldn't need to reduce the number of threads on MacOS */ +// TODO(yashykt): When our macos testing infrastructure becomes good enough, we +// wouldn't need to reduce the number of threads on MacOS #ifdef __APPLE__ #define NUM_THREADS 10 #else #define NUM_THREADS 100 -#endif /* __APPLE */ +#endif // __APPLE #define NUM_OUTER_LOOPS 10 #define NUM_INNER_LOOPS 10 @@ -93,7 +93,7 @@ void create_loop_destroy(void* addr) { grpc_timeout_milliseconds_to_deadline(POLL_MILLIS); ASSERT_EQ(grpc_completion_queue_next(cq, poll_time, nullptr).type, GRPC_OP_COMPLETE); - /* check that the watcher from "watch state" was free'd */ + // check that the watcher from "watch state" was free'd ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(chan), 0); } grpc_channel_destroy(chan); @@ -190,7 +190,7 @@ static void done_pollset_shutdown(void* pollset, grpc_error_handle /*error*/) { TEST(ConcurrentConnectivityTest, RunConcurrentConnectivityTest) { struct ServerThreadArgs args; - /* First round, no server */ + // First round, no server { gpr_log(GPR_DEBUG, "Wave 1"); grpc_core::Thread threads[NUM_THREADS]; @@ -205,7 +205,7 @@ TEST(ConcurrentConnectivityTest, RunConcurrentConnectivityTest) { } } - /* Second round, actual grpc server */ + // Second round, actual grpc server { gpr_log(GPR_DEBUG, "Wave 2"); int port = grpc_pick_unused_port_or_die(); @@ -237,7 +237,7 @@ TEST(ConcurrentConnectivityTest, RunConcurrentConnectivityTest) { grpc_completion_queue_destroy(args.cq); } - /* Third round, bogus tcp server */ + // Third round, bogus tcp server { gpr_log(GPR_DEBUG, "Wave 3"); auto* pollset = static_cast(gpr_zalloc(grpc_pollset_size())); @@ -291,7 +291,7 @@ void watches_with_short_timeouts(void* addr) { grpc_event ev = grpc_completion_queue_next(cq, poll_time, nullptr); ASSERT_EQ(ev.type, GRPC_OP_COMPLETE); ASSERT_EQ(ev.success, false); - /* check that the watcher from "watch state" was free'd */ + // check that the watcher from "watch state" was free'd ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(chan), 0); } grpc_channel_destroy(chan); diff --git a/test/core/surface/init_test.cc b/test/core/surface/init_test.cc index 091fa4c1ff4..5065712753d 100644 --- a/test/core/surface/init_test.cc +++ b/test/core/surface/init_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/surface/init.h" diff --git a/test/core/surface/lame_client_test.cc b/test/core/surface/lame_client_test.cc index cbb5eb9126d..20f10f980dc 100644 --- a/test/core/surface/lame_client_test.cc +++ b/test/core/surface/lame_client_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -144,7 +144,7 @@ TEST(LameClientTest, MainTest) { tag(2), nullptr); ASSERT_EQ(GRPC_CALL_OK, error); - /* the call should immediately fail */ + // the call should immediately fail cqv.Expect(tag(2), true); cqv.Verify(); diff --git a/test/core/surface/num_external_connectivity_watchers_test.cc b/test/core/surface/num_external_connectivity_watchers_test.cc index bf37d2d55fa..a276cbc1991 100644 --- a/test/core/surface/num_external_connectivity_watchers_test.cc +++ b/test/core/surface/num_external_connectivity_watchers_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -63,16 +63,16 @@ static void channel_idle_poll_for_timeout(grpc_channel* channel, grpc_event ev = grpc_completion_queue_next( cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); - /* expect watch_connectivity_state to end with a timeout */ + // expect watch_connectivity_state to end with a timeout ASSERT_EQ(ev.type, GRPC_OP_COMPLETE); ASSERT_EQ(ev.success, false); ASSERT_EQ(grpc_channel_check_connectivity_state(channel, 0), GRPC_CHANNEL_IDLE); } -/* Test and use the "num_external_watchers" call to make sure - * that "connectivity watcher" structs are free'd just after, if - * their corresponding timeouts occur. */ +// Test and use the "num_external_watchers" call to make sure +// that "connectivity watcher" structs are free'd just after, if +// their corresponding timeouts occur. static void run_timeouts_test(const test_fixture* fixture) { gpr_log(GPR_INFO, "TEST: %s", fixture->name); @@ -83,12 +83,12 @@ static void run_timeouts_test(const test_fixture* fixture) { grpc_channel* channel = fixture->create_channel(addr.c_str()); grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - /* start 1 watcher and then let it time out */ + // start 1 watcher and then let it time out channel_idle_start_watch(channel, cq); channel_idle_poll_for_timeout(channel, cq); ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(channel), 0); - /* start 3 watchers and then let them all time out */ + // start 3 watchers and then let them all time out for (size_t i = 1; i <= 3; i++) { channel_idle_start_watch(channel, cq); } @@ -97,8 +97,8 @@ static void run_timeouts_test(const test_fixture* fixture) { } ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(channel), 0); - /* start 3 watchers, see one time out, start another 3, and then see them all - * time out */ + // start 3 watchers, see one time out, start another 3, and then see them all + // time out for (size_t i = 1; i <= 3; i++) { channel_idle_start_watch(channel, cq); } @@ -122,8 +122,8 @@ static void run_timeouts_test(const test_fixture* fixture) { grpc_shutdown(); } -/* An edge scenario; sets channel state to explicitly, and outside - * of a polling call. */ +// An edge scenario; sets channel state to explicitly, and outside +// of a polling call. static void run_channel_shutdown_before_timeout_test( const test_fixture* fixture) { gpr_log(GPR_INFO, "TEST: %s", fixture->name); @@ -135,10 +135,10 @@ static void run_channel_shutdown_before_timeout_test( grpc_channel* channel = fixture->create_channel(addr.c_str()); grpc_completion_queue* cq = grpc_completion_queue_create_for_next(nullptr); - /* start 1 watcher and then shut down the channel before the timer goes off */ + // start 1 watcher and then shut down the channel before the timer goes off ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(channel), 0); - /* expecting a 30 second timeout to go off much later than the shutdown. */ + // expecting a 30 second timeout to go off much later than the shutdown. gpr_timespec connect_deadline = grpc_timeout_seconds_to_deadline(30); ASSERT_EQ(grpc_channel_check_connectivity_state(channel, 0), GRPC_CHANNEL_IDLE); @@ -151,7 +151,7 @@ static void run_channel_shutdown_before_timeout_test( grpc_event ev = grpc_completion_queue_next( cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); ASSERT_EQ(ev.type, GRPC_OP_COMPLETE); - /* expect success with a state transition to CHANNEL_SHUTDOWN */ + // expect success with a state transition to CHANNEL_SHUTDOWN ASSERT_EQ(ev.success, true); grpc_completion_queue_shutdown(cq); diff --git a/test/core/surface/secure_channel_create_test.cc b/test/core/surface/secure_channel_create_test.cc index 33b0b97241e..8fca5ad9c01 100644 --- a/test/core/surface/secure_channel_create_test.cc +++ b/test/core/surface/secure_channel_create_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "gtest/gtest.h" diff --git a/test/core/surface/sequential_connectivity_test.cc b/test/core/surface/sequential_connectivity_test.cc index 3797b8476b2..ab76f57217c 100644 --- a/test/core/surface/sequential_connectivity_test.cc +++ b/test/core/surface/sequential_connectivity_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -123,7 +123,7 @@ static void run_test(const test_fixture* fixture, bool share_subchannel) { connect_deadline, cq, nullptr); grpc_event ev = grpc_completion_queue_next( cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr); - /* check that the watcher from "watch state" was free'd */ + // check that the watcher from "watch state" was free'd ASSERT_EQ(grpc_channel_num_external_connectivity_watchers(channels[i]), 0); ASSERT_EQ(ev.type, GRPC_OP_COMPLETE); diff --git a/test/core/surface/server_chttp2_test.cc b/test/core/surface/server_chttp2_test.cc index 1ff7c411e7c..e350676fe7d 100644 --- a/test/core/surface/server_chttp2_test.cc +++ b/test/core/surface/server_chttp2_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/surface/server_test.cc b/test/core/surface/server_test.cc index dd1ffedf4db..c1c0535f5b4 100644 --- a/test/core/surface/server_test.cc +++ b/test/core/surface/server_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/transport/bdp_estimator_test.cc b/test/core/transport/bdp_estimator_test.cc index 0832874766b..a38db54a291 100644 --- a/test/core/transport/bdp_estimator_test.cc +++ b/test/core/transport/bdp_estimator_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/lib/transport/bdp_estimator.h" diff --git a/test/core/transport/chttp2/alpn_test.cc b/test/core/transport/chttp2/alpn_test.cc index 3f6e08c48a2..57db877a3be 100644 --- a/test/core/transport/chttp2/alpn_test.cc +++ b/test/core/transport/chttp2/alpn_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/alpn/alpn.h" diff --git a/test/core/transport/chttp2/bin_decoder_test.cc b/test/core/transport/chttp2/bin_decoder_test.cc index 57fb00743fc..b7673da1707 100644 --- a/test/core/transport/chttp2/bin_decoder_test.cc +++ b/test/core/transport/chttp2/bin_decoder_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/ext/transport/chttp2/transport/bin_decoder.h" @@ -92,10 +92,10 @@ static size_t base64_infer_length(const char* s) { TEST(BinDecoderTest, MainTest) { grpc_core::ExecCtx exec_ctx; - /* ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which - takes encoded base64 strings without pad chars, but output length is - required. */ - /* Base64 test vectors from RFC 4648 */ + // ENCODE_AND_DECODE tests grpc_chttp2_base64_decode_with_length(), which + // takes encoded base64 strings without pad chars, but output length is + // required. + // Base64 test vectors from RFC 4648 ENCODE_AND_DECODE(""); ENCODE_AND_DECODE("f"); ENCODE_AND_DECODE("foo"); @@ -106,20 +106,20 @@ TEST(BinDecoderTest, MainTest) { ENCODE_AND_DECODE("\xc0\xc1\xc2\xc3\xc4\xc5"); - /* Base64 test vectors from RFC 4648, with pad chars */ - /* BASE64("") = "" */ + // Base64 test vectors from RFC 4648, with pad chars + // BASE64("") = "" EXPECT_SLICE_EQ("", base64_decode("")); - /* BASE64("f") = "Zg==" */ + // BASE64("f") = "Zg==" EXPECT_SLICE_EQ("f", base64_decode("Zg==")); - /* BASE64("fo") = "Zm8=" */ + // BASE64("fo") = "Zm8=" EXPECT_SLICE_EQ("fo", base64_decode("Zm8=")); - /* BASE64("foo") = "Zm9v" */ + // BASE64("foo") = "Zm9v" EXPECT_SLICE_EQ("foo", base64_decode("Zm9v")); - /* BASE64("foob") = "Zm9vYg==" */ + // BASE64("foob") = "Zm9vYg==" EXPECT_SLICE_EQ("foob", base64_decode("Zm9vYg==")); - /* BASE64("fooba") = "Zm9vYmE=" */ + // BASE64("fooba") = "Zm9vYmE=" EXPECT_SLICE_EQ("fooba", base64_decode("Zm9vYmE=")); - /* BASE64("foobar") = "Zm9vYmFy" */ + // BASE64("foobar") = "Zm9vYmFy" EXPECT_SLICE_EQ("foobar", base64_decode("Zm9vYmFy")); EXPECT_SLICE_EQ("\xc0\xc1\xc2\xc3\xc4\xc5", base64_decode("wMHCw8TF")); diff --git a/test/core/transport/chttp2/bin_encoder_test.cc b/test/core/transport/chttp2/bin_encoder_test.cc index e0007a9678f..69bbf7df418 100644 --- a/test/core/transport/chttp2/bin_encoder_test.cc +++ b/test/core/transport/chttp2/bin_encoder_test.cc @@ -1,28 +1,28 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/bin_encoder.h" #include -/* This is here for grpc_is_binary_header - * TODO(murgatroid99): Remove this - */ +// This is here for grpc_is_binary_header +// TODO(murgatroid99): Remove this +// #include #include @@ -103,25 +103,25 @@ static void expect_binary_header(const char* hdr, int binary) { } TEST(BinEncoderTest, MainTest) { - /* Base64 test vectors from RFC 4648, with padding removed */ - /* BASE64("") = "" */ + // Base64 test vectors from RFC 4648, with padding removed + // BASE64("") = "" EXPECT_SLICE_EQ("", B64("")); - /* BASE64("f") = "Zg" */ + // BASE64("f") = "Zg" EXPECT_SLICE_EQ("Zg", B64("f")); - /* BASE64("fo") = "Zm8" */ + // BASE64("fo") = "Zm8" EXPECT_SLICE_EQ("Zm8", B64("fo")); - /* BASE64("foo") = "Zm9v" */ + // BASE64("foo") = "Zm9v" EXPECT_SLICE_EQ("Zm9v", B64("foo")); - /* BASE64("foob") = "Zm9vYg" */ + // BASE64("foob") = "Zm9vYg" EXPECT_SLICE_EQ("Zm9vYg", B64("foob")); - /* BASE64("fooba") = "Zm9vYmE" */ + // BASE64("fooba") = "Zm9vYmE" EXPECT_SLICE_EQ("Zm9vYmE", B64("fooba")); - /* BASE64("foobar") = "Zm9vYmFy" */ + // BASE64("foobar") = "Zm9vYmFy" EXPECT_SLICE_EQ("Zm9vYmFy", B64("foobar")); EXPECT_SLICE_EQ("wMHCw8TF", B64("\xc0\xc1\xc2\xc3\xc4\xc5")); - /* Huffman encoding tests */ + // Huffman encoding tests EXPECT_SLICE_EQ("\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff", HUFF("www.example.com")); EXPECT_SLICE_EQ("\xa8\xeb\x10\x64\x9c\xbf", HUFF("no-cache")); @@ -136,7 +136,7 @@ TEST(BinEncoderTest, MainTest) { "\x9d\x29\xad\x17\x18\x63\xc7\x8f\x0b\x97\xc8\xe9\xae\x82\xae\x43\xd3", HUFF("https://www.example.com")); - /* Various test vectors for combined encoding */ + // Various test vectors for combined encoding EXPECT_COMBINED_EQUIV(""); EXPECT_COMBINED_EQUIV("f"); EXPECT_COMBINED_EQUIV("fo"); diff --git a/test/core/transport/chttp2/context_list_test.cc b/test/core/transport/chttp2/context_list_test.cc index eecf57b0849..cc28f968c43 100644 --- a/test/core/transport/chttp2/context_list_test.cc +++ b/test/core/transport/chttp2/context_list_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/ext/transport/chttp2/transport/context_list.h" @@ -71,10 +71,10 @@ class ContextListTest : public ::testing::Test { } }; -/** Tests that all ContextList elements in the list are flushed out on - * execute. - * Also tests that arg and byte_counter are passed correctly. - */ +/// Tests that all ContextList elements in the list are flushed out on +/// execute. +/// Also tests that arg and byte_counter are passed correctly. +/// TEST_F(ContextListTest, ExecuteFlushesList) { ContextList* list = nullptr; const int kNumElems = 5; diff --git a/test/core/transport/chttp2/hpack_encoder_test.cc b/test/core/transport/chttp2/hpack_encoder_test.cc index 961756b09b0..671ca25c030 100644 --- a/test/core/transport/chttp2/hpack_encoder_test.cc +++ b/test/core/transport/chttp2/hpack_encoder_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/hpack_encoder.h" @@ -48,23 +48,23 @@ typedef struct { bool use_true_binary_metadata; } verify_params; -/* verify that the output frames that are generated by encoding the stream - have sensible type and flags values */ +// verify that the output frames that are generated by encoding the stream +// have sensible type and flags values static void verify_frames(grpc_slice_buffer& output, bool header_is_eof) { - /* per the HTTP/2 spec: - All frames begin with a fixed 9-octet header followed by a - variable-length payload. - - +-----------------------------------------------+ - | Length (24) | - +---------------+---------------+---------------+ - | Type (8) | Flags (8) | - +-+-------------+---------------+-------------------------------+ - |R| Stream Identifier (31) | - +=+=============================================================+ - | Frame Payload (0...) ... - +---------------------------------------------------------------+ - */ + // per the HTTP/2 spec: + // All frames begin with a fixed 9-octet header followed by a + // variable-length payload. + + // +-----------------------------------------------+ + // | Length (24) | + // +---------------+---------------+---------------+ + // | Type (8) | Flags (8) | + // +-+-------------+---------------+-------------------------------+ + // |R| Stream Identifier (31) | + // +=+=============================================================+ + // | Frame Payload (0...) ... + // +---------------------------------------------------------------+ + // uint8_t type = 0xff, flags = 0xff; size_t i, merged_length, frame_size; bool first_frame = false; @@ -169,11 +169,11 @@ grpc_slice EncodeHeaderIntoBytes( grpc_transport_one_way_stats stats = {}; grpc_core::HPackCompressor::EncodeHeaderOptions hopt{ - 0xdeadbeef, /* stream_id */ - is_eof, /* is_eof */ - false, /* use_true_binary_metadata */ - 16384, /* max_frame_size */ - &stats /* stats */ + 0xdeadbeef, // stream_id + is_eof, // is_eof + false, // use_true_binary_metadata + 16384, // max_frame_size + &stats // stats }; grpc_slice_buffer output; grpc_slice_buffer_init(&output); @@ -187,8 +187,8 @@ grpc_slice EncodeHeaderIntoBytes( return ret; } -/* verify that the output generated by encoding the stream matches the - hexstring passed in */ +// verify that the output generated by encoding the stream matches the +// hexstring passed in static void verify( bool is_eof, const char* expected, const std::vector>& header_fields) { @@ -316,10 +316,10 @@ static void verify_continuation_headers(const char* key, const char* value, grpc_transport_one_way_stats stats; stats = {}; grpc_core::HPackCompressor::EncodeHeaderOptions hopt = { - 0xdeadbeef, /* stream_id */ - is_eof, /* is_eof */ - false, /* use_true_binary_metadata */ - 150, /* max_frame_size */ + 0xdeadbeef, // stream_id + is_eof, // is_eof + false, // use_true_binary_metadata + 150, // max_frame_size &stats /* stats */}; g_compressor->EncodeHeaders(hopt, b, &output); verify_frames(output, is_eof); diff --git a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc index 85aee8dd669..6b54900bbf2 100644 --- a/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc +++ b/test/core/transport/chttp2/hpack_parser_fuzzer_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/transport/chttp2/hpack_parser_table_test.cc b/test/core/transport/chttp2/hpack_parser_table_test.cc index 48d76bcf84c..cf1b24cf40a 100644 --- a/test/core/transport/chttp2/hpack_parser_table_test.cc +++ b/test/core/transport/chttp2/hpack_parser_table_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/hpack_parser_table.h" diff --git a/test/core/transport/chttp2/hpack_parser_test.cc b/test/core/transport/chttp2/hpack_parser_test.cc index 7ff9335a54a..17b21f97408 100644 --- a/test/core/transport/chttp2/hpack_parser_test.cc +++ b/test/core/transport/chttp2/hpack_parser_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/hpack_parser.h" @@ -165,36 +165,36 @@ INSTANTIATE_TEST_SUITE_P( Test{ {}, { - /* D.2.1 */ + // D.2.1 {"400a 6375 7374 6f6d 2d6b 6579 0d63 7573" "746f 6d2d 6865 6164 6572", "custom-key: custom-header\n"}, - /* D.2.2 */ + // D.2.2 {"040c 2f73 616d 706c 652f 7061 7468", ":path: /sample/path\n"}, - /* D.2.3 */ + // D.2.3 {"1008 7061 7373 776f 7264 0673 6563 7265" "74", "password: secret\n"}, - /* D.2.4 */ + // D.2.4 {"82", ":method: GET\n"}, }}, Test{{}, { - /* D.3.1 */ + // D.3.1 {"8286 8441 0f77 7777 2e65 7861 6d70 6c65" "2e63 6f6d", ":path: /\n" ":authority: www.example.com\n" ":method: GET\n" ":scheme: http\n"}, - /* D.3.2 */ + // D.3.2 {"8286 84be 5808 6e6f 2d63 6163 6865", ":path: /\n" ":authority: www.example.com\n" ":method: GET\n" ":scheme: http\n" "cache-control: no-cache\n"}, - /* D.3.3 */ + // D.3.3 {"8287 85bf 400a 6375 7374 6f6d 2d6b 6579" "0c63 7573 746f 6d2d 7661 6c75 65", ":path: /index.html\n" @@ -205,21 +205,21 @@ INSTANTIATE_TEST_SUITE_P( }}, Test{{}, { - /* D.4.1 */ + // D.4.1 {"8286 8441 8cf1 e3c2 e5f2 3a6b a0ab 90f4" "ff", ":path: /\n" ":authority: www.example.com\n" ":method: GET\n" ":scheme: http\n"}, - /* D.4.2 */ + // D.4.2 {"8286 84be 5886 a8eb 1064 9cbf", ":path: /\n" ":authority: www.example.com\n" ":method: GET\n" ":scheme: http\n" "cache-control: no-cache\n"}, - /* D.4.3 */ + // D.4.3 {"8287 85bf 4088 25a8 49e9 5ba9 7d7f 8925" "a849 e95b b8e8 b4bf", ":path: /index.html\n" @@ -230,7 +230,7 @@ INSTANTIATE_TEST_SUITE_P( }}, Test{{256}, { - /* D.5.1 */ + // D.5.1 {"4803 3330 3258 0770 7269 7661 7465 611d" "4d6f 6e2c 2032 3120 4f63 7420 3230 3133" "2032 303a 3133 3a32 3120 474d 546e 1768" @@ -240,13 +240,13 @@ INSTANTIATE_TEST_SUITE_P( "cache-control: private\n" "date: Mon, 21 Oct 2013 20:13:21 GMT\n" "location: https://www.example.com\n"}, - /* D.5.2 */ + // D.5.2 {"4803 3330 37c1 c0bf", ":status: 307\n" "cache-control: private\n" "date: Mon, 21 Oct 2013 20:13:21 GMT\n" "location: https://www.example.com\n"}, - /* D.5.3 */ + // D.5.3 {"88c1 611d 4d6f 6e2c 2032 3120 4f63 7420" "3230 3133 2032 303a 3133 3a32 3220 474d" "54c0 5a04 677a 6970 7738 666f 6f3d 4153" @@ -264,7 +264,7 @@ INSTANTIATE_TEST_SUITE_P( }}, Test{{256}, { - /* D.6.1 */ + // D.6.1 {"4882 6402 5885 aec3 771a 4b61 96d0 7abe" "9410 54d4 44a8 2005 9504 0b81 66e0 82a6" "2d1b ff6e 919d 29ad 1718 63c7 8f0b 97c8" @@ -273,13 +273,13 @@ INSTANTIATE_TEST_SUITE_P( "cache-control: private\n" "date: Mon, 21 Oct 2013 20:13:21 GMT\n" "location: https://www.example.com\n"}, - /* D.6.2 */ + // D.6.2 {"4883 640e ffc1 c0bf", ":status: 307\n" "cache-control: private\n" "date: Mon, 21 Oct 2013 20:13:21 GMT\n" "location: https://www.example.com\n"}, - /* D.6.3 */ + // D.6.3 {"88c1 6196 d07a be94 1054 d444 a820 0595" "040b 8166 e084 a62d 1bff c05a 839b d9ab" "77ad 94e7 821d d7f2 e6c7 b335 dfdf cd5b" diff --git a/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc b/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc index 1f6b98dadf5..3ecf4227bad 100644 --- a/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc +++ b/test/core/transport/chttp2/remove_stream_from_stalled_lists_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 diff --git a/test/core/transport/chttp2/settings_timeout_test.cc b/test/core/transport/chttp2/settings_timeout_test.cc index 71e9c6447f1..ddeef1d64df 100644 --- a/test/core/transport/chttp2/settings_timeout_test.cc +++ b/test/core/transport/chttp2/settings_timeout_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/core/transport/chttp2/stream_map_test.cc b/test/core/transport/chttp2/stream_map_test.cc index 9b621082def..e66ffd16ce9 100644 --- a/test/core/transport/chttp2/stream_map_test.cc +++ b/test/core/transport/chttp2/stream_map_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/stream_map.h" @@ -26,7 +26,7 @@ #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x) -/* test creation & destruction */ +// test creation & destruction static void test_no_op(void) { grpc_chttp2_stream_map map; @@ -36,7 +36,7 @@ static void test_no_op(void) { grpc_chttp2_stream_map_destroy(&map); } -/* test lookup on an empty map */ +// test lookup on an empty map static void test_empty_find(void) { grpc_chttp2_stream_map map; @@ -47,7 +47,7 @@ static void test_empty_find(void) { grpc_chttp2_stream_map_destroy(&map); } -/* test add & lookup */ +// test add & lookup static void test_basic_add_find(uint32_t n) { grpc_chttp2_stream_map map; uint32_t i; @@ -71,7 +71,7 @@ static void test_basic_add_find(uint32_t n) { grpc_chttp2_stream_map_destroy(&map); } -/* verify that for_each gets the right values during test_delete_evens_XXX */ +// verify that for_each gets the right values during test_delete_evens_XXX static void verify_for_each(void* user_data, uint32_t stream_id, void* ptr) { uint32_t* for_each_check = static_cast(user_data); ASSERT_TRUE(ptr); @@ -103,8 +103,8 @@ static void check_delete_evens(grpc_chttp2_stream_map* map, uint32_t n) { } } -/* add a bunch of keys, delete the even ones, and make sure the map is - consistent */ +// add a bunch of keys, delete the even ones, and make sure the map is +// consistent static void test_delete_evens_sweep(uint32_t n) { grpc_chttp2_stream_map map; uint32_t i; @@ -125,8 +125,8 @@ static void test_delete_evens_sweep(uint32_t n) { grpc_chttp2_stream_map_destroy(&map); } -/* add a bunch of keys, delete the even ones immediately, and make sure the map - is consistent */ +// add a bunch of keys, delete the even ones immediately, and make sure the map +// is consistent static void test_delete_evens_incremental(uint32_t n) { grpc_chttp2_stream_map map; uint32_t i; @@ -145,8 +145,8 @@ static void test_delete_evens_incremental(uint32_t n) { grpc_chttp2_stream_map_destroy(&map); } -/* add a bunch of keys, delete old ones after some time, ensure the - backing array does not grow */ +// add a bunch of keys, delete old ones after some time, ensure the +// backing array does not grow static void test_periodic_compaction(uint32_t n) { grpc_chttp2_stream_map map; uint32_t i; diff --git a/test/core/transport/chttp2/too_many_pings_test.cc b/test/core/transport/chttp2/too_many_pings_test.cc index 577dae18f27..c9411e59c6b 100644 --- a/test/core/transport/chttp2/too_many_pings_test.cc +++ b/test/core/transport/chttp2/too_many_pings_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 diff --git a/test/core/transport/chttp2/varint_test.cc b/test/core/transport/chttp2/varint_test.cc index cf892a5ff8d..026ad9c3433 100644 --- a/test/core/transport/chttp2/varint_test.cc +++ b/test/core/transport/chttp2/varint_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/ext/transport/chttp2/transport/varint.h" diff --git a/test/core/transport/connectivity_state_test.cc b/test/core/transport/connectivity_state_test.cc index d88623e3321..2f74739fea9 100644 --- a/test/core/transport/connectivity_state_test.cc +++ b/test/core/transport/connectivity_state_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/transport/connectivity_state.h" diff --git a/test/core/transport/pid_controller_test.cc b/test/core/transport/pid_controller_test.cc index eccbb6148cf..82c5e4b6584 100644 --- a/test/core/transport/pid_controller_test.cc +++ b/test/core/transport/pid_controller_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "src/core/lib/transport/pid_controller.h" diff --git a/test/core/transport/status_conversion_test.cc b/test/core/transport/status_conversion_test.cc index 0d3d8d6e103..4d4b6eb1a13 100644 --- a/test/core/transport/status_conversion_test.cc +++ b/test/core/transport/status_conversion_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/transport/status_conversion.h" @@ -168,7 +168,7 @@ TEST(StatusConversionTest, TestHttp2StatusToGrpcStatus) { } TEST(StatusConversionTest, TestGrpcHttp2StatusToGrpcStatusAll) { - /* check all status values can be converted */ + // check all status values can be converted for (int i = 0; i <= 999; i++) { grpc_http2_status_to_grpc_status(i); } diff --git a/test/core/transport/timeout_encoding_test.cc b/test/core/transport/timeout_encoding_test.cc index 663862d39af..420fd930fee 100644 --- a/test/core/transport/timeout_encoding_test.cc +++ b/test/core/transport/timeout_encoding_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/transport/timeout_encoding.h" diff --git a/test/core/tsi/alts/crypt/aes_gcm_test.cc b/test/core/tsi/alts/crypt/aes_gcm_test.cc index 5fc951f65ca..0f1774f2130 100644 --- a/test/core/tsi/alts/crypt/aes_gcm_test.cc +++ b/test/core/tsi/alts/crypt/aes_gcm_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -31,7 +31,7 @@ const size_t kTestMaxSlices = 5; const size_t kTestMaxLength = 1024; const size_t kTestNumEncryptions = 100; -/* Struct for pre-generated test vector */ +// Struct for pre-generated test vector typedef struct gsec_aead_test_vector { uint8_t* nonce; uint8_t* aad; @@ -92,7 +92,7 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, gsec_test_random_array(&aad, aad_length); gsec_test_random_array(&message, message_length); - /* Test encryption */ + // Test encryption size_t ciphertext_and_tag_length, ciphertext_bytes_written = 0; gsec_aead_crypter_max_ciphertext_and_tag_length( crypter, message_length, &ciphertext_and_tag_length, nullptr); @@ -110,7 +110,7 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, ASSERT_EQ(message_length + tag_length, ciphertext_and_tag_length); ASSERT_EQ(ciphertext_bytes_written, ciphertext_and_tag_length); - /* Test decryption */ + // Test decryption size_t plaintext_length, plaintext_bytes_written = 0; gsec_aead_crypter_max_plaintext_length(crypter, ciphertext_bytes_written, &plaintext_length, nullptr); @@ -126,13 +126,14 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, ASSERT_EQ(memcmp(message, plaintext, message_length), 0); } - /** - * The returned plaintext will be zeroed if there was an authentication error. - */ + /// + /// The returned plaintext will be zeroed if there was an authentication + /// error. + /// uint8_t* zero_message = static_cast(gpr_zalloc(plaintext_length)); if (tag_length >= kTestMinTagLengthForCorruption) { char* error_message; - /* Corrupt nonce */ + // Corrupt nonce if (nonce_length > 0) { plaintext_bytes_written = 0; uint8_t* corrupt_nonce; @@ -153,7 +154,7 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, gpr_free(error_message); } - /* Corrupt ciphertext_and_tag */ + // Corrupt ciphertext_and_tag plaintext_bytes_written = 0; uint8_t* corrupt_ciphertext_and_tag; gsec_test_copy_and_alter_random_byte(ciphertext_and_tag, @@ -174,7 +175,7 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, gpr_free(error_message); gpr_free(corrupt_ciphertext_and_tag); - /* Corrupt start of ciphertext_and_tag */ + // Corrupt start of ciphertext_and_tag plaintext_bytes_written = 0; gsec_test_copy(ciphertext_and_tag, &corrupt_ciphertext_and_tag, ciphertext_and_tag_length); @@ -193,7 +194,7 @@ static void gsec_test_random_encrypt_decrypt(gsec_aead_crypter* crypter, gpr_free(error_message); gpr_free(corrupt_ciphertext_and_tag); - /* Corrupt end of ciphertext_and_tag */ + // Corrupt end of ciphertext_and_tag plaintext_bytes_written = 0; gsec_test_copy(ciphertext_and_tag, &corrupt_ciphertext_and_tag, ciphertext_and_tag_length); @@ -269,7 +270,7 @@ static void gsec_test_multiple_random_encrypt_decrypt( uint8_t** plaintexts = static_cast(gpr_malloc(sizeof(uint8_t*) * count)); - /* Do encryption */ + // Do encryption for (ind = 0; ind < count; ind++) { size_t aad_length = (aad_lengths == nullptr) ? 0 : aad_lengths[ind]; size_t message_length = @@ -287,7 +288,7 @@ static void gsec_test_multiple_random_encrypt_decrypt( ASSERT_EQ(message_length + tag_length, ciphertext_and_tag_lengths[ind]); ASSERT_EQ(ciphertext_bytes_writtens[ind], ciphertext_and_tag_lengths[ind]); } - /* Do Decryption */ + // Do Decryption for (ind = 0; ind < count; ind++) { size_t aad_length = (aad_lengths == nullptr) ? 0 : aad_lengths[ind]; size_t message_length = @@ -308,7 +309,7 @@ static void gsec_test_multiple_random_encrypt_decrypt( } } - /* Slice the plaintext and encrypt with iovecs */ + // Slice the plaintext and encrypt with iovecs for (ind = 0; ind < count; ind++) { size_t aad_length = (aad_lengths == nullptr) ? 0 : aad_lengths[ind]; struct iovec* aad_vecs = nullptr; @@ -343,7 +344,7 @@ static void gsec_test_multiple_random_encrypt_decrypt( free(message_vecs); } - /* Slice the ciphertext and decrypt with iovecs */ + // Slice the ciphertext and decrypt with iovecs for (ind = 0; ind < count; ind++) { size_t message_length = (message_lengths == nullptr) ? 0 : message_lengths[ind]; @@ -441,7 +442,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { uint8_t* ciphertext_and_tag = static_cast(gpr_malloc(ciphertext_and_tag_length)); - /* nullptr nonce */ + // nullptr nonce grpc_status_code status = gsec_aead_crypter_encrypt( crypter, nullptr, nonce_length, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, &ciphertext_bytes_written, @@ -451,7 +452,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer is nullptr.")); gpr_free(error_message); - /* Big nonce */ + // Big nonce status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length + 1, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, @@ -461,7 +462,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer has the wrong length.")); gpr_free(error_message); - /* Small nonce */ + // Small nonce status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length - 1, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, @@ -471,7 +472,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer has the wrong length.")); gpr_free(error_message); - /* nullptr aad */ + // nullptr aad status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, nullptr, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, @@ -480,7 +481,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "aad is nullptr.")); gpr_free(error_message); - /* nullptr aad with zero length */ + // nullptr aad with zero length gsec_assert_ok( gsec_aead_crypter_encrypt(crypter, nonce, nonce_length, nullptr, 0, message, message_length, ciphertext_and_tag, @@ -488,7 +489,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { &ciphertext_bytes_written, &error_message), error_message); - /* nullptr plaintext */ + // nullptr plaintext status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, aad, aad_length, nullptr, message_length, ciphertext_and_tag, ciphertext_and_tag_length, &ciphertext_bytes_written, @@ -498,7 +499,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "plaintext is nullptr.")); gpr_free(error_message); - /* nullptr ciphertext */ + // nullptr ciphertext status = gsec_aead_crypter_encrypt(crypter, nonce, nonce_length, aad, aad_length, message, message_length, nullptr, ciphertext_and_tag_length, @@ -508,7 +509,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "ciphertext is nullptr.")); gpr_free(error_message); - /* Short ciphertext */ + // Short ciphertext status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length - 1, @@ -518,7 +519,7 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "ciphertext is too small to hold a tag.")); gpr_free(error_message); - /* nullptr ciphertext_bytes_written */ + // nullptr ciphertext_bytes_written status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, nullptr, &error_message); @@ -527,14 +528,14 @@ static void gsec_test_encryption_failure(gsec_aead_crypter* crypter) { "bytes_written is nullptr.")); gpr_free(error_message); - /* nullptr plaintext/ciphertext encrypt with zero length */ + // nullptr plaintext/ciphertext encrypt with zero length gsec_assert_ok(gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, aad, aad_length, nullptr, 0, ciphertext_and_tag, ciphertext_and_tag_length, &ciphertext_bytes_written, &error_message), error_message); - /* Success */ + // Success status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, aad, aad_length, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, &ciphertext_bytes_written, @@ -560,7 +561,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { gsec_test_random_array(&aad, aad_length); gsec_test_random_array(&message, message_length); - /* Test encryption */ + // Test encryption size_t ciphertext_and_tag_length, ciphertext_bytes_written = 0; gsec_aead_crypter_max_ciphertext_and_tag_length( crypter, message_length, &ciphertext_and_tag_length, nullptr); @@ -580,7 +581,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { uint8_t* plaintext = static_cast(gpr_malloc(plaintext_length)); char* error_message; - /* nullptr nonce */ + // nullptr nonce status = gsec_aead_crypter_decrypt( crypter, nullptr, nonce_length, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, plaintext_length, @@ -590,7 +591,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer is nullptr.")); gpr_free(error_message); - /* Big nonce */ + // Big nonce status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length + 1, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, plaintext_length, @@ -600,7 +601,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer has the wrong length.")); gpr_free(error_message); - /* Small nonce */ + // Small nonce status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length - 1, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, plaintext_length, @@ -610,7 +611,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "Nonce buffer has the wrong length.")); gpr_free(error_message); - /* nullptr aad */ + // nullptr aad status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, nullptr, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, plaintext_length, @@ -619,7 +620,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "aad is nullptr.")); gpr_free(error_message); - /* nullptr aad with zero length */ + // nullptr aad with zero length status = gsec_aead_crypter_encrypt( crypter, nonce, nonce_length, nullptr, 0, message, message_length, ciphertext_and_tag, ciphertext_and_tag_length, &ciphertext_bytes_written, @@ -632,7 +633,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { &plaintext_bytes_written, &error_message); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Small ciphertext */ + // Small ciphertext if (tag_length > 0) { status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, aad, aad_length, ciphertext_and_tag, @@ -645,7 +646,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { gpr_free(error_message); } - /* nullptr ciphertext */ + // nullptr ciphertext status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, aad, aad_length, nullptr, ciphertext_and_tag_length, plaintext, plaintext_length, @@ -656,7 +657,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "ciphertext is nullptr.")); gpr_free(error_message); - /* nullptr plaintext */ + // nullptr plaintext status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, nullptr, plaintext_length, @@ -667,7 +668,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "plaintext is nullptr, but plaintext_length is positive.")); gpr_free(error_message); - /* Short plaintext */ + // Short plaintext status = gsec_aead_crypter_decrypt( crypter, nonce, nonce_length, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, plaintext_length - 1, @@ -678,7 +679,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { "Not enough plaintext buffer to hold encrypted ciphertext.")); gpr_free(error_message); - /* nullptr plaintext_bytes_written */ + // nullptr plaintext_bytes_written status = gsec_aead_crypter_decrypt(crypter, nonce, nonce_length, aad, aad_length, ciphertext_and_tag, ciphertext_and_tag_length, plaintext, @@ -699,7 +700,7 @@ static void gsec_test_decryption_failure(gsec_aead_crypter* crypter) { static void gsec_test_encrypt_decrypt_test_vector( gsec_aead_crypter* crypter, gsec_aead_test_vector* test_vector) { ASSERT_NE(crypter, nullptr); - /* Test byte-based encryption interface. */ + // Test byte-based encryption interface. size_t ciphertext_and_tag_length, ciphertext_bytes_written = 0; gsec_aead_crypter_max_ciphertext_and_tag_length( crypter, test_vector->plaintext_length, &ciphertext_and_tag_length, @@ -718,7 +719,7 @@ static void gsec_test_encrypt_decrypt_test_vector( ciphertext_and_tag_length), 0); - /* Test byte-based decryption interface */ + // Test byte-based decryption interface size_t plaintext_length, plaintext_bytes_written = 0; gsec_aead_crypter_max_plaintext_length(crypter, ciphertext_and_tag_length, &plaintext_length, nullptr); @@ -1469,13 +1470,13 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsRekeyIeee) { } TEST(AltsCryptTest, GsecTestDoVectorTestsNist) { - /** - * From: - * http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/ - * gcm-revised-spec.pdf - */ + /// + /// From: + /// http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/ + /// gcm-revised-spec.pdf + /// - /* Test vector 1 */ + // Test vector 1 gsec_aead_test_vector* test_vector_1; const uint8_t test_vector_1_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1496,7 +1497,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsNist) { gsec_test_verify_crypter_on_test_vector(test_vector_1); gsec_aead_free_test_vector(test_vector_1); - /* Test vector 2 */ + // Test vector 2 gsec_aead_test_vector* test_vector_2; const uint8_t test_vector_2_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1522,7 +1523,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsNist) { gsec_test_verify_crypter_on_test_vector(test_vector_2); gsec_aead_free_test_vector(test_vector_2); - /* Test vector 3 */ + // Test vector 3 gsec_aead_test_vector* test_vector_3; const uint8_t test_vector_3_key[] = {0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, @@ -1556,7 +1557,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsNist) { gsec_test_verify_crypter_on_test_vector(test_vector_3); gsec_aead_free_test_vector(test_vector_3); - /* Test vector 4 */ + // Test vector 4 gsec_aead_test_vector* test_vector_4; const uint8_t test_vector_4_key[] = {0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, @@ -1593,13 +1594,13 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsNist) { } TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { - /** - * From: - * http://www.ieee802.org/1/files/public/docs2011/ - * bn-randall-test-vectors-0511-v1.pdf - */ + /// + /// From: + /// http://www.ieee802.org/1/files/public/docs2011/ + /// bn-randall-test-vectors-0511-v1.pdf + /// - /* 2.1.1 54-byte auth */ + // 2.1.1 54-byte auth gsec_aead_test_vector* test_vector_5; const uint8_t test_vector_5_key[] = {0xad, 0x7a, 0x2b, 0xd0, 0x3e, 0xac, 0x83, 0x5a, 0x6f, 0x62, 0x0f, 0xdc, @@ -1627,7 +1628,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_5); gsec_aead_free_test_vector(test_vector_5); - /* 2.1.2 54-byte auth */ + // 2.1.2 54-byte auth gsec_aead_test_vector* test_vector_6; const uint8_t test_vector_6_key[] = { 0xe3, 0xc0, 0x8a, 0x8f, 0x06, 0xc6, 0xe3, 0xad, 0x95, 0xa7, 0x05, @@ -1657,7 +1658,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_6); gsec_aead_free_test_vector(test_vector_6); - /* 2.2.1 60-byte crypt */ + // 2.2.1 60-byte crypt gsec_aead_test_vector* test_vector_7; const uint8_t test_vector_7_key[] = {0xad, 0x7a, 0x2b, 0xd0, 0x3e, 0xac, 0x83, 0x5a, 0x6f, 0x62, 0x0f, 0xdc, @@ -1692,7 +1693,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_7); gsec_aead_free_test_vector(test_vector_7); - /* 2.2.2 60-byte crypt */ + // 2.2.2 60-byte crypt gsec_aead_test_vector* test_vector_8; const uint8_t test_vector_8_key[] = { 0xe3, 0xc0, 0x8a, 0x8f, 0x06, 0xc6, 0xe3, 0xad, 0x95, 0xa7, 0x05, @@ -1727,7 +1728,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_8); gsec_aead_free_test_vector(test_vector_8); - /* 2.3.1 60-byte auth */ + // 2.3.1 60-byte auth gsec_aead_test_vector* test_vector_9; const uint8_t test_vector_9_key[] = {0x07, 0x1b, 0x11, 0x3b, 0x0c, 0xa7, 0x43, 0xfe, 0xcc, 0xcf, 0x3d, 0x05, @@ -1755,7 +1756,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_9); gsec_aead_free_test_vector(test_vector_9); - /* 2.3.2 60-byte auth */ + // 2.3.2 60-byte auth gsec_aead_test_vector* test_vector_10; const uint8_t test_vector_10_key[] = { 0x69, 0x1d, 0x3e, 0xe9, 0x09, 0xd7, 0xf5, 0x41, 0x67, 0xfd, 0x1c, @@ -1784,7 +1785,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_10); gsec_aead_free_test_vector(test_vector_10); - /* 2.4.1 54-byte crypt */ + // 2.4.1 54-byte crypt gsec_aead_test_vector* test_vector_11; const uint8_t test_vector_11_key[] = {0x07, 0x1b, 0x11, 0x3b, 0x0c, 0xa7, 0x43, 0xfe, 0xcc, 0xcf, 0x3d, 0x05, @@ -1816,7 +1817,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_11); gsec_aead_free_test_vector(test_vector_11); - /* 2.4.2 54-byte crypt */ + // 2.4.2 54-byte crypt gsec_aead_test_vector* test_vector_12; const uint8_t test_vector_12_key[] = { 0x69, 0x1d, 0x3e, 0xe9, 0x09, 0xd7, 0xf5, 0x41, 0x67, 0xfd, 0x1c, @@ -1849,7 +1850,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_12); gsec_aead_free_test_vector(test_vector_12); - /* 2.5.1 65-byte auth */ + // 2.5.1 65-byte auth gsec_aead_test_vector* test_vector_13; const uint8_t test_vector_13_key[] = {0x01, 0x3f, 0xe0, 0x0b, 0x5f, 0x11, 0xbe, 0x7f, 0x86, 0x6d, 0x0c, 0xbb, @@ -1878,7 +1879,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_13); gsec_aead_free_test_vector(test_vector_13); - /* 2.5.2 65-byte auth */ + // 2.5.2 65-byte auth gsec_aead_test_vector* test_vector_14; const uint8_t test_vector_14_key[] = { 0x83, 0xc0, 0x93, 0xb5, 0x8d, 0xe7, 0xff, 0xe1, 0xc0, 0xda, 0x92, @@ -1908,7 +1909,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_14); gsec_aead_free_test_vector(test_vector_14); - /* 2.6.1 61-byte crypt */ + // 2.6.1 61-byte crypt gsec_aead_test_vector* test_vector_15; const uint8_t test_vector_15_key[] = {0x01, 0x3f, 0xe0, 0x0b, 0x5f, 0x11, 0xbe, 0x7f, 0x86, 0x6d, 0x0c, 0xbb, @@ -1943,7 +1944,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_15); gsec_aead_free_test_vector(test_vector_15); - /* 2.6.2 61-byte crypt */ + // 2.6.2 61-byte crypt gsec_aead_test_vector* test_vector_16; const uint8_t test_vector_16_key[] = { 0x83, 0xc0, 0x93, 0xb5, 0x8d, 0xe7, 0xff, 0xe1, 0xc0, 0xda, 0x92, @@ -1979,7 +1980,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_16); gsec_aead_free_test_vector(test_vector_16); - /* 2.7.1 79-byte crypt */ + // 2.7.1 79-byte crypt gsec_aead_test_vector* test_vector_17; const uint8_t test_vector_17_key[] = {0x88, 0xee, 0x08, 0x7f, 0xd9, 0x5d, 0xa9, 0xfb, 0xf6, 0x72, 0x5a, 0xa9, @@ -2009,7 +2010,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_17); gsec_aead_free_test_vector(test_vector_17); - /* 2.7.2 79-byte crypt */ + // 2.7.2 79-byte crypt gsec_aead_test_vector* test_vector_18; const uint8_t test_vector_18_key[] = { 0x4c, 0x97, 0x3d, 0xbc, 0x73, 0x64, 0x62, 0x16, 0x74, 0xf8, 0xb5, @@ -2040,7 +2041,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_18); gsec_aead_free_test_vector(test_vector_18); - /* 2.8.1 61-byte crypt */ + // 2.8.1 61-byte crypt gsec_aead_test_vector* test_vector_19; const uint8_t test_vector_19_key[] = {0x88, 0xee, 0x08, 0x7f, 0xd9, 0x5d, 0xa9, 0xfb, 0xf6, 0x72, 0x5a, 0xa9, @@ -2076,7 +2077,7 @@ TEST(AltsCryptTest, GsecTestDoVectorTestsIeee) { gsec_test_verify_crypter_on_test_vector(test_vector_19); gsec_aead_free_test_vector(test_vector_19); - /* 2.8.2 61-byte crypt */ + // 2.8.2 61-byte crypt gsec_aead_test_vector* test_vector_20; const uint8_t test_vector_20_key[] = { 0x4c, 0x97, 0x3d, 0xbc, 0x73, 0x64, 0x62, 0x16, 0x74, 0xf8, 0xb5, diff --git a/test/core/tsi/alts/crypt/gsec_test_util.cc b/test/core/tsi/alts/crypt/gsec_test_util.cc index 29533fa80e6..9b6898c3ae7 100644 --- a/test/core/tsi/alts/crypt/gsec_test_util.cc +++ b/test/core/tsi/alts/crypt/gsec_test_util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/core/tsi/alts/crypt/gsec_test_util.h" diff --git a/test/core/tsi/alts/crypt/gsec_test_util.h b/test/core/tsi/alts/crypt/gsec_test_util.h index 9182a22d000..946924195cd 100644 --- a/test/core/tsi/alts/crypt/gsec_test_util.h +++ b/test/core/tsi/alts/crypt/gsec_test_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_TEST_CORE_TSI_ALTS_CRYPT_GSEC_TEST_UTIL_H_ #define GRPC_TEST_CORE_TSI_ALTS_CRYPT_GSEC_TEST_UTIL_H_ @@ -26,61 +26,61 @@ #include -/** - * This method returns random bytes of certain length. - * - * - bytes: buffer to hold random bytes. - * - length: length of buffer to be populated. - */ +/// +/// This method returns random bytes of certain length. +/// +///- bytes: buffer to hold random bytes. +///- length: length of buffer to be populated. +/// void gsec_test_random_bytes(uint8_t* bytes, size_t length); -/** - * This method returns an array of random bytes. - * - * - bytes: array to hold random bytes. - * - length: length of array to be populated. - */ +/// +/// This method returns an array of random bytes. +/// +///- bytes: array to hold random bytes. +///- length: length of array to be populated. +/// void gsec_test_random_array(uint8_t** bytes, size_t length); -/** - * This method returns a uint32 that's not quite uniformly random, but good - * enough for tests. - * - * - max_length: a max value the returned random number can choose. - */ +/// +/// This method returns a uint32 that's not quite uniformly random, but good +/// enough for tests. +/// +///- max_length: a max value the returned random number can choose. +/// uint32_t gsec_test_bias_random_uint32(uint32_t max_length); -/** - * This method copies data from a source to a destination buffer. - * - * - src: a source buffer. - * - des: a destination buffer. - * - source_len: the length of source buffer to be copied from its beginning. - */ +/// +/// This method copies data from a source to a destination buffer. +/// +///- src: a source buffer. +///- des: a destination buffer. +///- source_len: the length of source buffer to be copied from its beginning. +/// void gsec_test_copy(const uint8_t* src, uint8_t** des, size_t source_len); -/** - * This method copies data from a source to a destination buffer, and flips one - * byte in the destination buffer randomly. - * - * - src: a source buffer. - * - des: a destination buffer. - * - length: the length of source buffer to be copied from its beginning. - */ +/// +/// This method copies data from a source to a destination buffer, and flips one +/// byte in the destination buffer randomly. +/// +///- src: a source buffer. +///- des: a destination buffer. +///- length: the length of source buffer to be copied from its beginning. +/// void gsec_test_copy_and_alter_random_byte(const uint8_t* src, uint8_t** des, size_t source_len); -/** - * This method compares two grpc_status_code values, and verifies if one string - * is a substring of the other. - * - * - status1: the first grpc_status_code to be compared. - * - status2: the second grpc_status_code to be compared. - * - msg1: a string to be scanned. - * - msg2: a small string to be searched within msg1. - * - * If both checks succeed, the method returns 1 and otherwise, it returns 0. - */ +/// +/// This method compares two grpc_status_code values, and verifies if one string +/// is a substring of the other. +/// +///- status1: the first grpc_status_code to be compared. +///- status2: the second grpc_status_code to be compared. +///- msg1: a string to be scanned. +///- msg2: a small string to be searched within msg1. +/// +/// If both checks succeed, the method returns 1 and otherwise, it returns 0. +/// int gsec_test_expect_compare_code_and_substr(grpc_status_code status1, grpc_status_code status2, const char* msg1, diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc index c621d6c3bcf..2f0370ada26 100644 --- a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h" #include diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h index 352bcf06bda..eaf793a68a0 100644 --- a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H #define TEST_CORE_TSI_ALTS_FAKE_HANDSHAKER_FAKE_HANDSHAKER_SERVER_H diff --git a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server_main.cc b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server_main.cc index 6eb0ba7d2b9..a689e2fc666 100644 --- a/test/core/tsi/alts/fake_handshaker/fake_handshaker_server_main.cc +++ b/test/core/tsi/alts/fake_handshaker/fake_handshaker_server_main.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include "absl/flags/flag.h" diff --git a/test/core/tsi/alts/frame_protector/alts_counter_test.cc b/test/core/tsi/alts/frame_protector/alts_counter_test.cc index 968b6f92f6e..d610deb4df2 100644 --- a/test/core/tsi/alts/frame_protector/alts_counter_test.cc +++ b/test/core/tsi/alts/frame_protector/alts_counter_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/frame_protector/alts_counter.h" @@ -40,8 +40,8 @@ static void alts_counter_test_input_sanity_check(size_t counter_size, alts_counter* ctr = nullptr; char* error_details = nullptr; - /* Input sanity check on alts_counter_create(). */ - /* Invalid counter size. */ + // Input sanity check on alts_counter_create(). + // Invalid counter size. grpc_status_code status = alts_counter_create(true, 0, overflow_size, &ctr, &error_details); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( @@ -49,14 +49,14 @@ static void alts_counter_test_input_sanity_check(size_t counter_size, "counter_size is invalid.")); gpr_free(error_details); - /* Invalid overflow size. */ + // Invalid overflow size. status = alts_counter_create(true, counter_size, 0, &ctr, &error_details); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( status, GRPC_STATUS_INVALID_ARGUMENT, error_details, "overflow_size is invalid.")); gpr_free(error_details); - /* alts_counter is nullptr. */ + // alts_counter is nullptr. status = alts_counter_create(true, counter_size, overflow_size, nullptr, &error_details); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( @@ -68,15 +68,15 @@ static void alts_counter_test_input_sanity_check(size_t counter_size, &error_details); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Input sanity check on alts_counter_increment(). */ - /* crypter_counter is nullptr. */ + // Input sanity check on alts_counter_increment(). + // crypter_counter is nullptr. bool is_overflow = false; status = alts_counter_increment(nullptr, &is_overflow, &error_details); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( status, GRPC_STATUS_INVALID_ARGUMENT, error_details, "crypter_counter is nullptr.")); gpr_free(error_details); - /* is_overflow is nullptr. */ + // is_overflow is nullptr. status = alts_counter_increment(ctr, nullptr, &error_details); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( status, GRPC_STATUS_INVALID_ARGUMENT, error_details, @@ -98,7 +98,7 @@ static void alts_counter_test_overflow_full_range(bool is_client, if (is_client) { expected[counter_size - 1] = 0x80; } - /* Do a single iteration to ensure the counter is initialized as expected. */ + // Do a single iteration to ensure the counter is initialized as expected. ASSERT_EQ(do_bytes_represent_client(ctr, alts_counter_get_counter(ctr), counter_size), is_client); @@ -107,11 +107,11 @@ static void alts_counter_test_overflow_full_range(bool is_client, ASSERT_EQ(alts_counter_increment(ctr, &is_overflow, &error_details), GRPC_STATUS_OK); ASSERT_FALSE(is_overflow); - /** - * The counter can return 2^{overflow_size * 8} counters. The - * high-order bit is fixed to the client/server. The last call will yield a - * useable counter, but overflow the counter object. - */ + /// + /// The counter can return 2^{overflow_size * 8} counters. The + /// high-order bit is fixed to the client/server. The last call will yield a + /// useable counter, but overflow the counter object. + /// int iterations = 1 << (overflow_size * 8); int ind = 1; for (ind = 1; ind < iterations - 1; ind++) { @@ -132,7 +132,7 @@ static void alts_counter_test_overflow_full_range(bool is_client, alts_counter_destroy(ctr); } -/* Set the counter manually and make sure it overflows as expected. */ +// Set the counter manually and make sure it overflows as expected. static void alts_counter_test_overflow_single_increment(bool is_client, size_t counter_size, size_t overflow_size) { diff --git a/test/core/tsi/alts/frame_protector/alts_crypter_test.cc b/test/core/tsi/alts/frame_protector/alts_crypter_test.cc index 2bbc4f394d9..8d11a32812a 100644 --- a/test/core/tsi/alts/frame_protector/alts_crypter_test.cc +++ b/test/core/tsi/alts/frame_protector/alts_crypter_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/frame_protector/alts_crypter.h" @@ -41,7 +41,7 @@ static void alts_crypter_test_random_seal_unseal(alts_crypter* server_seal, uint8_t* duplicate_buffer = nullptr; gsec_test_copy(data_buffer, &duplicate_buffer, data_size); - /* Client seal and server unseal */ + // Client seal and server unseal size_t size = data_size; grpc_status_code status = alts_crypter_process_in_place( client_seal, data_buffer, protected_data_size, size, &size, nullptr); @@ -52,7 +52,7 @@ static void alts_crypter_test_random_seal_unseal(alts_crypter* server_seal, ASSERT_EQ(status, GRPC_STATUS_OK); ASSERT_EQ(memcmp(data_buffer, duplicate_buffer, data_size), 0); ASSERT_EQ(size, data_size); - /* Server seal and client unseal */ + // Server seal and client unseal status = alts_crypter_process_in_place( server_seal, data_buffer, protected_data_size, size, &size, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); @@ -84,7 +84,7 @@ static void alts_crypter_test_multiple_random_seal_unseal( gsec_test_copy(data_buffer1, &duplicate_buffer1, data_size); gsec_test_copy(data_buffer2, &duplicate_buffer2, data_size); - /* Client seal and server unseal */ + // Client seal and server unseal size_t size1 = data_size, size2 = data_size; grpc_status_code status = alts_crypter_process_in_place( client_seal, data_buffer1, protected_data_size, size1, &size1, nullptr); @@ -105,7 +105,7 @@ static void alts_crypter_test_multiple_random_seal_unseal( ASSERT_EQ(memcmp(data_buffer2, duplicate_buffer2, data_size), 0); ASSERT_EQ(size2, data_size); - /* Server seal and client unseal */ + // Server seal and client unseal status = alts_crypter_process_in_place( server_seal, data_buffer1, protected_data_size, size1, &size1, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); @@ -140,7 +140,7 @@ static void alts_crypter_test_corrupted_unseal( auto* data_buffer = static_cast(gpr_malloc(protected_data_size)); auto* zero_buffer = static_cast(gpr_zalloc(data_size)); - /* Corrupt a random byte in protected data. */ + // Corrupt a random byte in protected data. size_t size = data_size; gsec_test_random_bytes(data_buffer, data_size); grpc_status_code status = alts_crypter_process_in_place( @@ -161,7 +161,7 @@ static void alts_crypter_test_corrupted_unseal( gpr_free(corrupted_data_buffer); gpr_free(error_message); - /* Corrupt the beginning of protected data. */ + // Corrupt the beginning of protected data. size = data_size; gsec_test_random_bytes(data_buffer, data_size); status = alts_crypter_process_in_place( @@ -180,7 +180,7 @@ static void alts_crypter_test_corrupted_unseal( gpr_free(corrupted_data_buffer); gpr_free(error_message); - /* Corrupt the end of protected data. */ + // Corrupt the end of protected data. size = data_size; gsec_test_random_bytes(data_buffer, data_size); status = alts_crypter_process_in_place( @@ -213,7 +213,7 @@ static void alts_crypter_test_unsync_seal_unseal(alts_crypter* server_seal, auto* data_buffer = static_cast(gpr_malloc(protected_data_size)); auto* zero_buffer = static_cast(gpr_zalloc(data_size)); - /* Perform two seals at client, one unseal at server. */ + // Perform two seals at client, one unseal at server. size_t size = data_size; gsec_test_random_bytes(data_buffer, data_size); grpc_status_code status = alts_crypter_process_in_place( @@ -238,7 +238,7 @@ static void alts_crypter_test_unsync_seal_unseal(alts_crypter* server_seal, ASSERT_EQ(memcmp(data_buffer, zero_buffer, data_size), 0); gpr_free(error_message); - /* Perform two seals at server, one unseal at client. */ + // Perform two seals at server, one unseal at client. size = data_size; gsec_test_random_bytes(data_buffer, data_size); status = alts_crypter_process_in_place( @@ -275,7 +275,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, char* error_message = nullptr; size_t size = data_size; - /* Crypter is nullptr. */ + // Crypter is nullptr. grpc_status_code status = alts_crypter_process_in_place( nullptr, data_buffer, protected_data_size, size, &size, &error_message); ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( @@ -283,7 +283,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, "crypter or crypter->vtable has not been initialized properly.")); gpr_free(error_message); - /* Seal data is nullptr. */ + // Seal data is nullptr. size = data_size; status = alts_crypter_process_in_place( crypter_seal, nullptr, protected_data_size, size, &size, &error_message); @@ -291,7 +291,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "data is nullptr.")); gpr_free(error_message); - /* Seal data size is 0. */ + // Seal data size is 0. size = 0; status = alts_crypter_process_in_place(crypter_seal, data_buffer, protected_data_size, size, &size, @@ -301,7 +301,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, "data_size is zero.")); gpr_free(error_message); - /* Seal data buffer has a size smaller than the required. */ + // Seal data buffer has a size smaller than the required. size = data_size; status = alts_crypter_process_in_place(crypter_seal, data_buffer, protected_data_size - 1, size, &size, @@ -312,7 +312,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, "num_overhead_bytes.")); gpr_free(error_message); - /* Unseal data is nullptr. */ + // Unseal data is nullptr. size = data_size; status = alts_crypter_process_in_place(crypter_unseal, nullptr, protected_data_size, size, &size, @@ -321,7 +321,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "data is nullptr.")); gpr_free(error_message); - /* Unseal data size is 0. */ + // Unseal data size is 0. size = 0; status = alts_crypter_process_in_place(crypter_unseal, data_buffer, protected_data_size, size, &size, @@ -331,7 +331,7 @@ static void alts_crypter_test_input_sanity_check(alts_crypter* crypter_seal, "data_size is smaller than num_overhead_bytes.")); gpr_free(error_message); - /* Unseal data size is smaller than number of overhead bytes. */ + // Unseal data size is smaller than number of overhead bytes. size = num_overhead_bytes - 1; status = alts_crypter_process_in_place(crypter_unseal, data_buffer, protected_data_size, size, &size, @@ -395,7 +395,7 @@ TEST(AltsCrypterTest, AltsCrypterDoGenericTests) { *server_crypter_unseal = nullptr, *client_crypter_seal = nullptr, *client_crypter_unseal = nullptr; - /* Random seal and unseal tests */ + // Random seal and unseal tests create_random_alts_seal_crypter(&server_seal, &server_unseal, &client_seal, &client_unseal, &server_crypter_seal, &server_crypter_unseal, &client_crypter_seal, @@ -414,7 +414,7 @@ TEST(AltsCrypterTest, AltsCrypterDoGenericTests) { destroy_random_alts_seal_crypter(server_seal, server_unseal, client_seal, client_unseal); - /* Multiple random seal and unseal tests */ + // Multiple random seal and unseal tests create_random_alts_seal_crypter(&server_seal, &server_unseal, &client_seal, &client_unseal, &server_crypter_seal, &server_crypter_unseal, &client_crypter_seal, @@ -433,7 +433,7 @@ TEST(AltsCrypterTest, AltsCrypterDoGenericTests) { destroy_random_alts_seal_crypter(server_seal, server_unseal, client_seal, client_unseal); - /* Corrupted unseal tests */ + // Corrupted unseal tests create_random_alts_seal_crypter(&server_seal, &server_unseal, &client_seal, &client_unseal, &server_crypter_seal, &server_crypter_unseal, &client_crypter_seal, @@ -452,7 +452,7 @@ TEST(AltsCrypterTest, AltsCrypterDoGenericTests) { destroy_random_alts_seal_crypter(server_seal, server_unseal, client_seal, client_unseal); - /* Unsync seal and unseal tests */ + // Unsync seal and unseal tests create_random_alts_seal_crypter(&server_seal, &server_unseal, &client_seal, &client_unseal, &server_crypter_seal, &server_crypter_unseal, &client_crypter_seal, @@ -471,7 +471,7 @@ TEST(AltsCrypterTest, AltsCrypterDoGenericTests) { destroy_random_alts_seal_crypter(server_seal, server_unseal, client_seal, client_unseal); - /* Input sanity check tests */ + // Input sanity check tests create_random_alts_seal_crypter(&server_seal, &server_unseal, &client_seal, &client_unseal, &server_crypter_seal, &server_crypter_unseal, &client_crypter_seal, diff --git a/test/core/tsi/alts/frame_protector/alts_frame_protector_test.cc b/test/core/tsi/alts/frame_protector/alts_frame_protector_test.cc index bf59e836366..3a3b2ec6e25 100644 --- a/test/core/tsi/alts/frame_protector/alts_frame_protector_test.cc +++ b/test/core/tsi/alts/frame_protector/alts_frame_protector_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/frame_protector/alts_frame_protector.h" @@ -45,7 +45,7 @@ static void alts_test_do_round_trip_check_frames( tsi_frame_protector* server_frame_protector = nullptr; tsi_test_frame_protector_config* config = fixture->config; tsi_test_channel* channel = fixture->channel; - /* Create a client frame protector. */ + // Create a client frame protector. size_t client_max_output_protected_frame_size = config->client_max_output_protected_frame_size; ASSERT_EQ( @@ -54,7 +54,7 @@ static void alts_test_do_round_trip_check_frames( ? nullptr : &client_max_output_protected_frame_size, &client_frame_protector), - TSI_OK); /* Create a server frame protector. */ + TSI_OK); // Create a server frame protector. size_t server_max_output_protected_frame_size = config->server_max_output_protected_frame_size; ASSERT_EQ( @@ -66,14 +66,14 @@ static void alts_test_do_round_trip_check_frames( TSI_OK); tsi_test_frame_protector_fixture_init(fixture, client_frame_protector, server_frame_protector); - /* Client sends a message to server. */ + // Client sends a message to server. uint8_t* saved_client_message = config->client_message; config->client_message = const_cast(client_message); config->client_message_size = client_message_size; tsi_test_frame_protector_send_message_to_peer(config, channel, client_frame_protector, /*is_client=*/true); - /* Verify if the generated frame is the same as the expected. */ + // Verify if the generated frame is the same as the expected. ASSERT_EQ(channel->bytes_written_to_server_channel, client_frame_size); ASSERT_EQ(memcmp(client_expected_frames, channel->server_channel, client_frame_size), @@ -88,14 +88,14 @@ static void alts_test_do_round_trip_check_frames( ASSERT_EQ(memcmp(config->client_message, server_received_message, server_received_message_size), 0); - /* Server sends a message to client. */ + // Server sends a message to client. uint8_t* saved_server_message = config->server_message; config->server_message = const_cast(server_message); config->server_message_size = server_message_size; tsi_test_frame_protector_send_message_to_peer(config, channel, server_frame_protector, /*is_client=*/false); - /* Verify if the generated frame is the same as the expected. */ + // Verify if the generated frame is the same as the expected. ASSERT_EQ(channel->bytes_written_to_client_channel, server_frame_size); ASSERT_EQ(memcmp(server_expected_frames, channel->client_channel, server_frame_size), @@ -113,7 +113,7 @@ static void alts_test_do_round_trip_check_frames( 0); config->client_message = saved_client_message; config->server_message = saved_server_message; - /* Destroy server and client frame protectors. */ + // Destroy server and client frame protectors. gpr_free(server_received_message); gpr_free(client_received_message); } @@ -137,7 +137,7 @@ static void alts_test_do_round_trip_vector_tests() { 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30}; const size_t small_message_size = sizeof(small_message) / sizeof(uint8_t); const size_t large_message_size = sizeof(large_message) / sizeof(uint8_t); - /* Test small client message and large server message. */ + // Test small client message and large server message. const uint8_t client_expected_frame1[] = { 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xd8, 0xd5, 0x92, 0x4d, 0x50, 0x32, 0xb7, 0x1f, 0xb8, 0xf2, 0xbb, 0x43, 0xc7, 0xe2, 0x94, @@ -168,10 +168,10 @@ static void alts_test_do_round_trip_vector_tests() { client_expected_frame1, client_frame_size1, large_message, large_message_size, server_expected_frame1, server_frame_size1); tsi_test_frame_protector_fixture_destroy(fixture); - /** - * Test large client message, small server message, and small - * message_buffer_allocated_size. - */ + /// + /// Test large client message, small server message, and small + /// message_buffer_allocated_size. + /// const uint8_t client_expected_frame2[] = { 0x94, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x93, 0x81, 0x86, 0xc7, 0xdc, 0xf4, 0x77, 0x3a, 0xdb, 0x91, 0x94, 0x61, 0xba, 0xed, 0xd5, 0x37, @@ -201,10 +201,10 @@ static void alts_test_do_round_trip_vector_tests() { reinterpret_cast(small_message), small_message_size, server_expected_frame2, server_frame_size2); tsi_test_frame_protector_fixture_destroy(fixture); - /** - * Test large client message, small server message, and small - * protected_buffer_size. - */ + /// + /// Test large client message, small server message, and small + /// protected_buffer_size. + /// const uint8_t client_expected_frame3[] = { 0x94, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x93, 0x81, 0x86, 0xc7, 0xdc, 0xf4, 0x77, 0x3a, 0xdb, 0x91, 0x94, 0x61, 0xba, 0xed, 0xd5, 0x37, @@ -234,10 +234,10 @@ static void alts_test_do_round_trip_vector_tests() { reinterpret_cast(small_message), small_message_size, server_expected_frame3, server_frame_size3); tsi_test_frame_protector_fixture_destroy(fixture); - /** - * Test large client message, small server message, and small - * read_buffer_allocated_size. - */ + /// + /// Test large client message, small server message, and small + /// read_buffer_allocated_size. + /// const uint8_t client_expected_frame4[] = { 0x94, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x93, 0x81, 0x86, 0xc7, 0xdc, 0xf4, 0x77, 0x3a, 0xdb, 0x91, 0x94, 0x61, 0xba, 0xed, 0xd5, 0x37, @@ -267,10 +267,10 @@ static void alts_test_do_round_trip_vector_tests() { reinterpret_cast(small_message), small_message_size, server_expected_frame4, server_frame_size4); tsi_test_frame_protector_fixture_destroy(fixture); - /** - * Test large client message, small server message, and small - * client_max_output_protected_frame_size. - */ + /// + /// Test large client message, small server message, and small + /// client_max_output_protected_frame_size. + /// const uint8_t client_expected_frame5[] = { 0x94, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x93, 0x81, 0x86, 0xc7, 0xdc, 0xf4, 0x77, 0x3a, 0xdb, 0x91, 0x94, 0x61, 0xba, 0xed, 0xd5, 0x37, @@ -300,10 +300,10 @@ static void alts_test_do_round_trip_vector_tests() { reinterpret_cast(small_message), small_message_size, server_expected_frame5, server_frame_size5); tsi_test_frame_protector_fixture_destroy(fixture); - /** - * Test small client message, large server message, and small - * server_max_output_protected_frame_size. - */ + /// + /// Test small client message, large server message, and small + /// server_max_output_protected_frame_size. + /// const uint8_t client_expected_frame6[] = { 0x1f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x09, 0xd8, 0xd5, 0x92, 0x4d, 0x50, 0x32, 0xb7, 0x1f, 0xb8, 0xf2, 0xbb, 0x43, 0xc7, 0xe2, 0x94, @@ -342,11 +342,11 @@ static void alts_test_do_round_trip(tsi_test_frame_protector_fixture* fixture, tsi_frame_protector* client_frame_protector = nullptr; tsi_frame_protector* server_frame_protector = nullptr; tsi_test_frame_protector_config* config = fixture->config; - /* Create a key to be used by both client and server. */ + // Create a key to be used by both client and server. uint8_t* key = nullptr; size_t key_length = rekey ? kAes128GcmRekeyKeyLength : kAes128GcmKeyLength; gsec_test_random_array(&key, key_length); - /* Create a client frame protector. */ + // Create a client frame protector. size_t client_max_output_protected_frame_size = config->client_max_output_protected_frame_size; ASSERT_EQ( @@ -356,7 +356,7 @@ static void alts_test_do_round_trip(tsi_test_frame_protector_fixture* fixture, : &client_max_output_protected_frame_size, &client_frame_protector), TSI_OK); - /* Create a server frame protector. */ + // Create a server frame protector. size_t server_max_output_protected_frame_size = config->server_max_output_protected_frame_size; ASSERT_EQ( @@ -372,7 +372,7 @@ static void alts_test_do_round_trip(tsi_test_frame_protector_fixture* fixture, gpr_free(key); } -/* Run all combinations of different arguments of test config. */ +// Run all combinations of different arguments of test config. static void alts_test_do_round_trip_all(bool rekey) { unsigned int* bit_array = static_cast( gpr_malloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS)); diff --git a/test/core/tsi/alts/frame_protector/frame_handler_test.cc b/test/core/tsi/alts/frame_protector/frame_handler_test.cc index 468e9278661..2bdb4c3ace6 100644 --- a/test/core/tsi/alts/frame_protector/frame_handler_test.cc +++ b/test/core/tsi/alts/frame_protector/frame_handler_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/frame_protector/frame_handler.h" diff --git a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc index 10857eaa291..ae9da992214 100644 --- a/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc +++ b/test/core/tsi/alts/handshaker/alts_concurrent_connectivity_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -295,8 +295,8 @@ TEST(AltsConcurrentConnectivityTest, TestBasicClientServerHandshakes) { } } -/* Run a bunch of concurrent ALTS handshakes on concurrent channels - * (using the fake, in-process handshake server). */ +// Run a bunch of concurrent ALTS handshakes on concurrent channels +// (using the fake, in-process handshake server). TEST(AltsConcurrentConnectivityTest, TestConcurrentClientServerHandshakes) { FakeHandshakeServer fake_handshake_server( true /* check num concurrent rpcs */); @@ -325,11 +325,11 @@ TEST(AltsConcurrentConnectivityTest, TestConcurrentClientServerHandshakes) { } } -/* This test is intended to make sure that ALTS handshakes we correctly - * fail fast when the security handshaker gets an error while reading - * from the remote peer, after having earlier sent the first bytes of the - * ALTS handshake to the peer, i.e. after getting into the middle of a - * handshake. */ +// This test is intended to make sure that ALTS handshakes we correctly +// fail fast when the security handshaker gets an error while reading +// from the remote peer, after having earlier sent the first bytes of the +// ALTS handshake to the peer, i.e. after getting into the middle of a +// handshake. TEST(AltsConcurrentConnectivityTest, TestHandshakeFailsFastWhenPeerEndpointClosesConnectionAfterAccepting) { // Don't enforce the number of concurrent rpcs for the fake handshake @@ -371,8 +371,8 @@ TEST(AltsConcurrentConnectivityTest, } } -/* This test is intended to make sure that ALTS handshakes correctly - * fail fast when the ALTS handshake server fails incoming handshakes fast. */ +// This test is intended to make sure that ALTS handshakes correctly +// fail fast when the ALTS handshake server fails incoming handshakes fast. TEST(AltsConcurrentConnectivityTest, TestHandshakeFailsFastWhenHandshakeServerClosesConnectionAfterAccepting) { // The fake_handshake_server emulates a broken ALTS handshaker, which @@ -410,9 +410,9 @@ TEST(AltsConcurrentConnectivityTest, } } -/* This test is intended to make sure that ALTS handshakes correctly - * fail fast when the ALTS handshake server is non-responsive, in which case - * the overall connection deadline kicks in. */ +// This test is intended to make sure that ALTS handshakes correctly +// fail fast when the ALTS handshake server is non-responsive, in which case +// the overall connection deadline kicks in. TEST(AltsConcurrentConnectivityTest, TestHandshakeFailsFastWhenHandshakeServerHangsAfterAccepting) { // fake_handshake_server emulates an insecure server, so send settings first. diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc b/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc index 98de04ef255..7791a01c27a 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc +++ b/test/core/tsi/alts/handshaker/alts_handshaker_client_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/handshaker/alts_handshaker_client.h" @@ -98,10 +98,10 @@ static void validate_target_identities( ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2))); } -/** - * Validate if grpc operation data is correctly populated with the fields of - * ALTS handshaker client. - */ +/// +/// Validate if grpc operation data is correctly populated with the fields of +/// ALTS handshaker client. +/// static bool validate_op(alts_handshaker_client* c, const grpc_op* op, size_t nops, bool is_start) { EXPECT_TRUE(c != nullptr && op != nullptr && nops != 0); @@ -148,10 +148,10 @@ static bool is_recv_status_op(const grpc_op* op, size_t nops) { return nops == 1 && op->op == GRPC_OP_RECV_STATUS_ON_CLIENT; } -/** - * A mock grpc_caller used to check if client_start, server_start, and next - * operations correctly handle invalid arguments. It should not be called. - */ +/// +/// A mock grpc_caller used to check if client_start, server_start, and next +/// operations correctly handle invalid arguments. It should not be called. +/// static grpc_call_error check_must_not_be_called(grpc_call* /*call*/, const grpc_op* /*ops*/, size_t /*nops*/, @@ -159,12 +159,12 @@ static grpc_call_error check_must_not_be_called(grpc_call* /*call*/, abort(); } -/** - * A mock grpc_caller used to check correct execution of client_start operation. - * It checks if the client_start handshaker request is populated with correct - * handshake_security_protocol, application_protocol, record_protocol and - * max_frame_size, and op is correctly populated. - */ +/// +/// A mock grpc_caller used to check correct execution of client_start +/// operation. It checks if the client_start handshaker request is populated +/// with correct handshake_security_protocol, application_protocol, +/// record_protocol and max_frame_size, and op is correctly populated. +/// static grpc_call_error check_client_start_success(grpc_call* /*call*/, const grpc_op* op, size_t nops, @@ -211,12 +211,12 @@ static grpc_call_error check_client_start_success(grpc_call* /*call*/, return GRPC_CALL_OK; } -/** - * A mock grpc_caller used to check correct execution of server_start operation. - * It checks if the server_start handshaker request is populated with correct - * handshake_security_protocol, application_protocol, record_protocol and - * max_frame_size, and op is correctly populated. - */ +/// +/// A mock grpc_caller used to check correct execution of server_start +/// operation. It checks if the server_start handshaker request is populated +/// with correct handshake_security_protocol, application_protocol, +/// record_protocol and max_frame_size, and op is correctly populated. +/// static grpc_call_error check_server_start_success(grpc_call* /*call*/, const grpc_op* op, size_t nops, @@ -257,11 +257,11 @@ static grpc_call_error check_server_start_success(grpc_call* /*call*/, return GRPC_CALL_OK; } -/** - * A mock grpc_caller used to check correct execution of next operation. It - * checks if the next handshaker request is populated with correct information, - * and op is correctly populated. - */ +/// +/// A mock grpc_caller used to check correct execution of next operation. It +/// checks if the next handshaker request is populated with correct information, +/// and op is correctly populated. +/// static grpc_call_error check_next_success(grpc_call* /*call*/, const grpc_op* op, size_t nops, grpc_closure* closure) { @@ -280,11 +280,11 @@ static grpc_call_error check_next_success(grpc_call* /*call*/, return GRPC_CALL_OK; } -/** - * A mock grpc_caller used to check if client_start, server_start, and next - * operations correctly handle the situation when the grpc call made to the - * handshaker service fails. - */ +/// +/// A mock grpc_caller used to check if client_start, server_start, and next +/// operations correctly handle the situation when the grpc call made to the +/// handshaker service fails. +/// static grpc_call_error check_grpc_call_failure(grpc_call* /*call*/, const grpc_op* op, size_t nops, grpc_closure* /*tag*/) { @@ -361,18 +361,18 @@ static void destroy_config(alts_handshaker_client_test_config* config) { } TEST(AltsHandshakerClientTest, ScheduleRequestInvalidArgTest) { - /* Initialization. */ + // Initialization. alts_handshaker_client_test_config* config = create_config(); - /* Tests. */ + // Tests. alts_handshaker_client_set_grpc_caller_for_testing(config->client, check_must_not_be_called); - /* Check client_start. */ + // Check client_start. { grpc_core::ExecCtx exec_ctx; ASSERT_EQ(alts_handshaker_client_start_client(nullptr), TSI_INVALID_ARGUMENT); } - /* Check server_start. */ + // Check server_start. { grpc_core::ExecCtx exec_ctx; ASSERT_EQ(alts_handshaker_client_start_server(config->server, nullptr), @@ -383,7 +383,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestInvalidArgTest) { ASSERT_EQ(alts_handshaker_client_start_server(nullptr, &config->out_frame), TSI_INVALID_ARGUMENT); } - /* Check next. */ + // Check next. { grpc_core::ExecCtx exec_ctx; ASSERT_EQ(alts_handshaker_client_next(config->client, nullptr), @@ -394,16 +394,16 @@ TEST(AltsHandshakerClientTest, ScheduleRequestInvalidArgTest) { ASSERT_EQ(alts_handshaker_client_next(nullptr, &config->out_frame), TSI_INVALID_ARGUMENT); } - /* Check shutdown. */ + // Check shutdown. alts_handshaker_client_shutdown(nullptr); - /* Cleanup. */ + // Cleanup. destroy_config(config); } TEST(AltsHandshakerClientTest, ScheduleRequestSuccessTest) { - /* Initialization. */ + // Initialization. alts_handshaker_client_test_config* config = create_config(); - /* Check client_start success. */ + // Check client_start success. alts_handshaker_client_set_grpc_caller_for_testing( config->client, check_client_start_success); { @@ -415,7 +415,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestSuccessTest) { ASSERT_EQ(alts_handshaker_client_next(nullptr, &config->out_frame), TSI_INVALID_ARGUMENT); } - /* Check server_start success. */ + // Check server_start success. alts_handshaker_client_set_grpc_caller_for_testing( config->server, check_server_start_success); { @@ -424,7 +424,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestSuccessTest) { alts_handshaker_client_start_server(config->server, &config->out_frame), TSI_OK); } - /* Check client next success. */ + // Check client next success. alts_handshaker_client_set_grpc_caller_for_testing(config->client, check_next_success); { @@ -432,7 +432,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestSuccessTest) { ASSERT_EQ(alts_handshaker_client_next(config->client, &config->out_frame), TSI_OK); } - /* Check server next success. */ + // Check server next success. alts_handshaker_client_set_grpc_caller_for_testing(config->server, check_next_success); { @@ -440,7 +440,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestSuccessTest) { ASSERT_EQ(alts_handshaker_client_next(config->server, &config->out_frame), TSI_OK); } - /* Cleanup. */ + // Cleanup. { grpc_core::ExecCtx exec_ctx; alts_handshaker_client_on_status_received_for_testing( @@ -459,9 +459,9 @@ static void tsi_cb_assert_tsi_internal_error( } TEST(AltsHandshakerClientTest, ScheduleRequestGrpcCallFailureTest) { - /* Initialization. */ + // Initialization. alts_handshaker_client_test_config* config = create_config(); - /* Check client_start failure. */ + // Check client_start failure. alts_handshaker_client_set_grpc_caller_for_testing(config->client, check_grpc_call_failure); { @@ -473,7 +473,7 @@ TEST(AltsHandshakerClientTest, ScheduleRequestGrpcCallFailureTest) { tsi_cb_assert_tsi_internal_error); alts_handshaker_client_start_client(config->client); } - /* Check server_start failure. */ + // Check server_start failure. alts_handshaker_client_set_grpc_caller_for_testing(config->server, check_grpc_call_failure); { @@ -487,17 +487,17 @@ TEST(AltsHandshakerClientTest, ScheduleRequestGrpcCallFailureTest) { } { grpc_core::ExecCtx exec_ctx; - /* Check client next failure. */ + // Check client next failure. ASSERT_EQ(alts_handshaker_client_next(config->client, &config->out_frame), TSI_INTERNAL_ERROR); } { grpc_core::ExecCtx exec_ctx; - /* Check server next failure. */ + // Check server next failure. ASSERT_EQ(alts_handshaker_client_next(config->server, &config->out_frame), TSI_INTERNAL_ERROR); } - /* Cleanup. */ + // Cleanup. { grpc_core::ExecCtx exec_ctx; alts_handshaker_client_on_status_received_for_testing( diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc index 936c338b1ad..dbf65518e56 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc +++ b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h" @@ -56,7 +56,7 @@ grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, return resp; } -/* Check equality of a pair of grpc_gcp_identity fields. */ +// Check equality of a pair of grpc_gcp_identity fields. static bool handshaker_identity_equals(const grpc_gcp_Identity* l_id, const grpc_gcp_Identity* r_id) { if ((grpc_gcp_Identity_has_service_account(l_id) != @@ -101,7 +101,7 @@ static bool handshaker_rpc_versions_equals( grpc_gcp_RpcProtocolVersions_Version_minor(r_minver)); } -/* Check equality of a pair of ALTS handshake responses. */ +// Check equality of a pair of ALTS handshake responses. bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, const grpc_gcp_HandshakerResp* r_resp) { return upb_StringView_IsEqual(grpc_gcp_HandshakerResp_out_frames(l_resp), @@ -116,7 +116,7 @@ bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, grpc_gcp_HandshakerResp_status(r_resp)); } -/* This method checks equality of two handshaker response results. */ +// This method checks equality of two handshaker response results. bool grpc_gcp_handshaker_resp_result_equals( const grpc_gcp_HandshakerResult* l_result, const grpc_gcp_HandshakerResult* r_result) { @@ -147,7 +147,7 @@ bool grpc_gcp_handshaker_resp_result_equals( grpc_gcp_HandshakerResult_peer_rpc_versions(r_result)); } -/* This method checks equality of two handshaker response statuses. */ +// This method checks equality of two handshaker response statuses. bool grpc_gcp_handshaker_resp_status_equals( const grpc_gcp_HandshakerStatus* l_status, const grpc_gcp_HandshakerStatus* r_status) { diff --git a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h index 2010e9513fd..168e8c6eac5 100644 --- a/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h +++ b/test/core/tsi/alts/handshaker/alts_handshaker_service_api_test_lib.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H #define GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H @@ -22,32 +22,32 @@ #include "src/core/tsi/alts/handshaker/transport_security_common_api.h" #include "src/proto/grpc/gcp/handshaker.upb.h" -/** - * The first part of this file contains function signatures for de-serializing - * ALTS handshake requests and setting/serializing ALTS handshake responses, - * which simulate the behaviour of grpc server that runs ALTS handshaker - * service. - */ +/// +/// The first part of this file contains function signatures for de-serializing +/// ALTS handshake requests and setting/serializing ALTS handshake responses, +/// which simulate the behaviour of grpc server that runs ALTS handshaker +/// service. +/// -/* This method sets peer_rpc_versions for ALTS handshaker response. */ +// This method sets peer_rpc_versions for ALTS handshaker response. bool grpc_gcp_handshaker_resp_set_peer_rpc_versions( grpc_gcp_HandshakerResp* resp, upb_Arena* arena, uint32_t max_major, uint32_t max_minor, uint32_t min_major, uint32_t min_minor); -/* This method de-serializes ALTS handshaker request. */ +// This method de-serializes ALTS handshaker request. grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, upb_Arena* arena); -/* This method checks equality of two ALTS handshaker responses. */ +// This method checks equality of two ALTS handshaker responses. bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, const grpc_gcp_HandshakerResp* r_resp); -/* This method checks equality of two handshaker response results. */ +// This method checks equality of two handshaker response results. bool grpc_gcp_handshaker_resp_result_equals( const grpc_gcp_HandshakerResult* l_result, const grpc_gcp_HandshakerResult* r_result); -/* This method checks equality of two handshaker response statuses. */ +// This method checks equality of two handshaker response statuses. bool grpc_gcp_handshaker_resp_status_equals( const grpc_gcp_HandshakerStatus* l_status, const grpc_gcp_HandshakerStatus* r_status); diff --git a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc index fc3b36bc6ff..10e5341c0fc 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h" @@ -75,14 +75,14 @@ using grpc_core::internal::alts_tsi_handshaker_get_is_client_for_testing; using grpc_core::internal::alts_tsi_handshaker_set_client_vtable_for_testing; static bool should_handshaker_client_api_succeed = true; -/* ALTS mock notification. */ +// ALTS mock notification. typedef struct notification { gpr_cv cv; gpr_mu mu; bool notified; } notification; -/* Type of ALTS handshaker response. */ +// Type of ALTS handshaker response. typedef enum { INVALID, FAILED, @@ -123,10 +123,10 @@ static void wait(notification* n) { gpr_mu_unlock(&n->mu); } -/** - * This method mocks ALTS handshaker service to generate handshaker response - * for a specific request. - */ +/// +/// This method mocks ALTS handshaker service to generate handshaker response +/// for a specific request. +/// static grpc_byte_buffer* generate_handshaker_response( alts_handshaker_response_type type) { upb::Arena arena; @@ -257,16 +257,16 @@ static void on_client_start_success_cb(tsi_result status, void* user_data, bytes_to_send_size), 0); ASSERT_EQ(result, nullptr); - /* Validate peer identity. */ + // Validate peer identity. tsi_peer peer; ASSERT_EQ(tsi_handshaker_result_extract_peer(result, &peer), TSI_INVALID_ARGUMENT); - /* Validate frame protector. */ + // Validate frame protector. tsi_frame_protector* protector = nullptr; ASSERT_EQ( tsi_handshaker_result_create_frame_protector(result, nullptr, &protector), TSI_INVALID_ARGUMENT); - /* Validate unused bytes. */ + // Validate unused bytes. const unsigned char* unused_bytes = nullptr; size_t unused_bytes_size = 0; ASSERT_EQ(tsi_handshaker_result_get_unused_bytes(result, &unused_bytes, @@ -286,16 +286,16 @@ static void on_server_start_success_cb(tsi_result status, void* user_data, bytes_to_send_size), 0); ASSERT_EQ(result, nullptr); - /* Validate peer identity. */ + // Validate peer identity. tsi_peer peer; ASSERT_EQ(tsi_handshaker_result_extract_peer(result, &peer), TSI_INVALID_ARGUMENT); - /* Validate frame protector. */ + // Validate frame protector. tsi_frame_protector* protector = nullptr; ASSERT_EQ( tsi_handshaker_result_create_frame_protector(result, nullptr, &protector), TSI_INVALID_ARGUMENT); - /* Validate unused bytes. */ + // Validate unused bytes. const unsigned char* unused_bytes = nullptr; size_t unused_bytes_size = 0; ASSERT_EQ(tsi_handshaker_result_get_unused_bytes(result, &unused_bytes, @@ -327,7 +327,7 @@ static void on_client_next_success_cb(tsi_result status, void* user_data, &actual_max_frame_size); ASSERT_EQ(actual_max_frame_size, kTsiAltsMaxFrameSize); tsi_zero_copy_grpc_protector_destroy(zero_copy_protector); - /* Validate peer identity. */ + // Validate peer identity. tsi_peer peer; ASSERT_EQ(tsi_handshaker_result_extract_peer(result, &peer), TSI_OK); ASSERT_EQ(peer.property_count, kTsiAltsNumOfPeerProperties); @@ -338,7 +338,7 @@ static void on_client_next_success_cb(tsi_result status, void* user_data, memcmp(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY, peer.properties[1].value.data, peer.properties[1].value.length), 0); - /* Validate alts context. */ + // Validate alts context. upb::Arena context_arena; grpc_gcp_AltsContext* ctx = grpc_gcp_AltsContext_parse( peer.properties[3].value.data, peer.properties[3].value.length, @@ -382,13 +382,13 @@ static void on_client_next_success_cb(tsi_result status, void* user_data, peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter); } - /* Validate security level. */ + // Validate security level. ASSERT_EQ( memcmp(ALTS_TSI_HANDSHAKER_TEST_SECURITY_LEVEL, peer.properties[4].value.data, peer.properties[4].value.length), 0); tsi_peer_destruct(&peer); - /* Validate unused bytes. */ + // Validate unused bytes. const unsigned char* bytes = nullptr; size_t bytes_size = 0; ASSERT_EQ(tsi_handshaker_result_get_unused_bytes(result, &bytes, &bytes_size), @@ -396,7 +396,7 @@ static void on_client_next_success_cb(tsi_result status, void* user_data, ASSERT_EQ(bytes_size, strlen(ALTS_TSI_HANDSHAKER_TEST_REMAIN_BYTES)); ASSERT_EQ(memcmp(bytes, ALTS_TSI_HANDSHAKER_TEST_REMAIN_BYTES, bytes_size), 0); - /* Validate frame protector. */ + // Validate frame protector. tsi_frame_protector* protector = nullptr; ASSERT_EQ( tsi_handshaker_result_create_frame_protector(result, nullptr, &protector), @@ -430,7 +430,7 @@ static void on_server_next_success_cb(tsi_result status, void* user_data, &actual_max_frame_size); ASSERT_EQ(actual_max_frame_size, kTsiAltsMinFrameSize); tsi_zero_copy_grpc_protector_destroy(zero_copy_protector); - /* Validate peer identity. */ + // Validate peer identity. tsi_peer peer; ASSERT_EQ(tsi_handshaker_result_extract_peer(result, &peer), TSI_OK); ASSERT_EQ(peer.property_count, kTsiAltsNumOfPeerProperties); @@ -441,7 +441,7 @@ static void on_server_next_success_cb(tsi_result status, void* user_data, memcmp(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY, peer.properties[1].value.data, peer.properties[1].value.length), 0); - /* Validate alts context. */ + // Validate alts context. upb::Arena context_arena; grpc_gcp_AltsContext* ctx = grpc_gcp_AltsContext_parse( peer.properties[3].value.data, peer.properties[3].value.length, @@ -485,21 +485,21 @@ static void on_server_next_success_cb(tsi_result status, void* user_data, peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter); } - /* Check security level. */ + // Check security level. ASSERT_EQ( memcmp(ALTS_TSI_HANDSHAKER_TEST_SECURITY_LEVEL, peer.properties[4].value.data, peer.properties[4].value.length), 0); tsi_peer_destruct(&peer); - /* Validate unused bytes. */ + // Validate unused bytes. const unsigned char* bytes = nullptr; size_t bytes_size = 0; ASSERT_EQ(tsi_handshaker_result_get_unused_bytes(result, &bytes, &bytes_size), TSI_OK); ASSERT_EQ(bytes_size, 0); ASSERT_EQ(bytes, nullptr); - /* Validate frame protector. */ + // Validate frame protector. tsi_frame_protector* protector = nullptr; ASSERT_EQ( tsi_handshaker_result_create_frame_protector(result, nullptr, &protector), @@ -514,13 +514,13 @@ static tsi_result mock_client_start(alts_handshaker_client* client) { if (!should_handshaker_client_api_succeed) { return TSI_INTERNAL_ERROR; } - /* Note that the alts_tsi_handshaker needs to set its - * has_sent_start_message field field to true - * before the call to alts_handshaker_client_start is made because - * because it's unsafe to access it afterwards. */ + // Note that the alts_tsi_handshaker needs to set its + // has_sent_start_message field field to true + // before the call to alts_handshaker_client_start is made because + // because it's unsafe to access it afterwards. alts_handshaker_client_check_fields_for_testing( client, on_client_start_success_cb, nullptr, true, nullptr); - /* Populate handshaker response for client_start request. */ + // Populate handshaker response for client_start request. grpc_byte_buffer** recv_buffer_ptr = alts_handshaker_client_get_recv_buffer_addr_for_testing(client); *recv_buffer_ptr = generate_handshaker_response(CLIENT_START); @@ -540,7 +540,7 @@ static tsi_result mock_server_start(alts_handshaker_client* client, client, on_server_start_success_cb, nullptr, true, nullptr); grpc_slice slice = grpc_empty_slice(); EXPECT_EQ(grpc_slice_cmp(*bytes_received, slice), 0); - /* Populate handshaker response for server_start request. */ + // Populate handshaker response for server_start request. grpc_byte_buffer** recv_buffer_ptr = alts_handshaker_client_get_recv_buffer_addr_for_testing(client); *recv_buffer_ptr = generate_handshaker_response(SERVER_START); @@ -569,7 +569,7 @@ static tsi_result mock_next(alts_handshaker_client* client, ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES, GRPC_SLICE_LENGTH(*bytes_received)), 0); - /* Populate handshaker response for next request. */ + // Populate handshaker response for next request. grpc_slice out_frame = grpc_slice_from_static_string(ALTS_TSI_HANDSHAKER_TEST_OUT_FRAME); grpc_byte_buffer** recv_buffer_ptr = @@ -611,45 +611,45 @@ static void run_tsi_handshaker_destroy_with_exec_ctx( TEST(AltsTsiHandshakerTest, CheckHandshakerNextInvalidInput) { should_handshaker_client_api_succeed = true; - /* Initialization. */ + // Initialization. tsi_handshaker* handshaker = create_test_handshaker(true); - /* Check nullptr handshaker. */ + // Check nullptr handshaker. ASSERT_EQ(tsi_handshaker_next(nullptr, nullptr, 0, nullptr, nullptr, nullptr, check_must_not_be_called, nullptr), TSI_INVALID_ARGUMENT); - /* Check nullptr callback. */ + // Check nullptr callback. ASSERT_EQ(tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr), TSI_INVALID_ARGUMENT); - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); } TEST(AltsTsiHandshakerTest, CheckHandshakerShutdownInvalidInput) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); - /* Check nullptr handshaker. */ + // Check nullptr handshaker. tsi_handshaker_shutdown(nullptr); - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); } static void check_handshaker_next_success() { - /** - * Create handshakers for which internal mock client is going to do - * correctness check. - */ + /// + /// Create handshakers for which internal mock client is going to do + /// correctness check. + /// tsi_handshaker* client_handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker* server_handshaker = create_test_handshaker(false /* is_client */); - /* Client start. */ + // Client start. ASSERT_EQ(tsi_handshaker_next(client_handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr), TSI_ASYNC); wait(&tsi_to_caller_notification); - /* Client next. */ + // Client next. ASSERT_EQ(tsi_handshaker_next( client_handshaker, (const unsigned char*)ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES, @@ -657,12 +657,12 @@ static void check_handshaker_next_success() { nullptr, on_client_next_success_cb, nullptr), TSI_ASYNC); wait(&tsi_to_caller_notification); - /* Server start. */ + // Server start. ASSERT_EQ(tsi_handshaker_next(server_handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_server_start_success_cb, nullptr), TSI_ASYNC); wait(&tsi_to_caller_notification); - /* Server next. */ + // Server next. ASSERT_EQ(tsi_handshaker_next( server_handshaker, (const unsigned char*)ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES, @@ -670,14 +670,14 @@ static void check_handshaker_next_success() { nullptr, on_server_next_success_cb, nullptr), TSI_ASYNC); wait(&tsi_to_caller_notification); - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(server_handshaker); run_tsi_handshaker_destroy_with_exec_ctx(client_handshaker); } static void check_handshaker_next_with_shutdown() { tsi_handshaker* handshaker = create_test_handshaker(true /* is_client*/); - /* next(success) -- shutdown(success) -- next (fail) */ + // next(success) -- shutdown(success) -- next (fail) ASSERT_EQ(tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr), TSI_ASYNC); @@ -689,7 +689,7 @@ static void check_handshaker_next_with_shutdown() { strlen(ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES), nullptr, nullptr, nullptr, on_client_next_success_cb, nullptr), TSI_HANDSHAKE_SHUTDOWN); - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); } @@ -700,36 +700,36 @@ static void check_handle_response_with_shutdown(void* /*unused*/) { TEST(AltsTsiHandshakerTest, CheckHandshakerNextFailure) { should_handshaker_client_api_succeed = false; - /** - * Create handshakers for which internal mock client is always going to fail. - */ + /// + /// Create handshakers for which internal mock client is always going to fail. + /// tsi_handshaker* client_handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker* server_handshaker = create_test_handshaker(false /* is_client */); - /* Client start. */ + // Client start. ASSERT_EQ(tsi_handshaker_next(client_handshaker, nullptr, 0, nullptr, nullptr, nullptr, check_must_not_be_called, nullptr), TSI_INTERNAL_ERROR); - /* Server start. */ + // Server start. ASSERT_EQ(tsi_handshaker_next(server_handshaker, nullptr, 0, nullptr, nullptr, nullptr, check_must_not_be_called, nullptr), TSI_INTERNAL_ERROR); - /* Server next. */ + // Server next. ASSERT_EQ(tsi_handshaker_next( server_handshaker, (const unsigned char*)ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES, strlen(ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES), nullptr, nullptr, nullptr, check_must_not_be_called, nullptr), TSI_INTERNAL_ERROR); - /* Client next. */ + // Client next. ASSERT_EQ(tsi_handshaker_next( client_handshaker, (const unsigned char*)ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES, strlen(ALTS_TSI_HANDSHAKER_TEST_RECV_BYTES), nullptr, nullptr, nullptr, check_must_not_be_called, nullptr), TSI_INTERNAL_ERROR); - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(server_handshaker); run_tsi_handshaker_destroy_with_exec_ctx(client_handshaker); } @@ -758,13 +758,13 @@ static void on_failed_grpc_call_cb(tsi_result status, void* user_data, TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrHandshaker) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -774,22 +774,22 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrHandshaker) { grpc_byte_buffer* recv_buffer = grpc_raw_byte_buffer_create(&slice, 1); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Check nullptr handshaker. */ + // Check nullptr handshaker. alts_handshaker_client_set_fields_for_testing( client, nullptr, on_invalid_input_cb, nullptr, recv_buffer, /*inject_read_failure=*/false); alts_handshaker_client_handle_response(client, true); - /* Note: here and elsewhere in this test, we first ref the handshaker in order - * to match the unref that on_status_received will do. This necessary - * because this test mocks out the grpc call in such a way that the code - * path that would usually take this ref is skipped. */ + // Note: here and elsewhere in this test, we first ref the handshaker in order + // to match the unref that on_status_received will do. This necessary + // because this test mocks out the grpc call in such a way that the code + // path that would usually take this ref is skipped. alts_handshaker_client_ref_for_testing(client); { grpc_core::ExecCtx exec_ctx; alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. grpc_slice_unref(slice); run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); @@ -798,13 +798,13 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrHandshaker) { TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrRecvBytes) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -812,7 +812,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrRecvBytes) { reinterpret_cast(handshaker); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Check nullptr recv_bytes. */ + // Check nullptr recv_bytes. alts_handshaker_client_set_fields_for_testing( client, alts_handshaker, on_invalid_input_cb, nullptr, nullptr, /*inject_read_failure=*/false); @@ -823,7 +823,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrRecvBytes) { alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); @@ -832,13 +832,13 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseNullptrRecvBytes) { TEST(AltsTsiHandshakerTest, CheckHandleResponseFailedGrpcCallToHandshakerService) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -848,7 +848,7 @@ TEST(AltsTsiHandshakerTest, grpc_byte_buffer* recv_buffer = grpc_raw_byte_buffer_create(&slice, 1); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Check failed grpc call made to handshaker service. */ + // Check failed grpc call made to handshaker service. alts_handshaker_client_set_fields_for_testing( client, alts_handshaker, on_failed_grpc_call_cb, nullptr, recv_buffer, /*inject_read_failure=*/true); @@ -859,7 +859,7 @@ TEST(AltsTsiHandshakerTest, alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_UNKNOWN, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. grpc_slice_unref(slice); run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); @@ -869,13 +869,13 @@ TEST(AltsTsiHandshakerTest, TEST(AltsTsiHandshakerTest, CheckHandleResponseFailedRecvMessageFromHandshakerService) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -885,7 +885,7 @@ TEST(AltsTsiHandshakerTest, grpc_byte_buffer* recv_buffer = grpc_raw_byte_buffer_create(&slice, 1); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Check failed recv message op from handshaker service. */ + // Check failed recv message op from handshaker service. alts_handshaker_client_set_fields_for_testing( client, alts_handshaker, on_failed_grpc_call_cb, nullptr, recv_buffer, /*inject_read_failure=*/false); @@ -896,7 +896,7 @@ TEST(AltsTsiHandshakerTest, alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. grpc_slice_unref(slice); run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); @@ -916,13 +916,13 @@ static void on_invalid_resp_cb(tsi_result status, void* user_data, TEST(AltsTsiHandshakerTest, CheckHandleResponseInvalidResp) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -930,7 +930,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseInvalidResp) { reinterpret_cast(handshaker); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Tests. */ + // Tests. grpc_byte_buffer* recv_buffer = generate_handshaker_response(INVALID); alts_handshaker_client_set_fields_for_testing( client, alts_handshaker, on_invalid_resp_cb, nullptr, recv_buffer, @@ -942,17 +942,17 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseInvalidResp) { alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); } static void check_handle_response_success(void* /*unused*/) { - /* Client start. */ + // Client start. wait(&caller_to_tsi_notification); alts_handshaker_client_handle_response(cb_event, true /* is_ok */); - /* Client next. */ + // Client next. wait(&caller_to_tsi_notification); alts_handshaker_client_handle_response(cb_event, true /* is_ok */); alts_handshaker_client_ref_for_testing(cb_event); @@ -961,10 +961,10 @@ static void check_handle_response_success(void* /*unused*/) { alts_handshaker_client_on_status_received_for_testing( cb_event, GRPC_STATUS_OK, absl::OkStatus()); } - /* Server start. */ + // Server start. wait(&caller_to_tsi_notification); alts_handshaker_client_handle_response(cb_event, true /* is_ok */); - /* Server next. */ + // Server next. wait(&caller_to_tsi_notification); alts_handshaker_client_handle_response(cb_event, true /* is_ok */); alts_handshaker_client_ref_for_testing(cb_event); @@ -988,13 +988,13 @@ static void on_failed_resp_cb(tsi_result status, void* user_data, TEST(AltsTsiHandshakerTest, CheckHandleResponseFailure) { should_handshaker_client_api_succeed = false; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /** - * Create a handshaker at the client side, for which internal mock client is - * always going to fail. - */ + /// + /// Create a handshaker at the client side, for which internal mock client is + /// always going to fail. + /// tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); tsi_handshaker_next(handshaker, nullptr, 0, nullptr, nullptr, nullptr, on_client_start_success_cb, nullptr); @@ -1002,7 +1002,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseFailure) { reinterpret_cast(handshaker); alts_handshaker_client* client = alts_tsi_handshaker_get_client_for_testing(alts_handshaker); - /* Tests. */ + // Tests. grpc_byte_buffer* recv_buffer = generate_handshaker_response(FAILED); alts_handshaker_client_set_fields_for_testing( client, alts_handshaker, on_failed_resp_cb, nullptr, recv_buffer, @@ -1014,7 +1014,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseFailure) { alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); @@ -1033,7 +1033,7 @@ static void on_shutdown_resp_cb(tsi_result status, void* user_data, TEST(AltsTsiHandshakerTest, CheckHandleResponseAfterShutdown) { should_handshaker_client_api_succeed = true; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); tsi_handshaker* handshaker = create_test_handshaker(true /* is_client */); @@ -1047,7 +1047,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseAfterShutdown) { alts_handshaker_client_get_recv_buffer_addr_for_testing(client); grpc_byte_buffer_destroy(*recv_buffer_ptr); - /* Tests. */ + // Tests. tsi_handshaker_shutdown(handshaker); grpc_byte_buffer* recv_buffer = generate_handshaker_response(CLIENT_START); alts_handshaker_client_set_fields_for_testing( @@ -1060,7 +1060,7 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseAfterShutdown) { alts_handshaker_client_on_status_received_for_testing( client, GRPC_STATUS_OK, absl::OkStatus()); } - /* Cleanup. */ + // Cleanup. run_tsi_handshaker_destroy_with_exec_ctx(handshaker); notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); @@ -1068,33 +1068,33 @@ TEST(AltsTsiHandshakerTest, CheckHandleResponseAfterShutdown) { TEST(AltsTsiHandshakerTest, CheckHandshakerNextFailsAfterShutdown) { should_handshaker_client_api_succeed = true; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); cb_event = nullptr; - /* Tests. */ + // Tests. grpc_core::Thread thd("alts_tsi_handshaker_test", &check_handle_response_with_shutdown, nullptr); thd.Start(); check_handshaker_next_with_shutdown(); thd.Join(); - /* Cleanup. */ + // Cleanup. notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); } TEST(AltsTsiHandshakerTest, CheckHandshakerSuccess) { should_handshaker_client_api_succeed = true; - /* Initialization. */ + // Initialization. notification_init(&caller_to_tsi_notification); notification_init(&tsi_to_caller_notification); - /* Tests. */ + // Tests. grpc_core::Thread thd("alts_tsi_handshaker_test", &check_handle_response_success, nullptr); thd.Start(); check_handshaker_next_success(); thd.Join(); - /* Cleanup. */ + // Cleanup. notification_destroy(&caller_to_tsi_notification); notification_destroy(&tsi_to_caller_notification); } diff --git a/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc b/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc index 079f9370366..5e6e2e331f3 100644 --- a/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc +++ b/test/core/tsi/alts/handshaker/alts_tsi_utils_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/handshaker/alts_tsi_utils.h" @@ -50,7 +50,7 @@ TEST(AltsTsiUtilsTest, DeserializeResponseTest) { char* buf = grpc_gcp_HandshakerResp_serialize(resp, arena.ptr(), &buf_len); grpc_slice slice = grpc_slice_from_copied_buffer(buf, buf_len); - /* Valid serialization. */ + // Valid serialization. upb::Arena arena2; grpc_byte_buffer* buffer = grpc_raw_byte_buffer_create(&slice, 1 /* number of slices */); @@ -59,13 +59,13 @@ TEST(AltsTsiUtilsTest, DeserializeResponseTest) { ASSERT_TRUE(grpc_gcp_handshaker_resp_equals(resp, decoded_resp)); grpc_byte_buffer_destroy(buffer); - /* Invalid serialization. */ + // Invalid serialization. grpc_slice bad_slice = grpc_slice_split_head(&slice, GRPC_SLICE_LENGTH(slice) - 1); buffer = grpc_raw_byte_buffer_create(&bad_slice, 1 /* number of slices */); ASSERT_EQ(alts_tsi_utils_deserialize_response(buffer, arena2.ptr()), nullptr); - /* Clean up. */ + // Clean up. grpc_slice_unref(slice); grpc_slice_unref(bad_slice); grpc_byte_buffer_destroy(buffer); diff --git a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc index e5c2478edfb..463d90044ba 100644 --- a/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc +++ b/test/core/tsi/alts/handshaker/transport_security_common_api_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/handshaker/transport_security_common_api.h" @@ -55,10 +55,10 @@ TEST(TransportSecurityCommonApiTest, TestSuccess) { &version, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_set_min( &version, kMinRpcVersionMajor, kMinRpcVersionMinor)); - /* Serializes to grpc slice. */ + // Serializes to grpc slice. grpc_slice encoded_slice; ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_encode(&version, &encoded_slice)); - /* Deserializes and compares with the original version. */ + // Deserializes and compares with the original version. ASSERT_TRUE( grpc_gcp_rpc_protocol_versions_decode(encoded_slice, &decoded_version)); ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_equal(&version, &decoded_version)); @@ -68,7 +68,7 @@ TEST(TransportSecurityCommonApiTest, TestSuccess) { TEST(TransportSecurityCommonApiTest, TestFailure) { grpc_gcp_rpc_protocol_versions version, decoded_version; grpc_slice encoded_slice; - /* Test for invalid arguments. */ + // Test for invalid arguments. ASSERT_FALSE(grpc_gcp_rpc_protocol_versions_set_max( nullptr, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); ASSERT_FALSE(grpc_gcp_rpc_protocol_versions_set_min( @@ -80,7 +80,7 @@ TEST(TransportSecurityCommonApiTest, TestFailure) { ASSERT_FALSE(grpc_gcp_rpc_protocol_versions_encode(nullptr, &encoded_slice)); ASSERT_FALSE(grpc_gcp_rpc_protocol_versions_encode(&version, nullptr)); ASSERT_FALSE(grpc_gcp_rpc_protocol_versions_decode(encoded_slice, nullptr)); - /* Test for upb decode. */ + // Test for upb decode. ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_encode(&version, &encoded_slice)); grpc_slice bad_slice = grpc_slice_split_head( &encoded_slice, GRPC_SLICE_LENGTH(encoded_slice) - 1); @@ -105,7 +105,7 @@ TEST(TransportSecurityCommonApiTest, TestCheckSuccess) { grpc_gcp_rpc_protocol_versions v1; grpc_gcp_rpc_protocol_versions v2; grpc_gcp_rpc_protocol_versions_version highest_common_version; - /* test equality. */ + // test equality. ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_set_max(&v1, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_set_min(&v1, kMaxRpcVersionMajor, @@ -123,7 +123,7 @@ TEST(TransportSecurityCommonApiTest, TestCheckSuccess) { &highest_common_version, &v1.max_rpc_version), 0); - /* test inequality. */ + // test inequality. ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_set_max(&v1, kMaxRpcVersionMajor, kMaxRpcVersionMinor)); ASSERT_TRUE(grpc_gcp_rpc_protocol_versions_set_min(&v1, kMinRpcVersionMinor, diff --git a/test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc b/test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc index 45c18ec043f..815ff326611 100644 --- a/test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc +++ b/test/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h" @@ -36,7 +36,7 @@ constexpr size_t kMaxSlices = 10; constexpr size_t kSealRepeatTimes = 5; constexpr size_t kTagLength = 16; -/* Test fixtures for each test cases. */ +// Test fixtures for each test cases. struct alts_grpc_record_protocol_test_fixture { alts_grpc_record_protocol* client_protect; alts_grpc_record_protocol* client_unprotect; @@ -44,7 +44,7 @@ struct alts_grpc_record_protocol_test_fixture { alts_grpc_record_protocol* server_unprotect; }; -/* Test input variables for protect/unprotect operations. */ +// Test input variables for protect/unprotect operations. struct alts_grpc_record_protocol_test_var { size_t header_length; size_t tag_length; @@ -54,7 +54,7 @@ struct alts_grpc_record_protocol_test_var { grpc_slice_buffer unprotected_sb; }; -/* --- Test utility functions. --- */ +// --- Test utility functions. --- static void create_random_slice_buffer(grpc_slice_buffer* sb) { ASSERT_NE(sb, nullptr); @@ -80,8 +80,8 @@ static uint8_t* pointer_to_nth_byte(grpc_slice_buffer* sb, size_t index) { return nullptr; } -/* Checks if two slice buffer contents are the same. It is not super efficient, - * but OK for testing. */ +// Checks if two slice buffer contents are the same. It is not super efficient, +// but OK for testing. static bool are_slice_buffers_equal(grpc_slice_buffer* first, grpc_slice_buffer* second) { EXPECT_NE(first, nullptr); @@ -122,7 +122,7 @@ test_fixture_integrity_only_create(bool rekey, bool extra_copy) { gsec_test_random_array(&key, key_length); gsec_aead_crypter* crypter = nullptr; - /* Create client record protocol for protect. */ + // Create client record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -131,7 +131,7 @@ test_fixture_integrity_only_create(bool rekey, bool extra_copy) { crypter, 8, /*is_client=*/true, /*is_protect=*/true, extra_copy, &fixture->client_protect), TSI_OK); - /* Create client record protocol for unprotect. */ + // Create client record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -140,7 +140,7 @@ test_fixture_integrity_only_create(bool rekey, bool extra_copy) { crypter, 8, /*is_client=*/true, /*is_protect=*/false, extra_copy, &fixture->client_unprotect), TSI_OK); - /* Create server record protocol for protect. */ + // Create server record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -149,7 +149,7 @@ test_fixture_integrity_only_create(bool rekey, bool extra_copy) { crypter, 8, /*is_client=*/false, /*is_protect=*/true, extra_copy, &fixture->server_protect), TSI_OK); - /* Create server record protocol for unprotect. */ + // Create server record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -188,7 +188,7 @@ test_fixture_privacy_integrity_create(bool rekey) { gsec_test_random_array(&key, key_length); gsec_aead_crypter* crypter = nullptr; - /* Create client record protocol for protect. */ + // Create client record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -197,7 +197,7 @@ test_fixture_privacy_integrity_create(bool rekey) { crypter, 8, /*is_client=*/true, /*is_protect=*/true, &fixture->client_protect), TSI_OK); - /* Create client record protocol for unprotect. */ + // Create client record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -206,7 +206,7 @@ test_fixture_privacy_integrity_create(bool rekey) { crypter, 8, /*is_client=*/true, /*is_protect=*/false, &fixture->client_unprotect), TSI_OK); - /* Create server record protocol for protect. */ + // Create server record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -215,7 +215,7 @@ test_fixture_privacy_integrity_create(bool rekey) { crypter, 8, /*is_client=*/false, /*is_protect=*/true, &fixture->server_protect), TSI_OK); - /* Create server record protocol for unprotect. */ + // Create server record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -259,12 +259,12 @@ alts_grpc_record_protocol_test_var_create() { gpr_zalloc(sizeof(alts_grpc_record_protocol_test_var))); var->header_length = alts_iovec_record_protocol_get_header_length(); var->tag_length = kTagLength; - /* Initialized slice buffers. */ + // Initialized slice buffers. grpc_slice_buffer_init(&var->original_sb); grpc_slice_buffer_init(&var->duplicate_sb); grpc_slice_buffer_init(&var->protected_sb); grpc_slice_buffer_init(&var->unprotected_sb); - /* Randomly sets content of original_sb, and copies into duplicate_sb. */ + // Randomly sets content of original_sb, and copies into duplicate_sb. create_random_slice_buffer(&var->original_sb); for (size_t i = 0; i < var->original_sb.count; i++) { grpc_slice_buffer_add(&var->duplicate_sb, @@ -285,7 +285,7 @@ static void alts_grpc_record_protocol_test_var_destroy( gpr_free(var); } -/* --- alts grpc record protocol tests. --- */ +// --- alts grpc record protocol tests. --- static void random_seal_unseal(alts_grpc_record_protocol* sender, alts_grpc_record_protocol* receiver) { @@ -293,7 +293,7 @@ static void random_seal_unseal(alts_grpc_record_protocol* sender, for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_grpc_record_protocol_test_var* var = alts_grpc_record_protocol_test_var_create(); - /* Seals and then unseals. */ + // Seals and then unseals. size_t data_length = var->original_sb.length; tsi_result status = alts_grpc_record_protocol_protect( sender, &var->original_sb, &var->protected_sb); @@ -316,7 +316,7 @@ static void empty_seal_unseal(alts_grpc_record_protocol* sender, for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_grpc_record_protocol_test_var* var = alts_grpc_record_protocol_test_var_create(); - /* Seals and then unseals empty payload. */ + // Seals and then unseals empty payload. grpc_slice_buffer_reset_and_unref(&var->original_sb); grpc_slice_buffer_reset_and_unref(&var->duplicate_sb); tsi_result status = alts_grpc_record_protocol_protect( @@ -339,16 +339,16 @@ static void unsync_seal_unseal(alts_grpc_record_protocol* sender, tsi_result status; alts_grpc_record_protocol_test_var* var = alts_grpc_record_protocol_test_var_create(); - /* Seals once. */ + // Seals once. status = alts_grpc_record_protocol_protect(sender, &var->original_sb, &var->protected_sb); ASSERT_EQ(status, TSI_OK); grpc_slice_buffer_reset_and_unref(&var->protected_sb); - /* Seals again. */ + // Seals again. status = alts_grpc_record_protocol_protect(sender, &var->duplicate_sb, &var->protected_sb); ASSERT_EQ(status, TSI_OK); - /* Unseals the second frame. */ + // Unseals the second frame. status = alts_grpc_record_protocol_unprotect(receiver, &var->protected_sb, &var->unprotected_sb); ASSERT_EQ(status, TSI_INTERNAL_ERROR); @@ -362,11 +362,11 @@ static void corrupted_data(alts_grpc_record_protocol* sender, tsi_result status; alts_grpc_record_protocol_test_var* var = alts_grpc_record_protocol_test_var_create(); - /* Seals once. */ + // Seals once. status = alts_grpc_record_protocol_protect(sender, &var->original_sb, &var->protected_sb); ASSERT_EQ(status, TSI_OK); - /* Corrupts one byte in protected_sb and tries to unprotect. */ + // Corrupts one byte in protected_sb and tries to unprotect. alter_random_byte(&var->protected_sb); status = alts_grpc_record_protocol_unprotect(receiver, &var->protected_sb, &var->unprotected_sb); @@ -380,12 +380,12 @@ static void input_check(alts_grpc_record_protocol* rp) { tsi_result status; alts_grpc_record_protocol_test_var* var = alts_grpc_record_protocol_test_var_create(); - /* Protects with nullptr input. */ + // Protects with nullptr input. status = alts_grpc_record_protocol_protect(rp, nullptr, &var->protected_sb); ASSERT_EQ(status, TSI_INVALID_ARGUMENT); status = alts_grpc_record_protocol_protect(rp, &var->original_sb, nullptr); ASSERT_EQ(status, TSI_INVALID_ARGUMENT); - /* Unprotects with nullptr input. */ + // Unprotects with nullptr input. status = alts_grpc_record_protocol_protect(rp, &var->original_sb, &var->protected_sb); ASSERT_EQ(status, TSI_OK); @@ -394,8 +394,8 @@ static void input_check(alts_grpc_record_protocol* rp) { ASSERT_EQ(status, TSI_INVALID_ARGUMENT); status = alts_grpc_record_protocol_unprotect(rp, &var->protected_sb, nullptr); ASSERT_EQ(status, TSI_INVALID_ARGUMENT); - /* Unprotects on a temporary slice buffer which length is smaller than header - * length plus tag length. */ + // Unprotects on a temporary slice buffer which length is smaller than header + // length plus tag length. grpc_slice_buffer temp_sb; grpc_slice_buffer_init(&temp_sb); grpc_slice_buffer_move_first( @@ -408,7 +408,7 @@ static void input_check(alts_grpc_record_protocol* rp) { grpc_core::ExecCtx::Get()->Flush(); } -/* --- Test cases. --- */ +// --- Test cases. --- static void alts_grpc_record_protocol_random_seal_unseal_tests( alts_grpc_record_protocol_test_fixture* fixture) { diff --git a/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc b/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc index ff9e6c5f43e..0a5807a6699 100644 --- a/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc +++ b/test/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h" @@ -30,7 +30,7 @@ constexpr size_t kMaxSlices = 10; constexpr size_t kSealRepeatTimes = 5; constexpr size_t kTagLength = 16; -/* Test fixtures for each test cases. */ +// Test fixtures for each test cases. struct alts_iovec_record_protocol_test_fixture { alts_iovec_record_protocol* client_protect; alts_iovec_record_protocol* client_unprotect; @@ -38,7 +38,7 @@ struct alts_iovec_record_protocol_test_fixture { alts_iovec_record_protocol* server_unprotect; }; -/* Test variables for protect/unprotect operations. */ +// Test variables for protect/unprotect operations. struct alts_iovec_record_protocol_test_var { uint8_t* header_buf; size_t header_length; @@ -56,7 +56,7 @@ struct alts_iovec_record_protocol_test_var { iovec_t unprotected_iovec; }; -/* --- Test utility functions. --- */ +// --- Test utility functions. --- static void randomly_slice(uint8_t* input, size_t input_length, iovec_t** output, size_t* output_length) { @@ -103,7 +103,7 @@ alts_iovec_record_protocol_test_fixture_create(bool rekey, uint8_t* key; gsec_test_random_array(&key, key_length); gsec_aead_crypter* crypter = nullptr; - /* Create client record protocol for protect. */ + // Create client record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -112,7 +112,7 @@ alts_iovec_record_protocol_test_fixture_create(bool rekey, crypter, overflow_size, /*is_client=*/true, integrity_only, /*is_protect=*/true, &fixture->client_protect, nullptr), GRPC_STATUS_OK); - /* Create client record protocol for unprotect. */ + // Create client record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -121,7 +121,7 @@ alts_iovec_record_protocol_test_fixture_create(bool rekey, crypter, overflow_size, /*is_client=*/true, integrity_only, /*is_protect=*/false, &fixture->client_unprotect, nullptr), GRPC_STATUS_OK); - /* Create server record protocol for protect. */ + // Create server record protocol for protect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -130,7 +130,7 @@ alts_iovec_record_protocol_test_fixture_create(bool rekey, crypter, overflow_size, /*is_client=*/false, integrity_only, /*is_protect=*/true, &fixture->server_protect, nullptr), GRPC_STATUS_OK); - /* Create server record protocol for unprotect. */ + // Create server record protocol for unprotect. EXPECT_EQ(gsec_aes_gcm_aead_crypter_create( key, key_length, kAesGcmNonceLength, kAesGcmTagLength, rekey, &crypter, nullptr), @@ -159,17 +159,17 @@ static alts_iovec_record_protocol_test_var* alts_iovec_record_protocol_test_var_create() { auto* var = static_cast( gpr_zalloc(sizeof(alts_iovec_record_protocol_test_var))); - /* Sets header buffer. */ + // Sets header buffer. var->header_length = alts_iovec_record_protocol_get_header_length(); var->header_buf = static_cast(gpr_malloc(var->header_length)); var->header_iovec.iov_base = var->header_buf; var->header_iovec.iov_len = var->header_length; - /* Sets tag buffer. */ + // Sets tag buffer. var->tag_length = kTagLength; var->tag_buf = static_cast(gpr_malloc(var->tag_length)); var->tag_iovec.iov_base = var->tag_buf; var->tag_iovec.iov_len = var->tag_length; - /* Randomly sets data buffer and duplicates to dup_buf. */ + // Randomly sets data buffer and duplicates to dup_buf. var->data_length = gsec_test_bias_random_uint32(kMaxDataSize) + 1; var->data_buf = static_cast(gpr_malloc(var->data_length)); gsec_test_random_bytes(var->data_buf, var->data_length); @@ -178,13 +178,13 @@ alts_iovec_record_protocol_test_var_create() { var->data_iovec_length = 0; randomly_slice(var->data_buf, var->data_length, &var->data_iovec, &var->data_iovec_length); - /* Sets protected iovec. */ + // Sets protected iovec. size_t protected_buf_length = var->header_length + var->data_length + var->tag_length; var->protected_buf = static_cast(gpr_malloc(protected_buf_length)); var->protected_iovec.iov_base = var->protected_buf; var->protected_iovec.iov_len = protected_buf_length; - /* Unprotected iovec points to data_buf. */ + // Unprotected iovec points to data_buf. var->unprotected_iovec.iov_base = var->data_buf; var->unprotected_iovec.iov_len = var->data_length; return var; @@ -204,28 +204,28 @@ static void alts_iovec_record_protocol_test_var_destroy( gpr_free(var); } -/* --- Integrity-only protect/unprotect tests. --- */ +// --- Integrity-only protect/unprotect tests. --- static void integrity_only_random_seal_unseal( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); - /* Seals and then unseals. */ + // Seals and then unseals. grpc_status_code status = alts_iovec_record_protocol_integrity_only_protect( sender, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); gpr_free(var->data_iovec); - /* Randomly slices data buffer again. */ + // Randomly slices data buffer again. randomly_slice(var->data_buf, var->data_length, &var->data_iovec, &var->data_iovec_length); status = alts_iovec_record_protocol_integrity_only_unprotect( receiver, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Makes sure data buffer has not been modified during - * seal/unseal. */ + // Makes sure data buffer has not been modified during + // seal/unseal. ASSERT_EQ(memcmp(var->data_buf, var->dup_buf, var->data_length), 0); alts_iovec_record_protocol_test_var_destroy(var); } @@ -236,7 +236,7 @@ static void integrity_only_empty_seal_unseal( for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); - /* Seals and then unseals empty payload. */ + // Seals and then unseals empty payload. grpc_status_code status = alts_iovec_record_protocol_integrity_only_protect( sender, nullptr, 0, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); @@ -249,7 +249,7 @@ static void integrity_only_empty_seal_unseal( static void integrity_only_unsync_seal_unseal( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { - /* Seals once. */ + // Seals once. alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); grpc_status_code status = alts_iovec_record_protocol_integrity_only_protect( @@ -257,13 +257,13 @@ static void integrity_only_unsync_seal_unseal( var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); alts_iovec_record_protocol_test_var_destroy(var); - /* Seals again. */ + // Seals again. var = alts_iovec_record_protocol_test_var_create(); status = alts_iovec_record_protocol_integrity_only_protect( sender, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Unseals the second frame. */ + // Unseals the second frame. char* error_message = nullptr; status = alts_iovec_record_protocol_integrity_only_unprotect( receiver, var->data_iovec, var->data_iovec_length, var->header_iovec, @@ -277,14 +277,14 @@ static void integrity_only_unsync_seal_unseal( static void integrity_only_corrupted_data( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { - /* Seals the data first. */ + // Seals the data first. alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); grpc_status_code status = alts_iovec_record_protocol_integrity_only_protect( sender, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Alter frame length field. */ + // Alter frame length field. char* error_message = nullptr; size_t offset = alter_random_byte(var->header_buf, kZeroCopyFrameLengthFieldSize); @@ -295,7 +295,7 @@ static void integrity_only_corrupted_data( status, GRPC_STATUS_INTERNAL, error_message, "Bad frame length.")); gpr_free(error_message); revert_back_alter(var->header_buf, offset); - /* Alter message type field. */ + // Alter message type field. offset = alter_random_byte(var->header_buf + kZeroCopyFrameLengthFieldSize, kZeroCopyFrameMessageTypeFieldSize); status = alts_iovec_record_protocol_integrity_only_unprotect( @@ -306,7 +306,7 @@ static void integrity_only_corrupted_data( "Unsupported message type.")); gpr_free(error_message); revert_back_alter(var->header_buf + kZeroCopyFrameLengthFieldSize, offset); - /* Alter data. */ + // Alter data. offset = alter_random_byte(var->data_buf, var->data_length); status = alts_iovec_record_protocol_integrity_only_unprotect( receiver, var->data_iovec, var->data_iovec_length, var->header_iovec, @@ -316,7 +316,7 @@ static void integrity_only_corrupted_data( "Frame tag verification failed.")); gpr_free(error_message); revert_back_alter(var->data_buf, offset); - /* Alter tag. */ + // Alter tag. offset = alter_random_byte(var->tag_buf, var->tag_length); status = alts_iovec_record_protocol_integrity_only_unprotect( receiver, var->data_iovec, var->data_iovec_length, var->header_iovec, @@ -326,7 +326,7 @@ static void integrity_only_corrupted_data( "Frame tag verification failed.")); gpr_free(error_message); revert_back_alter(var->tag_buf, offset); - /* Reverted protected data should be verified correctly. */ + // Reverted protected data should be verified correctly. status = alts_iovec_record_protocol_integrity_only_unprotect( receiver, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); @@ -339,7 +339,7 @@ static void integrity_only_protect_input_check(alts_iovec_record_protocol* rp) { alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); char* error_message = nullptr; - /* Header buffer is nullptr. */ + // Header buffer is nullptr. iovec_t header_iovec = {nullptr, var->header_length}; grpc_status_code status = alts_iovec_record_protocol_integrity_only_protect( rp, var->data_iovec, var->data_iovec_length, header_iovec, var->tag_iovec, @@ -348,7 +348,7 @@ static void integrity_only_protect_input_check(alts_iovec_record_protocol* rp) { status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Header is nullptr.")); gpr_free(error_message); - /* Header buffer length is 0. */ + // Header buffer length is 0. header_iovec.iov_base = var->header_buf; header_iovec.iov_len = 0; status = alts_iovec_record_protocol_integrity_only_protect( @@ -358,7 +358,7 @@ static void integrity_only_protect_input_check(alts_iovec_record_protocol* rp) { status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Header length is incorrect.")); gpr_free(error_message); - /* Tag buffer is nullptr. */ + // Tag buffer is nullptr. iovec_t tag_iovec = {nullptr, var->tag_length}; status = alts_iovec_record_protocol_integrity_only_protect( rp, var->data_iovec, var->data_iovec_length, var->header_iovec, tag_iovec, @@ -366,7 +366,7 @@ static void integrity_only_protect_input_check(alts_iovec_record_protocol* rp) { ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Tag is nullptr.")); gpr_free(error_message); - /* Tag buffer length is 0. */ + // Tag buffer length is 0. tag_iovec.iov_base = var->tag_buf; tag_iovec.iov_len = 0; status = alts_iovec_record_protocol_integrity_only_protect( @@ -384,7 +384,7 @@ static void integrity_only_unprotect_input_check( alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); char* error_message = nullptr; - /* Header buffer is nullptr. */ + // Header buffer is nullptr. iovec_t header_iovec = {nullptr, var->header_length}; grpc_status_code status = alts_iovec_record_protocol_integrity_only_unprotect( rp, var->data_iovec, var->data_iovec_length, header_iovec, var->tag_iovec, @@ -393,7 +393,7 @@ static void integrity_only_unprotect_input_check( status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Header is nullptr.")); gpr_free(error_message); - /* Header buffer length is 0. */ + // Header buffer length is 0. header_iovec.iov_base = var->header_buf; header_iovec.iov_len = 0; status = alts_iovec_record_protocol_integrity_only_unprotect( @@ -403,7 +403,7 @@ static void integrity_only_unprotect_input_check( status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Header length is incorrect.")); gpr_free(error_message); - /* Tag buffer is nullptr. */ + // Tag buffer is nullptr. iovec_t tag_iovec = {nullptr, var->tag_length}; status = alts_iovec_record_protocol_integrity_only_unprotect( rp, var->data_iovec, var->data_iovec_length, var->header_iovec, tag_iovec, @@ -411,7 +411,7 @@ static void integrity_only_unprotect_input_check( ASSERT_TRUE(gsec_test_expect_compare_code_and_substr( status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Tag is nullptr.")); gpr_free(error_message); - /* Tag buffer length is 0. */ + // Tag buffer length is 0. tag_iovec.iov_base = var->tag_buf; tag_iovec.iov_len = 0; status = alts_iovec_record_protocol_integrity_only_unprotect( @@ -424,14 +424,14 @@ static void integrity_only_unprotect_input_check( alts_iovec_record_protocol_test_var_destroy(var); } -/* --- Privacy-integrity protect/unprotect tests. --- */ +// --- Privacy-integrity protect/unprotect tests. --- static void privacy_integrity_random_seal_unseal( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); - /* Seals and then unseals. */ + // Seals and then unseals. grpc_status_code status = alts_iovec_record_protocol_privacy_integrity_protect( sender, var->data_iovec, var->data_iovec_length, @@ -439,7 +439,7 @@ static void privacy_integrity_random_seal_unseal( ASSERT_EQ(status, GRPC_STATUS_OK); iovec_t header_iovec = {var->protected_buf, var->header_length}; gpr_free(var->data_iovec); - /* Randomly slices protected buffer, excluding the header. */ + // Randomly slices protected buffer, excluding the header. randomly_slice(var->protected_buf + var->header_length, var->data_length + var->tag_length, &var->data_iovec, &var->data_iovec_length); @@ -447,7 +447,7 @@ static void privacy_integrity_random_seal_unseal( receiver, header_iovec, var->data_iovec, var->data_iovec_length, var->unprotected_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Makes sure unprotected data are the same as the original. */ + // Makes sure unprotected data are the same as the original. ASSERT_EQ(memcmp(var->data_buf, var->dup_buf, var->data_length), 0); alts_iovec_record_protocol_test_var_destroy(var); } @@ -464,7 +464,7 @@ static void privacy_integrity_empty_seal_unseal( iovec_t protected_iovec = {protected_buf, empty_payload_frame_size}; iovec_t unprotected_iovec = {nullptr, 0}; iovec_t data_iovec = {protected_buf + var->header_length, var->tag_length}; - /* Seals and then unseals empty payload. */ + // Seals and then unseals empty payload. grpc_status_code status = alts_iovec_record_protocol_privacy_integrity_protect( sender, nullptr, 0, protected_iovec, nullptr); @@ -480,7 +480,7 @@ static void privacy_integrity_empty_seal_unseal( static void privacy_integrity_unsync_seal_unseal( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { - /* Seals once. */ + // Seals once. alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); grpc_status_code status = @@ -489,13 +489,13 @@ static void privacy_integrity_unsync_seal_unseal( nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); alts_iovec_record_protocol_test_var_destroy(var); - /* Seals again. */ + // Seals again. var = alts_iovec_record_protocol_test_var_create(); status = alts_iovec_record_protocol_privacy_integrity_protect( sender, var->data_iovec, var->data_iovec_length, var->protected_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Unseals the second frame. */ + // Unseals the second frame. char* error_message = nullptr; iovec_t header_iovec = {var->protected_buf, var->header_length}; iovec_t protected_iovec = {var->protected_buf + var->header_length, @@ -511,7 +511,7 @@ static void privacy_integrity_unsync_seal_unseal( static void privacy_integrity_corrupted_data( alts_iovec_record_protocol* sender, alts_iovec_record_protocol* receiver) { - /* Seals the data first. */ + // Seals the data first. alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); grpc_status_code status = @@ -523,11 +523,11 @@ static void privacy_integrity_corrupted_data( uint8_t* header_buf = var->protected_buf; size_t header_length = var->header_length; iovec_t header_iovec = {header_buf, header_length}; - /* The following protected_buf and protected_length excludes header. */ + // The following protected_buf and protected_length excludes header. uint8_t* protected_buf = var->protected_buf + var->header_length; size_t protected_length = var->data_length + var->tag_length; iovec_t protected_iovec = {protected_buf, protected_length}; - /* Alter frame length field. */ + // Alter frame length field. size_t offset = alter_random_byte(header_buf, kZeroCopyFrameLengthFieldSize); status = alts_iovec_record_protocol_privacy_integrity_unprotect( receiver, header_iovec, &protected_iovec, 1, var->unprotected_iovec, @@ -536,7 +536,7 @@ static void privacy_integrity_corrupted_data( status, GRPC_STATUS_INTERNAL, error_message, "Bad frame length.")); gpr_free(error_message); revert_back_alter(header_buf, offset); - /* Alter message type field. */ + // Alter message type field. offset = alter_random_byte(header_buf + kZeroCopyFrameLengthFieldSize, kZeroCopyFrameMessageTypeFieldSize); status = alts_iovec_record_protocol_privacy_integrity_unprotect( @@ -547,7 +547,7 @@ static void privacy_integrity_corrupted_data( "Unsupported message type.")); gpr_free(error_message); revert_back_alter(header_buf + kZeroCopyFrameLengthFieldSize, offset); - /* Alter protected data. */ + // Alter protected data. offset = alter_random_byte(protected_buf, protected_length); status = alts_iovec_record_protocol_privacy_integrity_unprotect( receiver, header_iovec, &protected_iovec, 1, var->unprotected_iovec, @@ -556,7 +556,7 @@ static void privacy_integrity_corrupted_data( status, GRPC_STATUS_INTERNAL, error_message, "Frame decryption failed.")); gpr_free(error_message); revert_back_alter(protected_buf, offset); - /* Reverted protected data should be verified correctly. */ + // Reverted protected data should be verified correctly. status = alts_iovec_record_protocol_privacy_integrity_unprotect( receiver, header_iovec, &protected_iovec, 1, var->unprotected_iovec, nullptr); @@ -570,7 +570,7 @@ static void privacy_integrity_protect_input_check( alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); char* error_message = nullptr; - /* Protected output buffer is nullptr. */ + // Protected output buffer is nullptr. iovec_t protected_iovec = {nullptr, var->protected_iovec.iov_len}; grpc_status_code status = alts_iovec_record_protocol_privacy_integrity_protect( @@ -580,7 +580,7 @@ static void privacy_integrity_protect_input_check( status, GRPC_STATUS_INVALID_ARGUMENT, error_message, "Protected frame is nullptr.")); gpr_free(error_message); - /* Protected output buffer length incorrect. */ + // Protected output buffer length incorrect. protected_iovec.iov_base = var->protected_buf; protected_iovec.iov_len = var->header_length + var->data_length; status = alts_iovec_record_protocol_privacy_integrity_protect( @@ -598,7 +598,7 @@ static void privacy_integrity_unprotect_input_check( alts_iovec_record_protocol_test_var* var = alts_iovec_record_protocol_test_var_create(); char* error_message = nullptr; - /* Header buffer is nullptr. */ + // Header buffer is nullptr. iovec_t header_iovec = {var->protected_buf, var->header_length}; iovec_t protected_iovec = {var->protected_buf + var->header_length, var->data_length + var->tag_length}; @@ -612,7 +612,7 @@ static void privacy_integrity_unprotect_input_check( "Header is nullptr.")); gpr_free(error_message); header_iovec.iov_base = var->protected_buf; - /* Header buffer length is 0. */ + // Header buffer length is 0. header_iovec.iov_len = 0; status = alts_iovec_record_protocol_privacy_integrity_unprotect( rp, header_iovec, &protected_iovec, 1, var->unprotected_iovec, @@ -622,7 +622,7 @@ static void privacy_integrity_unprotect_input_check( "Header length is incorrect.")); gpr_free(error_message); header_iovec.iov_len = var->header_length; - /* Unprotected output buffer length is incorrect. */ + // Unprotected output buffer length is incorrect. iovec_t unprotected_iovec = {var->data_buf, var->data_length - 1}; status = alts_iovec_record_protocol_privacy_integrity_unprotect( rp, header_iovec, &protected_iovec, 1, unprotected_iovec, &error_message); @@ -633,7 +633,7 @@ static void privacy_integrity_unprotect_input_check( alts_iovec_record_protocol_test_var_destroy(var); } -/* --- Integrity-only and privacy-integrity mixed. --- */ +// --- Integrity-only and privacy-integrity mixed. --- static void record_protocol_wrong_mode( alts_iovec_record_protocol* integrity_only_protect_rp, @@ -644,7 +644,7 @@ static void record_protocol_wrong_mode( alts_iovec_record_protocol_test_var_create(); grpc_status_code status; char* error_message = nullptr; - /* Call integrity-only protect on privacy-integrity record protocol. */ + // Call integrity-only protect on privacy-integrity record protocol. status = alts_iovec_record_protocol_integrity_only_protect( privacy_integrity_protect_rp, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, &error_message); @@ -652,7 +652,7 @@ static void record_protocol_wrong_mode( status, GRPC_STATUS_FAILED_PRECONDITION, error_message, "Integrity-only operations are not allowed for this object.")); gpr_free(error_message); - /* Call integrity-only unprotect on privacy-integrity record protocol. */ + // Call integrity-only unprotect on privacy-integrity record protocol. status = alts_iovec_record_protocol_integrity_only_unprotect( privacy_integrity_unprotect_rp, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, &error_message); @@ -660,7 +660,7 @@ static void record_protocol_wrong_mode( status, GRPC_STATUS_FAILED_PRECONDITION, error_message, "Integrity-only operations are not allowed for this object.")); gpr_free(error_message); - /* Call privacy-integrity protect on integrity-only record protocol. */ + // Call privacy-integrity protect on integrity-only record protocol. status = alts_iovec_record_protocol_privacy_integrity_protect( integrity_only_protect_rp, var->data_iovec, var->data_iovec_length, var->protected_iovec, &error_message); @@ -668,7 +668,7 @@ static void record_protocol_wrong_mode( status, GRPC_STATUS_FAILED_PRECONDITION, error_message, "Privacy-integrity operations are not allowed for this object.")); gpr_free(error_message); - /* Call privacy-integrity unprotect on integrity-only record protocol. */ + // Call privacy-integrity unprotect on integrity-only record protocol. status = alts_iovec_record_protocol_privacy_integrity_unprotect( integrity_only_unprotect_rp, var->header_iovec, var->data_iovec, var->data_iovec_length, var->unprotected_iovec, &error_message); @@ -686,12 +686,12 @@ static void integrity_seal_privacy_unseal( alts_iovec_record_protocol_test_var_create(); grpc_status_code status; char* error_message = nullptr; - /* Seals with integrity-only protect. */ + // Seals with integrity-only protect. status = alts_iovec_record_protocol_integrity_only_protect( integrity_only_sender, var->data_iovec, var->data_iovec_length, var->header_iovec, var->tag_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Unseal with privacy-integrity unprotect. */ + // Unseal with privacy-integrity unprotect. memcpy(var->protected_buf, var->data_buf, var->data_length); memcpy(var->protected_buf + var->data_length, var->tag_buf, var->tag_length); iovec_t protected_iovec = {var->protected_buf, @@ -712,12 +712,12 @@ static void privacy_seal_integrity_unseal( alts_iovec_record_protocol_test_var_create(); grpc_status_code status; char* error_message = nullptr; - /* Seals with privacy-integrity protect. */ + // Seals with privacy-integrity protect. status = alts_iovec_record_protocol_privacy_integrity_protect( privacy_integrity_sender, var->data_iovec, var->data_iovec_length, var->protected_iovec, nullptr); ASSERT_EQ(status, GRPC_STATUS_OK); - /* Unseal with integrity-only unprotect. */ + // Unseal with integrity-only unprotect. iovec_t header_iovec = {var->protected_buf, var->header_length}; iovec_t data_iovec = {var->protected_buf + var->header_length, var->data_length}; @@ -734,7 +734,7 @@ static void privacy_seal_integrity_unseal( alts_iovec_record_protocol_test_var_destroy(var); } -/* --- Test cases. --- */ +// --- Test cases. --- TEST(AltsIovecRecordProtocolTest, AltsIovecRecordProtocolRandomSealUnsealTests) { diff --git a/test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc b/test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc index 324101e36b1..764bae62b5e 100644 --- a/test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc +++ b/test/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h" @@ -32,8 +32,8 @@ #include "test/core/tsi/alts/crypt/gsec_test_util.h" #include "test/core/util/test_config.h" -/* TODO: tests zero_copy_grpc_protector under TSI test library, which - * has more comprehensive tests. */ +// TODO(unknown): tests zero_copy_grpc_protector under TSI test library, which +// has more comprehensive tests. constexpr size_t kSealRepeatTimes = 50; constexpr size_t kSmallBufferSize = 16; @@ -41,13 +41,13 @@ constexpr size_t kLargeBufferSize = 16384; constexpr size_t kChannelMaxSize = 2048; constexpr size_t kChannelMinSize = 128; -/* Test fixtures for each test cases. */ +// Test fixtures for each test cases. struct alts_zero_copy_grpc_protector_test_fixture { tsi_zero_copy_grpc_protector* client; tsi_zero_copy_grpc_protector* server; }; -/* Test input variables for protect/unprotect operations. */ +// Test input variables for protect/unprotect operations. struct alts_zero_copy_grpc_protector_test_var { grpc_slice_buffer original_sb; grpc_slice_buffer duplicate_sb; @@ -56,7 +56,7 @@ struct alts_zero_copy_grpc_protector_test_var { grpc_slice_buffer unprotected_sb; }; -/* --- Test utility functions. --- */ +// --- Test utility functions. --- static void create_random_slice_buffer(grpc_slice_buffer* sb, grpc_slice_buffer* dup_sb, @@ -83,8 +83,8 @@ static uint8_t* pointer_to_nth_byte(grpc_slice_buffer* sb, size_t index) { return nullptr; } -/* Checks if two slice buffer contents are the same. It is not super efficient, - * but OK for testing. */ +// Checks if two slice buffer contents are the same. It is not super efficient, +// but OK for testing. static bool are_slice_buffers_equal(grpc_slice_buffer* first, grpc_slice_buffer* second) { EXPECT_NE(first, nullptr); @@ -175,7 +175,7 @@ static void alts_zero_copy_grpc_protector_test_var_destroy( gpr_free(var); } -/* --- ALTS zero-copy protector tests. --- */ +// --- ALTS zero-copy protector tests. --- static void seal_unseal_small_buffer(tsi_zero_copy_grpc_protector* sender, tsi_zero_copy_grpc_protector* receiver) { @@ -184,21 +184,21 @@ static void seal_unseal_small_buffer(tsi_zero_copy_grpc_protector* sender, int min_progress_size; alts_zero_copy_grpc_protector_test_var* var = alts_zero_copy_grpc_protector_test_var_create(); - /* Creates a random small slice buffer and calls protect(). */ + // Creates a random small slice buffer and calls protect(). create_random_slice_buffer(&var->original_sb, &var->duplicate_sb, kSmallBufferSize); ASSERT_EQ(tsi_zero_copy_grpc_protector_protect(sender, &var->original_sb, &var->protected_sb), TSI_OK); - /* Splits protected slice buffer into two: first one is staging_sb, and - * second one is protected_sb. */ + // Splits protected slice buffer into two: first one is staging_sb, and + // second one is protected_sb. uint32_t staging_sb_size = gsec_test_bias_random_uint32( static_cast(var->protected_sb.length - 1)) + 1; grpc_slice_buffer_move_first(&var->protected_sb, staging_sb_size, &var->staging_sb); - /* Unprotects one by one. */ + // Unprotects one by one. ASSERT_EQ(tsi_zero_copy_grpc_protector_unprotect(receiver, &var->staging_sb, &var->unprotected_sb, &min_progress_size), @@ -227,14 +227,14 @@ static void seal_unseal_large_buffer(tsi_zero_copy_grpc_protector* sender, for (size_t i = 0; i < kSealRepeatTimes; i++) { alts_zero_copy_grpc_protector_test_var* var = alts_zero_copy_grpc_protector_test_var_create(); - /* Creates a random large slice buffer and calls protect(). */ + // Creates a random large slice buffer and calls protect(). create_random_slice_buffer(&var->original_sb, &var->duplicate_sb, kLargeBufferSize); ASSERT_EQ(tsi_zero_copy_grpc_protector_protect(sender, &var->original_sb, &var->protected_sb), TSI_OK); - /* Splits protected slice buffer into multiple pieces. Receiver unprotects - * each slice buffer one by one. */ + // Splits protected slice buffer into multiple pieces. Receiver unprotects + // each slice buffer one by one. uint32_t channel_size = gsec_test_bias_random_uint32(static_cast( kChannelMaxSize + 1 - kChannelMinSize)) + static_cast(kChannelMinSize); @@ -256,7 +256,7 @@ static void seal_unseal_large_buffer(tsi_zero_copy_grpc_protector* sender, grpc_core::ExecCtx::Get()->Flush(); } -/* --- Test cases. --- */ +// --- Test cases. --- static void alts_zero_copy_protector_seal_unseal_small_buffer_tests( bool enable_extra_copy) { diff --git a/test/core/tsi/fake_transport_security_test.cc b/test/core/tsi/fake_transport_security_test.cc index 350ebbb8501..6006008cbab 100644 --- a/test/core/tsi/fake_transport_security_test.cc +++ b/test/core/tsi/fake_transport_security_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/tsi/fake_transport_security.h" diff --git a/test/core/tsi/ssl_session_cache_test.cc b/test/core/tsi/ssl_session_cache_test.cc index a239d740041..11db1458662 100644 --- a/test/core/tsi/ssl_session_cache_test.cc +++ b/test/core/tsi/ssl_session_cache_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "src/core/tsi/ssl/session_cache/ssl_session_cache.h" diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 8751da9ecc1..45a184d2998 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "src/core/tsi/ssl_transport_security.h" @@ -115,7 +115,7 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { ASSERT_NE(ssl_fixture->alpn_lib, nullptr); ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib; ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib; - /* Create client handshaker factory. */ + // Create client handshaker factory. tsi_ssl_client_handshaker_options client_options; client_options.pem_root_certs = key_cert_lib->root_cert; if (ssl_fixture->force_client_auth) { @@ -140,7 +140,7 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { ASSERT_EQ(tsi_create_ssl_client_handshaker_factory_with_options( &client_options, &ssl_fixture->client_handshaker_factory), TSI_OK); - /* Create server handshaker factory. */ + // Create server handshaker factory. tsi_ssl_server_handshaker_options server_options; if (alpn_lib->alpn_mode == ALPN_SERVER_NO_CLIENT || alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK || @@ -174,7 +174,7 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { ASSERT_EQ(tsi_create_ssl_server_handshaker_factory_with_options( &server_options, &ssl_fixture->server_handshaker_factory), TSI_OK); - /* Create server and client handshakers. */ + // Create server and client handshakers. ASSERT_EQ( tsi_ssl_client_handshaker_factory_create_handshaker( ssl_fixture->client_handshaker_factory, @@ -395,7 +395,7 @@ static void ssl_test_destruct(tsi_test_fixture* fixture) { if (ssl_fixture == nullptr) { return; } - /* Destroy ssl_alpn_lib. */ + // Destroy ssl_alpn_lib. ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib; for (size_t i = 0; i < alpn_lib->num_server_alpn_protocols; i++) { gpr_free(const_cast(alpn_lib->server_alpn_protocols[i])); @@ -406,7 +406,7 @@ static void ssl_test_destruct(tsi_test_fixture* fixture) { } gpr_free(alpn_lib->client_alpn_protocols); gpr_free(alpn_lib); - /* Destroy ssl_key_cert_lib. */ + // Destroy ssl_key_cert_lib. ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib; for (size_t i = 0; i < key_cert_lib->server_num_key_cert_pairs; i++) { ssl_test_pem_key_cert_pair_destroy( @@ -427,7 +427,7 @@ static void ssl_test_destruct(tsi_test_fixture* fixture) { if (ssl_fixture->session_cache != nullptr) { tsi_ssl_session_cache_unref(ssl_fixture->session_cache); } - /* Unreference others. */ + // Unreference others. tsi_ssl_server_handshaker_factory_unref( ssl_fixture->server_handshaker_factory); tsi_ssl_client_handshaker_factory_unref( @@ -457,7 +457,7 @@ static tsi_test_fixture* ssl_tsi_test_fixture_create() { tsi_test_fixture_init(&ssl_fixture->base); ssl_fixture->base.test_unused_bytes = true; ssl_fixture->base.vtable = &vtable; - /* Create ssl_key_cert_lib. */ + // Create ssl_key_cert_lib. ssl_key_cert_lib* key_cert_lib = grpc_core::Zalloc(); key_cert_lib->use_bad_server_cert = false; key_cert_lib->use_bad_client_cert = false; @@ -499,7 +499,7 @@ static tsi_test_fixture* ssl_tsi_test_fixture_create() { tsi_ssl_root_certs_store_create(key_cert_lib->root_cert); EXPECT_NE(key_cert_lib->root_store, nullptr); ssl_fixture->key_cert_lib = key_cert_lib; - /* Create ssl_alpn_lib. */ + // Create ssl_alpn_lib. ssl_alpn_lib* alpn_lib = grpc_core::Zalloc(); alpn_lib->server_alpn_protocols = static_cast( gpr_zalloc(sizeof(char*) * SSL_TSI_TEST_ALPN_NUM)); @@ -586,7 +586,7 @@ void ssl_tsi_test_do_handshake_with_client_authentication_and_root_store() { void ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain() { gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain"); - /* server1 cert contains "waterzooi.test.google.be" in SAN. */ + // server1 cert contains "waterzooi.test.google.be" in SAN. tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); ssl_tsi_test_fixture* ssl_fixture = reinterpret_cast(fixture); @@ -600,7 +600,7 @@ void ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain() { gpr_log( GPR_INFO, "ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain"); - /* server1 cert contains "*.test.google.fr" in SAN. */ + // server1 cert contains "*.test.google.fr" in SAN. tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); ssl_tsi_test_fixture* ssl_fixture = reinterpret_cast(fixture); @@ -613,7 +613,7 @@ void ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain() { void ssl_tsi_test_do_handshake_with_wrong_server_name_indication() { gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_wrong_server_name_indication"); - /* server certs do not contain "test.google.cn". */ + // server certs do not contain "test.google.cn". tsi_test_fixture* fixture = ssl_tsi_test_fixture_create(); ssl_tsi_test_fixture* ssl_fixture = reinterpret_cast(fixture); @@ -893,8 +893,8 @@ void test_tsi_ssl_server_handshaker_factory_refcounting() { ssl_test_pem_key_cert_pair_destroy(cert_pair); } -/* Attempting to create a handshaker factory with invalid parameters should fail - * but not crash. */ +// Attempting to create a handshaker factory with invalid parameters should fail +// but not crash. void test_tsi_ssl_client_handshaker_factory_bad_params() { const char* cert_chain = "This is not a valid PEM file."; diff --git a/test/core/tsi/transport_security_test.cc b/test/core/tsi/transport_security_test.cc index 31491eef573..139438a5057 100644 --- a/test/core/tsi/transport_security_test.cc +++ b/test/core/tsi/transport_security_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/tsi/transport_security.h" @@ -38,26 +38,26 @@ #include "test/core/util/test_config.h" typedef struct { - /* 1 if success, 0 if failure. */ + // 1 if success, 0 if failure. int expected; - /* Host name to match. */ + // Host name to match. const char* host_name; - /* Common name (CN). */ + // Common name (CN). const char* common_name; - /* Comma separated list of certificate names to match against. Any occurrence - of '#' will be replaced with a null character before processing. */ + // Comma separated list of certificate names to match against. Any occurrence + // of '#' will be replaced with a null character before processing. const char* dns_names; - /* Comma separated list of IP SANs to match aggainst */ + // Comma separated list of IP SANs to match aggainst const char* ip_names; } cert_name_test_entry; -/* Largely inspired from: - chromium/src/net/cert/x509_certificate_unittest.cc. - TODO(jboeuf) uncomment test cases as we fix tsi_ssl_peer_matches_name. */ +// Largely inspired from: +// chromium/src/net/cert/x509_certificate_unittest.cc. +// TODO(jboeuf) uncomment test cases as we fix tsi_ssl_peer_matches_name. const cert_name_test_entry cert_name_test_entries[] = { {1, "foo.com", "foo.com", nullptr, nullptr}, {1, "f", "f", nullptr, nullptr}, @@ -65,13 +65,13 @@ const cert_name_test_entry cert_name_test_entries[] = { {1, "bar.foo.com", "*.foo.com", nullptr, nullptr}, {1, "www.test.fr", "common.name", "*.test.com,*.test.co.uk,*.test.de,*.test.fr", nullptr}, - /* - {1, "wwW.tESt.fr", "common.name", ",*.*,*.test.de,*.test.FR,www"}, - */ + // + // {1, "wwW.tESt.fr", "common.name", ",*.*,*.test.de,*.test.FR,www"}, + // {0, "f.uk", ".uk", nullptr, nullptr}, {0, "w.bar.foo.com", "?.bar.foo.com", nullptr, nullptr}, {0, "www.foo.com", "(www|ftp).foo.com", nullptr, nullptr}, - {0, "www.foo.com", "www.foo.com#", nullptr, nullptr}, /* # = null char. */ + {0, "www.foo.com", "www.foo.com#", nullptr, nullptr}, // # = null char. {0, "www.foo.com", "", "www.foo.com#*.foo.com,#,#", nullptr}, {0, "www.house.example", "ww.house.example", nullptr, nullptr}, {0, "test.org", "", "www.test.org,*.test.org,*.org", nullptr}, @@ -82,18 +82,18 @@ const cert_name_test_entry cert_name_test_entries[] = { {0, "wwww.bar.foo.com", "w*w.bar.foo.c0m", nullptr, nullptr}, {0, "WALLY.bar.foo.com", "wa*.bar.foo.com", nullptr, nullptr}, {0, "wally.bar.foo.com", "*Ly.bar.foo.com", nullptr, nullptr}, - /* - {1, "ww%57.foo.com", "", "www.foo.com"}, - {1, "www&.foo.com", "www%26.foo.com", NULL}, - */ + // + // {1, "ww%57.foo.com", "", "www.foo.com"}, + // {1, "www&.foo.com", "www%26.foo.com", NULL}, + // - /* Common name must not be used if subject alternative name was provided. */ + // Common name must not be used if subject alternative name was provided. {0, "www.test.co.jp", "www.test.co.jp", "*.test.de,*.jp,www.test.co.uk,www.*.co.jp", nullptr}, {0, "www.bar.foo.com", "www.bar.foo.com", "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com,", nullptr}, - /* IDN tests */ + // IDN tests {1, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br", nullptr, nullptr}, {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, @@ -104,58 +104,58 @@ const cert_name_test_entry cert_name_test_entries[] = { "*--poema-9qae5a.com.br", nullptr}, - /* The following are adapted from the examples quoted from - http://tools.ietf.org/html/rfc6125#section-6.4.3 - (e.g., *.example.com would match foo.example.com but - not bar.foo.example.com or example.com). */ + // The following are adapted from the examples quoted from + // http://tools.ietf.org/html/rfc6125#section-6.4.3 + // (e.g., *.example.com would match foo.example.com but + // not bar.foo.example.com or example.com). {1, "foo.example.com", "*.example.com", nullptr, nullptr}, {0, "bar.foo.example.com", "*.example.com", nullptr, nullptr}, {0, "example.com", "*.example.com", nullptr, nullptr}, - /* Partial wildcards are disallowed, though RFC 2818 rules allow them. - That is, forms such as baz*.example.net, *baz.example.net, and - b*z.example.net should NOT match domains. Instead, the wildcard must - always be the left-most label, and only a single label. */ + // Partial wildcards are disallowed, though RFC 2818 rules allow them. + // That is, forms such as baz*.example.net, *baz.example.net, and + // b*z.example.net should NOT match domains. Instead, the wildcard must + // always be the left-most label, and only a single label. {0, "baz1.example.net", "baz*.example.net", nullptr, nullptr}, {0, "foobaz.example.net", "*baz.example.net", nullptr, nullptr}, {0, "buzz.example.net", "b*z.example.net", nullptr, nullptr}, {0, "www.test.example.net", "www.*.example.net", nullptr, nullptr}, - /* Wildcards should not be valid for public registry controlled domains, - and unknown/unrecognized domains, at least three domain components must - be present. */ + // Wildcards should not be valid for public registry controlled domains, + // and unknown/unrecognized domains, at least three domain components must + // be present. {1, "www.test.example", "*.test.example", nullptr, nullptr}, {1, "test.example.co.uk", "*.example.co.uk", nullptr, nullptr}, {0, "test.example", "*.example", nullptr, nullptr}, - /* - {0, "example.co.uk", "*.co.uk", NULL}, - */ + // + // {0, "example.co.uk", "*.co.uk", NULL}, + // {0, "foo.com", "*.com", nullptr, nullptr}, {0, "foo.us", "*.us", nullptr, nullptr}, {0, "foo", "*", nullptr, nullptr}, - /* IDN variants of wildcards and registry controlled domains. */ + // IDN variants of wildcards and registry controlled domains. {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", nullptr, nullptr}, - /* - {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL}, - */ + // + // {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL}, + // {0, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h", nullptr, nullptr}, - /* Wildcards should be permissible for 'private' registry controlled - domains. */ + // Wildcards should be permissible for 'private' registry controlled + // domains. {1, "www.appspot.com", "*.appspot.com", nullptr, nullptr}, {1, "foo.s3.amazonaws.com", "*.s3.amazonaws.com", nullptr, nullptr}, - /* Multiple wildcards are not valid. */ + // Multiple wildcards are not valid. {0, "foo.example.com", "*.*.com", nullptr, nullptr}, {0, "foo.bar.example.com", "*.bar.*.com", nullptr, nullptr}, - /* Absolute vs relative DNS name tests. Although not explicitly specified - in RFC 6125, absolute reference names (those ending in a .) should - match either absolute or relative presented names. */ + // Absolute vs relative DNS name tests. Although not explicitly specified + // in RFC 6125, absolute reference names (those ending in a .) should + // match either absolute or relative presented names. {1, "foo.com", "foo.com.", nullptr, nullptr}, {1, "foo.com.", "foo.com", nullptr, nullptr}, {1, "foo.com.", "foo.com.", nullptr, nullptr}, @@ -171,17 +171,17 @@ const cert_name_test_entry cert_name_test_entries[] = { {0, "example.com.", "*.com.", nullptr, nullptr}, {0, "foo.", "*.", nullptr, nullptr}, {0, "foo", "*.", nullptr, nullptr}, - /* - {0, "foo.co.uk", "*.co.uk.", NULL}, - {0, "foo.co.uk.", "*.co.uk.", NULL}, - */ + // + // {0, "foo.co.uk", "*.co.uk.", NULL}, + // {0, "foo.co.uk.", "*.co.uk.", NULL}, + // - /* An empty CN is OK. */ + // An empty CN is OK. {1, "test.foo.com", "", "test.foo.com", nullptr}, - /* An IP should not be used for the CN. */ + // An IP should not be used for the CN. {0, "173.194.195.139", "173.194.195.139", nullptr, nullptr}, - /* An IP can be used if the SAN IP is present */ + // An IP can be used if the SAN IP is present {1, "173.194.195.139", "foo.example.com", nullptr, "173.194.195.139"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8,8.8.4.4"}, @@ -316,7 +316,7 @@ TEST(TransportSecurityTest, TestPeerMatchesName) { int result = tsi_ssl_peer_matches_name(&peer, entry->host_name); if (result != entry->expected) { gpr_log(GPR_ERROR, "%s", cert_name_test_entry_to_string(entry).c_str()); - ASSERT_TRUE(0); /* Unexpected result. */ + ASSERT_TRUE(0); // Unexpected result. } tsi_peer_destruct(&peer); } diff --git a/test/core/tsi/transport_security_test_lib.cc b/test/core/tsi/transport_security_test_lib.cc index 72812b6a09d..549a73a3656 100644 --- a/test/core/tsi/transport_security_test_lib.cc +++ b/test/core/tsi/transport_security_test_lib.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "test/core/tsi/transport_security_test_lib.h" @@ -106,9 +106,9 @@ static void check_handshake_results(tsi_test_fixture* fixture) { GPR_ASSERT(fixture != nullptr); GPR_ASSERT(fixture->vtable != nullptr); GPR_ASSERT(fixture->vtable->check_handshaker_peers != nullptr); - /* Check handshaker peers. */ + // Check handshaker peers. fixture->vtable->check_handshaker_peers(fixture); - /* Check unused bytes. */ + // Check unused bytes. if (fixture->test_unused_bytes) { tsi_test_channel* channel = fixture->channel; if (fixture->server_result != nullptr && @@ -135,7 +135,7 @@ static void send_bytes_to_peer(tsi_test_channel* test_channel, : &test_channel->bytes_written_to_client_channel; GPR_ASSERT(bytes_written != nullptr); GPR_ASSERT(*bytes_written + buf_size <= TSI_TEST_DEFAULT_CHANNEL_SIZE); - /* Write data to channel. */ + // Write data to channel. memcpy(channel + *bytes_written, buf, buf_size); *bytes_written += buf_size; } @@ -177,7 +177,7 @@ static void receive_bytes_from_peer(tsi_test_channel* test_channel, size_t to_read = *buf_size < *bytes_written - *bytes_read ? *buf_size : *bytes_written - *bytes_read; - /* Read data from channel. */ + // Read data from channel. memcpy(*buf, channel + *bytes_read, to_read); *buf_size = to_read; *bytes_read += to_read; @@ -186,7 +186,7 @@ static void receive_bytes_from_peer(tsi_test_channel* test_channel, void tsi_test_frame_protector_send_message_to_peer( tsi_test_frame_protector_config* config, tsi_test_channel* channel, tsi_frame_protector* protector, bool is_client) { - /* Initialization. */ + // Initialization. GPR_ASSERT(config != nullptr); GPR_ASSERT(channel != nullptr); GPR_ASSERT(protector != nullptr); @@ -200,21 +200,21 @@ void tsi_test_frame_protector_send_message_to_peer( const unsigned char* message_bytes = reinterpret_cast(message); tsi_result result = TSI_OK; - /* Do protect and send protected data to peer. */ + // Do protect and send protected data to peer. while (message_size > 0 && result == TSI_OK) { size_t protected_buffer_size_to_send = config->protected_buffer_size; size_t processed_message_size = message_size; - /* Do protect. */ + // Do protect. result = tsi_frame_protector_protect( protector, message_bytes, &processed_message_size, protected_buffer, &protected_buffer_size_to_send); GPR_ASSERT(result == TSI_OK); - /* Send protected data to peer. */ + // Send protected data to peer. send_bytes_to_peer(channel, protected_buffer, protected_buffer_size_to_send, is_client); message_bytes += processed_message_size; message_size -= processed_message_size; - /* Flush if we're done. */ + // Flush if we're done. if (message_size == 0) { size_t still_pending_size; do { @@ -237,7 +237,7 @@ void tsi_test_frame_protector_receive_message_from_peer( tsi_test_frame_protector_config* config, tsi_test_channel* channel, tsi_frame_protector* protector, unsigned char* message, size_t* bytes_received, bool is_client) { - /* Initialization. */ + // Initialization. GPR_ASSERT(config != nullptr); GPR_ASSERT(channel != nullptr); GPR_ASSERT(protector != nullptr); @@ -252,9 +252,9 @@ void tsi_test_frame_protector_receive_message_from_peer( gpr_zalloc(config->read_buffer_allocated_size)); unsigned char* message_buffer = static_cast( gpr_zalloc(config->message_buffer_allocated_size)); - /* Do unprotect on data received from peer. */ + // Do unprotect on data received from peer. while (!done && result == TSI_OK) { - /* Receive data from peer. */ + // Receive data from peer. if (read_from_peer_size == 0) { read_from_peer_size = config->read_buffer_allocated_size; receive_bytes_from_peer(channel, &read_buffer, &read_from_peer_size, @@ -264,7 +264,7 @@ void tsi_test_frame_protector_receive_message_from_peer( if (read_from_peer_size == 0) { done = true; } - /* Do unprotect. */ + // Do unprotect. size_t message_buffer_size; do { message_buffer_size = config->message_buffer_allocated_size; @@ -297,7 +297,7 @@ grpc_error_handle on_handshake_next_done( GPR_ASSERT(args->fixture != nullptr); tsi_test_fixture* fixture = args->fixture; grpc_error_handle error; - /* Read more data if we need to. */ + // Read more data if we need to. if (result == TSI_INCOMPLETE_DATA) { GPR_ASSERT(bytes_to_send_size == 0); notification_signal(fixture); @@ -308,14 +308,14 @@ grpc_error_handle on_handshake_next_done( return grpc_set_tsi_error_result(GRPC_ERROR_CREATE("Handshake failed"), result); } - /* Update handshaker result. */ + // Update handshaker result. if (handshaker_result != nullptr) { tsi_handshaker_result** result_to_write = args->is_client ? &fixture->client_result : &fixture->server_result; GPR_ASSERT(*result_to_write == nullptr); *result_to_write = handshaker_result; } - /* Send data to peer, if needed. */ + // Send data to peer, if needed. if (bytes_to_send_size > 0) { send_bytes_to_peer(fixture->channel, bytes_to_send, bytes_to_send_size, args->is_client); @@ -345,7 +345,7 @@ static bool is_handshake_finished_properly(handshaker_args* args) { } static void do_handshaker_next(handshaker_args* args) { - /* Initialization. */ + // Initialization. GPR_ASSERT(args != nullptr); GPR_ASSERT(args->fixture != nullptr); tsi_test_fixture* fixture = args->fixture; @@ -358,7 +358,7 @@ static void do_handshaker_next(handshaker_args* args) { unsigned char* bytes_to_send = nullptr; size_t bytes_to_send_size = 0; tsi_result result = TSI_OK; - /* Receive data from peer, if available. */ + // Receive data from peer, if available. do { size_t buf_size = args->handshake_buffer_size; receive_bytes_from_peer(fixture->channel, &args->handshake_buffer, @@ -366,7 +366,7 @@ static void do_handshaker_next(handshaker_args* args) { if (buf_size > 0) { args->transferred_data = true; } - /* Peform handshaker next. */ + // Peform handshaker next. result = tsi_handshaker_next( handshaker, args->handshake_buffer, buf_size, const_cast(&bytes_to_send), &bytes_to_send_size, @@ -383,13 +383,13 @@ static void do_handshaker_next(handshaker_args* args) { } void tsi_test_do_handshake(tsi_test_fixture* fixture) { - /* Initializaiton. */ + // Initializaiton. setup_handshakers(fixture); handshaker_args* client_args = handshaker_args_create(fixture, true /* is_client */); handshaker_args* server_args = handshaker_args_create(fixture, false /* is_client */); - /* Do handshake. */ + // Do handshake. do { client_args->transferred_data = false; server_args->transferred_data = false; @@ -404,9 +404,9 @@ void tsi_test_do_handshake(tsi_test_fixture* fixture) { GPR_ASSERT(client_args->transferred_data || server_args->transferred_data); } while (fixture->client_result == nullptr || fixture->server_result == nullptr); - /* Verify handshake results. */ + // Verify handshake results. check_handshake_results(fixture); - /* Cleanup. */ + // Cleanup. handshaker_args_destroy(client_args); handshaker_args_destroy(server_args); } @@ -419,7 +419,7 @@ static void tsi_test_do_ping_pong(tsi_test_frame_protector_config* config, GPR_ASSERT(channel != nullptr); GPR_ASSERT(client_frame_protector != nullptr); GPR_ASSERT(server_frame_protector != nullptr); - /* Client sends a message to server. */ + // Client sends a message to server. tsi_test_frame_protector_send_message_to_peer( config, channel, client_frame_protector, true /* is_client */); unsigned char* server_received_message = @@ -431,7 +431,7 @@ static void tsi_test_do_ping_pong(tsi_test_frame_protector_config* config, GPR_ASSERT(config->client_message_size == server_received_message_size); GPR_ASSERT(memcmp(config->client_message, server_received_message, server_received_message_size) == 0); - /* Server sends a message to client. */ + // Server sends a message to client. tsi_test_frame_protector_send_message_to_peer( config, channel, server_frame_protector, false /* is_client */); unsigned char* client_received_message = @@ -456,15 +456,15 @@ void tsi_test_frame_protector_do_round_trip_no_handshake( } void tsi_test_do_round_trip(tsi_test_fixture* fixture) { - /* Initialization. */ + // Initialization. GPR_ASSERT(fixture != nullptr); GPR_ASSERT(fixture->config != nullptr); tsi_test_frame_protector_config* config = fixture->config; tsi_frame_protector* client_frame_protector = nullptr; tsi_frame_protector* server_frame_protector = nullptr; - /* Perform handshake. */ + // Perform handshake. tsi_test_do_handshake(fixture); - /* Create frame protectors.*/ + // Create frame protectors. size_t client_max_output_protected_frame_size = config->client_max_output_protected_frame_size; GPR_ASSERT(tsi_handshaker_result_create_frame_protector( @@ -483,7 +483,7 @@ void tsi_test_do_round_trip(tsi_test_fixture* fixture) { &server_frame_protector) == TSI_OK); tsi_test_do_ping_pong(config, fixture->channel, client_frame_protector, server_frame_protector); - /* Destroy server and client frame protectors. */ + // Destroy server and client frame protectors. tsi_frame_protector_destroy(client_frame_protector); tsi_frame_protector_destroy(server_frame_protector); } @@ -509,21 +509,21 @@ tsi_test_frame_protector_config* tsi_test_frame_protector_config_create( tsi_test_frame_protector_config* config = static_cast( gpr_zalloc(sizeof(*config))); - /* Set the value for read_buffer_allocated_size. */ + // Set the value for read_buffer_allocated_size. config->read_buffer_allocated_size = use_default_read_buffer_allocated_size ? TSI_TEST_DEFAULT_BUFFER_SIZE : TSI_TEST_SMALL_READ_BUFFER_ALLOCATED_SIZE; - /* Set the value for message_buffer_allocated_size. */ + // Set the value for message_buffer_allocated_size. config->message_buffer_allocated_size = use_default_message_buffer_allocated_size ? TSI_TEST_DEFAULT_BUFFER_SIZE : TSI_TEST_SMALL_MESSAGE_BUFFER_ALLOCATED_SIZE; - /* Set the value for protected_buffer_size. */ + // Set the value for protected_buffer_size. config->protected_buffer_size = use_default_protected_buffer_size ? TSI_TEST_DEFAULT_PROTECTED_BUFFER_SIZE : TSI_TEST_SMALL_PROTECTED_BUFFER_SIZE; - /* Set the value for client message. */ + // Set the value for client message. config->client_message_size = use_default_client_message ? TSI_TEST_BIG_MESSAGE_SIZE : TSI_TEST_SMALL_MESSAGE_SIZE; @@ -531,7 +531,7 @@ tsi_test_frame_protector_config* tsi_test_frame_protector_config_create( use_default_client_message ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE) : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE); - /* Set the value for server message. */ + // Set the value for server message. config->server_message_size = use_default_server_message ? TSI_TEST_BIG_MESSAGE_SIZE : TSI_TEST_SMALL_MESSAGE_SIZE; @@ -539,16 +539,16 @@ tsi_test_frame_protector_config* tsi_test_frame_protector_config_create( use_default_server_message ? generate_random_message(TSI_TEST_BIG_MESSAGE_SIZE) : generate_random_message(TSI_TEST_SMALL_MESSAGE_SIZE); - /* Set the value for client max_output_protected_frame_size. - If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(), - which then uses default protected frame size for it. */ + // Set the value for client max_output_protected_frame_size. + // If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(), + // which then uses default protected frame size for it. config->client_max_output_protected_frame_size = use_default_client_max_output_protected_frame_size ? 0 : TSI_TEST_SMALL_CLIENT_MAX_OUTPUT_PROTECTED_FRAME_SIZE; - /* Set the value for server max_output_protected_frame_size. - If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(), - which then uses default protected frame size for it. */ + // Set the value for server max_output_protected_frame_size. + // If it is 0, we pass NULL to tsi_handshaker_result_create_frame_protector(), + // which then uses default protected frame size for it. config->server_max_output_protected_frame_size = use_default_server_max_output_protected_frame_size ? 0 diff --git a/test/core/tsi/transport_security_test_lib.h b/test/core/tsi/transport_security_test_lib.h index 358b94dbe5c..afaafae9397 100644 --- a/test/core/tsi/transport_security_test_lib.h +++ b/test/core/tsi/transport_security_test_lib.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H_ #define GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H_ @@ -39,31 +39,31 @@ #define TSI_TEST_NUM_OF_COMBINATIONS 128 #define TSI_TEST_UNUSED_BYTES "HELLO GOOGLE" -/* --- tsi_test_fixture object --- - The tests for specific TSI implementations should create their own - custom "subclass" of this fixture, which wraps all information - that will be used to test correctness of TSI handshakes and frame - protect/unprotect operations with respect to TSI implementations. */ +// --- tsi_test_fixture object --- +// The tests for specific TSI implementations should create their own +// custom "subclass" of this fixture, which wraps all information +// that will be used to test correctness of TSI handshakes and frame +// protect/unprotect operations with respect to TSI implementations. typedef struct tsi_test_fixture tsi_test_fixture; -/* --- tsi_test_frame_protector_fixture object --- - The object wraps all necessary information used to test correctness of TSI - frame protector implementations. */ +// --- tsi_test_frame_protector_fixture object --- +// The object wraps all necessary information used to test correctness of TSI +// frame protector implementations. typedef struct tsi_test_frame_protector_fixture tsi_test_frame_protector_fixture; -/* --- tsi_test_frame_protector_config object --- - This object is used to configure different parameters of TSI frame protector - APIs. */ +// --- tsi_test_frame_protector_config object --- +// This object is used to configure different parameters of TSI frame protector +// APIs. typedef struct tsi_test_frame_protector_config tsi_test_frame_protector_config; -/* --- tsi_test_channel object --- - This object represents simulated channels between the client and server - from/to which they could read/write the exchanged information. */ +// --- tsi_test_channel object --- +// This object represents simulated channels between the client and server +// from/to which they could read/write the exchanged information. typedef struct tsi_test_channel tsi_test_channel; -/* V-table for tsi_test_fixture operations that are implemented differently in - different TSI implementations. */ +// V-table for tsi_test_fixture operations that are implemented differently in +// different TSI implementations. typedef struct tsi_test_fixture_vtable { void (*setup_handshakers)(tsi_test_fixture* fixture); void (*check_handshaker_peers)(tsi_test_fixture* fixture); @@ -72,88 +72,88 @@ typedef struct tsi_test_fixture_vtable { struct tsi_test_fixture { const tsi_test_fixture_vtable* vtable; - /* client/server TSI handshaker used to perform TSI handshakes, and will get - instantiated during the call to setup_handshakers. */ + // client/server TSI handshaker used to perform TSI handshakes, and will get + // instantiated during the call to setup_handshakers. tsi_handshaker* client_handshaker; tsi_handshaker* server_handshaker; - /* client/server TSI handshaker results used to store the result of TSI - handshake. If the handshake fails, the result will store NULL upon - finishing the handshake. */ + // client/server TSI handshaker results used to store the result of TSI + // handshake. If the handshake fails, the result will store NULL upon + // finishing the handshake. tsi_handshaker_result* client_result; tsi_handshaker_result* server_result; - /* size of buffer used to store data received from the peer. */ + // size of buffer used to store data received from the peer. size_t handshake_buffer_size; - /* tsi_test_channel instance. */ + // tsi_test_channel instance. tsi_test_channel* channel; - /* tsi_test_frame_protector_config instance */ + // tsi_test_frame_protector_config instance tsi_test_frame_protector_config* config; - /* a flag indicating if client has finished TSI handshake first (i.e., before - server). - The flag should be referred if and only if TSI handshake finishes - successfully. */ + // a flag indicating if client has finished TSI handshake first (i.e., before + // server). + // The flag should be referred if and only if TSI handshake finishes + // successfully. bool has_client_finished_first; - /* a flag indicating whether to test tsi_handshaker_result_get_unused_bytes() - for TSI implementation. This field is true by default, and false - for SSL TSI implementation due to grpc issue #12164 - (https://github.com/grpc/grpc/issues/12164). - */ + // a flag indicating whether to test tsi_handshaker_result_get_unused_bytes() + // for TSI implementation. This field is true by default, and false + // for SSL TSI implementation due to grpc issue #12164 + // (https://github.com/grpc/grpc/issues/12164). + // bool test_unused_bytes; - /* These objects will be used coordinate client/server handshakers with TSI - thread to perform TSI handshakes in an asynchronous manner (for GTS TSI - implementations). - */ + // These objects will be used coordinate client/server handshakers with TSI + // thread to perform TSI handshakes in an asynchronous manner (for GTS TSI + // implementations). + // gpr_cv cv; gpr_mu mu; bool notified; }; struct tsi_test_frame_protector_fixture { - /* client/server TSI frame protectors whose ownership are transferred. */ + // client/server TSI frame protectors whose ownership are transferred. tsi_frame_protector* client_frame_protector; tsi_frame_protector* server_frame_protector; - /* tsi_test_channel instance. */ + // tsi_test_channel instance. tsi_test_channel* channel; - /* tsi_test_frame_protector_config instance */ + // tsi_test_frame_protector_config instance tsi_test_frame_protector_config* config; }; struct tsi_test_channel { - /* simulated channels between client and server. If the server (client) - wants to send data to the client (server), he will write data to - client_channel (server_channel), which will be read by client (server). */ + // simulated channels between client and server. If the server (client) + // wants to send data to the client (server), he will write data to + // client_channel (server_channel), which will be read by client (server). uint8_t* client_channel; uint8_t* server_channel; - /* size of data written to the client/server channel. */ + // size of data written to the client/server channel. size_t bytes_written_to_client_channel; size_t bytes_written_to_server_channel; - /* size of data read from the client/server channel */ + // size of data read from the client/server channel size_t bytes_read_from_client_channel; size_t bytes_read_from_server_channel; }; struct tsi_test_frame_protector_config { - /* size of buffer used to store protected frames to be unprotected. */ + // size of buffer used to store protected frames to be unprotected. size_t read_buffer_allocated_size; - /* size of buffer used to store bytes resulted from unprotect operations. */ + // size of buffer used to store bytes resulted from unprotect operations. size_t message_buffer_allocated_size; - /* size of buffer used to store frames resulted from protect operations. */ + // size of buffer used to store frames resulted from protect operations. size_t protected_buffer_size; - /* size of client/server maximum frame size. */ + // size of client/server maximum frame size. size_t client_max_output_protected_frame_size; size_t server_max_output_protected_frame_size; - /* pointer that points to client/server message to be protected. */ + // pointer that points to client/server message to be protected. uint8_t* client_message; uint8_t* server_message; - /* size of client/server message. */ + // size of client/server message. size_t client_message_size; size_t server_message_size; }; -/* This method creates a tsi_test_frame_protector_config instance. Each - parameter of this function is a boolean value indicating whether to set the - corresponding parameter with a default value or not. If it's false, it will - be set with a specific value which is usually much smaller than the default. - Both values are defined with #define directive. */ +// This method creates a tsi_test_frame_protector_config instance. Each +// parameter of this function is a boolean value indicating whether to set the +// corresponding parameter with a default value or not. If it's false, it will +// be set with a specific value which is usually much smaller than the default. +// Both values are defined with #define directive. tsi_test_frame_protector_config* tsi_test_frame_protector_config_create( bool use_default_read_buffer_allocated_size, bool use_default_message_buffer_allocated_size, @@ -162,69 +162,69 @@ tsi_test_frame_protector_config* tsi_test_frame_protector_config_create( bool use_default_client_max_output_protected_frame_size, bool use_default_server_max_output_protected_frame_size); -/* This method sets different buffer and frame sizes of a - tsi_test_frame_protector_config instance with user provided values. */ +// This method sets different buffer and frame sizes of a +// tsi_test_frame_protector_config instance with user provided values. void tsi_test_frame_protector_config_set_buffer_size( tsi_test_frame_protector_config* config, size_t read_buffer_allocated_size, size_t message_buffer_allocated_size, size_t protected_buffer_size, size_t client_max_output_protected_frame_size, size_t server_max_output_protected_frame_size); -/* This method destroys a tsi_test_frame_protector_config instance. */ +// This method destroys a tsi_test_frame_protector_config instance. void tsi_test_frame_protector_config_destroy( tsi_test_frame_protector_config* config); -/* This method initializes members of tsi_test_fixture instance. - Note that the struct instance should be allocated before making - this call. */ +// This method initializes members of tsi_test_fixture instance. +// Note that the struct instance should be allocated before making +// this call. void tsi_test_fixture_init(tsi_test_fixture* fixture); -/* This method destroys a tsi_test_fixture instance. Note that the - fixture intance must be dynamically allocated and will be freed by - this function. */ +// This method destroys a tsi_test_fixture instance. Note that the +// fixture intance must be dynamically allocated and will be freed by +// this function. void tsi_test_fixture_destroy(tsi_test_fixture* fixture); -/* This method creates a tsi_test_frame_protector_fixture instance. */ +// This method creates a tsi_test_frame_protector_fixture instance. tsi_test_frame_protector_fixture* tsi_test_frame_protector_fixture_create(); -/* This method initializes members of tsi_test_frame_protector_fixture instance. - Note that the struct instance should be allocated before making - this call. */ +// This method initializes members of tsi_test_frame_protector_fixture instance. +// Note that the struct instance should be allocated before making +// this call. void tsi_test_frame_protector_fixture_init( tsi_test_frame_protector_fixture* fixture, tsi_frame_protector* client_frame_protector, tsi_frame_protector* server_frame_protector); -/* This method destroys a tsi_test_frame_protector_fixture instance. Note that - the fixture intance must be dynamically allocated and will be freed by this - function. */ +// This method destroys a tsi_test_frame_protector_fixture instance. Note that +// the fixture intance must be dynamically allocated and will be freed by this +// function. void tsi_test_frame_protector_fixture_destroy( tsi_test_frame_protector_fixture* fixture); -/* This method performs a protect opeation on raw data and sends the result to - peer. */ +// This method performs a protect opeation on raw data and sends the result to +// peer. void tsi_test_frame_protector_send_message_to_peer( tsi_test_frame_protector_config* config, tsi_test_channel* channel, tsi_frame_protector* protector, bool is_client); -/* This method receives message from peer and unprotects it. */ +// This method receives message from peer and unprotects it. void tsi_test_frame_protector_receive_message_from_peer( tsi_test_frame_protector_config* config, tsi_test_channel* channel, tsi_frame_protector* protector, unsigned char* message, size_t* bytes_received, bool is_client); -/* This method performs a full TSI handshake between a client and a server. - Note that the test library will implement the new TSI handshaker API to - perform handshakes. */ +// This method performs a full TSI handshake between a client and a server. +// Note that the test library will implement the new TSI handshaker API to +// perform handshakes. void tsi_test_do_handshake(tsi_test_fixture* fixture); -/* This method performs a round trip test between the client and the server. - That is, the client sends a protected message to a server who receives the - message, and unprotects it. The same operation is triggered again with - the client and server switching its role. */ +// This method performs a round trip test between the client and the server. +// That is, the client sends a protected message to a server who receives the +// message, and unprotects it. The same operation is triggered again with +// the client and server switching its role. void tsi_test_do_round_trip(tsi_test_fixture* fixture); -/* This method performs the above round trip test without doing handshakes. */ +// This method performs the above round trip test without doing handshakes. void tsi_test_frame_protector_do_round_trip_no_handshake( tsi_test_frame_protector_fixture* fixture); diff --git a/test/core/uri/uri_fuzzer_test.cc b/test/core/uri/uri_fuzzer_test.cc index a2975be05cd..0220c20b700 100644 --- a/test/core/uri/uri_fuzzer_test.cc +++ b/test/core/uri/uri_fuzzer_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/core/util/cmdline.cc b/test/core/util/cmdline.cc index 7c09f41b275..c1e34992af5 100644 --- a/test/core/util/cmdline.cc +++ b/test/core/util/cmdline.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/cmdline.h" @@ -129,9 +129,9 @@ void gpr_cmdline_on_extra_arg( cl->extra_arg_help = help; } -/* recursively descend argument list, adding the last element - to s first - so that arguments are added in the order they were - added to the list by api calls */ +// recursively descend argument list, adding the last element +// to s first - so that arguments are added in the order they were +// added to the list by api calls static void add_args_to_usage(arg* a, std::vector* s) { if (a == nullptr) return; add_args_to_usage(a->next, s); @@ -251,7 +251,7 @@ static int normal_state(gpr_cmdline* cl, char* str) { if (str[0] == '-') { if (str[1] == '-') { if (str[2] == 0) { - /* handle '--' to move to just extra args */ + // handle '--' to move to just extra args cl->state = extra_state; return 1; } @@ -259,9 +259,9 @@ static int normal_state(gpr_cmdline* cl, char* str) { } else { str += 1; } - /* first byte of str is now past the leading '-' or '--' */ + // first byte of str is now past the leading '-' or '--' if (str[0] == 'n' && str[1] == 'o' && str[2] == '-') { - /* str is of the form '--no-foo' - it's a flag disable */ + // str is of the form '--no-foo' - it's a flag disable str += 3; cl->cur_arg = find_arg(cl, str); if (cl->cur_arg == nullptr) { @@ -272,11 +272,11 @@ static int normal_state(gpr_cmdline* cl, char* str) { return print_usage_and_die(cl); } *static_cast(cl->cur_arg->value) = 0; - return 1; /* early out */ + return 1; // early out } eq = strchr(str, '='); if (eq != nullptr) { - /* copy the string into a temp buffer and extract the name */ + // copy the string into a temp buffer and extract the name tmp = arg_name = static_cast(gpr_malloc(static_cast(eq - str + 1))); memcpy(arg_name, str, static_cast(eq - str)); @@ -289,13 +289,13 @@ static int normal_state(gpr_cmdline* cl, char* str) { return print_usage_and_die(cl); } if (eq != nullptr) { - /* str was of the type --foo=value, parse the value */ + // str was of the type --foo=value, parse the value r = value_state(cl, eq + 1); } else if (cl->cur_arg->type != ARGTYPE_BOOL) { - /* flag types don't have a '--foo value' variant, other types do */ + // flag types don't have a '--foo value' variant, other types do cl->state = value_state; } else { - /* flag parameter: just set the value */ + // flag parameter: just set the value *static_cast(cl->cur_arg->value) = 1; } } else { diff --git a/test/core/util/cmdline.h b/test/core/util/cmdline.h index 773563dcbe9..1771d7cb8af 100644 --- a/test/core/util/cmdline.h +++ b/test/core/util/cmdline.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_CMDLINE_H #define GRPC_TEST_CORE_UTIL_CMDLINE_H @@ -23,60 +23,60 @@ #include -/** Simple command line parser. +/// Simple command line parser. - Supports flags that can be specified as -foo, --foo, --no-foo, -no-foo, etc - And integers, strings that can be specified as -foo=4, -foo blah, etc +/// Supports flags that can be specified as -foo, --foo, --no-foo, -no-foo, etc +/// And integers, strings that can be specified as -foo=4, -foo blah, etc - No support for short command line options (but we may get that in the - future.) +/// No support for short command line options (but we may get that in the +/// future.) - Usage (for a program with a single flag argument 'foo'): +/// Usage (for a program with a single flag argument 'foo'): - int main(int argc, char **argv) { - gpr_cmdline *cl; - int verbose = 0; +/// int main(int argc, char **argv) { +/// gpr_cmdline *cl; +/// int verbose = 0; - cl = gpr_cmdline_create("My cool tool"); - gpr_cmdline_add_int(cl, "verbose", "Produce verbose output?", &verbose); - gpr_cmdline_parse(cl, argc, argv); - gpr_cmdline_destroy(cl); +/// cl = gpr_cmdline_create("My cool tool"); +/// gpr_cmdline_add_int(cl, "verbose", "Produce verbose output?", &verbose); +/// gpr_cmdline_parse(cl, argc, argv); +/// gpr_cmdline_destroy(cl); - if (verbose) { - gpr_log(GPR_INFO, "Goodbye cruel world!"); - } +/// if (verbose) { +/// gpr_log(GPR_INFO, "Goodbye cruel world!"); +/// } - return 0; - } */ +/// return 0; +///} typedef struct gpr_cmdline gpr_cmdline; -/** Construct a command line parser: takes a short description of the tool - doing the parsing */ +/// Construct a command line parser: takes a short description of the tool +/// doing the parsing gpr_cmdline* gpr_cmdline_create(const char* description); -/** Add an integer parameter, with a name (used on the command line) and some - helpful text (used in the command usage) */ +/// Add an integer parameter, with a name (used on the command line) and some +/// helpful text (used in the command usage) void gpr_cmdline_add_int(gpr_cmdline* cl, const char* name, const char* help, int* value); -/** The same, for a boolean flag */ +/// The same, for a boolean flag void gpr_cmdline_add_flag(gpr_cmdline* cl, const char* name, const char* help, int* value); -/** And for a string */ +/// And for a string void gpr_cmdline_add_string(gpr_cmdline* cl, const char* name, const char* help, const char** value); -/** Set a callback for non-named arguments */ +/// Set a callback for non-named arguments void gpr_cmdline_on_extra_arg( gpr_cmdline* cl, const char* name, const char* help, void (*on_extra_arg)(void* user_data, const char* arg), void* user_data); -/** Enable surviving failure: default behavior is to exit the process */ +/// Enable surviving failure: default behavior is to exit the process void gpr_cmdline_set_survive_failure(gpr_cmdline* cl); -/** Parse the command line; returns 1 on success, on failure either dies - (by default) or returns 0 if gpr_cmdline_set_survive_failure() has been - called */ +/// Parse the command line; returns 1 on success, on failure either dies +///(by default) or returns 0 if gpr_cmdline_set_survive_failure() has been +/// called int gpr_cmdline_parse(gpr_cmdline* cl, int argc, char** argv); -/** Destroy the parser */ +/// Destroy the parser void gpr_cmdline_destroy(gpr_cmdline* cl); -/** Get a string describing usage */ +/// Get a string describing usage std::string gpr_cmdline_usage_string(gpr_cmdline* cl, const char* argv0); -#endif /* GRPC_TEST_CORE_UTIL_CMDLINE_H */ +#endif // GRPC_TEST_CORE_UTIL_CMDLINE_H diff --git a/test/core/util/cmdline_test.cc b/test/core/util/cmdline_test.cc index cae61d3390d..ddc5c123403 100644 --- a/test/core/util/cmdline_test.cc +++ b/test/core/util/cmdline_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/cmdline.h" diff --git a/test/core/util/fuzzer_corpus_test.cc b/test/core/util/fuzzer_corpus_test.cc index b3d4609fc37..f1e831765ef 100644 --- a/test/core/util/fuzzer_corpus_test.cc +++ b/test/core/util/fuzzer_corpus_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/core/util/fuzzer_util.cc b/test/core/util/fuzzer_util.cc index 432f46124fb..33ac5866352 100644 --- a/test/core/util/fuzzer_util.cc +++ b/test/core/util/fuzzer_util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/core/util/fuzzer_util.h" diff --git a/test/core/util/fuzzer_util.h b/test/core/util/fuzzer_util.h index 0e938399a1f..2332a2ab0d5 100644 --- a/test/core/util/fuzzer_util.h +++ b/test/core/util/fuzzer_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_FUZZER_UTIL_H #define GRPC_TEST_CORE_UTIL_FUZZER_UTIL_H @@ -46,4 +46,4 @@ uint32_t grpc_fuzzer_get_next_uint32(input_stream* inp); } // namespace testing } // namespace grpc_core -#endif /* GRPC_TEST_CORE_UTIL_FUZZER_UTIL_H */ +#endif // GRPC_TEST_CORE_UTIL_FUZZER_UTIL_H diff --git a/test/core/util/grpc_profiler.cc b/test/core/util/grpc_profiler.cc index 88f233598b3..56aa628b05f 100644 --- a/test/core/util/grpc_profiler.cc +++ b/test/core/util/grpc_profiler.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/grpc_profiler.h" diff --git a/test/core/util/grpc_profiler.h b/test/core/util/grpc_profiler.h index f9ddd2242e8..c5d6a1ecbf2 100644 --- a/test/core/util/grpc_profiler.h +++ b/test/core/util/grpc_profiler.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H #define GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H @@ -22,4 +22,4 @@ void grpc_profiler_start(const char* filename); void grpc_profiler_stop(); -#endif /* GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H */ +#endif // GRPC_TEST_CORE_UTIL_GRPC_PROFILER_H diff --git a/test/core/util/histogram.cc b/test/core/util/histogram.cc index 8be862eb0fd..b02cde8ea5a 100644 --- a/test/core/util/histogram.cc +++ b/test/core/util/histogram.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -28,39 +28,39 @@ #include "src/core/lib/gpr/useful.h" -/* Histograms are stored with exponentially increasing bucket sizes. - The first bucket is [0, m) where m = 1 + resolution - Bucket n (n>=1) contains [m**n, m**(n+1)) - There are sufficient buckets to reach max_bucket_start */ +// Histograms are stored with exponentially increasing bucket sizes. +// The first bucket is [0, m) where m = 1 + resolution +// Bucket n (n>=1) contains [m**n, m**(n+1)) +// There are sufficient buckets to reach max_bucket_start struct grpc_histogram { - /* Sum of all values seen so far */ + // Sum of all values seen so far double sum; - /* Sum of squares of all values seen so far */ + // Sum of squares of all values seen so far double sum_of_squares; - /* number of values seen so far */ + // number of values seen so far double count; - /* m in the description */ + // m in the description double multiplier; double one_on_log_multiplier; - /* minimum value seen */ + // minimum value seen double min_seen; - /* maximum value seen */ + // maximum value seen double max_seen; - /* maximum representable value */ + // maximum representable value double max_possible; - /* number of buckets */ + // number of buckets size_t num_buckets; - /* the buckets themselves */ + // the buckets themselves uint32_t* buckets; }; -/* determine a bucket index given a value - does no bounds checking */ +// determine a bucket index given a value - does no bounds checking static size_t bucket_for_unchecked(grpc_histogram* h, double x) { return static_cast(log(x) * h->one_on_log_multiplier); } -/* bounds checked version of the above */ +// bounds checked version of the above static size_t bucket_for(grpc_histogram* h, double x) { size_t bucket = bucket_for_unchecked(h, grpc_core::Clamp(x, 1.0, h->max_possible)); @@ -68,7 +68,7 @@ static size_t bucket_for(grpc_histogram* h, double x) { return bucket; } -/* at what value does a bucket start? */ +// at what value does a bucket start? static double bucket_start(grpc_histogram* h, double x) { return pow(h->multiplier, x); } @@ -116,7 +116,7 @@ void grpc_histogram_add(grpc_histogram* h, double x) { int grpc_histogram_merge(grpc_histogram* dst, const grpc_histogram* src) { if ((dst->num_buckets != src->num_buckets) || (dst->multiplier != src->multiplier)) { - /* Fail because these histograms don't match */ + // Fail because these histograms don't match return 0; } grpc_histogram_merge_contents(dst, src->buckets, src->num_buckets, @@ -163,7 +163,7 @@ static double threshold_for_count_below(grpc_histogram* h, double count_below) { return h->max_seen; } - /* find the lowest bucket that gets us above count_below */ + // find the lowest bucket that gets us above count_below count_so_far = 0.0; for (lower_idx = 0; lower_idx < h->num_buckets; lower_idx++) { count_so_far += h->buckets[lower_idx]; @@ -172,8 +172,8 @@ static double threshold_for_count_below(grpc_histogram* h, double count_below) { } } if (count_so_far == count_below) { - /* this bucket hits the threshold exactly... we should be midway through - any run of zero values following the bucket */ + // this bucket hits the threshold exactly... we should be midway through + // any run of zero values following the bucket for (upper_idx = lower_idx + 1; upper_idx < h->num_buckets; upper_idx++) { if (h->buckets[upper_idx]) { break; @@ -183,8 +183,8 @@ static double threshold_for_count_below(grpc_histogram* h, double count_below) { bucket_start(h, static_cast(upper_idx))) / 2.0; } else { - /* treat values as uniform throughout the bucket, and find where this value - should lie */ + // treat values as uniform throughout the bucket, and find where this value + // should lie lower_bound = bucket_start(h, static_cast(lower_idx)); upper_bound = bucket_start(h, static_cast(lower_idx + 1)); return grpc_core::Clamp(upper_bound - (upper_bound - lower_bound) * diff --git a/test/core/util/histogram.h b/test/core/util/histogram.h index 0c7283f5930..0ddb04ae2c7 100644 --- a/test/core/util/histogram.h +++ b/test/core/util/histogram.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_SUPPORT_HISTOGRAM_H #define GRPC_SUPPORT_HISTOGRAM_H @@ -35,9 +35,9 @@ grpc_histogram* grpc_histogram_create(double resolution, void grpc_histogram_destroy(grpc_histogram* h); void grpc_histogram_add(grpc_histogram* h, double x); -/** The following merges the second histogram into the first. It only works - if they have the same buckets and resolution. Returns 0 on failure, 1 - on success */ +/// The following merges the second histogram into the first. It only works +/// if they have the same buckets and resolution. Returns 0 on failure, 1 +/// on success int grpc_histogram_merge(grpc_histogram* dst, const grpc_histogram* src); double grpc_histogram_percentile(grpc_histogram* histogram, double percentile); @@ -61,4 +61,4 @@ void grpc_histogram_merge_contents(grpc_histogram* histogram, } #endif -#endif /* GRPC_SUPPORT_HISTOGRAM_H */ +#endif // GRPC_SUPPORT_HISTOGRAM_H diff --git a/test/core/util/histogram_test.cc b/test/core/util/histogram_test.cc index f5cce02cebe..6ffe5b9a223 100644 --- a/test/core/util/histogram_test.cc +++ b/test/core/util/histogram_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/histogram.h" @@ -88,7 +88,7 @@ TEST(HistogramTest, Percentile) { expect_percentile(h, 100, 8, 8); expect_percentile(h, 110, 8, 8); - /* test monotonicity */ + // test monotonicity last = 0.0; for (i = 0; i < 100.0; i += 0.01) { cur = grpc_histogram_percentile(h, i); @@ -145,7 +145,7 @@ TEST(HistogramTest, Merge) { ASSERT_EQ(grpc_histogram_sum_of_squares(h1), 431.5); ASSERT_EQ(grpc_histogram_mean(h1), 6.0); - /* test monotonicity */ + // test monotonicity last = 0.0; for (i = 0; i < 100.0; i += 0.01) { cur = grpc_histogram_percentile(h1, i); diff --git a/test/core/util/mock_endpoint.cc b/test/core/util/mock_endpoint.cc index 629563bfe3b..44e48f4937f 100644 --- a/test/core/util/mock_endpoint.cc +++ b/test/core/util/mock_endpoint.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/core/util/mock_endpoint.h" diff --git a/test/core/util/mock_endpoint.h b/test/core/util/mock_endpoint.h index 57dc1a06140..33635a23ccd 100644 --- a/test/core/util/mock_endpoint.h +++ b/test/core/util/mock_endpoint.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef MOCK_ENDPOINT_H #define MOCK_ENDPOINT_H diff --git a/test/core/util/parse_hexstring.cc b/test/core/util/parse_hexstring.cc index 44eb25eaf5f..66b135acd26 100644 --- a/test/core/util/parse_hexstring.cc +++ b/test/core/util/parse_hexstring.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/parse_hexstring.h" diff --git a/test/core/util/parse_hexstring.h b/test/core/util/parse_hexstring.h index b7d54c1711e..b34257868ae 100644 --- a/test/core/util/parse_hexstring.h +++ b/test/core/util/parse_hexstring.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H #define GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H @@ -23,4 +23,4 @@ grpc_slice parse_hexstring(const char* hexstring); -#endif /* GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H */ +#endif // GRPC_TEST_CORE_UTIL_PARSE_HEXSTRING_H diff --git a/test/core/util/passthru_endpoint.cc b/test/core/util/passthru_endpoint.cc index 7fde1a56efc..31c4ecd2ab6 100644 --- a/test/core/util/passthru_endpoint.cc +++ b/test/core/util/passthru_endpoint.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/core/util/passthru_endpoint.h" diff --git a/test/core/util/passthru_endpoint.h b/test/core/util/passthru_endpoint.h index 44ddb227e0f..42d5bce910f 100644 --- a/test/core/util/passthru_endpoint.h +++ b/test/core/util/passthru_endpoint.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef PASSTHRU_ENDPOINT_H #define PASSTHRU_ENDPOINT_H @@ -28,9 +28,9 @@ #include "src/core/lib/iomgr/endpoint.h" -/* The struct is refcounted, always use grpc_passthru_endpoint_stats_create and - * grpc_passthru_endpoint_stats_destroy, rather then embedding it in your - * objects by value. */ +// The struct is refcounted, always use grpc_passthru_endpoint_stats_create and +// grpc_passthru_endpoint_stats_destroy, rather then embedding it in your +// objects by value. typedef struct { gpr_refcount refs; gpr_atm num_writes; diff --git a/test/core/util/port.cc b/test/core/util/port.cc index a91ee8cbf78..b5665427caf 100644 --- a/test/core/util/port.cc +++ b/test/core/util/port.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/iomgr/port.h" @@ -48,8 +48,8 @@ static int free_chosen_port_locked(int port) { size_t i; int found = 0; size_t found_at = 0; - /* Find the port and erase it from the list, then tell the server it can be - freed. */ + // Find the port and erase it from the list, then tell the server it can be + // freed. for (i = 0; i < num_chosen_ports; i++) { if (chosen_ports[i] == port) { GPR_ASSERT(found == 0); @@ -139,4 +139,4 @@ void grpc_set_pick_port_functions(grpc_pick_port_functions functions) { g_pick_port_functions = functions; } -#endif /* GRPC_TEST_PICK_PORT */ +#endif // GRPC_TEST_PICK_PORT diff --git a/test/core/util/port.h b/test/core/util/port.h index 3a4cf4467a3..00a0f310234 100644 --- a/test/core/util/port.h +++ b/test/core/util/port.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_PORT_H #define GRPC_TEST_CORE_UTIL_PORT_H @@ -25,20 +25,20 @@ typedef struct grpc_pick_port_functions { void (*recycle_unused_port_fn)(int port); } grpc_pick_port_functions; -/* pick a port number that is currently unused by either tcp or udp. return - 0 on failure. */ +// pick a port number that is currently unused by either tcp or udp. return +// 0 on failure. int grpc_pick_unused_port(void); -/* pick a port number that is currently unused by either tcp or udp. abort - on failure. */ +// pick a port number that is currently unused by either tcp or udp. abort +// on failure. int grpc_pick_unused_port_or_die(void); -/* Return a port which was previously returned by grpc_pick_unused_port(). - * Implementations of grpc_pick_unused_port() backed by a portserver may limit - * the total number of ports available; this lets a binary return its allocated - * ports back to the server if it is going to allocate a large number. */ +// Return a port which was previously returned by grpc_pick_unused_port(). +// Implementations of grpc_pick_unused_port() backed by a portserver may limit +// the total number of ports available; this lets a binary return its allocated +// ports back to the server if it is going to allocate a large number. void grpc_recycle_unused_port(int port); -/** Request the family of pick_port functions in \a functions be used. */ +/// Request the family of pick_port functions in \a functions be used. void grpc_set_pick_port_functions(grpc_pick_port_functions functions); -#endif /* GRPC_TEST_CORE_UTIL_PORT_H */ +#endif // GRPC_TEST_CORE_UTIL_PORT_H diff --git a/test/core/util/port_isolated_runtime_environment.cc b/test/core/util/port_isolated_runtime_environment.cc index 404edc97c1a..6d9c13bbcbf 100644 --- a/test/core/util/port_isolated_runtime_environment.cc +++ b/test/core/util/port_isolated_runtime_environment.cc @@ -1,27 +1,27 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #if defined(GRPC_PORT_ISOLATED_RUNTIME) -/* When individual tests run in an isolated runtime environment (e.g. each test - * runs in a separate container) the framework takes a round-robin pick of a - * port within certain range. There is no need to recycle ports. - */ +// When individual tests run in an isolated runtime environment (e.g. each test +// runs in a separate container) the framework takes a round-robin pick of a +// port within certain range. There is no need to recycle ports. +// #include #include @@ -68,4 +68,4 @@ int grpc_pick_unused_port_or_die(void) { void grpc_recycle_unused_port(int port) { (void)port; } -#endif /* GRPC_PORT_ISOLATED_RUNTIME */ +#endif // GRPC_PORT_ISOLATED_RUNTIME diff --git a/test/core/util/port_server_client.cc b/test/core/util/port_server_client.cc index 894054f9fa4..905814c2374 100644 --- a/test/core/util/port_server_client.cc +++ b/test/core/util/port_server_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/core/util/port_server_client.h b/test/core/util/port_server_client.h index 86dd7018ffd..97865ba6e77 100644 --- a/test/core/util/port_server_client.h +++ b/test/core/util/port_server_client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_PORT_SERVER_CLIENT_H #define GRPC_TEST_CORE_UTIL_PORT_SERVER_CLIENT_H diff --git a/test/core/util/reconnect_server.cc b/test/core/util/reconnect_server.cc index d83c329d239..479ee8d4eea 100644 --- a/test/core/util/reconnect_server.cc +++ b/test/core/util/reconnect_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/reconnect_server.h" diff --git a/test/core/util/reconnect_server.h b/test/core/util/reconnect_server.h index 34b47f00025..603ad17a523 100644 --- a/test/core/util/reconnect_server.h +++ b/test/core/util/reconnect_server.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H #define GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H @@ -44,4 +44,4 @@ void reconnect_server_poll(reconnect_server* server, int seconds); void reconnect_server_destroy(reconnect_server* server); void reconnect_server_clear_timestamps(reconnect_server* server); -#endif /* GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H */ +#endif // GRPC_TEST_CORE_UTIL_RECONNECT_SERVER_H diff --git a/test/core/util/slice_splitter.cc b/test/core/util/slice_splitter.cc index 474967c2dba..d7426f3d7a5 100644 --- a/test/core/util/slice_splitter.cc +++ b/test/core/util/slice_splitter.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/slice_splitter.h" @@ -97,7 +97,7 @@ void grpc_split_slices_to_buffer(grpc_slice_split_mode mode, size_t i; grpc_split_slices(mode, src_slices, src_slice_count, &slices, &nslices); for (i = 0; i < nslices; i++) { - /* add indexed to avoid re-merging split slices */ + // add indexed to avoid re-merging split slices grpc_slice_buffer_add_indexed(dst, slices[i]); } gpr_free(slices); diff --git a/test/core/util/slice_splitter.h b/test/core/util/slice_splitter.h index 27472cecd79..7b4d20ef398 100644 --- a/test/core/util/slice_splitter.h +++ b/test/core/util/slice_splitter.h @@ -1,42 +1,42 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H #define GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H -/* utility function to split/merge slices together to help create test - cases */ +// utility function to split/merge slices together to help create test +// cases #include #include typedef enum { - /* merge all input slices into a single slice */ + // merge all input slices into a single slice GRPC_SLICE_SPLIT_MERGE_ALL, - /* leave slices as is */ + // leave slices as is GRPC_SLICE_SPLIT_IDENTITY, - /* split slices into one byte chunks */ + // split slices into one byte chunks GRPC_SLICE_SPLIT_ONE_BYTE } grpc_slice_split_mode; -/* allocates *dst_slices; caller must unref all slices in dst_slices then free - it */ +// allocates *dst_slices; caller must unref all slices in dst_slices then free +// it void grpc_split_slices(grpc_slice_split_mode mode, grpc_slice* src_slices, size_t src_slice_count, grpc_slice** dst_slices, size_t* dst_slice_count); @@ -51,4 +51,4 @@ grpc_slice grpc_slice_merge(grpc_slice* slices, size_t nslices); const char* grpc_slice_split_mode_name(grpc_slice_split_mode mode); -#endif /* GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H */ +#endif // GRPC_TEST_CORE_UTIL_SLICE_SPLITTER_H diff --git a/test/core/util/stack_tracer.cc b/test/core/util/stack_tracer.cc index 4aa8330abe7..4ae0218f28d 100644 --- a/test/core/util/stack_tracer.cc +++ b/test/core/util/stack_tracer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 the 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. - * - */ +// +// +// Copyright 2020 the 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 diff --git a/test/core/util/stack_tracer.h b/test/core/util/stack_tracer.h index 6b3b92ec4cf..9f15c6dee1b 100644 --- a/test/core/util/stack_tracer.h +++ b/test/core/util/stack_tracer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 the 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. - * - */ +// +// +// Copyright 2020 the 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_EXAMINE_STACK_H #define GRPC_TEST_CORE_UTIL_EXAMINE_STACK_H @@ -45,4 +45,4 @@ void InitializeStackTracer(const char* argv0); } // namespace testing } // namespace grpc_core -#endif /* GRPC_TEST_CORE_UTIL_EXAMINE_STACK_H */ +#endif // GRPC_TEST_CORE_UTIL_EXAMINE_STACK_H diff --git a/test/core/util/stack_tracer_test.cc b/test/core/util/stack_tracer_test.cc index bdc1dc205f9..141b551cb5b 100644 --- a/test/core/util/stack_tracer_test.cc +++ b/test/core/util/stack_tracer_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 the 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. - * - */ +// +// +// Copyright 2020 the 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 "test/core/util/stack_tracer.h" diff --git a/test/core/util/subprocess.h b/test/core/util/subprocess.h index 5e52d6abad7..a46be258516 100644 --- a/test/core/util/subprocess.h +++ b/test/core/util/subprocess.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_SUBPROCESS_H #define GRPC_TEST_CORE_UTIL_SUBPROCESS_H @@ -23,15 +23,15 @@ typedef struct gpr_subprocess gpr_subprocess; -/** .exe on windows, empty on unices */ +/// .exe on windows, empty on unices const char* gpr_subprocess_binary_extension(); gpr_subprocess* gpr_subprocess_create(int argc, const char** argv); -/** if subprocess has not been joined, kill it */ +/// if subprocess has not been joined, kill it void gpr_subprocess_destroy(gpr_subprocess* p); -/** returns exit status; can be called at most once */ +/// returns exit status; can be called at most once int gpr_subprocess_join(gpr_subprocess* p); void gpr_subprocess_interrupt(gpr_subprocess* p); int gpr_subprocess_get_process_id(gpr_subprocess* p); -#endif /* GRPC_TEST_CORE_UTIL_SUBPROCESS_H */ +#endif // GRPC_TEST_CORE_UTIL_SUBPROCESS_H diff --git a/test/core/util/subprocess_posix.cc b/test/core/util/subprocess_posix.cc index 007046e132d..1b97df0d26d 100644 --- a/test/core/util/subprocess_posix.cc +++ b/test/core/util/subprocess_posix.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 @@ -56,7 +56,7 @@ gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) { memcpy(exec_args, argv, static_cast(argc) * sizeof(char*)); exec_args[argc] = nullptr; execv(exec_args[0], exec_args); - /* if we reach here, an error has occurred */ + // if we reach here, an error has occurred gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], grpc_core::StrError(errno).c_str()); _exit(1); @@ -98,4 +98,4 @@ void gpr_subprocess_interrupt(gpr_subprocess* p) { int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pid; } -#endif /* GPR_POSIX_SUBPROCESS */ +#endif // GPR_POSIX_SUBPROCESS diff --git a/test/core/util/subprocess_windows.cc b/test/core/util/subprocess_windows.cc index 7cf55f15351..7a474afa808 100644 --- a/test/core/util/subprocess_windows.cc +++ b/test/core/util/subprocess_windows.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 @@ -126,4 +126,4 @@ int gpr_subprocess_get_process_id(gpr_subprocess* p) { return p->pi.dwProcessId; } -#endif /* GPR_WINDOWS_SUBPROCESS */ +#endif // GPR_WINDOWS_SUBPROCESS diff --git a/test/core/util/test_config.cc b/test/core/util/test_config.cc index 07f1d7ec4c4..366ddc69f3a 100644 --- a/test/core/util/test_config.cc +++ b/test/core/util/test_config.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/test_config.h" @@ -132,8 +132,8 @@ void grpc_test_init(int* argc, char** argv) { ", poller=%" PRId64 ", total=%" PRId64, grpc_test_sanitizer_slowdown_factor(), g_fixture_slowdown_factor, g_poller_slowdown_factor, grpc_test_slowdown_factor()); - /* seed rng with pid, so we don't end up with the same random numbers as a - concurrently running test binary */ + // seed rng with pid, so we don't end up with the same random numbers as a + // concurrently running test binary srand(seed()); } diff --git a/test/core/util/test_config.h b/test/core/util/test_config.h index 096f5f60d7b..f28924e6131 100644 --- a/test/core/util/test_config.h +++ b/test/core/util/test_config.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_TEST_CONFIG_H #define GRPC_TEST_CORE_UTIL_TEST_CONFIG_H @@ -26,13 +26,13 @@ extern int64_t g_fixture_slowdown_factor; extern int64_t g_poller_slowdown_factor; -/* Returns an appropriate scaling factor for timeouts. */ +// Returns an appropriate scaling factor for timeouts. int64_t grpc_test_slowdown_factor(); -/* Converts a given timeout (in seconds) to a deadline. */ +// Converts a given timeout (in seconds) to a deadline. gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s); -/* Converts a given timeout (in milliseconds) to a deadline. */ +// Converts a given timeout (in milliseconds) to a deadline. gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms); #if !defined(GRPC_TEST_CUSTOM_PICK_PORT) && !defined(GRPC_PORT_ISOLATED_RUNTIME) @@ -69,4 +69,4 @@ class TestGrpcScope { } // namespace testing } // namespace grpc -#endif /* GRPC_TEST_CORE_UTIL_TEST_CONFIG_H */ +#endif // GRPC_TEST_CORE_UTIL_TEST_CONFIG_H diff --git a/test/core/util/test_tcp_server.cc b/test/core/util/test_tcp_server.cc index e01e1ff9f8c..986065cbe01 100644 --- a/test/core/util/test_tcp_server.cc +++ b/test/core/util/test_tcp_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/core/util/test_tcp_server.h" diff --git a/test/core/util/test_tcp_server.h b/test/core/util/test_tcp_server.h index 7c60823256f..613d4d8f8ba 100644 --- a/test/core/util/test_tcp_server.h +++ b/test/core/util/test_tcp_server.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_TEST_TCP_SERVER_H #define GRPC_TEST_CORE_UTIL_TEST_TCP_SERVER_H @@ -47,4 +47,4 @@ void test_tcp_server_start(test_tcp_server* server, int port); void test_tcp_server_poll(test_tcp_server* server, int milliseconds); void test_tcp_server_destroy(test_tcp_server* server); -#endif /* GRPC_TEST_CORE_UTIL_TEST_TCP_SERVER_H */ +#endif // GRPC_TEST_CORE_UTIL_TEST_TCP_SERVER_H diff --git a/test/core/util/tracer_util.cc b/test/core/util/tracer_util.cc index 4a967ca9e49..9ca14a3adc0 100644 --- a/test/core/util/tracer_util.cc +++ b/test/core/util/tracer_util.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/core/lib/debug/trace.h" diff --git a/test/core/util/tracer_util.h b/test/core/util/tracer_util.h index 7f9aa151edf..a4b1aa5c89f 100644 --- a/test/core/util/tracer_util.h +++ b/test/core/util/tracer_util.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CORE_UTIL_TRACER_UTIL_H #define GRPC_TEST_CORE_UTIL_TRACER_UTIL_H @@ -29,4 +29,4 @@ void grpc_tracer_enable_flag(TraceFlag* flag); } // namespace testing } // namespace grpc_core -#endif /* GRPC_TEST_CORE_UTIL_TRACER_UTIL_H */ +#endif // GRPC_TEST_CORE_UTIL_TRACER_UTIL_H diff --git a/test/core/xds/xds_client_test.cc b/test/core/xds/xds_client_test.cc index f03e9203c09..aa81577cd2f 100644 --- a/test/core/xds/xds_client_test.cc +++ b/test/core/xds/xds_client_test.cc @@ -1158,7 +1158,7 @@ TEST_F(XdsClientTest, ResourceValidationFailure) { CheckRequest( *request, XdsFooResourceType::Get()->type_url(), /*version_info=*/"", /*response_nonce=*/"A", - /*error_detail=*/ + // error_detail= absl::InvalidArgumentError( "xDS response validation errors: [" "resource index 0: foo1: INVALID_ARGUMENT: errors validating JSON: " @@ -1305,7 +1305,7 @@ TEST_F(XdsClientTest, ResourceValidationFailureMultipleResources) { ASSERT_TRUE(request.has_value()); CheckRequest(*request, XdsFooResourceType::Get()->type_url(), /*version_info=*/"1", /*response_nonce=*/"A", - /*error_detail=*/ + // error_detail= absl::InvalidArgumentError( "xDS response validation errors: [" // foo1 @@ -1395,7 +1395,7 @@ TEST_F(XdsClientTest, ResourceValidationFailureForCachedResource) { CheckRequest( *request, XdsFooResourceType::Get()->type_url(), /*version_info=*/"1", /*response_nonce=*/"B", - /*error_detail=*/ + // error_detail= absl::InvalidArgumentError( "xDS response validation errors: [" "resource index 0: foo1: INVALID_ARGUMENT: errors validating JSON: " diff --git a/test/cpp/client/client_channel_stress_test.cc b/test/cpp/client/client_channel_stress_test.cc index 3224af691f3..85d9b99e3fe 100644 --- a/test/cpp/client/client_channel_stress_test.cc +++ b/test/cpp/client/client_channel_stress_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 2f5d9f2a762..ad91306e544 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/client/destroy_grpclb_channel_with_active_connect_stress_test.cc b/test/cpp/client/destroy_grpclb_channel_with_active_connect_stress_test.cc index d81cb11bd70..5d24c367cf1 100644 --- a/test/cpp/client/destroy_grpclb_channel_with_active_connect_stress_test.cc +++ b/test/cpp/client/destroy_grpclb_channel_with_active_connect_stress_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/cpp/codegen/codegen_test_full.cc b/test/cpp/codegen/codegen_test_full.cc index 520a8a52b49..1394c4a349e 100644 --- a/test/cpp/codegen/codegen_test_full.cc +++ b/test/cpp/codegen/codegen_test_full.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/codegen/codegen_test_minimal.cc b/test/cpp/codegen/codegen_test_minimal.cc index 70392922b2a..f65435d7665 100644 --- a/test/cpp/codegen/codegen_test_minimal.cc +++ b/test/cpp/codegen/codegen_test_minimal.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/codegen/golden_file_test.cc b/test/cpp/codegen/golden_file_test.cc index 26b42c11c01..a46cf932a28 100644 --- a/test/cpp/codegen/golden_file_test.cc +++ b/test/cpp/codegen/golden_file_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/codegen/proto_utils_test.cc b/test/cpp/codegen/proto_utils_test.cc index 75297e326b2..9defb344307 100644 --- a/test/cpp/codegen/proto_utils_test.cc +++ b/test/cpp/codegen/proto_utils_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/common/alarm_test.cc b/test/cpp/common/alarm_test.cc index 77ad4cff93e..4b571e021da 100644 --- a/test/cpp/common/alarm_test.cc +++ b/test/cpp/common/alarm_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/common/alts_util_test.cc b/test/cpp/common/alts_util_test.cc index 83ac9406db3..597d44e2f9f 100644 --- a/test/cpp/common/alts_util_test.cc +++ b/test/cpp/common/alts_util_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/cpp/common/auth_property_iterator_test.cc b/test/cpp/common/auth_property_iterator_test.cc index 5a6084be7f0..7d72a344344 100644 --- a/test/cpp/common/auth_property_iterator_test.cc +++ b/test/cpp/common/auth_property_iterator_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/common/channel_arguments_test.cc b/test/cpp/common/channel_arguments_test.cc index 57eb2e5c52c..323bb0ce500 100644 --- a/test/cpp/common/channel_arguments_test.cc +++ b/test/cpp/common/channel_arguments_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/common/secure_auth_context_test.cc b/test/cpp/common/secure_auth_context_test.cc index fcae9ba1bfe..ca50902377f 100644 --- a/test/cpp/common/secure_auth_context_test.cc +++ b/test/cpp/common/secure_auth_context_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "src/cpp/common/secure_auth_context.h" diff --git a/test/cpp/common/time_jump_test.cc b/test/cpp/common/time_jump_test.cc index 1bf8239287c..45116f1531e 100644 --- a/test/cpp/common/time_jump_test.cc +++ b/test/cpp/common/time_jump_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/cpp/common/timer_test.cc b/test/cpp/common/timer_test.cc index 9cc060daf7f..7b7c94f5f4e 100644 --- a/test/cpp/common/timer_test.cc +++ b/test/cpp/common/timer_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "src/core/lib/iomgr/timer.h" diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc index 00669dd4757..96400e4df4a 100644 --- a/test/cpp/end2end/async_end2end_test.cc +++ b/test/cpp/end2end/async_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/cfstream_test.cc b/test/cpp/end2end/cfstream_test.cc index 94bfaa910b7..ed1797057c9 100644 --- a/test/cpp/end2end/cfstream_test.cc +++ b/test/cpp/end2end/cfstream_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 The 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. - * - */ +// +// +// Copyright 2019 The 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 #include diff --git a/test/cpp/end2end/channelz_service_test.cc b/test/cpp/end2end/channelz_service_test.cc index 7e8982b0cb9..39f1e62b50d 100644 --- a/test/cpp/end2end/channelz_service_test.cc +++ b/test/cpp/end2end/channelz_service_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/end2end/client_callback_end2end_test.cc b/test/cpp/end2end/client_callback_end2end_test.cc index a783622bb51..3e0eddf1526 100644 --- a/test/cpp/end2end/client_callback_end2end_test.cc +++ b/test/cpp/end2end/client_callback_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc index 58e3a21e6b3..f1c7aead747 100644 --- a/test/cpp/end2end/client_crash_test.cc +++ b/test/cpp/end2end/client_crash_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/end2end/client_crash_test_server.cc b/test/cpp/end2end/client_crash_test_server.cc index 0952d581b2d..7b5092c99bf 100644 --- a/test/cpp/end2end/client_crash_test_server.cc +++ b/test/cpp/end2end/client_crash_test_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/client_interceptors_end2end_test.cc b/test/cpp/end2end/client_interceptors_end2end_test.cc index 635f6217b4c..c99e4d65cdc 100644 --- a/test/cpp/end2end/client_interceptors_end2end_test.cc +++ b/test/cpp/end2end/client_interceptors_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include @@ -48,7 +48,7 @@ #include #include "src/core/lib/iomgr/socket_utils_posix.h" -#endif /* GRPC_POSIX_SOCKET */ +#endif // GRPC_POSIX_SOCKET namespace grpc { namespace testing { @@ -70,7 +70,7 @@ enum class ChannelType { kFdChannel, }; -/* Hijacks Echo RPC and fills in the expected values */ +// Hijacks Echo RPC and fills in the expected values class HijackingInterceptor : public experimental::Interceptor { public: explicit HijackingInterceptor(experimental::ClientRpcInfo* info) { @@ -739,7 +739,7 @@ std::vector CreateTestScenarios() { // TODO(yashykt): Maybe add support for non-posix sockets too #ifdef GRPC_POSIX_SOCKET scenarios.emplace_back(ChannelType::kFdChannel, rpc_type); -#endif /* GRPC_POSIX_SOCKET */ +#endif // GRPC_POSIX_SOCKET } return scenarios; } @@ -771,7 +771,7 @@ class ParameterizedClientInterceptorsEnd2endTest server_ = builder.BuildAndStart(); AddInsecureChannelFromFd(server_.get(), sv_[1]); } -#endif /* GRPC_POSIX_SOCKET */ +#endif // GRPC_POSIX_SOCKET } ~ParameterizedClientInterceptorsEnd2endTest() override { @@ -792,7 +792,7 @@ class ParameterizedClientInterceptorsEnd2endTest return experimental::CreateCustomInsecureChannelWithInterceptorsFromFd( "", sv_[0], ChannelArguments(), std::move(creators)); } -#endif /* GRPC_POSIX_SOCKET */ +#endif // GRPC_POSIX_SOCKET return nullptr; } diff --git a/test/cpp/end2end/context_allocator_end2end_test.cc b/test/cpp/end2end/context_allocator_end2end_test.cc index a45bd9fcc99..57c4c568e91 100644 --- a/test/cpp/end2end/context_allocator_end2end_test.cc +++ b/test/cpp/end2end/context_allocator_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 #include diff --git a/test/cpp/end2end/delegating_channel_test.cc b/test/cpp/end2end/delegating_channel_test.cc index 2a8fadd90ac..33ae2cd0e46 100644 --- a/test/cpp/end2end/delegating_channel_test.cc +++ b/test/cpp/end2end/delegating_channel_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 9fdedbdd7d8..fc47a0926ff 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/exception_test.cc b/test/cpp/end2end/exception_test.cc index dbaa8de870a..6f80e2203fe 100644 --- a/test/cpp/end2end/exception_test.cc +++ b/test/cpp/end2end/exception_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/end2end/filter_end2end_test.cc b/test/cpp/end2end/filter_end2end_test.cc index a9c6bb8c55c..ef51f6ff9e5 100644 --- a/test/cpp/end2end/filter_end2end_test.cc +++ b/test/cpp/end2end/filter_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/end2end/flaky_network_test.cc b/test/cpp/end2end/flaky_network_test.cc index f1f40b6aa1e..1b7af33cbce 100644 --- a/test/cpp/end2end/flaky_network_test.cc +++ b/test/cpp/end2end/flaky_network_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/cpp/end2end/generic_end2end_test.cc b/test/cpp/end2end/generic_end2end_test.cc index 4c11ef2ce73..321e26918ff 100644 --- a/test/cpp/end2end/generic_end2end_test.cc +++ b/test/cpp/end2end/generic_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/health_service_end2end_test.cc b/test/cpp/end2end/health_service_end2end_test.cc index 774432ede99..da8a633d2a9 100644 --- a/test/cpp/end2end/health_service_end2end_test.cc +++ b/test/cpp/end2end/health_service_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/end2end/hybrid_end2end_test.cc b/test/cpp/end2end/hybrid_end2end_test.cc index a5e33916cba..d9c3d75da28 100644 --- a/test/cpp/end2end/hybrid_end2end_test.cc +++ b/test/cpp/end2end/hybrid_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/end2end/interceptors_util.cc b/test/cpp/end2end/interceptors_util.cc index 8f125225bf0..58a26b0950a 100644 --- a/test/cpp/end2end/interceptors_util.cc +++ b/test/cpp/end2end/interceptors_util.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/cpp/end2end/interceptors_util.h" diff --git a/test/cpp/end2end/interceptors_util.h b/test/cpp/end2end/interceptors_util.h index ef6520ca3a2..b0dd55eb504 100644 --- a/test/cpp/end2end/interceptors_util.h +++ b/test/cpp/end2end/interceptors_util.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 @@ -27,8 +27,8 @@ namespace grpc { namespace testing { -/* This interceptor does nothing. Just keeps a global count on the number of - * times it was invoked. */ +// This interceptor does nothing. Just keeps a global count on the number of +// times it was invoked. class PhonyInterceptor : public experimental::Interceptor { public: PhonyInterceptor() {} @@ -82,7 +82,7 @@ class PhonyInterceptorFactory } }; -/* This interceptor can be used to test the interception mechanism. */ +// This interceptor can be used to test the interception mechanism. class TestInterceptor : public experimental::Interceptor { public: TestInterceptor(const std::string& method, const char* suffix_for_stats, @@ -118,7 +118,7 @@ class TestInterceptorFactory const char* suffix_for_stats_; }; -/* This interceptor factory returns nullptr on interceptor creation */ +// This interceptor factory returns nullptr on interceptor creation class NullInterceptorFactory : public experimental::ClientInterceptorFactoryInterface, public experimental::ServerInterceptorFactoryInterface { diff --git a/test/cpp/end2end/message_allocator_end2end_test.cc b/test/cpp/end2end/message_allocator_end2end_test.cc index bccecf6f9aa..530ec6daf60 100644 --- a/test/cpp/end2end/message_allocator_end2end_test.cc +++ b/test/cpp/end2end/message_allocator_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/cpp/end2end/mock_test.cc b/test/cpp/end2end/mock_test.cc index 6db981b2942..03a451f0a60 100644 --- a/test/cpp/end2end/mock_test.cc +++ b/test/cpp/end2end/mock_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/nonblocking_test.cc b/test/cpp/end2end/nonblocking_test.cc index 53c7d3fd60c..c3636058bbe 100644 --- a/test/cpp/end2end/nonblocking_test.cc +++ b/test/cpp/end2end/nonblocking_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/end2end/port_sharing_end2end_test.cc b/test/cpp/end2end/port_sharing_end2end_test.cc index 2a8f7d99922..4bcfc45cf2c 100644 --- a/test/cpp/end2end/port_sharing_end2end_test.cc +++ b/test/cpp/end2end/port_sharing_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 #include diff --git a/test/cpp/end2end/proto_server_reflection_test.cc b/test/cpp/end2end/proto_server_reflection_test.cc index fd45abd06d6..5f6c38f3c16 100644 --- a/test/cpp/end2end/proto_server_reflection_test.cc +++ b/test/cpp/end2end/proto_server_reflection_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/end2end/raw_end2end_test.cc b/test/cpp/end2end/raw_end2end_test.cc index 4839fe79a58..23d9491dc1b 100644 --- a/test/cpp/end2end/raw_end2end_test.cc +++ b/test/cpp/end2end/raw_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/server_builder_plugin_test.cc b/test/cpp/end2end/server_builder_plugin_test.cc index f206cc5332c..0c1f7650955 100644 --- a/test/cpp/end2end/server_builder_plugin_test.cc +++ b/test/cpp/end2end/server_builder_plugin_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/end2end/server_crash_test.cc b/test/cpp/end2end/server_crash_test.cc index 7d841f12e22..a9b93a69ed6 100644 --- a/test/cpp/end2end/server_crash_test.cc +++ b/test/cpp/end2end/server_crash_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/end2end/server_crash_test_client.cc b/test/cpp/end2end/server_crash_test_client.cc index 102df3c5409..66f83043ed8 100644 --- a/test/cpp/end2end/server_crash_test_client.cc +++ b/test/cpp/end2end/server_crash_test_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/server_early_return_test.cc b/test/cpp/end2end/server_early_return_test.cc index 17eda0713a6..abc9b0638b0 100644 --- a/test/cpp/end2end/server_early_return_test.cc +++ b/test/cpp/end2end/server_early_return_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/end2end/server_interceptors_end2end_test.cc b/test/cpp/end2end/server_interceptors_end2end_test.cc index 5611aec13e5..774ba31a82e 100644 --- a/test/cpp/end2end/server_interceptors_end2end_test.cc +++ b/test/cpp/end2end/server_interceptors_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include diff --git a/test/cpp/end2end/server_load_reporting_end2end_test.cc b/test/cpp/end2end/server_load_reporting_end2end_test.cc index d488fbf45bf..e5def260d9c 100644 --- a/test/cpp/end2end/server_load_reporting_end2end_test.cc +++ b/test/cpp/end2end/server_load_reporting_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/end2end/service_config_end2end_test.cc b/test/cpp/end2end/service_config_end2end_test.cc index 131cf595724..e5d5dabd31d 100644 --- a/test/cpp/end2end/service_config_end2end_test.cc +++ b/test/cpp/end2end/service_config_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/end2end/shutdown_test.cc b/test/cpp/end2end/shutdown_test.cc index bbd5739e854..e98f5fcd7d6 100644 --- a/test/cpp/end2end/shutdown_test.cc +++ b/test/cpp/end2end/shutdown_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/end2end/streaming_throughput_test.cc b/test/cpp/end2end/streaming_throughput_test.cc index 70ccb9bf4ff..bbdb76b0b41 100644 --- a/test/cpp/end2end/streaming_throughput_test.cc +++ b/test/cpp/end2end/streaming_throughput_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/end2end/test_health_check_service_impl.cc b/test/cpp/end2end/test_health_check_service_impl.cc index daa617fe508..337e0640650 100644 --- a/test/cpp/end2end/test_health_check_service_impl.cc +++ b/test/cpp/end2end/test_health_check_service_impl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 "test/cpp/end2end/test_health_check_service_impl.h" diff --git a/test/cpp/end2end/test_health_check_service_impl.h b/test/cpp/end2end/test_health_check_service_impl.h index fe613fb14ac..55d53082480 100644 --- a/test/cpp/end2end/test_health_check_service_impl.h +++ b/test/cpp/end2end/test_health_check_service_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_TEST_CPP_END2END_TEST_HEALTH_CHECK_SERVICE_IMPL_H #define GRPC_TEST_CPP_END2END_TEST_HEALTH_CHECK_SERVICE_IMPL_H diff --git a/test/cpp/end2end/test_service_impl.cc b/test/cpp/end2end/test_service_impl.cc index 2e014a289ff..51409f3a231 100644 --- a/test/cpp/end2end/test_service_impl.cc +++ b/test/cpp/end2end/test_service_impl.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/end2end/test_service_impl.h" diff --git a/test/cpp/end2end/test_service_impl.h b/test/cpp/end2end/test_service_impl.h index 18a793ccf9e..e7057833fba 100644 --- a/test/cpp/end2end/test_service_impl.h +++ b/test/cpp/end2end/test_service_impl.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_END2END_TEST_SERVICE_IMPL_H #define GRPC_TEST_CPP_END2END_TEST_SERVICE_IMPL_H diff --git a/test/cpp/end2end/thread_stress_test.cc b/test/cpp/end2end/thread_stress_test.cc index 79a23b33b88..f6f4ea0ee9b 100644 --- a/test/cpp/end2end/thread_stress_test.cc +++ b/test/cpp/end2end/thread_stress_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/end2end/time_change_test.cc b/test/cpp/end2end/time_change_test.cc index 5e13db7bc95..61e4a468b08 100644 --- a/test/cpp/end2end/time_change_test.cc +++ b/test/cpp/end2end/time_change_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc index 866e690c36c..2c5683eefc4 100644 --- a/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc +++ b/test/cpp/ext/filters/census/stats_plugin_end2end_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include // NOLINT diff --git a/test/cpp/grpclb/grpclb_api_test.cc b/test/cpp/grpclb/grpclb_api_test.cc index cd21e4917bc..5309eca9756 100644 --- a/test/cpp/grpclb/grpclb_api_test.cc +++ b/test/cpp/grpclb/grpclb_api_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index b4d7bcf1c26..bbf53420299 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -50,38 +50,38 @@ ABSL_FLAG( // TODO(veblush): Replace the help message with the following full message // once Abseil fixes the flag-help compiler error on Windows. (b/171659833) - /* - "cancel_after_begin : cancel stream after starting it;\n" - "cancel_after_first_response: cancel on first response;\n" - "channel_soak: sends 'soak_iterations' rpcs, rebuilds channel each time;\n" - "client_compressed_streaming : compressed request streaming with " - "client_compressed_unary : single compressed request;\n" - "client_streaming : request streaming with single response;\n" - "compute_engine_creds: large_unary with compute engine auth;\n" - "custom_metadata: server will echo custom metadata;\n" - "empty_stream : bi-di stream with no request/response;\n" - "empty_unary : empty (zero bytes) request and response;\n" - "google_default_credentials: large unary using GDC;\n" - "half_duplex : half-duplex streaming;\n" - "jwt_token_creds: large_unary with JWT token auth;\n" - "large_unary : single request and (large) response;\n" - "long_lived_channel: sends large_unary rpcs over a long-lived channel;\n" - "oauth2_auth_token: raw oauth2 access token auth;\n" - "per_rpc_creds: raw oauth2 access token on a single rpc;\n" - "ping_pong : full-duplex streaming;\n" - "response streaming;\n" - "rpc_soak: 'sends soak_iterations' large_unary rpcs;\n" - "server_compressed_streaming : single request with compressed " - "server_compressed_unary : single compressed response;\n" - "server_streaming : single request with response streaming;\n" - "slow_consumer : single request with response streaming with " - "slow client consumer;\n" - "special_status_message: verify Unicode and whitespace in status message;\n" - "status_code_and_message: verify status code & message;\n" - "timeout_on_sleeping_server: deadline exceeds on stream;\n" - "unimplemented_method: client calls an unimplemented method;\n" - "unimplemented_service: client calls an unimplemented service;\n" - */ + // + //"cancel_after_begin : cancel stream after starting it;\n" + //"cancel_after_first_response: cancel on first response;\n" + //"channel_soak: sends 'soak_iterations' rpcs, rebuilds channel each + // time;\n" "client_compressed_streaming : compressed request streaming with + //" "client_compressed_unary : single compressed request;\n" + //"client_streaming : request streaming with single response;\n" + //"compute_engine_creds: large_unary with compute engine auth;\n" + //"custom_metadata: server will echo custom metadata;\n" + //"empty_stream : bi-di stream with no request/response;\n" + //"empty_unary : empty (zero bytes) request and response;\n" + //"google_default_credentials: large unary using GDC;\n" + //"half_duplex : half-duplex streaming;\n" + //"jwt_token_creds: large_unary with JWT token auth;\n" + //"large_unary : single request and (large) response;\n" + //"long_lived_channel: sends large_unary rpcs over a long-lived channel;\n" + //"oauth2_auth_token: raw oauth2 access token auth;\n" + //"per_rpc_creds: raw oauth2 access token on a single rpc;\n" + //"ping_pong : full-duplex streaming;\n" + //"response streaming;\n" + //"rpc_soak: 'sends soak_iterations' large_unary rpcs;\n" + //"server_compressed_streaming : single request with compressed " + //"server_compressed_unary : single compressed response;\n" + //"server_streaming : single request with response streaming;\n" + //"slow_consumer : single request with response streaming with " + //"slow client consumer;\n" + //"special_status_message: verify Unicode and whitespace in status + // message;\n" "status_code_and_message: verify status code & message;\n" + //"timeout_on_sleeping_server: deadline exceeds on stream;\n" + //"unimplemented_method: client calls an unimplemented method;\n" + //"unimplemented_service: client calls an unimplemented service;\n" + // ); ABSL_FLAG(std::string, default_service_account, "", "Email of GCE default service account"); diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index 21c760ade46..640a906e765 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/interop/client_helper.h" diff --git a/test/cpp/interop/client_helper.h b/test/cpp/interop/client_helper.h index 3b7ec7a540c..dd80ee77c0b 100644 --- a/test/cpp/interop/client_helper.h +++ b/test/cpp/interop/client_helper.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_INTEROP_CLIENT_HELPER_H #define GRPC_TEST_CPP_INTEROP_CLIENT_HELPER_H diff --git a/test/cpp/interop/grpclb_fallback_test.cc b/test/cpp/interop/grpclb_fallback_test.cc index 256669c461d..d56c505c8b3 100644 --- a/test/cpp/interop/grpclb_fallback_test.cc +++ b/test/cpp/interop/grpclb_fallback_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 diff --git a/test/cpp/interop/http2_client.cc b/test/cpp/interop/http2_client.cc index dc1a5581433..69fe14dbbc3 100644 --- a/test/cpp/interop/http2_client.cc +++ b/test/cpp/interop/http2_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/interop/http2_client.h" diff --git a/test/cpp/interop/http2_client.h b/test/cpp/interop/http2_client.h index 35783927301..4eeaaf4125b 100644 --- a/test/cpp/interop/http2_client.h +++ b/test/cpp/interop/http2_client.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_INTEROP_HTTP2_CLIENT_H #define GRPC_TEST_CPP_INTEROP_HTTP2_CLIENT_H diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 32ab4e9215c..c9a2175815b 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 "test/cpp/interop/interop_client.h" diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index 3cfab57ab86..132c6aba148 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_INTEROP_INTEROP_CLIENT_H #define GRPC_TEST_CPP_INTEROP_INTEROP_CLIENT_H diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index e2bf7fcd248..a4807ff77f7 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 #include diff --git a/test/cpp/interop/interop_server_bootstrap.cc b/test/cpp/interop/interop_server_bootstrap.cc index 3eb4e3241b3..92ffb0e6aa9 100644 --- a/test/cpp/interop/interop_server_bootstrap.cc +++ b/test/cpp/interop/interop_server_bootstrap.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc index dc428294633..33bb29eafac 100644 --- a/test/cpp/interop/interop_test.cc +++ b/test/cpp/interop/interop_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -63,7 +63,7 @@ int test_client(const char* root, const char* host, int port) { execv(args[0], args.data()); return 1; } - /* wait for client */ + // wait for client gpr_log(GPR_INFO, "Waiting for client: %s", host); if (waitpid(cli, &status, 0) == -1) return 2; if (!WIFEXITED(status)) return 4; @@ -81,21 +81,21 @@ int main(int argc, char** argv) { pid_t svr; int ret; int do_ipv6 = 1; - /* seed rng with pid, so we don't end up with the same random numbers as a - concurrently running test binary */ + // seed rng with pid, so we don't end up with the same random numbers as a + // concurrently running test binary srand(getpid()); if (!grpc_ipv6_loopback_available()) { gpr_log(GPR_INFO, "Can't bind to ::1. Skipping IPv6 tests."); do_ipv6 = 0; } - /* figure out where we are */ + // figure out where we are if (lslash) { memcpy(root, me, lslash - me); root[lslash - me] = 0; } else { strcpy(root, "."); } - /* start the server */ + // start the server svr = fork(); if (svr == 0) { std::vector args; @@ -111,9 +111,9 @@ int main(int argc, char** argv) { execv(args[0], args.data()); return 1; } - /* wait a little */ + // wait a little sleep(10); - /* start the clients */ + // start the clients ret = test_client(root, "127.0.0.1", port); if (ret != 0) return ret; ret = test_client(root, "::ffff:127.0.0.1", port); @@ -124,7 +124,7 @@ int main(int argc, char** argv) { ret = test_client(root, "::1", port); if (ret != 0) return ret; } - /* wait for server */ + // wait for server gpr_log(GPR_INFO, "Waiting for server"); kill(svr, SIGINT); if (waitpid(svr, &status, 0) == -1) return 2; diff --git a/test/cpp/interop/metrics_client.cc b/test/cpp/interop/metrics_client.cc index f733dfc27fb..0221814f636 100644 --- a/test/cpp/interop/metrics_client.cc +++ b/test/cpp/interop/metrics_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #include #include diff --git a/test/cpp/interop/reconnect_interop_client.cc b/test/cpp/interop/reconnect_interop_client.cc index 9554c17b04b..c794f8ce67f 100644 --- a/test/cpp/interop/reconnect_interop_client.cc +++ b/test/cpp/interop/reconnect_interop_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/interop/reconnect_interop_server.cc b/test/cpp/interop/reconnect_interop_server.cc index 6496f8f4d90..680ad50e499 100644 --- a/test/cpp/interop/reconnect_interop_server.cc +++ b/test/cpp/interop/reconnect_interop_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// // Test description at doc/connection-backoff-interop-test-description.md diff --git a/test/cpp/interop/server_helper.cc b/test/cpp/interop/server_helper.cc index b6f9faaff12..8dfc5576d7a 100644 --- a/test/cpp/interop/server_helper.cc +++ b/test/cpp/interop/server_helper.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/interop/server_helper.h" diff --git a/test/cpp/interop/server_helper.h b/test/cpp/interop/server_helper.h index ce04d201560..9acb77f624e 100644 --- a/test/cpp/interop/server_helper.h +++ b/test/cpp/interop/server_helper.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_INTEROP_SERVER_HELPER_H #define GRPC_TEST_CPP_INTEROP_SERVER_HELPER_H diff --git a/test/cpp/interop/stress_interop_client.cc b/test/cpp/interop/stress_interop_client.cc index f001f815683..c4530a08006 100644 --- a/test/cpp/interop/stress_interop_client.cc +++ b/test/cpp/interop/stress_interop_client.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #include "test/cpp/interop/stress_interop_client.h" diff --git a/test/cpp/interop/stress_interop_client.h b/test/cpp/interop/stress_interop_client.h index 653df916542..6d5727deb4a 100644 --- a/test/cpp/interop/stress_interop_client.h +++ b/test/cpp/interop/stress_interop_client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #ifndef GRPC_TEST_CPP_STRESS_INTEROP_CLIENT_H #define GRPC_TEST_CPP_STRESS_INTEROP_CLIENT_H diff --git a/test/cpp/interop/stress_test.cc b/test/cpp/interop/stress_test.cc index 1faed82820a..659a54eff3c 100644 --- a/test/cpp/interop/stress_test.cc +++ b/test/cpp/interop/stress_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #include #include diff --git a/test/cpp/interop/xds_interop_client.cc b/test/cpp/interop/xds_interop_client.cc index 065b8008a21..f9105cb3edf 100644 --- a/test/cpp/interop/xds_interop_client.cc +++ b/test/cpp/interop/xds_interop_client.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 #include @@ -129,7 +129,7 @@ struct AsyncClientCall { simple_response_reader; }; -/** Records the remote peer distribution for a given range of RPCs. */ +/// Records the remote peer distribution for a given range of RPCs. class XdsStatsWatcher { public: XdsStatsWatcher(int start_id, int end_id) diff --git a/test/cpp/interop/xds_interop_server.cc b/test/cpp/interop/xds_interop_server.cc index ef79beb7418..0f2a90e3316 100644 --- a/test/cpp/interop/xds_interop_server.cc +++ b/test/cpp/interop/xds_interop_server.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 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. - * - */ +// +// +// Copyright 2020 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 diff --git a/test/cpp/microbenchmarks/bm_alarm.cc b/test/cpp/microbenchmarks/bm_alarm.cc index fed8840a666..ae170559167 100644 --- a/test/cpp/microbenchmarks/bm_alarm.cc +++ b/test/cpp/microbenchmarks/bm_alarm.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This benchmark exists to ensure that immediately-firing alarms are fast */ +// This benchmark exists to ensure that immediately-firing alarms are fast #include diff --git a/test/cpp/microbenchmarks/bm_arena.cc b/test/cpp/microbenchmarks/bm_arena.cc index ec31091664b..7b6253c7a52 100644 --- a/test/cpp/microbenchmarks/bm_arena.cc +++ b/test/cpp/microbenchmarks/bm_arena.cc @@ -1,22 +1,22 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// -/* Benchmark arenas */ +// Benchmark arenas #include diff --git a/test/cpp/microbenchmarks/bm_byte_buffer.cc b/test/cpp/microbenchmarks/bm_byte_buffer.cc index 7e6ca5d9254..a43be1115d3 100644 --- a/test/cpp/microbenchmarks/bm_byte_buffer.cc +++ b/test/cpp/microbenchmarks/bm_byte_buffer.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This benchmark exists to show that byte-buffer copy is size-independent */ +// This benchmark exists to show that byte-buffer copy is size-independent #include diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 49768760fc4..1f9d142518a 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -1,23 +1,23 @@ -/* - * - * 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. - * - */ - -/* This benchmark exists to ensure that the benchmark integration is - * working */ +// +// +// 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. +// +// + +// This benchmark exists to ensure that the benchmark integration is +// working #include @@ -377,45 +377,45 @@ static const grpc_channel_filter phony_filter = { namespace phony_transport { -/* Memory required for a single stream element - this is allocated by upper - layers and initialized by the transport */ -size_t sizeof_stream; /* = sizeof(transport stream) */ +// Memory required for a single stream element - this is allocated by upper +// layers and initialized by the transport +size_t sizeof_stream; // = sizeof(transport stream) -/* name of this transport implementation */ +// name of this transport implementation const char* name; -/* implementation of grpc_transport_init_stream */ +// implementation of grpc_transport_init_stream int InitStream(grpc_transport* /*self*/, grpc_stream* /*stream*/, grpc_stream_refcount* /*refcount*/, const void* /*server_data*/, grpc_core::Arena* /*arena*/) { return 0; } -/* implementation of grpc_transport_set_pollset */ +// implementation of grpc_transport_set_pollset void SetPollset(grpc_transport* /*self*/, grpc_stream* /*stream*/, grpc_pollset* /*pollset*/) {} -/* implementation of grpc_transport_set_pollset */ +// implementation of grpc_transport_set_pollset void SetPollsetSet(grpc_transport* /*self*/, grpc_stream* /*stream*/, grpc_pollset_set* /*pollset_set*/) {} -/* implementation of grpc_transport_perform_stream_op */ +// implementation of grpc_transport_perform_stream_op void PerformStreamOp(grpc_transport* /*self*/, grpc_stream* /*stream*/, grpc_transport_stream_op_batch* op) { grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete, absl::OkStatus()); } -/* implementation of grpc_transport_perform_op */ +// implementation of grpc_transport_perform_op void PerformOp(grpc_transport* /*self*/, grpc_transport_op* /*op*/) {} -/* implementation of grpc_transport_destroy_stream */ +// implementation of grpc_transport_destroy_stream void DestroyStream(grpc_transport* /*self*/, grpc_stream* /*stream*/, grpc_closure* /*then_sched_closure*/) {} -/* implementation of grpc_transport_destroy */ +// implementation of grpc_transport_destroy void Destroy(grpc_transport* /*self*/) {} -/* implementation of grpc_transport_get_endpoint */ +// implementation of grpc_transport_get_endpoint grpc_endpoint* GetEndpoint(grpc_transport* /*self*/) { return nullptr; } static const grpc_transport_vtable phony_transport_vtable = {0, diff --git a/test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc b/test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc index 436f487126d..e0f20a8564c 100644 --- a/test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_callback_streaming_ping_pong.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "test/core/util/test_config.h" #include "test/cpp/microbenchmarks/callback_streaming_ping_pong.h" @@ -23,9 +23,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONFIGURATIONS - */ +//****************************************************************************** +// CONFIGURATIONS +// // Replace "benchmark::internal::Benchmark" with "::testing::Benchmark" to use // internal microbenchmarking tooling diff --git a/test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc b/test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc index b828fa7c0c6..a1c2585c3dd 100644 --- a/test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_callback_unary_ping_pong.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "test/core/util/test_config.h" #include "test/cpp/microbenchmarks/callback_unary_ping_pong.h" @@ -23,9 +23,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONFIGURATIONS - */ +//****************************************************************************** +// CONFIGURATIONS +// // Replace "benchmark::internal::Benchmark" with "::testing::Benchmark" to use // internal microbenchmarking tooling diff --git a/test/cpp/microbenchmarks/bm_channel.cc b/test/cpp/microbenchmarks/bm_channel.cc index ccfee54db09..c4b62a304c0 100644 --- a/test/cpp/microbenchmarks/bm_channel.cc +++ b/test/cpp/microbenchmarks/bm_channel.cc @@ -1,22 +1,22 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// -/* Benchmark channel */ +// Benchmark channel #include diff --git a/test/cpp/microbenchmarks/bm_channel_args.cc b/test/cpp/microbenchmarks/bm_channel_args.cc index a19fdbdce49..f68c2a05428 100644 --- a/test/cpp/microbenchmarks/bm_channel_args.cc +++ b/test/cpp/microbenchmarks/bm_channel_args.cc @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -/* Benchmark ChannelArgs comparison performance between grpc_channel_args and - * grpc_core::ChannelArgs */ +// Benchmark ChannelArgs comparison performance between grpc_channel_args and +// grpc_core::ChannelArgs #include diff --git a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc index c840b48423f..2c420d0f067 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_hpack.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_hpack.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Microbenchmarks around CHTTP2 HPACK operations */ +// +// +// 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 +// +// 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. +// +// + +// Microbenchmarks around CHTTP2 HPACK operations #include diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc index 17caf9acdf4..e2f84500f06 100644 --- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc +++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc @@ -1,22 +1,22 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* Microbenchmarks around CHTTP2 transport operations */ +// +// +// 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 +// +// 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. +// +// + +// Microbenchmarks around CHTTP2 transport operations #include diff --git a/test/cpp/microbenchmarks/bm_closure.cc b/test/cpp/microbenchmarks/bm_closure.cc index b322ea58cf9..c2f048bcbc4 100644 --- a/test/cpp/microbenchmarks/bm_closure.cc +++ b/test/cpp/microbenchmarks/bm_closure.cc @@ -1,22 +1,22 @@ -/* - * - * 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. - * - */ - -/* Test various closure related operations */ +// +// +// 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. +// +// + +// Test various closure related operations #include diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index bfc4bbb668e..29a1ddaaf33 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -1,23 +1,23 @@ -/* - * - * 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 - * - * 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. - * - */ - -/* This benchmark exists to ensure that the benchmark integration is - * working */ +// +// +// 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 +// +// 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. +// +// + +// This benchmark exists to ensure that the benchmark integration is +// working #include @@ -41,7 +41,7 @@ static void BM_CreateDestroyCpp(benchmark::State& state) { } BENCHMARK(BM_CreateDestroyCpp); -/* Create cq using a different constructor */ +// Create cq using a different constructor static void BM_CreateDestroyCpp2(benchmark::State& state) { for (auto _ : state) { grpc_completion_queue* core_cq = diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index 82bde5d96e4..e2ad03f4cb7 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -63,13 +63,13 @@ static grpc_error_handle pollset_kick(grpc_pollset* /*p*/, return absl::OkStatus(); } -/* Callback when the tag is dequeued from the completion queue. Does nothing */ +// Callback when the tag is dequeued from the completion queue. Does nothing static void cq_done_cb(void* /*done_arg*/, grpc_cq_completion* cq_completion) { gpr_free(cq_completion); } -/* Queues a completion tag if deadline is > 0. - * Does nothing if deadline is 0 (i.e gpr_time_0(GPR_CLOCK_MONOTONIC)) */ +// Queues a completion tag if deadline is > 0. +// Does nothing if deadline is 0 (i.e gpr_time_0(GPR_CLOCK_MONOTONIC)) static grpc_error_handle pollset_work(grpc_pollset* ps, grpc_pollset_worker** /*worker*/, grpc_core::Timestamp deadline) { @@ -126,37 +126,37 @@ static void setup() { static void teardown() { grpc_completion_queue_shutdown(g_cq); - /* Drain any events */ + // Drain any events gpr_timespec deadline = gpr_time_0(GPR_CLOCK_MONOTONIC); while (grpc_completion_queue_next(g_cq, deadline, nullptr).type != GRPC_QUEUE_SHUTDOWN) { - /* Do nothing */ + // Do nothing } grpc_completion_queue_destroy(g_cq); grpc_shutdown(); } -/* A few notes about Multi-threaded benchmarks: - - Setup: - The benchmark framework ensures that none of the threads proceed beyond the - state.KeepRunning() call unless all the threads have called state.keepRunning - at least once. So it is safe to do the initialization in one of the threads - before state.KeepRunning() is called. - - Teardown: - The benchmark framework also ensures that no thread is running the benchmark - code (i.e the code between two successive calls of state.KeepRunning()) if - state.KeepRunning() returns false. So it is safe to do the teardown in one - of the threads after state.keepRunning() returns false. - - However, our use requires synchronization because we do additional work at - each thread that requires specific ordering (TrackCounters must be constructed - after grpc_init because it needs the number of cores, initialized by grpc, - and its Finish call must take place before grpc_shutdown so that it can use - grpc_stats). -*/ +// A few notes about Multi-threaded benchmarks: + +// Setup: +// The benchmark framework ensures that none of the threads proceed beyond the +// state.KeepRunning() call unless all the threads have called state.keepRunning +// at least once. So it is safe to do the initialization in one of the threads +// before state.KeepRunning() is called. + +// Teardown: +// The benchmark framework also ensures that no thread is running the benchmark +// code (i.e the code between two successive calls of state.KeepRunning()) if +// state.KeepRunning() returns false. So it is safe to do the teardown in one +// of the threads after state.keepRunning() returns false. + +// However, our use requires synchronization because we do additional work at +// each thread that requires specific ordering (TrackCounters must be +// constructed after grpc_init because it needs the number of cores, initialized +// by grpc, and its Finish call must take place before grpc_shutdown so that it +// can use grpc_stats). +// static void BM_Cq_Throughput(benchmark::State& state) { gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); auto thd_idx = state.thread_index(); diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc index a8335935702..06e40752940 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_ping_pong.cc @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ - -/* Benchmark gRPC end2end in various configurations */ +// +// +// Copyright 2016 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. +// +// + +// Benchmark gRPC end2end in various configurations #include "test/core/util/build.h" #include "test/core/util/test_config.h" @@ -26,9 +26,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONFIGURATIONS - */ +//****************************************************************************** +// CONFIGURATIONS +// static const int kMaxMessageSize = [] { if (BuiltUnderMsan() || BuiltUnderTsan() || BuiltUnderUbsan()) { diff --git a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc index 2b750b6776c..a4d5a42b7fd 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_streaming_pump.cc @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// -/* Benchmark gRPC end2end in various configurations */ +// Benchmark gRPC end2end in various configurations #include "test/core/util/test_config.h" #include "test/cpp/microbenchmarks/fullstack_streaming_pump.h" @@ -25,9 +25,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONFIGURATIONS - */ +//****************************************************************************** +// CONFIGURATIONS +// BENCHMARK_TEMPLATE(BM_PumpStreamClientToServer, TCP) ->Range(0, 128 * 1024 * 1024); diff --git a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc index cb7dd8696f4..b587a75d2e4 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_unary_ping_pong.cc @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// -/* Benchmark gRPC end2end in various configurations */ +// Benchmark gRPC end2end in various configurations #include "test/core/util/test_config.h" #include "test/cpp/microbenchmarks/fullstack_unary_ping_pong.h" @@ -25,9 +25,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONFIGURATIONS - */ +//****************************************************************************** +// CONFIGURATIONS +// // Replace "benchmark::internal::Benchmark" with "::testing::Benchmark" to use // internal microbenchmarking tooling diff --git a/test/cpp/microbenchmarks/bm_huffman_decode.cc b/test/cpp/microbenchmarks/bm_huffman_decode.cc index 75f21409410..ca14a987879 100644 --- a/test/cpp/microbenchmarks/bm_huffman_decode.cc +++ b/test/cpp/microbenchmarks/bm_huffman_decode.cc @@ -54,10 +54,10 @@ BENCHMARK(BM_Decode); // Legacy huffman decoder static void BM_LegacyDecode(benchmark::State& state) { - /* state table for huffman decoding: given a state, gives an index/16 into - next_sub_tbl. Taking that index and adding the value of the nibble being - considered returns the next state. - generated by gen_hpack_tables.c */ + // state table for huffman decoding: given a state, gives an index/16 into + // next_sub_tbl. Taking that index and adding the value of the nibble being + // considered returns the next state. + // generated by gen_hpack_tables.c static const uint8_t next_tbl[256] = { 0, 1, 2, 3, 4, 1, 2, 5, 6, 1, 7, 8, 1, 3, 3, 9, 10, 11, 1, 1, 1, 12, 1, 2, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -76,8 +76,8 @@ static void BM_LegacyDecode(benchmark::State& state) { 3, 18, 47, 2, }; - /* next state, based upon current state and the current nibble: see above. - generated by gen_hpack_tables.c */ + // next state, based upon current state and the current nibble: see above. + // generated by gen_hpack_tables.c static const int16_t next_sub_tbl[48 * 16] = { 1, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 2, 6, 10, 13, 14, 15, 16, 17, 2, 6, 10, 13, 14, 15, @@ -133,9 +133,9 @@ static void BM_LegacyDecode(benchmark::State& state) { 0, 0, 255, }; - /* emission table: indexed like next_tbl, ultimately gives the byte to be - emitted, or -1 for no byte, or 256 for end of stream - generated by gen_hpack_tables.c */ + // emission table: indexed like next_tbl, ultimately gives the byte to be + // emitted, or -1 for no byte, or 256 for end of stream + // generated by gen_hpack_tables.c static const uint16_t emit_tbl[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, 23, 24, 25, 26, 27, @@ -157,7 +157,7 @@ static void BM_LegacyDecode(benchmark::State& state) { 248, }; - /* generated by gen_hpack_tables.c */ + // generated by gen_hpack_tables.c static const int16_t emit_sub_tbl[249 * 16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 48, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49, 49, 49, diff --git a/test/cpp/microbenchmarks/bm_opencensus_plugin.cc b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc index e5636a9b71e..8e222289210 100644 --- a/test/cpp/microbenchmarks/bm_opencensus_plugin.cc +++ b/test/cpp/microbenchmarks/bm_opencensus_plugin.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 #include // NOLINT diff --git a/test/cpp/microbenchmarks/bm_pollset.cc b/test/cpp/microbenchmarks/bm_pollset.cc index dfe3e5bf63f..b3ea49f1f64 100644 --- a/test/cpp/microbenchmarks/bm_pollset.cc +++ b/test/cpp/microbenchmarks/bm_pollset.cc @@ -1,22 +1,22 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// -/* Test out pollset latencies */ +// Test out pollset latencies #include diff --git a/test/cpp/microbenchmarks/callback_streaming_ping_pong.h b/test/cpp/microbenchmarks/callback_streaming_ping_pong.h index 21f66df63de..769d6082e49 100644 --- a/test/cpp/microbenchmarks/callback_streaming_ping_pong.h +++ b/test/cpp/microbenchmarks/callback_streaming_ping_pong.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef TEST_CPP_MICROBENCHMARKS_CALLBACK_STREAMING_PING_PONG_H #define TEST_CPP_MICROBENCHMARKS_CALLBACK_STREAMING_PING_PONG_H @@ -31,9 +31,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * BENCHMARKING KERNELS - */ +//****************************************************************************** +// BENCHMARKING KERNELS +// class BidiClient : public grpc::ClientBidiReactor { public: diff --git a/test/cpp/microbenchmarks/callback_test_service.cc b/test/cpp/microbenchmarks/callback_test_service.cc index ae7ed496730..87290f57d26 100644 --- a/test/cpp/microbenchmarks/callback_test_service.cc +++ b/test/cpp/microbenchmarks/callback_test_service.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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 "test/cpp/microbenchmarks/callback_test_service.h" diff --git a/test/cpp/microbenchmarks/callback_test_service.h b/test/cpp/microbenchmarks/callback_test_service.h index 0268de6e47c..d8627a9e407 100644 --- a/test/cpp/microbenchmarks/callback_test_service.h +++ b/test/cpp/microbenchmarks/callback_test_service.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// #ifndef TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H #define TEST_CPP_MICROBENCHMARKS_CALLBACK_TEST_SERVICE_H diff --git a/test/cpp/microbenchmarks/callback_unary_ping_pong.h b/test/cpp/microbenchmarks/callback_unary_ping_pong.h index e243960da6b..7117656de4d 100644 --- a/test/cpp/microbenchmarks/callback_unary_ping_pong.h +++ b/test/cpp/microbenchmarks/callback_unary_ping_pong.h @@ -1,22 +1,22 @@ -/* - * - * Copyright 2019 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. - * - */ +// +// +// Copyright 2019 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. +// +// -/* Benchmark gRPC end2end in various configurations */ +// Benchmark gRPC end2end in various configurations #ifndef TEST_CPP_MICROBENCHMARKS_CALLBACK_UNARY_PING_PONG_H #define TEST_CPP_MICROBENCHMARKS_CALLBACK_UNARY_PING_PONG_H @@ -33,9 +33,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * BENCHMARKING KERNELS - */ +//****************************************************************************** +// BENCHMARKING KERNELS +// inline void SendCallbackUnaryPingPong( benchmark::State* state, ClientContext* cli_ctx, EchoRequest* request, diff --git a/test/cpp/microbenchmarks/fullstack_context_mutators.h b/test/cpp/microbenchmarks/fullstack_context_mutators.h index 82e05e8dc28..0d49408b756 100644 --- a/test/cpp/microbenchmarks/fullstack_context_mutators.h +++ b/test/cpp/microbenchmarks/fullstack_context_mutators.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef TEST_CPP_MICROBENCHMARKS_FULLSTACK_CONTEXT_MUTATORS_H #define TEST_CPP_MICROBENCHMARKS_FULLSTACK_CONTEXT_MUTATORS_H @@ -33,9 +33,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * CONTEXT MUTATORS - */ +//****************************************************************************** +// CONTEXT MUTATORS +// static const int kPregenerateKeyCount = 100000; diff --git a/test/cpp/microbenchmarks/fullstack_fixtures.h b/test/cpp/microbenchmarks/fullstack_fixtures.h index ef75c955a46..cb71c28aad1 100644 --- a/test/cpp/microbenchmarks/fullstack_fixtures.h +++ b/test/cpp/microbenchmarks/fullstack_fixtures.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef TEST_CPP_MICROBENCHMARKS_FULLSTACK_FIXTURES_H #define TEST_CPP_MICROBENCHMARKS_FULLSTACK_FIXTURES_H @@ -168,8 +168,8 @@ class EndpointPairFixture : public BaseFixture { fixture_configuration.ApplyCommonServerBuilderConfig(&b); server_ = b.BuildAndStart(); grpc_core::ExecCtx exec_ctx; - /* add server endpoint to server_ - * */ + // add server endpoint to server_ + // { grpc_core::Server* core_server = grpc_core::Server::FromC(server_->c_server()); @@ -188,7 +188,7 @@ class EndpointPairFixture : public BaseFixture { nullptr); } - /* create channel */ + // create channel { grpc_core::ChannelArgs c_args; { @@ -253,10 +253,10 @@ class SockPair : public EndpointPairFixture { fixture_configuration) {} }; -/* Use InProcessCHTTP2 instead. This class (with stats as an explicit parameter) - is here only to be able to initialize both the base class and stats_ with the - same stats instance without accessing the stats_ fields before the object is - properly initialized. */ +// Use InProcessCHTTP2 instead. This class (with stats as an explicit parameter) +// is here only to be able to initialize both the base class and stats_ with the +// same stats instance without accessing the stats_ fields before the object is +// properly initialized. class InProcessCHTTP2WithExplicitStats : public EndpointPairFixture { public: InProcessCHTTP2WithExplicitStats( diff --git a/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h b/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h index 00f37065704..92845e3fc40 100644 --- a/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h +++ b/test/cpp/microbenchmarks/fullstack_streaming_ping_pong.h @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ - -/* Benchmark gRPC end2end in various configurations */ +// +// +// Copyright 2016 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. +// +// + +// Benchmark gRPC end2end in various configurations #ifndef TEST_CPP_MICROBENCHMARKS_FULLSTACK_STREAMING_PING_PONG_H #define TEST_CPP_MICROBENCHMARKS_FULLSTACK_STREAMING_PING_PONG_H @@ -32,9 +32,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * BENCHMARKING KERNELS - */ +//****************************************************************************** +// BENCHMARKING KERNELS +// static void* tag(intptr_t x) { return reinterpret_cast(x); } diff --git a/test/cpp/microbenchmarks/fullstack_streaming_pump.h b/test/cpp/microbenchmarks/fullstack_streaming_pump.h index e71c5fd7b80..d153c9314f1 100644 --- a/test/cpp/microbenchmarks/fullstack_streaming_pump.h +++ b/test/cpp/microbenchmarks/fullstack_streaming_pump.h @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// -/* Benchmark gRPC end2end in various configurations */ +// Benchmark gRPC end2end in various configurations #ifndef TEST_CPP_MICROBENCHMARKS_FULLSTACK_STREAMING_PUMP_H #define TEST_CPP_MICROBENCHMARKS_FULLSTACK_STREAMING_PUMP_H @@ -32,9 +32,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * BENCHMARKING KERNELS - */ +//****************************************************************************** +// BENCHMARKING KERNELS +// static void* tag(intptr_t x) { return reinterpret_cast(x); } diff --git a/test/cpp/microbenchmarks/fullstack_unary_ping_pong.h b/test/cpp/microbenchmarks/fullstack_unary_ping_pong.h index 55af57635eb..08c025e2ff4 100644 --- a/test/cpp/microbenchmarks/fullstack_unary_ping_pong.h +++ b/test/cpp/microbenchmarks/fullstack_unary_ping_pong.h @@ -1,22 +1,22 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// -/* Benchmark gRPC end2end in various configurations */ +// Benchmark gRPC end2end in various configurations #ifndef TEST_CPP_MICROBENCHMARKS_FULLSTACK_UNARY_PING_PONG_H #define TEST_CPP_MICROBENCHMARKS_FULLSTACK_UNARY_PING_PONG_H @@ -32,9 +32,9 @@ namespace grpc { namespace testing { -/******************************************************************************* - * BENCHMARKING KERNELS - */ +//****************************************************************************** +// BENCHMARKING KERNELS +// static void* tag(intptr_t x) { return reinterpret_cast(x); } diff --git a/test/cpp/microbenchmarks/helpers.cc b/test/cpp/microbenchmarks/helpers.cc index 3f504256a47..394030ac7ed 100644 --- a/test/cpp/microbenchmarks/helpers.cc +++ b/test/cpp/microbenchmarks/helpers.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 "test/cpp/microbenchmarks/helpers.h" diff --git a/test/cpp/microbenchmarks/helpers.h b/test/cpp/microbenchmarks/helpers.h index df1e9f00884..f48a4b66af5 100644 --- a/test/cpp/microbenchmarks/helpers.h +++ b/test/cpp/microbenchmarks/helpers.h @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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. +// +// #ifndef TEST_CPP_MICROBENCHMARKS_COUNTERS_H #define TEST_CPP_MICROBENCHMARKS_COUNTERS_H diff --git a/test/cpp/microbenchmarks/noop-benchmark.cc b/test/cpp/microbenchmarks/noop-benchmark.cc index 1ee469e07d6..203a3e5ee47 100644 --- a/test/cpp/microbenchmarks/noop-benchmark.cc +++ b/test/cpp/microbenchmarks/noop-benchmark.cc @@ -1,23 +1,23 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// -/* This benchmark exists to ensure that the benchmark integration is - * working */ +// This benchmark exists to ensure that the benchmark integration is +// working #include diff --git a/test/cpp/naming/address_sorting_test.cc b/test/cpp/naming/address_sorting_test.cc index b61ba3bbff8..e9a6af1c68e 100644 --- a/test/cpp/naming/address_sorting_test.cc +++ b/test/cpp/naming/address_sorting_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include @@ -188,17 +188,17 @@ void VerifyLbAddrOutputs(const grpc_core::ServerAddressList& addresses, } } -/* We need to run each test case inside of its own - * isolated grpc_init/grpc_shutdown pair, so that - * the "address sorting source addr factory" can be - * restored to its default for each test case. */ +// We need to run each test case inside of its own +// isolated grpc_init/grpc_shutdown pair, so that +// the "address sorting source addr factory" can be +// restored to its default for each test case. class AddressSortingTest : public ::testing::Test { protected: void SetUp() override { grpc_init(); } void TearDown() override { grpc_shutdown(); } }; -/* Tests for rule 1 */ +// Tests for rule 1 TEST_F(AddressSortingTest, TestDepriotizesUnreachableAddresses) { bool ipv4_supported = true; bool ipv6_supported = true; @@ -257,7 +257,7 @@ TEST_F(AddressSortingTest, TestDepriotizesUnsupportedDomainIpv4) { }); } -/* Tests for rule 2 */ +// Tests for rule 2 TEST_F(AddressSortingTest, TestDepriotizesNonMatchingScope) { bool ipv4_supported = true; @@ -281,7 +281,7 @@ TEST_F(AddressSortingTest, TestDepriotizesNonMatchingScope) { }); } -/* Tests for rule 5 */ +// Tests for rule 5 TEST_F(AddressSortingTest, TestUsesLabelFromDefaultTable) { bool ipv4_supported = true; @@ -304,8 +304,8 @@ TEST_F(AddressSortingTest, TestUsesLabelFromDefaultTable) { }); } -/* Flip the input on the test above to reorder the sort function's - * comparator's inputs. */ +// Flip the input on the test above to reorder the sort function's +// comparator's inputs. TEST_F(AddressSortingTest, TestUsesLabelFromDefaultTableInputFlipped) { bool ipv4_supported = true; bool ipv6_supported = true; @@ -327,7 +327,7 @@ TEST_F(AddressSortingTest, TestUsesLabelFromDefaultTableInputFlipped) { }); } -/* Tests for rule 6 */ +// Tests for rule 6 TEST_F(AddressSortingTest, TestUsesDestinationWithHigherPrecedenceWithAnIpv4Address) { @@ -510,7 +510,7 @@ TEST_F( }); } -/* Tests for rule 8 */ +// Tests for rule 8 TEST_F(AddressSortingTest, TestPrefersSmallerScope) { bool ipv4_supported = true; @@ -535,7 +535,7 @@ TEST_F(AddressSortingTest, TestPrefersSmallerScope) { }); } -/* Tests for rule 9 */ +// Tests for rule 9 TEST_F(AddressSortingTest, TestPrefersLongestMatchingSrcDstPrefix) { bool ipv4_supported = true; @@ -643,7 +643,7 @@ TEST_F(AddressSortingTest, TestPrefersLongestPrefixDiffersByLastBit) { }); } -/* Tests for rule 10 */ +// Tests for rule 10 TEST_F(AddressSortingTest, TestStableSort) { bool ipv4_supported = true; @@ -768,12 +768,12 @@ TEST_F(AddressSortingTest, TestStableSortV4CompatAndSiteLocalAddresses) { .value())); } -/* TestPrefersIpv6Loopback tests the actual "address probing" code - * for the current platform, without any mocks. - * This test relies on the assumption that the ipv6 loopback address is - * available in the hosts/containers that grpc C/C++ tests run on - * (whether ipv4 loopback is available or not, an available ipv6 - * loopback should be preferred). */ +// TestPrefersIpv6Loopback tests the actual "address probing" code +// for the current platform, without any mocks. +// This test relies on the assumption that the ipv6 loopback address is +// available in the hosts/containers that grpc C/C++ tests run on +// (whether ipv4 loopback is available or not, an available ipv6 +// loopback should be preferred). TEST_F(AddressSortingTest, TestPrefersIpv6Loopback) { auto lb_addrs = BuildLbAddrInputs({ {"[::1]:443", AF_INET6}, @@ -786,8 +786,8 @@ TEST_F(AddressSortingTest, TestPrefersIpv6Loopback) { }); } -/* Flip the order of the inputs above and expect the same output order - * (try to rule out influence of arbitrary qsort ordering) */ +// Flip the order of the inputs above and expect the same output order +// (try to rule out influence of arbitrary qsort ordering) TEST_F(AddressSortingTest, TestPrefersIpv6LoopbackInputsFlipped) { auto lb_addrs = BuildLbAddrInputs({ {"127.0.0.1:443", AF_INET}, @@ -800,10 +800,10 @@ TEST_F(AddressSortingTest, TestPrefersIpv6LoopbackInputsFlipped) { }); } -/* Try to rule out false positives in the above two tests in which - * the sorter might think that neither ipv6 or ipv4 loopback is - * available, but ipv6 loopback is still preferred only due - * to precedence table lookups. */ +// Try to rule out false positives in the above two tests in which +// the sorter might think that neither ipv6 or ipv4 loopback is +// available, but ipv6 loopback is still preferred only due +// to precedence table lookups. TEST_F(AddressSortingTest, TestSorterKnowsIpv6LoopbackIsAvailable) { sockaddr_in6 ipv6_loopback; memset(&ipv6_loopback, 0, sizeof(ipv6_loopback)); diff --git a/test/cpp/naming/cancel_ares_query_test.cc b/test/cpp/naming/cancel_ares_query_test.cc index 1ab3672af82..d413b753e22 100644 --- a/test/cpp/naming/cancel_ares_query_test.cc +++ b/test/cpp/naming/cancel_ares_query_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/naming/resolver_component_test.cc b/test/cpp/naming/resolver_component_test.cc index 22ea6a8f778..e73ccd1e56a 100644 --- a/test/cpp/naming/resolver_component_test.cc +++ b/test/cpp/naming/resolver_component_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -526,10 +526,10 @@ class CheckingResultHandler : public ResultHandler { int g_fake_non_responsive_dns_server_port = -1; -/* This function will configure any ares_channel created by the c-ares based - * resolver. This is useful to effectively mock /etc/resolv.conf settings - * (and equivalent on Windows), which unit tests don't have write permissions. - */ +// This function will configure any ares_channel created by the c-ares based +// resolver. This is useful to effectively mock /etc/resolv.conf settings +// (and equivalent on Windows), which unit tests don't have write permissions. +// void InjectBrokenNameServerList(ares_channel channel) { struct ares_addr_port_node dns_server_addrs[2]; memset(dns_server_addrs, 0, sizeof(dns_server_addrs)); diff --git a/test/cpp/naming/resolver_component_tests_runner_invoker.cc b/test/cpp/naming/resolver_component_tests_runner_invoker.cc index a80527cb271..8adeca0c75e 100644 --- a/test/cpp/naming/resolver_component_tests_runner_invoker.cc +++ b/test/cpp/naming/resolver_component_tests_runner_invoker.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 #include diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc index d50fc083421..20d4378f893 100644 --- a/test/cpp/performance/writes_per_rpc_test.cc +++ b/test/cpp/performance/writes_per_rpc_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -69,7 +69,7 @@ class EndpointPairFixture { grpc_core::ExecCtx exec_ctx; - /* add server endpoint to server_ */ + // add server endpoint to server_ { grpc_core::Server* core_server = grpc_core::Server::FromC(server_->c_server()); @@ -86,7 +86,7 @@ class EndpointPairFixture { grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr); } - /* create channel */ + // create channel { grpc_core::ChannelArgs args = grpc_core::CoreConfiguration::Get() diff --git a/test/cpp/qps/benchmark_config.cc b/test/cpp/qps/benchmark_config.cc index 3a44eab8d77..75bcda071b9 100644 --- a/test/cpp/qps/benchmark_config.cc +++ b/test/cpp/qps/benchmark_config.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/qps/benchmark_config.h" diff --git a/test/cpp/qps/benchmark_config.h b/test/cpp/qps/benchmark_config.h index d3d6910ff0b..77d9d31bb47 100644 --- a/test/cpp/qps/benchmark_config.h +++ b/test/cpp/qps/benchmark_config.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_BENCHMARK_CONFIG_H #define GRPC_TEST_CPP_UTIL_BENCHMARK_CONFIG_H @@ -26,11 +26,11 @@ namespace grpc { namespace testing { -/** Returns the benchmark Reporter instance. - * - * The returned instance will take care of generating reports for all the actual - * reporters configured via the "enable_*_reporter" command line flags (see - * benchmark_config.cc). */ +/// Returns the benchmark Reporter instance. +/// +/// The returned instance will take care of generating reports for all the +/// actual reporters configured via the "enable_*_reporter" command line flags +/// (see benchmark_config.cc). std::shared_ptr GetReporter(); } // namespace testing diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 27828e13eb8..cff54595cfe 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_CLIENT_H #define TEST_QPS_CLIENT_H @@ -451,9 +451,9 @@ class ClientImpl : public Client { void WaitForChannelsToConnect() { int connect_deadline_seconds = 10; - /* Allow optionally overriding connect_deadline in order - * to deal with benchmark environments in which the server - * can take a long time to become ready. */ + // Allow optionally overriding connect_deadline in order + // to deal with benchmark environments in which the server + // can take a long time to become ready. auto channel_connect_timeout_str = grpc_core::GetEnv("QPS_WORKER_CHANNEL_CONNECT_TIMEOUT"); if (channel_connect_timeout_str.has_value() && diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index f2aed3c2e04..d6c8354e617 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/qps/client_callback.cc b/test/cpp/qps/client_callback.cc index 01985a74148..1b6414a8448 100644 --- a/test/cpp/qps/client_callback.cc +++ b/test/cpp/qps/client_callback.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include @@ -41,9 +41,9 @@ namespace grpc { namespace testing { -/** - * Maintains context info per RPC - */ +/// +/// Maintains context info per RPC +/// struct CallbackClientRpcContext { explicit CallbackClientRpcContext(BenchmarkService::Stub* stub) : alarm_(nullptr), stub_(stub) {} @@ -79,12 +79,12 @@ class CallbackClient ~CallbackClient() override {} - /** - * The main thread of the benchmark will be waiting on DestroyMultithreading. - * Increment the rpcs_done_ variable to signify that the Callback RPC - * after thread completion is done. When the last outstanding rpc increments - * the counter it should also signal the main thread's conditional variable. - */ + /// + /// The main thread of the benchmark will be waiting on DestroyMultithreading. + /// Increment the rpcs_done_ variable to signify that the Callback RPC + /// after thread completion is done. When the last outstanding rpc increments + /// the counter it should also signal the main thread's conditional variable. + /// void NotifyMainThreadOfThreadCompletion() { std::lock_guard l(shutdown_mu_); rpcs_done_++; @@ -130,9 +130,9 @@ class CallbackClient return num_threads; } - /** - * Wait until all outstanding Callback RPCs are done - */ + /// + /// Wait until all outstanding Callback RPCs are done + /// void DestroyMultithreading() final { std::unique_lock l(shutdown_mu_); while (rpcs_done_ != total_outstanding_rpcs_) { diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index c9e0fcfb9aa..86c32e67924 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index 462c7f9bd30..f33568d3158 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/qps/driver.h" diff --git a/test/cpp/qps/driver.h b/test/cpp/qps/driver.h index 2e1d697cc2f..6e15ec02911 100644 --- a/test/cpp/qps/driver.h +++ b/test/cpp/qps/driver.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_DRIVER_H #define TEST_QPS_DRIVER_H diff --git a/test/cpp/qps/histogram.h b/test/cpp/qps/histogram.h index e0057d14b3b..3518d46aebd 100644 --- a/test/cpp/qps/histogram.h +++ b/test/cpp/qps/histogram.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_HISTOGRAM_H #define TEST_QPS_HISTOGRAM_H @@ -80,4 +80,4 @@ class Histogram { } // namespace testing } // namespace grpc -#endif /* TEST_QPS_HISTOGRAM_H */ +#endif // TEST_QPS_HISTOGRAM_H diff --git a/test/cpp/qps/inproc_sync_unary_ping_pong_test.cc b/test/cpp/qps/inproc_sync_unary_ping_pong_test.cc index ba0b9acf420..31dfa2541e6 100644 --- a/test/cpp/qps/inproc_sync_unary_ping_pong_test.cc +++ b/test/cpp/qps/inproc_sync_unary_ping_pong_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/qps/interarrival.h b/test/cpp/qps/interarrival.h index 8a3a2f03ef1..b2c6352ce9d 100644 --- a/test/cpp/qps/interarrival.h +++ b/test/cpp/qps/interarrival.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_INTERARRIVAL_H #define TEST_QPS_INTERARRIVAL_H diff --git a/test/cpp/qps/json_run_localhost.cc b/test/cpp/qps/json_run_localhost.cc index 96f7bca8e32..0e8828b11ad 100644 --- a/test/cpp/qps/json_run_localhost.cc +++ b/test/cpp/qps/json_run_localhost.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 #include diff --git a/test/cpp/qps/parse_json.cc b/test/cpp/qps/parse_json.cc index f3ac1052d4d..6300d04bc7c 100644 --- a/test/cpp/qps/parse_json.cc +++ b/test/cpp/qps/parse_json.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/qps/parse_json.h" diff --git a/test/cpp/qps/parse_json.h b/test/cpp/qps/parse_json.h index 6f61afc6222..3bbb6880061 100644 --- a/test/cpp/qps/parse_json.h +++ b/test/cpp/qps/parse_json.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef TEST_QPS_PARSE_JSON_H #define TEST_QPS_PARSE_JSON_H diff --git a/test/cpp/qps/qps_interarrival_test.cc b/test/cpp/qps/qps_interarrival_test.cc index 9cc68a1686d..a5dffca99a8 100644 --- a/test/cpp/qps/qps_interarrival_test.cc +++ b/test/cpp/qps/qps_interarrival_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/qps/qps_json_driver.cc b/test/cpp/qps/qps_json_driver.cc index c6cf60dcf2f..9984a4bd05b 100644 --- a/test/cpp/qps/qps_json_driver.cc +++ b/test/cpp/qps/qps_json_driver.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 #include diff --git a/test/cpp/qps/qps_openloop_test.cc b/test/cpp/qps/qps_openloop_test.cc index af97bb06ca1..33ff1b726a7 100644 --- a/test/cpp/qps/qps_openloop_test.cc +++ b/test/cpp/qps/qps_openloop_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/qps/qps_server_builder.cc b/test/cpp/qps/qps_server_builder.cc index 05d45455740..1b915cdf39b 100644 --- a/test/cpp/qps/qps_server_builder.cc +++ b/test/cpp/qps/qps_server_builder.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/qps/qps_server_builder.h" diff --git a/test/cpp/qps/qps_server_builder.h b/test/cpp/qps/qps_server_builder.h index 98f9fa72e97..07dd3c4d251 100644 --- a/test/cpp/qps/qps_server_builder.h +++ b/test/cpp/qps/qps_server_builder.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_QPS_SERVER_BUILDER_H #define GRPC_QPS_SERVER_BUILDER_H diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index 8a93d57c1a9..d3c0630fe12 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/qps/qps_worker.h" diff --git a/test/cpp/qps/qps_worker.h b/test/cpp/qps/qps_worker.h index 841260c776d..bb2273a70dc 100644 --- a/test/cpp/qps/qps_worker.h +++ b/test/cpp/qps/qps_worker.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef QPS_WORKER_H #define QPS_WORKER_H diff --git a/test/cpp/qps/report.cc b/test/cpp/qps/report.cc index bb6496a867f..a57a45d36e6 100644 --- a/test/cpp/qps/report.cc +++ b/test/cpp/qps/report.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/qps/report.h" diff --git a/test/cpp/qps/report.h b/test/cpp/qps/report.h index 6d8bc3a8da9..430b4767a1b 100644 --- a/test/cpp/qps/report.h +++ b/test/cpp/qps/report.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_REPORT_H #define TEST_QPS_REPORT_H @@ -32,50 +32,50 @@ namespace grpc { namespace testing { -/** Interface for all reporters. */ +/// Interface for all reporters. class Reporter { public: - /** Construct a reporter with the given \a name. */ + /// Construct a reporter with the given \a name. explicit Reporter(const string& name) : name_(name) {} virtual ~Reporter() {} - /** Returns this reporter's name. - * - * Names are constants, set at construction time. */ + /// Returns this reporter's name. + /// + /// Names are constants, set at construction time. string name() const { return name_; } - /** Reports QPS for the given \a result. */ + /// Reports QPS for the given \a result. virtual void ReportQPS(const ScenarioResult& result) = 0; - /** Reports QPS per core as (YYY/server core). */ + /// Reports QPS per core as (YYY/server core). virtual void ReportQPSPerCore(const ScenarioResult& result) = 0; - /** Reports latencies for the 50, 90, 95, 99 and 99.9 percentiles, in ms. */ + /// Reports latencies for the 50, 90, 95, 99 and 99.9 percentiles, in ms. virtual void ReportLatency(const ScenarioResult& result) = 0; - /** Reports system and user time for client and server systems. */ + /// Reports system and user time for client and server systems. virtual void ReportTimes(const ScenarioResult& result) = 0; - /** Reports server cpu usage. */ + /// Reports server cpu usage. virtual void ReportCpuUsage(const ScenarioResult& result) = 0; - /** Reports client and server poll usage inside completion queue. */ + /// Reports client and server poll usage inside completion queue. virtual void ReportPollCount(const ScenarioResult& result) = 0; - /** Reports queries per cpu-sec. */ + /// Reports queries per cpu-sec. virtual void ReportQueriesPerCpuSec(const ScenarioResult& result) = 0; private: const string name_; }; -/** A composite for all reporters to be considered. */ +/// A composite for all reporters to be considered. class CompositeReporter : public Reporter { public: CompositeReporter() : Reporter("CompositeReporter") {} - /** Adds a \a reporter to the composite. */ + /// Adds a \a reporter to the composite. void add(std::unique_ptr reporter); void ReportQPS(const ScenarioResult& result) override; @@ -90,7 +90,7 @@ class CompositeReporter : public Reporter { std::vector > reporters_; }; -/** Reporter to gpr_log(GPR_INFO). */ +/// Reporter to gpr_log(GPR_INFO). class GprLogReporter : public Reporter { public: explicit GprLogReporter(const string& name) : Reporter(name) {} @@ -105,7 +105,7 @@ class GprLogReporter : public Reporter { void ReportQueriesPerCpuSec(const ScenarioResult& result) override; }; -/** Dumps the report to a JSON file. */ +/// Dumps the report to a JSON file. class JsonReporter : public Reporter { public: JsonReporter(const string& name, const string& report_file) diff --git a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc index 416c0bc0fed..388ad91eb32 100644 --- a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc +++ b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h index 9c286781351..f3451fca777 100644 --- a/test/cpp/qps/server.h +++ b/test/cpp/qps/server.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_SERVER_H #define TEST_QPS_SERVER_H diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 108acdeba59..f643ce53a05 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/qps/server_callback.cc b/test/cpp/qps/server_callback.cc index f2583042096..bb2f2f16c3d 100644 --- a/test/cpp/qps/server_callback.cc +++ b/test/cpp/qps/server_callback.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include #include diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc index 7fec46b1b0d..f78e17c2157 100644 --- a/test/cpp/qps/server_sync.cc +++ b/test/cpp/qps/server_sync.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/qps/stats.h b/test/cpp/qps/stats.h index 1ab0f11fb86..3676cc78967 100644 --- a/test/cpp/qps/stats.h +++ b/test/cpp/qps/stats.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_STATS_UTILS_H #define TEST_QPS_STATS_UTILS_H diff --git a/test/cpp/qps/usage_timer.cc b/test/cpp/qps/usage_timer.cc index 29a6aaabd33..a06a555acbc 100644 --- a/test/cpp/qps/usage_timer.cc +++ b/test/cpp/qps/usage_timer.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/qps/usage_timer.h" diff --git a/test/cpp/qps/usage_timer.h b/test/cpp/qps/usage_timer.h index cdd2aff8c5b..f10733a550c 100644 --- a/test/cpp/qps/usage_timer.h +++ b/test/cpp/qps/usage_timer.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef TEST_QPS_USAGE_TIMER_H #define TEST_QPS_USAGE_TIMER_H diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index 3be0ae3e8bd..3d2614a1048 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/server/load_reporter/get_cpu_stats_test.cc b/test/cpp/server/load_reporter/get_cpu_stats_test.cc index 09f1df0bfd8..95ef6352f60 100644 --- a/test/cpp/server/load_reporter/get_cpu_stats_test.cc +++ b/test/cpp/server/load_reporter/get_cpu_stats_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/server/load_reporter/load_data_store_test.cc b/test/cpp/server/load_reporter/load_data_store_test.cc index c623422f32c..e5f9cf0a57b 100644 --- a/test/cpp/server/load_reporter/load_data_store_test.cc +++ b/test/cpp/server/load_reporter/load_data_store_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/server/load_reporter/load_reporter_test.cc b/test/cpp/server/load_reporter/load_reporter_test.cc index b171d86b393..a5acdda391c 100644 --- a/test/cpp/server/load_reporter/load_reporter_test.cc +++ b/test/cpp/server/load_reporter/load_reporter_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/server/server_builder_test.cc b/test/cpp/server/server_builder_test.cc index 953d8d7b607..14eaa5efb7d 100644 --- a/test/cpp/server/server_builder_test.cc +++ b/test/cpp/server/server_builder_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/server/server_builder_with_socket_mutator_test.cc b/test/cpp/server/server_builder_with_socket_mutator_test.cc index 02573656ad9..ee1141375b3 100644 --- a/test/cpp/server/server_builder_with_socket_mutator_test.cc +++ b/test/cpp/server/server_builder_with_socket_mutator_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 @@ -30,10 +30,10 @@ #include "test/core/util/port.h" #include "test/core/util/test_config.h" -/* This test does a sanity check that grpc_socket_mutator's - * are used by servers. It's meant to protect code and end-to-end - * tests that rely on this functionality but which live outside - * of the grpc github repo. */ +// This test does a sanity check that grpc_socket_mutator's +// are used by servers. It's meant to protect code and end-to-end +// tests that rely on this functionality but which live outside +// of the grpc github repo. namespace grpc { namespace { diff --git a/test/cpp/server/server_request_call_test.cc b/test/cpp/server/server_request_call_test.cc index 399f0c3ef90..f131362f0fa 100644 --- a/test/cpp/server/server_request_call_test.cc +++ b/test/cpp/server/server_request_call_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/test/client_context_test_peer_test.cc b/test/cpp/test/client_context_test_peer_test.cc index f04032494d6..ee1347cdb21 100644 --- a/test/cpp/test/client_context_test_peer_test.cc +++ b/test/cpp/test/client_context_test_peer_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2021 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. - * - */ +// +// +// Copyright 2021 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 #include diff --git a/test/cpp/test/mock_stream_test.cc b/test/cpp/test/mock_stream_test.cc index 2c7c5e59c83..f88be58c360 100644 --- a/test/cpp/test/mock_stream_test.cc +++ b/test/cpp/test/mock_stream_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2020 the 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. - * - */ +// +// +// Copyright 2020 the 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 diff --git a/test/cpp/test/server_context_test_spouse_test.cc b/test/cpp/test/server_context_test_spouse_test.cc index 8034fbcb8c5..e778484d88a 100644 --- a/test/cpp/test/server_context_test_spouse_test.cc +++ b/test/cpp/test/server_context_test_spouse_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/thread_manager/thread_manager_test.cc b/test/cpp/thread_manager/thread_manager_test.cc index 712d4d9fc44..3436a0530dd 100644 --- a/test/cpp/thread_manager/thread_manager_test.cc +++ b/test/cpp/thread_manager/thread_manager_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - *is % allowed in string - */ +// +// +// Copyright 2016 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. +// is % allowed in string +// #include diff --git a/test/cpp/util/byte_buffer_proto_helper.cc b/test/cpp/util/byte_buffer_proto_helper.cc index 86271c988d4..dd9b93e8341 100644 --- a/test/cpp/util/byte_buffer_proto_helper.cc +++ b/test/cpp/util/byte_buffer_proto_helper.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/byte_buffer_proto_helper.h" diff --git a/test/cpp/util/byte_buffer_proto_helper.h b/test/cpp/util/byte_buffer_proto_helper.h index eb923eccb57..ecc0085039a 100644 --- a/test/cpp/util/byte_buffer_proto_helper.h +++ b/test/cpp/util/byte_buffer_proto_helper.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_BYTE_BUFFER_PROTO_HELPER_H #define GRPC_TEST_CPP_UTIL_BYTE_BUFFER_PROTO_HELPER_H diff --git a/test/cpp/util/byte_buffer_test.cc b/test/cpp/util/byte_buffer_test.cc index 4fd27c30f03..cba3b3b650b 100644 --- a/test/cpp/util/byte_buffer_test.cc +++ b/test/cpp/util/byte_buffer_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/util/channel_trace_proto_helper.cc b/test/cpp/util/channel_trace_proto_helper.cc index 82fddc2f07d..fc0f91c9683 100644 --- a/test/cpp/util/channel_trace_proto_helper.cc +++ b/test/cpp/util/channel_trace_proto_helper.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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 diff --git a/test/cpp/util/channel_trace_proto_helper.h b/test/cpp/util/channel_trace_proto_helper.h index 664e899deb6..791b8ae698d 100644 --- a/test/cpp/util/channel_trace_proto_helper.h +++ b/test/cpp/util/channel_trace_proto_helper.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2018 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. - * - */ +// +// +// Copyright 2018 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_CHANNEL_TRACE_PROTO_HELPER_H #define GRPC_TEST_CPP_UTIL_CHANNEL_TRACE_PROTO_HELPER_H diff --git a/test/cpp/util/channelz_sampler.cc b/test/cpp/util/channelz_sampler.cc index b3144e1b023..29698665f17 100644 --- a/test/cpp/util/channelz_sampler.cc +++ b/test/cpp/util/channelz_sampler.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 #include diff --git a/test/cpp/util/channelz_sampler_test.cc b/test/cpp/util/channelz_sampler_test.cc index b367034ea5a..209721f1544 100644 --- a/test/cpp/util/channelz_sampler_test.cc +++ b/test/cpp/util/channelz_sampler_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 #include diff --git a/test/cpp/util/cli_call.cc b/test/cpp/util/cli_call.cc index b6f16fad1dd..00b26da11f4 100644 --- a/test/cpp/util/cli_call.cc +++ b/test/cpp/util/cli_call.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/util/cli_call.h" diff --git a/test/cpp/util/cli_call.h b/test/cpp/util/cli_call.h index d2130733d2f..f2a43f9d789 100644 --- a/test/cpp/util/cli_call.h +++ b/test/cpp/util/cli_call.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_CLI_CALL_H #define GRPC_TEST_CPP_UTIL_CLI_CALL_H diff --git a/test/cpp/util/cli_call_test.cc b/test/cpp/util/cli_call_test.cc index 48523924241..5c106e939e7 100644 --- a/test/cpp/util/cli_call_test.cc +++ b/test/cpp/util/cli_call_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/util/cli_call.h" diff --git a/test/cpp/util/cli_credentials.cc b/test/cpp/util/cli_credentials.cc index 579c7958544..439cfedefc7 100644 --- a/test/cpp/util/cli_credentials.cc +++ b/test/cpp/util/cli_credentials.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/cli_credentials.h" diff --git a/test/cpp/util/cli_credentials.h b/test/cpp/util/cli_credentials.h index 4c534fa5f54..dbf20f7b5ea 100644 --- a/test/cpp/util/cli_credentials.h +++ b/test/cpp/util/cli_credentials.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_CLI_CREDENTIALS_H #define GRPC_TEST_CPP_UTIL_CLI_CREDENTIALS_H diff --git a/test/cpp/util/config_grpc_cli.h b/test/cpp/util/config_grpc_cli.h index 358884196df..f6d0034b13d 100644 --- a/test/cpp/util/config_grpc_cli.h +++ b/test/cpp/util/config_grpc_cli.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_CONFIG_GRPC_CLI_H #define GRPC_TEST_CPP_UTIL_CONFIG_GRPC_CLI_H diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc index 4ca10b62c1d..0707cd94e8d 100644 --- a/test/cpp/util/create_test_channel.cc +++ b/test/cpp/util/create_test_channel.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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 "test/cpp/util/create_test_channel.h" diff --git a/test/cpp/util/create_test_channel.h b/test/cpp/util/create_test_channel.h index d217c64a261..8d04668213b 100644 --- a/test/cpp/util/create_test_channel.h +++ b/test/cpp/util/create_test_channel.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2015-2016 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. - * - */ +// +// +// Copyright 2015-2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H #define GRPC_TEST_CPP_UTIL_CREATE_TEST_CHANNEL_H diff --git a/test/cpp/util/error_details_test.cc b/test/cpp/util/error_details_test.cc index b443b1ff9db..3849d9c00e3 100644 --- a/test/cpp/util/error_details_test.cc +++ b/test/cpp/util/error_details_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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. - * - */ +// +// +// 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 diff --git a/test/cpp/util/grpc_cli.cc b/test/cpp/util/grpc_cli.cc index 88ce1b76c31..48d07b37c79 100644 --- a/test/cpp/util/grpc_cli.cc +++ b/test/cpp/util/grpc_cli.cc @@ -1,64 +1,65 @@ -/* +// - * 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 - * - * 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. - * - */ +// 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 +// +// 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. +// +// -/* - A command line tool to talk to a grpc server. - Run `grpc_cli help` command to see its usage information. +// +// A command line tool to talk to a grpc server. +// Run `grpc_cli help` command to see its usage information. - Example of talking to grpc interop server: - grpc_cli call localhost:50051 UnaryCall "response_size:10" \ - --protofiles=src/proto/grpc/testing/test.proto \ - --channel_creds_type=insecure +// Example of talking to grpc interop server: +// grpc _cli call localhost:50051 UnaryCall "response_size:10" \ +// --protofiles=src/proto/grpc/testing/test.proto \ +// --channel_creds_type=insecure - Options: - 1. --protofiles, use this flag to provide proto files if the server does - does not have the reflection service. - 2. --proto_path, if your proto file is not under current working directory, - use this flag to provide a search root. It should work similar to the - counterpart in protoc. This option is valid only when protofiles is - provided. - 3. --metadata specifies metadata to be sent to the server, such as: - --metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2" - 4. --channel_creds_type, whether to use tls, insecure or platform-specific - options. - 5. --use_auth, if set to true, attach a GoogleDefaultCredentials to the call - 6. --infile, input filename (defaults to stdin) - 7. --outfile, output filename (defaults to stdout) - 8. --binary_input, use the serialized request as input. The serialized - request can be generated by calling something like: - protoc --proto_path=src/proto/grpc/testing/ \ - --encode=grpc.testing.SimpleRequest \ - src/proto/grpc/testing/messages.proto \ - < input.txt > input.bin - If this is used and no proto file is provided in the argument list, the - method string has to be exact in the form of /package.service/method. - 9. --binary_output, use binary format response as output, it can - be later decoded using protoc: - protoc --proto_path=src/proto/grpc/testing/ \ - --decode=grpc.testing.SimpleResponse \ - src/proto/grpc/testing/messages.proto \ - < output.bin > output.txt - 10. --default_service_config, optional default service config to use - on the channel. Note that this may be ignored if the name resolver - returns a service config. - 11. --display_peer_address, on CallMethod commands, log the peer socket - address of the connection that each RPC is made on to stderr. -*/ +// Options: +// 1. --protofiles, use this flag to provide proto files if the server does +// does not have the reflection service. +// 2. --proto_path, if your proto file is not under current working directory, +// use this flag to provide a search root. It should work similar to the +// counterpart in protoc. This option is valid only when protofiles is +// provided. +// 3. --metadata specifies metadata to be sent to the server, such as: +// --metadata="MyHeaderKey1:Value1:MyHeaderKey2:Value2" +// 4. --channel_creds_type, whether to use tls, insecure or platform-specific +// options. +// 5. --use_auth, if set to true, attach a GoogleDefaultCredentials to the +// call +// 6. --infile, input filename (defaults to stdin) +// 7. --outfile, output filename (defaults to stdout) +// 8. --binary_input, use the serialized request as input. The serialized +// request can be generated by calling something like: +// pr otoc --proto_path=src/proto/grpc/testing/ \ +// --encode=grpc.testing.SimpleRequest \ +// src/proto/grpc/testing/messages.proto \ +// < input.txt > input.bin +// If this is used and no proto file is provided in the argument list, the +// method string has to be exact in the form of /package.service/method. +// 9. --binary_output, use binary format response as output, it can +// be later decoded using protoc: +// protoc --proto_path=src/proto/grpc/testing/ \ +// --decode=grpc.testing.SimpleResponse \ +// src/proto/grpc/testing/messages.proto \ +// < output.bin > output.txt +// 10. --default_service_config, optional default service config to use +// on the channel. Note that this may be ignored if the name resolver +// returns a service config. +// 11. --display_peer_address, on CallMethod commands, log the peer socket +// address of the connection that each RPC is made on to stderr. +// #include #include diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index 07eea786b8d..90da1b6113f 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 diff --git a/test/cpp/util/grpc_tool.h b/test/cpp/util/grpc_tool.h index 124ace3f580..471830f2fcb 100644 --- a/test/cpp/util/grpc_tool.h +++ b/test/cpp/util/grpc_tool.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_GRPC_TOOL_H #define GRPC_TEST_CPP_UTIL_GRPC_TOOL_H diff --git a/test/cpp/util/grpc_tool_test.cc b/test/cpp/util/grpc_tool_test.cc index 7b1a5754686..c204702dfd2 100644 --- a/test/cpp/util/grpc_tool_test.cc +++ b/test/cpp/util/grpc_tool_test.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/grpc_tool.h" diff --git a/test/cpp/util/metrics_server.cc b/test/cpp/util/metrics_server.cc index 9504c700fa9..715043f357d 100644 --- a/test/cpp/util/metrics_server.cc +++ b/test/cpp/util/metrics_server.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #include "test/cpp/util/metrics_server.h" diff --git a/test/cpp/util/metrics_server.h b/test/cpp/util/metrics_server.h index 732e8520489..c4bd2214149 100644 --- a/test/cpp/util/metrics_server.h +++ b/test/cpp/util/metrics_server.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - *is % allowed in string - */ +// +// +// 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 +// +// 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. +// is % allowed in string +// #ifndef GRPC_TEST_CPP_METRICS_SERVER_H #define GRPC_TEST_CPP_METRICS_SERVER_H @@ -26,27 +26,27 @@ #include "src/proto/grpc/testing/metrics.grpc.pb.h" #include "src/proto/grpc/testing/metrics.pb.h" -/* - * This implements a Metrics server defined in - * src/proto/grpc/testing/metrics.proto. Any - * test service can use this to export Metrics (TODO (sreek): Only Gauges for - * now). - * - * Example: - * MetricsServiceImpl metricsImpl; - * .. - * // Create QpsGauge(s). Note: QpsGauges can be created even after calling - * // 'StartServer'. - * QpsGauge qps_gauge1 = metricsImpl.CreateQpsGauge("foo", is_present); - * // qps_gauge1 can now be used anywhere in the program by first making a - * // one-time call qps_gauge1.Reset() and then calling qps_gauge1.Incr() - * // every time to increment a query counter - * - * ... - * // Create the metrics server - * std::unique_ptr server = metricsImpl.StartServer(port); - * server->Wait(); // Note: This is blocking. - */ +// +// This implements a Metrics server defined in +// src/proto/grpc/testing/metrics.proto. Any +// test service can use this to export Metrics (TODO (sreek): Only Gauges for +// now). +// +// Example: +// MetricsServiceImpl metricsImpl; +// .. +// // Create QpsGauge(s). Note: QpsGauges can be created even after calling +// // 'StartServer'. +// QpsGauge qps_gauge1 = metricsImpl.CreateQpsGauge("foo", is_present); +// // qps_gauge1 can now be used anywhere in the program by first making a +// // one-time call qps_gauge1.Reset() and then calling qps_gauge1.Incr() +// // every time to increment a query counter +// +// ... +// // Create the metrics server +// std::unique_ptr server = metricsImpl.StartServer(port); +// server->Wait(); // Note: This is blocking. +// namespace grpc { namespace testing { diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc index 92bbf4241d2..97ac68f1795 100644 --- a/test/cpp/util/proto_file_parser.cc +++ b/test/cpp/util/proto_file_parser.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/proto_file_parser.h" diff --git a/test/cpp/util/proto_file_parser.h b/test/cpp/util/proto_file_parser.h index 29ea6331316..a397aa43eeb 100644 --- a/test/cpp/util/proto_file_parser.h +++ b/test/cpp/util/proto_file_parser.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_PROTO_FILE_PARSER_H #define GRPC_TEST_CPP_UTIL_PROTO_FILE_PARSER_H diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index f2356021dff..c9b6cfc3839 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/proto_reflection_descriptor_database.h" diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h index b8c9bab9fd7..9e0181492ee 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.h +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H #define GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H diff --git a/test/cpp/util/service_describer.cc b/test/cpp/util/service_describer.cc index f5b6208df6d..3b503fcd9e3 100644 --- a/test/cpp/util/service_describer.cc +++ b/test/cpp/util/service_describer.cc @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/service_describer.h" diff --git a/test/cpp/util/service_describer.h b/test/cpp/util/service_describer.h index 9e00eee1f56..d730cf7cbec 100644 --- a/test/cpp/util/service_describer.h +++ b/test/cpp/util/service_describer.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_SERVICE_DESCRIBER_H #define GRPC_TEST_CPP_UTIL_SERVICE_DESCRIBER_H diff --git a/test/cpp/util/slice_test.cc b/test/cpp/util/slice_test.cc index 2bb57cc2302..ade9c60df8e 100644 --- a/test/cpp/util/slice_test.cc +++ b/test/cpp/util/slice_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/util/string_ref_helper.cc b/test/cpp/util/string_ref_helper.cc index 247e7a7147f..40c5d9055e5 100644 --- a/test/cpp/util/string_ref_helper.cc +++ b/test/cpp/util/string_ref_helper.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/util/string_ref_helper.h" diff --git a/test/cpp/util/string_ref_helper.h b/test/cpp/util/string_ref_helper.h index a9fb553e3a8..a8f42e62af0 100644 --- a/test/cpp/util/string_ref_helper.h +++ b/test/cpp/util/string_ref_helper.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_STRING_REF_HELPER_H #define GRPC_TEST_CPP_UTIL_STRING_REF_HELPER_H diff --git a/test/cpp/util/string_ref_test.cc b/test/cpp/util/string_ref_test.cc index abce2b5f738..2bba7dd50b3 100644 --- a/test/cpp/util/string_ref_test.cc +++ b/test/cpp/util/string_ref_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/util/subprocess.cc b/test/cpp/util/subprocess.cc index ddaad898050..1cd7fbd44a4 100644 --- a/test/cpp/util/subprocess.cc +++ b/test/cpp/util/subprocess.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 "test/cpp/util/subprocess.h" diff --git a/test/cpp/util/subprocess.h b/test/cpp/util/subprocess.h index d75de16b872..59e5d674f8e 100644 --- a/test/cpp/util/subprocess.h +++ b/test/cpp/util/subprocess.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_SUBPROCESS_H #define GRPC_TEST_CPP_UTIL_SUBPROCESS_H diff --git a/test/cpp/util/test_config.h b/test/cpp/util/test_config.h index 094ed44f632..233e5a695f5 100644 --- a/test/cpp/util/test_config.h +++ b/test/cpp/util/test_config.h @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_TEST_CONFIG_H #define GRPC_TEST_CPP_UTIL_TEST_CONFIG_H diff --git a/test/cpp/util/test_config_cc.cc b/test/cpp/util/test_config_cc.cc index 866540d580f..cf32dbc0eae 100644 --- a/test/cpp/util/test_config_cc.cc +++ b/test/cpp/util/test_config_cc.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index b635e27cba1..8cb2b3e0ffe 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -1,21 +1,21 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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 "test/cpp/util/test_credentials_provider.h" diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 89827a0b120..40f90703237 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -1,20 +1,20 @@ -/* - * - * Copyright 2016 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. - * - */ +// +// +// Copyright 2016 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. +// +// #ifndef GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H #define GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H diff --git a/test/cpp/util/time_test.cc b/test/cpp/util/time_test.cc index 33f6962c024..be2cdf21b80 100644 --- a/test/cpp/util/time_test.cc +++ b/test/cpp/util/time_test.cc @@ -1,20 +1,20 @@ -/* - * - * 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 - * - * 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. - * - */ +// +// +// 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 +// +// 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 diff --git a/tools/distrib/check_include_guards.py b/tools/distrib/check_include_guards.py index 723e6ca84d5..1d1b70c6cb6 100755 --- a/tools/distrib/check_include_guards.py +++ b/tools/distrib/check_include_guards.py @@ -132,9 +132,11 @@ class GuardValidator(object): # Is there a properly commented #endif? flines = fcontents.rstrip().splitlines() - match = self.endif_c_core_re.search('\n'.join(flines[-3:])) + # Use findall and use the last result if there are multiple matches, + # i.e. nested include guards. + match = self.endif_c_core_re.findall('\n'.join(flines[-3:])) if not match and not c_core_header: - match = self.endif_re.search('\n'.join(flines[-3:])) + match = self.endif_re.findall('\n'.join(flines[-3:])) if not match: # No endif. Check if we have the last line as just '#endif' and if so # replace it with a properly commented one. @@ -152,10 +154,10 @@ class GuardValidator(object): fpath, self.endif_c_core_re if c_core_header else self.endif_re, flines[-1], '', '', False) - elif match.group(1) != running_guard: + elif match[-1] != running_guard: # Is the #endif guard the same as the #ifndef and #define guards? - fcontents = self.fail(fpath, self.endif_re, fcontents, - match.group(1), valid_guard, fix) + fcontents = self.fail(fpath, self.endif_re, fcontents, match[-1], + valid_guard, fix) if fix: save(fpath, fcontents) diff --git a/tools/run_tests/sanity/check_deprecated_grpc++.py b/tools/run_tests/sanity/check_deprecated_grpc++.py index b57651b4ce4..28f20f404c1 100755 --- a/tools/run_tests/sanity/check_deprecated_grpc++.py +++ b/tools/run_tests/sanity/check_deprecated_grpc++.py @@ -89,23 +89,23 @@ expected_files = [ "include/grpc++/test/server_context_test_spouse.h" ] -file_template = '''/* - * - * Copyright 2018 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. - * - */ +file_template = '''// +// +// Copyright 2018 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. +// +// // DEPRECATED: The headers in include/grpc++ are deprecated. Please include the // headers in include/grpcpp instead. This header exists only for backwards