()
| 76 | } |
| 77 | |
| 78 | function make_req() { |
| 79 | opt.headers['x-count'] = count++; |
| 80 | http.get(opt, function(res) { |
| 81 | res.setEncoding('utf8'); |
| 82 | var body = ''; |
| 83 | |
| 84 | res.on('data', function(chunk) { |
| 85 | body += chunk; |
| 86 | }); |
| 87 | |
| 88 | res.on('end', function() { |
| 89 | assert.equal('foo', body); |
| 90 | maybe_done(); |
| 91 | }); |
| 92 | }); |
| 93 | } |
| 94 | |
| 95 | for (var i=0 ; i<num_requests ; ++i) { |
| 96 | make_req(); |