-
Notifications
You must be signed in to change notification settings - Fork 773
bugfix: CDN == "source" does not request pieces from source #1501
base: master
Are you sure you want to change the base?
Conversation
We found this is your first time to contribute to Dragonfly, @m0nstermind |
…rnode was configured with explicily defined port Signed-off-by: Oleg Anastasyev <[email protected]>
Please sign your commit with |
ee3967f
to
9c4b244
Compare
BTW unit test failed with which, i believe is not about this PR, but due to connectivity problems with registry.cn-zhangjiakou.aliyuncs.com |
LGTM. |
I have rerun the CI. |
Codecov Report
@@ Coverage Diff @@
## master #1501 +/- ##
==========================================
- Coverage 50.76% 49.31% -1.46%
==========================================
Files 145 145
Lines 9557 8381 -1176
==========================================
- Hits 4852 4133 -719
+ Misses 4309 3861 -448
+ Partials 396 387 -9
Continue to review full report at Codecov.
|
by dfget having suprnodes was configured with explicily defined port
Ⅰ. Describe what this PR did
When supernode listens on non default port ( e.g. other than 80 for http ) the CDN Pattern: source ( to request pieces from source url ) does not work. dfget try to load pieces for the first time from supernode and fail, because supernode does not have them.
The source of this is in comparation performed by dfget at power_client.go, which compares piece destination ip, received by downloader to the url of supernode PowerClient is initialized with ( which comes in form ip:port ). In case of default port value, it is omitted from configration and this check passes and always fails for non default port values.
The PR fixes this to compare ip to ip.
Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Why don't you add test cases (unit test/integration test)?
The fix is trivial
Ⅳ. Describe how to verify it
Prepare supernode.yaml with
run supernode without running nginx
run dfget with
dfget --node 127.0.0.1:5002 http://source/url/to/get
dfget will fail to download any pieces from source url, trying to get it from 127.0.0.1:8001 ( the default download port of supernode )
Ⅴ. Special notes for reviews
none