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

Method finalization

src/common/cURLManager.cpp:620–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618
619
620void ResourceGetter::finalization(char* data, unsigned int length, bool good) {
621 printf("FIXME -- ResourceGetter::finalization, %i\n", good ? 1 : 0);
622
623 if (!resources.size() || !doingStuff) {
624 return; // we are suposed to be done
625 }
626
627 // this is who we are suposed to be geting
628 trResourceItem item = resources[0];
629 resources.erase(resources.begin());
630 if (good) {
631 // save the thing
632 FILE* fp = fopen(item.filePath.c_str(), "wb");
633 if (fp) {
634 fwrite(data, length, 1, fp);
635 fclose(fp);
636 }
637
638 }
639
640 if (item.doneFunc != NULL) {
641 item.doneFunc(item, good);
642 }
643
644 // do the next one if we must
645 getResource();
646}
647
648
649bool ResourceGetter::itemExists(trResourceItem& item) {

Callers

nothing calls this directly

Calls 3

c_strMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected