Explorar el Código

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 hace 2 años
padre
commit
686fee7b67
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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)