MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / perform

Method perform

src/common/cURLManager.cpp:376–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374
375
376bool cURLManager::perform() {
377 if (multiHandle == NULL) {
378 return false;
379 }
380
381 if (!inited) {
382 setup();
383 }
384
385 int activeTransfers = 0;
386 CURLMcode result;
387 justCalled = false;
388 while (true) {
389 result = curl_multi_perform(multiHandle, &activeTransfers);
390 if (result != CURLM_CALL_MULTI_PERFORM) {
391 break;
392 }
393 }
394 if (result != CURLM_OK)
395 debugf(1, "Error while doing multi_perform from libcurl %d : %s\n",
396 result, errorBuffer);
397
398 int msgs_in_queue;
399 CURLMsg* pendingMsg;
400 CURL* easy;
401
402 std::vector<cURLManager*> toBeDeleted;
403
404 while (true) {
405 pendingMsg = curl_multi_info_read(multiHandle, &msgs_in_queue);
406 if (!pendingMsg) {
407 break;
408 }
409
410 easy = pendingMsg->easy_handle;
411
412 if (cURLMap.count(easy)) {
413 cURLMap[easy]->infoComplete(pendingMsg->data.result);
414 if (cURLMap[easy]->deleteOnDone) {
415 toBeDeleted.push_back(cURLMap[easy]);
416 }
417 }
418
419 if (msgs_in_queue <= 0) {
420 break;
421 }
422 }
423
424 for (size_t i = 0; i < toBeDeleted.size(); i++) {
425 delete toBeDeleted[i];
426 }
427 toBeDeleted.clear();
428
429 return justCalled;
430}
431
432
433void cURLManager::infoComplete(CURLcode result) {

Callers

nothing calls this directly

Calls 9

setupFunction · 0.85
curl_multi_performFunction · 0.85
debugfFunction · 0.85
curl_multi_info_readFunction · 0.85
infoCompleteMethod · 0.80
countMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected