mirror of https://github.com/qt/qtgrpc.git
Check the return value of QFile::open calls
As it's defined as [[nodiscard]]. Pick-to: 6.8 6.9 Change-Id: I849922ed7bd64a4f67e6da0e11b1d6b4ad38deb7 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
parent
8bcd951804
commit
dfc3306e1a
|
@ -329,11 +329,17 @@ void TestServer::run(qint64 latency)
|
|||
|
||||
grpc::ServerBuilder builder;
|
||||
QFile cfile(":/assets/cert.pem");
|
||||
cfile.open(QFile::ReadOnly);
|
||||
if (!cfile.open(QFile::ReadOnly)) {
|
||||
qDebug() << "Unable to open SSL certificate. Test lacks resources.";
|
||||
return;
|
||||
}
|
||||
QString cert = cfile.readAll();
|
||||
|
||||
QFile kfile(":/assets/key.pem");
|
||||
kfile.open(QFile::ReadOnly);
|
||||
if (!kfile.open(QFile::ReadOnly)){
|
||||
qDebug() << "Unable to open SSL key. Test lacks resources.";
|
||||
return;
|
||||
}
|
||||
QString key = kfile.readAll();
|
||||
|
||||
grpc::SslServerCredentialsOptions opts(GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE);
|
||||
|
|
Loading…
Reference in New Issue