envoyproxy / envoyproxy/envoy

grpc async client should catch proto cast exception

オープン
#5,409 コメント 2 件 リアクション 0 件 担当者 1 名 @hello-jianghongke が担当を希望しています GitHub で見る
enhancement help wanted
主要言語
C++
スター
28.9k
フォーク
5.6k
平均マージ
1日 22時間
マージ済み PR(30日)
430

説明

*Title*: *grpc async client should catch proto cast exception*

*Description*:
> grpc async client proto cast catches no exception as follows:
`include\envoy\grpc\async_client.h`
```
void onReceiveMessageUntyped(ProtobufTypes::MessagePtr&& message) override {
onReceiveMessage(std::unique_ptr(dynamic_cast(message.release())));
}
```
which may crashs the process when the received message is not standard, like `00 00 00 00 00`.

And should be modified as follows:
```
void onReceiveMessageUntyped(ProtobufTypes::MessagePtr&& message) override {
try {
onReceiveMessage(std::unique_ptr(dynamic_cast(message.release())));
} catch(const std::exception& e) {
std::cout << "wrong message received, error: " << e.what() << std::endl;
}
}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。