fetch: failed to set start time

This commit is contained in:
K. Lange 2018-10-15 11:21:47 +09:00
parent f6c300f323
commit 3c40152910
1 changed files with 2 additions and 0 deletions

View File

@ -222,6 +222,8 @@ int http_fetch(FILE * f) {
int bytes_to_read = atoi(hashmap_get(headers, "Content-Length"));
fetch_options.content_length = bytes_to_read;
gettimeofday(&fetch_options.start, NULL);
while (bytes_to_read > 0) {
char buf[1024];
size_t r = fread(buf, 1, bytes_to_read < 1024 ? bytes_to_read : 1024, f);