close curl before process.on 'exit'

This commit is contained in:
jiangfriend@gmail.com 2012-05-28 20:17:15 +08:00
parent 90f3135c8c
commit f6bfa11f6e
2 changed files with 2 additions and 0 deletions

View file

@ -42,6 +42,7 @@
return stream.on('end', function() { return stream.on('end', function() {
var _this = this; var _this = this;
p("----"); p("----");
curl.close();
p("deleting " + cookieFile); p("deleting " + cookieFile);
return fs.unlink(cookieFile, function() { return fs.unlink(cookieFile, function() {
return p("done."); return p("done.");

View file

@ -25,6 +25,7 @@ stream = fs.createReadStream(cookieFile)
stream.pipe(process.stdout) stream.pipe(process.stdout)
stream.on 'end', -> stream.on 'end', ->
p "----" p "----"
curl.close()
p "deleting #{cookieFile}" p "deleting #{cookieFile}"
fs.unlink! cookieFile fs.unlink! cookieFile
p "done." p "done."