From ba28fb599e91ab898e66475e719429f04a7061b6 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 15 May 2017 17:30:00 -0400 Subject: [PATCH 1/2] Only determine key if info is available --- src/downloader.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/downloader.c b/src/downloader.c index 39d1a6e..44865e4 100644 --- a/src/downloader.c +++ b/src/downloader.c @@ -1282,6 +1282,10 @@ static void after_request_info(uv_work_t *work, int status) req->state->error_status = STORJ_FILE_UNSUPPORTED_ERASURE; } } + + // Now that we have info we can calculate the decryption key + determine_decryption_key(req->state); + } else if (req->error_status) { switch(req->error_status) { case STORJ_BRIDGE_REQUEST_ERROR: @@ -1300,9 +1304,6 @@ static void after_request_info(uv_work_t *work, int status) req->state->error_status = STORJ_BRIDGE_FILEINFO_ERROR; } - // Now that we have info we can calculate the decryption key - determine_decryption_key(req->state); - queue_next_work(req->state); free(req); From d6d552aa3af939d3c6a9ac44749d8649482e3f54 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Mon, 15 May 2017 20:36:34 -0400 Subject: [PATCH 2/2] Increase default timeout --- src/storj.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storj.h b/src/storj.h index 2c9f69e..44cc885 100644 --- a/src/storj.h +++ b/src/storj.h @@ -102,7 +102,7 @@ extern "C" { #define STORJ_SHARD_CHALLENGES 4 #define STORJ_LOW_SPEED_LIMIT 30720L #define STORJ_LOW_SPEED_TIME 20L -#define STORJ_HTTP_TIMEOUT 20L +#define STORJ_HTTP_TIMEOUT 60L typedef struct { uint8_t *encryption_ctr;