MCPcopy Index your code
hub / github.com/git/git / refresh_lock

Function refresh_lock

http-push.c:451–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451static int refresh_lock(struct remote_lock *lock)
452{
453 struct active_request_slot *slot;
454 struct slot_results results;
455 struct curl_slist *dav_headers;
456 int rc = 0;
457
458 lock->refreshing = 1;
459
460 dav_headers = get_dav_token_headers(lock, DAV_HEADER_IF | DAV_HEADER_TIMEOUT);
461
462 slot = get_active_slot();
463 slot->results = &results;
464 curl_setup_http_get(slot->curl, lock->url, DAV_LOCK);
465 curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, dav_headers);
466
467 if (start_active_slot(slot)) {
468 run_active_slot(slot);
469 if (results.curl_result != CURLE_OK) {
470 fprintf(stderr, "LOCK HTTP error %ld\n",
471 results.http_code);
472 } else {
473 lock->start_time = time(NULL);
474 rc = 1;
475 }
476 }
477
478 lock->refreshing = 0;
479 curl_slist_free_all(dav_headers);
480
481 return rc;
482}
483
484static void check_locks(void)
485{

Callers 1

check_locksFunction · 0.85

Calls 5

get_dav_token_headersFunction · 0.85
get_active_slotFunction · 0.85
curl_setup_http_getFunction · 0.85
start_active_slotFunction · 0.85
run_active_slotFunction · 0.85

Tested by

no test coverage detected