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');
|
var s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg');
|
||||||
res.pipe(s);
|
res.pipe(s);
|
||||||
|
|
||||||
// TODO there should be a callback to pipe() that will allow
|
s.on('finish', function() {
|
||||||
// us to get a callback when the pipe is finished.
|
|
||||||
res.on('end', function() {
|
|
||||||
console.error('done ' + x);
|
console.error('done ' + x);
|
||||||
if (++responses == total) {
|
if (++responses == total) {
|
||||||
s.on('close', checkFiles);
|
checkFiles();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).on('error', function(e) {
|
}).on('error', function(e) {
|
||||||
|
|
Loading…
Reference in New Issue