Permalink
Browse files

fix for ends without closes and closes without ends on aws response

  • Loading branch information...
1 parent b87a605 commit db5c04147ef8685095f71f5beaa3a507f731551a Jeffrey D. Van Alstine committed Aug 4, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/aws.js
View
@@ -68,13 +68,16 @@ var genericAWSClient = function(obj) {
res.addListener('data', function (chunk) {
data += chunk.toString()
})
- res.addListener('close', function() {
+ var cb = function() {
var parser = new xml2js.Parser();
parser.addListener('end', function(result) {
callback(result);
});
parser.parseString(data);
- })
+ };
+
+ res.addListener('end', cb)
+ res.addListener('close', cb)
});
req.write(body)
req.end()

0 comments on commit db5c041

Please sign in to comment.