-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Assertion `(offset) < (storage_size)' failed. #3182
Comments
Do you have a small test case that reproduces it, no third-party modules? |
Here you are (logic extracted from http-post): var options = require('url').parse('http://XYZ:3000/build');
options.method = 'POST';
options.headers = {
'Content-Type': 'multipart/form-data; boundary=-----np0.25114468042738736',
'Content-Length': 8809774
};
var req = require('http').request(options, function(responce) {
console.log('response');
});
var fs = require('fs');
req.write('-------np0.25114468042738736\r\n');
req.write('Content-Disposition: form-data; name="token"\r\n\r\n');
req.write('some-token\r\n');
req.write('-------np0.25114468042738736\r\n');
req.write('Content-Disposition: form-data; name="targets"\r\n\r\n');
req.write('some-data\r\n');
req.write('-------np0.25114468042738736\r\n');
req.write('Content-Disposition: form-data; name="zip"; filename="trunk.zip"\r\n\r\n');
req.write(fs.readFileSync('./trunk.zip', 'binary'));
req.write('\r\n');
req.write('-------np0.25114468042738736--\r\n');
req.end(); XYZ is host accepting post requests at port 3000. Problematic part seems to be writing binary data to http request. |
What does trunk.zip contain in your example? How big is it approximately? |
it's a zip archive ~8.8MByte |
ok, update: it seems that if you put 'Content-Length' actualy if you put any 'Content-Lenght', if you ommit that it works |
Minimal example: var options = require('url').parse('http://posttestserver.com/post.php');
options.method = 'POST';
options.headers = {
'Content-Type': 'multipart/form-data; boundary=-----np0.13421504013240337',
'Content-Length': 1
};
var req = require('http').request(options, function(responce) {
console.log('response');
});
var fs = require('fs');
req.write('-------np0.926842468092218--\r\n');
req.write('Content-Disposition: form-data; name="name"; filename="name"\r\n\r\n');
req.write(fs.readFileSync('./test', 'binary'));
req.write('\r\n');
req.write('-------np0.926842468092218--\r\n');
req.end(); test file is created as: |
tested on node v4.1.2 and it works :) much ado about nothing |
Hi, I have following exception when I run code (it uses http and http-post internally and was working in 0.12.* node)
node: ../src/stream_base.cc:157: int node::StreamBase::Writev(const v8::FunctionCallbackInfov8::Value&): Assertion `(offset) < (storage_size)' failed.
$ node -v
v4.1.1
$ npm -v
3.3.5
i can provide details if needed
The text was updated successfully, but these errors were encountered: