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

Increase 512kbytes object put limit to 2mbytes #2980

Merged
merged 2 commits into from
Jul 20, 2016
Merged
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
6 changes: 3 additions & 3 deletions core/commands/object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
ft "github.com/ipfs/go-ipfs/unixfs"
)

// ErrObjectTooLarge is returned when too much data was read from stdin. current limit 512k
var ErrObjectTooLarge = errors.New("input object was too large. limit is 512kbytes")
// ErrObjectTooLarge is returned when too much data was read from stdin. current limit 2m
var ErrObjectTooLarge = errors.New("input object was too large. limit is 2mbytes")

const inputLimit = 512 * 1024
const inputLimit = 2 << 20
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: I want to move towards using 2 << 20 for things like this. The go team does this on all go projects and it makes it really easy to read, ex:

1 << 10 == 1K
4 << 10 == 4K
2 << 20 == 2MB
4 << 30 == 4GB

Copy link

Choose a reason for hiding this comment

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

Agreed, although important to note it's Ki, Mi, and Gi :)


type Node struct {
Links []Link
Expand Down