소스 검색

Fix handling of gRPC errors when the stream is finished

- Handle the gRPC errors if the assigned QNetworkReply is finished
  without network error and send the QGrpcStream::finish() signal
  if no gRPC error received from server.
- Cancel all gRPC streams when re-attaching the channel.

Fixes #259
Alexey Edelev 2 년 전
부모
커밋
51615ca6bb
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/grpc/qabstractgrpcclient.cpp

+ 3 - 0
src/grpc/qabstractgrpcclient.cpp

@@ -71,6 +71,9 @@ void QAbstractGrpcClient::attachChannel(const std::shared_ptr<QAbstractGrpcChann
     }
     dPtr->channel = channel;
     dPtr->serializer = channel->serializer();
+    for (auto stream : dPtr->activeStreams) {
+        stream->cancel();
+    }
 }
 
 QGrpcStatus QAbstractGrpcClient::call(const QString &method, const QByteArray &arg, QByteArray &ret)