fix stuck on register #7

Merged
genofire merged 1 commits from karmanyaahm/unified-push-xmpp:deadlock into main 2021-09-14 08:09:03 +02:00
1 changed files with 4 additions and 0 deletions
Showing only changes of commit 8d526b10b0 - Show all commits

View File

@ -128,6 +128,10 @@ func (s *XMPPService) Register(appName, token string) (string, string, error) {
logger.Errorf("xmpp recv IQ for register: %v", 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 {
logger.WithField("endpoint", endpoint.Body).Info("success")
return endpoint.Body, "", nil