fuwaneko / node-protobuf

Google Protocol Buffers wrapper for Node.js [UNMAINTAINED]
181 stars 42 forks source link

add optional parameters to control SetTotalBytesLimit #63

Closed andreasgal closed 8 years ago

fuwaneko commented 8 years ago

Please, explain use cases for this.

andreasgal commented 8 years ago

I am parsing caffe models with node-protobuf, and they tend to be beyond the 60MB limit that Google's code has by default. I am sure this isn't the only real world use of huge protobufs out there. I didn't want to just up the default at compile time since Google's rationale for a limited default is sane (avoid DOS attacks).

See: https://groups.google.com/forum/#!topic/caffe-users/0b2bAngjbWc

fuwaneko commented 8 years ago

@andreasgal I don't think that protobuf messages above 1Mb are a good design decision, though I suspected that you're trying to use caffe since deep learning is a thing right now. Okay, while I still think raising that limit is dangerous, it's better to be able to do it manually if you know what you're doing. I'll accept PR as soon as I'm free.

andreasgal commented 8 years ago

I completely agree with you. Caffe's use of protobuf messages is a terrible, terrible, design, but its what it is.