forked from genofire/unified-push-xmpp
fix deadlock on distributor register (#7)
Closes #6 I'm not sure if this is the correct solution according to the library, but it *is* one that works. Co-authored-by: Karmanyaah Malhotra <karmanyaahm@gmail.com> Reviewed-on: genofire/unified-push-xmpp#7 Co-authored-by: karmanyaahm <karmanyaahm@noreply.%(DOMAIN)s> Co-committed-by: karmanyaahm <karmanyaahm@noreply.%(DOMAIN)s>
This commit is contained in:
parent
88c59ac00b
commit
7647fc1631
|
@ -128,6 +128,10 @@ func (s *XMPPService) Register(appName, token string) (string, string, error) {
|
||||||
logger.Errorf("xmpp recv IQ for register: %v", err)
|
logger.Errorf("xmpp recv IQ for register: %v", err)
|
||||||
return "", "xmpp unable recv iq to gateway", err
|
return "", "xmpp unable recv iq to gateway", err
|
||||||
}
|
}
|
||||||
|
if err := t.Close(); err != nil {
|
||||||
|
logger.Errorf("unable to close registration response %v", err)
|
||||||
|
return "", "xmpp unable recv iq to gateway", err
|
||||||
|
}
|
||||||
if endpoint := iqRegister.Register.Endpoint; endpoint != nil {
|
if endpoint := iqRegister.Register.Endpoint; endpoint != nil {
|
||||||
logger.WithField("endpoint", endpoint.Body).Info("success")
|
logger.WithField("endpoint", endpoint.Body).Info("success")
|
||||||
return endpoint.Body, "", nil
|
return endpoint.Body, "", nil
|
||||||
|
|
Loading…
Reference in New Issue