Fix for unknown port

For example, in torrents from Yify their tracker has url "udp://tracker.yify-torrents.com/announce" in which case a crtitical error is shown because "port should be in range from 0 to 65535"
This commit is contained in:
thermatk 2014-04-04 19:59:25 +04:00
parent 7858111646
commit c8cc97afea

View File

@ -208,6 +208,9 @@ Client.prototype._requestUdp = function (announceUrl, opts) {
})
function send (message) {
if(parsedUrl.port==null) {
parsedUrl.port=80;
}
socket.send(message, 0, message.length, parsedUrl.port, parsedUrl.hostname)
}