Skip to content

Commit

Permalink
Use keepalive agent when loading http tilejson sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Young Hahn committed Nov 1, 2012
1 parent a4eb11a commit 43feeda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tilejson.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ TileJSON.prototype._open = function(uri) {


Step(function() { Step(function() {
if (uri.protocol === 'http:' || uri.protocol === 'https:') { if (uri.protocol === 'http:' || uri.protocol === 'https:') {
new get(url.format(uri)).asString(this); new get({
uri: url.format(uri),
headers: {Connection:'Keep-Alive'},
agent: agent
}).asString(this);
} else { } else {
tilejson.filename = uri.pathname; tilejson.filename = uri.pathname;
fs.watchFile(uri.pathname, {persistent:false}, function(cur, prev) { fs.watchFile(uri.pathname, {persistent:false}, function(cur, prev) {
Expand Down

0 comments on commit 43feeda

Please sign in to comment.