Skip to content

Commit

Permalink
Merge pull request #156 from tmobile/tmo-CFSPDK-1273-Fix-2mb-download
Browse files Browse the repository at this point in the history
Change retry behavior
  • Loading branch information
johnlange2 authored May 5, 2023
2 parents efcfc30 + efdf64b commit 65f2077
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/tmo_shell/src/tmo_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,12 @@ int tmo_http_download(int devid, char url[], char filename[], char *auth_key)
headers[0] = range_header;
req.header_fields = (const char**)headers;
// req.header_fields
int last_rcvd_cnt = http_total_received;
http_client_req(sock, &req, HTTP_CLIENT_REQ_TIMEOUT, &file);
/* Reset count if new data has been transfered */
if (last_rcvd_cnt < http_total_received) {
fail_count = 0;
}
}
if (http_total_received == http_total_written) {
printf("\nReceived:%d, Wrote: %d\n", http_total_received, http_total_written);
Expand Down Expand Up @@ -514,7 +519,12 @@ int tmo_http_download(int devid, char url[], char filename[], char *auth_key)
headers[0] = range_header;
req.header_fields = (const char**)headers;
// req.header_fields
int last_rcvd_cnt = http_total_received;
http_client_req(sock, &req, HTTP_CLIENT_REQ_TIMEOUT, &file);
/* Reset count if new data has been transfered */
if (last_rcvd_cnt < http_total_received) {
fail_count = 0;
}
}
printf("\n\nReceived:%d\n", http_total_received);
}
Expand Down

0 comments on commit 65f2077

Please sign in to comment.