Reset RPC input stream after aborting the connection

Without reset, on reconnection, the input stream reads the buffered
data before abort.
This commit is contained in:
Srivats P 2020-05-12 21:56:40 +05:30
parent 75ce626532
commit 1bc2d08fdb

View File

@ -417,6 +417,13 @@ _top:
// so we overload a SSL error to indicate abort
emit error(QAbstractSocket::SslInvalidUserDataError);
mpSocket->abort();
// reset inStream - there's no way to do that currently, so
// we delete-create
delete inStream;
inStream = new google::protobuf::io::CopyingInputStreamAdaptor(
new PbQtInputStream(mpSocket));
inStream->SetOwnsCopyingStream(true);
goto _exit2;
}