niftylettuce/express-cdn — pull request #69 by RomanMinkin (2014-06-26 15:54:38+00:00)
Title: knox bump to the latest version to avoid `Error: read ECONNRESET` for S3

All my services started to have the same error each time i restart an app. Looks like S3 hangs up a socket as a result unexpected error throws, so process quits.

After I updated `knox` to the latest version issue stopped happening for me.

I was also working around `maxSockets` limits, but it didn't help:

```javascript
S3.agent = require('https').globalAgent;
S3.agent.maxSockets = 50;
```

Here is a full error stack from `longjohn`:

```
{ task: 'express-cdn',
message: '"jquery-1.10.1.js+bootstrap.js+admin.js" not modified and is already stored on S3' }
{ task: 'express-cdn',
message: '"jquery-1.10.1.js+bootstrap.js+emerging-tech.js" not modified and is already stored on S3' }
{ task: 'express-cdn',
message: '"jquery-1.10.1.js+modernizr-2.6.2.min.js+main.js" not modified and is already stored on S3' }
{ task: 'express-cdn',
message: '"bootstrap.css+emerging.css" not modified and is already stored on S3' }
{ task: 'express-cdn',
message: '"bootstrap.css+admin.css" not modified and is already stored on S3' }

/project-path/node_modules/longjohn/dist/longjohn.js:185
throw e;
^
Error: read ECONNRESET
at errnoException (net.js:901:11)
at onread (net.js:556:19)
---------------------------------------------
at Readable.on (_stream_readable.js:689:33)
at http.js:1753:12
at process._tickCallback (node.js:415:13)
---------------------------------------------
at ClientRequest.onSocket (http.js:1730:11)
at new ClientRequest (http.js:1432:10)
at exports.request (https.js:123:10)
at Client.request (/project-path/node_modules/express-cdn/node_modules/knox/lib/client.js:308:42)
at Client.head (/project-path/node_modules/express-cdn/node_modules/knox/lib/client.js:618:15)
at Client.headFile (/project-path/node_modules/express-cdn/node_modules/knox/lib/client.js:636:18)
at /project-path/node_modules/express-cdn/lib/main.js:471:10
at /project-path/node_modules/express-cdn/node_modules/async/lib/async.js:227:13
---------------------------------------------
at walker (/project-path/node_modules/express-cdn/lib/main.js:550:14)
at CDN (/project-path/node_modules/express-cdn/lib/main.js:598:7)
at module.exports (/project-path/cdn.js:20:34)
at module.exports (/project-path/app.js:53:27)
at app.configure (/project-path/node_modules/express/lib/application.js:392:61)
at Object. (/project-path/app.js:22:5)
at Module._compile (module.js:456:26)
at Module._extensions..js (module.js:474:10)
```