Discovery windows use the server hostname instead of the domain part of the jid
When using "service discovery", the address textbox is already filled with the hostname of my server. Since I use a ssh tunnel to bypass a firewall, I see "localhost", which doesn't work. Using the domain name of my jid work fine.
So, I think it should always use the domain of the jid, as the hostname doesn't mean much from a service discovery point of view.
More ever, the code seems to do this, except the variable is overwritten later. Removing the offending line solve this bug ( patch enclosed ).