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

bugfix: CDN == "source" does not request pieces from source #1501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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