mirror of https://github.com/nodejs/node.git
test: check result as early as possible
PR-URL: https://github.com/nodejs/io.js/pull/2007 Reviewed-By: Rod Vagg <rod@vagg.org>pull/1824/merge
parent
8ac50819b6
commit
3ba4f71fc4
|
@ -47,12 +47,10 @@ server.listen(common.PORT, function() {
|
|||
var s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg');
|
||||
res.pipe(s);
|
||||
|
||||
// TODO there should be a callback to pipe() that will allow
|
||||
// us to get a callback when the pipe is finished.
|
||||
res.on('end', function() {
|
||||
s.on('finish', function() {
|
||||
console.error('done ' + x);
|
||||
if (++responses == total) {
|
||||
s.on('close', checkFiles);
|
||||
checkFiles();
|
||||
}
|
||||
});
|
||||
}).on('error', function(e) {
|
||||
|
|
Loading…
Reference in New Issue