From e9470e29f70ced846f107b36e17942729670c503 Mon Sep 17 00:00:00 2001 From: Jimmy Thomson Date: Sat, 7 May 2016 18:51:01 -0700 Subject: [PATCH 1/2] Increasing HTTP connection timeouts When uploading larger projects, some connections would be terminated unexpectedly. I believe that it is related to https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ and so I have increased the timout to work around that. If it is the linked issue, then a 5 minute timeout should be sufficient to allow arbitrary uploads. --- src/remotebuild/lib/server.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/remotebuild/lib/server.ts b/src/remotebuild/lib/server.ts index e7f769f2..74862496 100644 --- a/src/remotebuild/lib/server.ts +++ b/src/remotebuild/lib/server.ts @@ -216,6 +216,9 @@ class Server { return Q(http.createServer(app)). then(function (svr: http.Server): Q.Promise { var deferred: Q.Deferred = Q.defer(); + // Increase the timeout to work around disconnects on larger uploads + // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ + svr.setTimeout(5*60*1000); svr.on("error", function (err: any): void { deferred.reject(Server.friendlyServerListenError(err, conf)); }); @@ -288,6 +291,9 @@ class Server { }). then(function (svr: https.Server): Q.Promise { var deferred: Q.Deferred = Q.defer(); + // Increase the timeout to work around disconnects on larger uploads + // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ + svr.setTimeout(5*60*1000); svr.on("error", function (err: any): void { if (generatedNewCerts) { HostSpecifics.hostSpecifics.removeAllCertsSync(conf); From fd771516f71608a9ad4b3abdbcafc5a8b48be2f1 Mon Sep 17 00:00:00 2001 From: Jimmy Thomson Date: Mon, 9 May 2016 11:14:58 -0700 Subject: [PATCH 2/2] Fixing tabs/spaces --- src/remotebuild/lib/server.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/remotebuild/lib/server.ts b/src/remotebuild/lib/server.ts index 74862496..af70cef2 100644 --- a/src/remotebuild/lib/server.ts +++ b/src/remotebuild/lib/server.ts @@ -216,9 +216,9 @@ class Server { return Q(http.createServer(app)). then(function (svr: http.Server): Q.Promise { var deferred: Q.Deferred = Q.defer(); - // Increase the timeout to work around disconnects on larger uploads - // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ - svr.setTimeout(5*60*1000); + // Increase the timeout to work around disconnects on larger uploads + // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ + svr.setTimeout(5*60*1000); svr.on("error", function (err: any): void { deferred.reject(Server.friendlyServerListenError(err, conf)); }); @@ -291,9 +291,9 @@ class Server { }). then(function (svr: https.Server): Q.Promise { var deferred: Q.Deferred = Q.defer(); - // Increase the timeout to work around disconnects on larger uploads - // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ - svr.setTimeout(5*60*1000); + // Increase the timeout to work around disconnects on larger uploads + // https://blog.cloudflare.com/the-curious-case-of-slow-downloads/ + svr.setTimeout(5*60*1000); svr.on("error", function (err: any): void { if (generatedNewCerts) { HostSpecifics.hostSpecifics.removeAllCertsSync(conf);