This is actually undesireable as it takes away control from the user who
may want to pause/resume to throttle the upload stream, or synchronize
it with disk flushing.
I actually ran into memory issues when trying to stream huge files to
disc as the file module was building up a huge action buffer. This can
now easily be avoided like this:
part.addListener('body', function(chunk) {
req.pause();
file.write(chunk).addCallback(function() {
req.resume();
});
}
Express (my framework) uses them as a default
response body when non is present. Others
might use them for something as well.
Beats duplicating the list :D
Change the http.Client API so that it provides a single request() method
taking an optional parameter to specify the HTTP method (defaulting to
"GET"), instead of the five methods get(), head(), post(), del() and put().
At the same time implement synchronous wrappers of the POSIX functions.
These will be undocumented until we settle on an API. Works like this
// returns promise as before
posix.mkdir("test").addCallback(function () {
sys.puts("done");
});
// returns undefined, executed synchronously.
posix.mkdirSync("test");
sys.puts("done");
This refactoring is a step towards allowing promises to be implemented
purely in javascript.
Multipart parts now have a name and filename property. Those are the
same as:
part.headers['content-disposition'].name
part.headers['content-disposition'].filename
This patch also updates and improves the docs for the multipart module.
No longer based on Ragel, but hand-written.
Had to add HTTPConnection.resetParser() because the parser is stricter and
will error out when you try to give it a message after the previous had
"Connection: close". The HTTP client was doing that. Thus we reset the
parser manually after each new connection.