| 482 | } |
| 483 | |
| 484 | static void check_locks(void) |
| 485 | { |
| 486 | struct remote_lock *lock = repo->locks; |
| 487 | time_t current_time = time(NULL); |
| 488 | int time_remaining; |
| 489 | |
| 490 | while (lock) { |
| 491 | time_remaining = lock->start_time + lock->timeout - |
| 492 | current_time; |
| 493 | if (!lock->refreshing && time_remaining < LOCK_REFRESH) { |
| 494 | if (!refresh_lock(lock)) { |
| 495 | fprintf(stderr, |
| 496 | "Unable to refresh lock for %s\n", |
| 497 | lock->url); |
| 498 | aborted = 1; |
| 499 | return; |
| 500 | } |
| 501 | } |
| 502 | lock = lock->next; |
| 503 | } |
| 504 | } |
| 505 | |
| 506 | static void release_request(struct transfer_request *request) |
| 507 | { |
no test coverage detected