direct-connect / go-dcpp

Hybrid Direct Connect hub written in Go.
BSD 3-Clause "New" or "Revised" License
36 stars 9 forks source link

Ping, nmdcs: XML-Line does not return the redirect information #93

Open Kcchouette opened 5 years ago

Kcchouette commented 5 years ago

Related to https://github.com/direct-connect/go-dcpp/issues/89

 ./dcping ping dchub://piter.feardc.net:411
{"name":"White Nights of St. Petersburg","addr":["dchub://piter.feardc.net:411"],"soft":{"name":"Verlihub","vers":"1.2.0.7","ext":["NoHello","NoGetINFO","TLS","UserIP2","TTHSearch","ZPipe","HubINFO","BotList","MCTo","FailOver","HubTopic","OpPlus","NickRule","SearchRule","UserCommand"]},"users":0,"redirect":"nmdcs://piter.feardc.net:411"}
./dcping ping dchub://piter.feardc.net:411 --out=xml-line
<Hub Name="White Nights of St. Petersburg" Address="dchub://piter.feardc.net:411" Software="Verlihub" Status="Online"></Hub>

That I expect:

Solution 1:

./dcping ping dchub://piter.feardc.net:411 --out=xml-line
<Hub Name="White Nights of St. Petersburg" Address="nmdcs://piter.feardc.net:411" Failover="dchub://piter.feardc.net:411" Software="Verlihub" Status="Online"></Hub>

Solution 2:

./dcping ping dchub://piter.feardc.net:411 --out=xml-line
<Hub Name="White Nights of St. Petersburg" Failover="nmdcs://piter.feardc.net:411" Address="dchub://piter.feardc.net:411" Software="Verlihub" Status="Online"></Hub>

Solution 3:

./dcping ping dchub://piter.feardc.net:411 --out=xml-line
<Hub Name="White Nights of St. Petersburg" Redirect="nmdcs://piter.feardc.net:411" Address="dchub://piter.feardc.net:411" Software="Verlihub" Status="Online"></Hub>
Kcchouette commented 5 years ago

The best solution for my case will be Solution 1