Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Only determine key if info is available #330

Merged
merged 2 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/downloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/storj.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down