Skip to content

Multipart File Transfer#357

Merged
mappum merged 41 commits intomasterfrom
multifile
Nov 18, 2014
Merged

Multipart File Transfer#357
mappum merged 41 commits intomasterfrom
multifile

Conversation

@mappum
Copy link
Contributor

@mappum mappum commented Nov 17, 2014

This PR is ready for CR.

Overview of changes:

  • Added a commands.File interface that implements io.Reader (which also has a filename and can be read in parts)
  • Changed from accessing file argument values in Request#Arguments() to a separate Request#Files()
  • Open files recursively on the client (and make them into commands.Files)
  • Transfer files as multipart in commands/http

@btc btc added the status/in-progress In progress label Nov 17, 2014
Copy link
Member

Choose a reason for hiding this comment

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

I like both of these

Copy link
Member

Choose a reason for hiding this comment

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

what if we add more argument types, like int with proper integer parsing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it would make sense convoluting the package for that, it would be better for the command to just parse the int themselves.

Copy link
Member

Choose a reason for hiding this comment

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

This function is simply out of control. There's so much going on. refactor. Think of composing simple units.

Copy link
Member

Choose a reason for hiding this comment

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

what if addDagnode returns an error!? please never ignore errors. :( (hm, i think it should be a compiler error to ignore func output.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, didn't mean to do that. Fixed in 3be02a3

@jbenet
Copy link
Member

jbenet commented Nov 17, 2014

CR done. looots of comments up there o/

One major thing is tests. I worry there are subtle bugs in the File/Reader stuff. See: http://golang.org/src/pkg/mime/multipart/multipart_test.go for inspiration

This is a short summary of the major things, though please address all

@jbenet
Copy link
Member

jbenet commented Nov 17, 2014

@mappum attention to #357 (comment) -- which is now a hidden-diff comment

@mappum
Copy link
Contributor Author

mappum commented Nov 18, 2014

(The error Travis is complaining about came from bitswap BTW)

mappum added a commit that referenced this pull request Nov 18, 2014
@mappum mappum merged commit 105f232 into master Nov 18, 2014
@btc btc removed the status/in-progress In progress label Nov 18, 2014
@mappum mappum deleted the multifile branch November 18, 2014 10:20
@jbenet
Copy link
Member

jbenet commented Nov 18, 2014

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.

4 participants