- changed status to closed
Double finished emit
When QJsonRpcHttpReply
encounters an error, finished()
will be emitted twice, both for networkReplyFinished()
and networkReplyError()
. From a isolated point of view you have now clue if the second finished() is from the same error or a new one without doing extra checks.
I think a simple solution would be to just return when we in networkReplyFinished()
figure out it's an error - so we just let networkReplyError()
deal with the reply (just as stated by // this should be handled by the networkReplyError slot
).
Thanks in advance :)
Anders
Comments (4)
-
-
Hey, thanks for the bug report. It turns out that finished is always called even if an error is encountered, so just emitting finished in the network reply's finished slot is enough here.
-
reporter You're welcome, and thanks for the lib - we just started using it :)
Regarding whether
finished()
is emitted, we've always been a bit annoyed by the Qt documentation, where it says (for theerror()
signal):The finished() signal will probably follow, indicating that the connection is over.
However, we have an idea that the only situations wherefinished()
won't be emitted aftererror()
is when you have an ongoing connection and it hopefully always will be emitted for http. -
@Anigif sounds good, please let me know if you run into a situation where this is not the case, we can easily add tests cases for it. Cheers
- Log in to comment
fix(QJsonRpcHttpReply): only emit finished once
closes
#23→ <<cset 7e4aef3b43b8>>