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

Commit

Permalink
bugfix: CDN == "source" does not request pieces from source when supe…
Browse files Browse the repository at this point in the history
…rnode was configured with explicily defined port

Signed-off-by: Oleg Anastasyev <[email protected]>
  • Loading branch information
Oleg Anastasyev committed Nov 3, 2020
1 parent 731059a commit 9c4b244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dfget/core/downloader/p2p_downloader/power_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type PowerClient struct {
taskID string
// headers is the extra HTTP headers when downloading a piece.
headers []string
// node indicates the IP address of the currently registered supernode.
// node indicates the IP address[:port] of the currently registered supernode.
node string
// pieceTask is the data when successfully pulling piece task
// and the task is continuing.
Expand Down Expand Up @@ -119,7 +119,7 @@ func (pc *PowerClient) downloadPiece() (content *pool.Buffer, e error) {
peerPort := pc.pieceTask.PeerPort

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

0 comments on commit 9c4b244

Please sign in to comment.