Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit ee3967f

Browse files
author
Oleg Anastasyev
committed
bugfix: CDN == "source" does not request pieces from source when supernode was configured with explicily defined port
1 parent 731059a commit ee3967f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dfget/core/downloader/p2p_downloader/power_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type PowerClient struct {
5252
taskID string
5353
// headers is the extra HTTP headers when downloading a piece.
5454
headers []string
55-
// node indicates the IP address of the currently registered supernode.
55+
// node indicates the IP address[:port] of the currently registered supernode.
5656
node string
5757
// pieceTask is the data when successfully pulling piece task
5858
// and the task is continuing.
@@ -119,7 +119,7 @@ func (pc *PowerClient) downloadPiece() (content *pool.Buffer, e error) {
119119
peerPort := pc.pieceTask.PeerPort
120120

121121
// check that the target download peer is available
122-
if dstIP != "" && dstIP != pc.node {
122+
if dstIP != "" && dstIP != netutils.ExtractHost(pc.node) {
123123
if _, e = httputils.CheckConnect(dstIP, peerPort, -1); e != nil {
124124
return nil, e
125125
}

0 commit comments

Comments
 (0)