Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #495: Hijack proxy /add correctly. Disable keep-alives. #505

Merged
merged 5 commits into from Aug 20, 2018

Conversation

hsanjuan
Copy link
Collaborator

No more hacks around /add. This uses the local adder when hijacking /add.
It supports the parameters and works pretty well with the ipfs CLI, showing
progress and everything.

#495

@hsanjuan hsanjuan self-assigned this Aug 16, 2018
@ghost ghost added the status/in-progress In progress label Aug 16, 2018
@coveralls
Copy link

coveralls commented Aug 16, 2018

Coverage Status

Coverage decreased (-0.1%) to 64.908% when pulling be651da on fix/495-proxy-add into 0f2a978 on master.

@hsanjuan hsanjuan added need/review Needs a review and removed status/in-progress In progress labels Aug 17, 2018
@ghost ghost added the status/in-progress In progress label Aug 17, 2018
@hsanjuan hsanjuan removed the status/in-progress In progress label Aug 17, 2018
@ghost ghost added the status/in-progress In progress label Aug 17, 2018
@hsanjuan hsanjuan removed the status/in-progress In progress label Aug 17, 2018
@ghost ghost added the status/in-progress In progress label Aug 17, 2018
No more hacks around /add. This uses the local adder when hijacking /add.
It supports the parameters and works pretty well with the ipfs CLI, showing
progress and everything.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This uses Join rather than PeerAdd. Join ensures a DHT bootstrap
after successfully joining.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
See discussion in ipfs/kubo#5168

We cannot stream responses with keep-alives enabled.

I prefer this to not be a client feature, as otherwise users might end up
shooting themselves in the foot.

Note, the price is a corrupted request body which gets added
normally and gives wrong hashes!

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
@hsanjuan
Copy link
Collaborator Author

Related to why we need to disable keep alives for adding to work correctly: ipfs/kubo#5168

@hsanjuan hsanjuan removed the status/in-progress In progress label Aug 18, 2018
@hsanjuan hsanjuan changed the title Fix #495: Hijack proxy /add correctly. Fix #495: Hijack proxy /add correctly. Disable keep-alives. Aug 18, 2018
@@ -0,0 +1,68 @@
// Package adderutils provides some utilities for adding content to cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I not sure this really requires being in its own utils package... Unless I am missing an import cycle, I believe this could simply be a function in the adder package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, import cycle :(. adder[utils] -> local -> adder

@hsanjuan hsanjuan merged commit 63fa1ba into master Aug 20, 2018
@hsanjuan hsanjuan deleted the fix/495-proxy-add branch August 20, 2018 08:29
@ghost ghost removed the need/review Needs a review label Aug 20, 2018
@hsanjuan hsanjuan mentioned this pull request Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants