PingManager: Make exception for feature-not-implemented
The ping manager rightfully makes an exception (=return true despite error) if the pinged entity replies with cancel/service-unavailable. However quite a few implementations will return cancel/feature-not-implemented instead. (ejabberd is an example but there are also a few clients which do (Conversations). I think it would make sense for the Ping Manager to accept feature-not-implemented as well. At least I don't see a downside.
Comments (7)
-
reporter -
repo owner Thanks for reporting. You are right, we could take feature-not-implemented into account as well.
The bare JID was originally used, because the assumption was, that on exception, the server had responded on behalf of the client, meaning the client is offline. (pong = false). See code comment.
Need to rethink this. We probably should examine the from attribute of the response as well.
-
repo owner - changed status to resolved
Improve PingManager.
A feature-not-implemented response should result in a positive pong as well.
Pongs which came from other clients are always positive, even if they are error responses.
Fixes issue
#113.→ <<cset c1630443a00d>>
-
repo owner @iNPUTmice I'd be happy if you could please review the above change. Error responses from a bare JID are now true if service-unavailable or feature-not-implemented, else false. Error responses from a full JID are always true.
-
repo owner Improve PingManager.
A feature-not-implemented response should result in a positive pong as well.
Pongs which came from other clients are always positive, even if they are error responses.
Fixes issue
#113.→ <<cset 1ce69260dd63>>
-
repo owner Fix version: 0.7.5
-
repo owner - changed status to closed
- Log in to comment
On a related note I don’t understand why the the error response parser only yields true if the response came from a bare JID. I think it is completely legitimate behaviour when the error response (service-unavailable/feature not implemented) comes from a full jid (a client for example)
If anything it might make some sense to check if input jid is equal to the jid responsding to the error (however they should never be not equal)
cheers Daniel