Changeset 33659 in vbox
- Timestamp:
- Nov 1, 2010 2:46:15 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Main/ApplianceImplIO.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ApplianceImplIO.cpp
r33652 r33659 493 493 size_t cbAvail = RTCircBufUsed(pInt->pCircBuf); 494 494 size_t cbMemAllRead = 0; 495 bool fStop = false;496 bool fEOF = false;497 495 /* First loop over all the free memory in the circular 498 496 * memory buffer (could be turn around at the end). */ … … 500 498 { 501 499 if ( cbMemAllRead == cbAvail 502 || f Stop == true)500 || fLoop == false) 503 501 break; 504 502 char *pcBuf; … … 521 519 if (RT_FAILURE(rc)) 522 520 { 523 fStop = true;524 521 fLoop = false; 525 break;526 }527 if (cbWritten == 0)528 {529 fStop = true;530 fLoop = false;531 fEOF = true;532 // RTPrintf("EOF\n");533 522 break; 534 523 } … … 537 526 } 538 527 /* Update the SHA1 context with the next data block. */ 539 if (pInt->pSha1Storage->fCreateDigest) 528 if ( RT_SUCCESS(rc) 529 && pInt->pSha1Storage->fCreateDigest) 540 530 RTSha1Update(&pInt->ctx, pcBuf, cbAllWritten); 541 531 /* Mark the block as empty. */ … … 554 544 size_t cbAvail = RTCircBufFree(pInt->pCircBuf); 555 545 size_t cbMemAllWrite = 0; 556 bool fStop = false;557 bool fEOF = false;558 546 /* First loop over all the available memory in the circular 559 547 * memory buffer (could be turn around at the end). */ … … 561 549 { 562 550 if ( cbMemAllWrite == cbAvail 563 || f Stop == true)551 || fLoop == false) 564 552 break; 565 553 char *pcBuf; … … 582 570 if (RT_FAILURE(rc)) 583 571 { 584 fStop = true;585 572 fLoop = false; 586 573 break; 587 574 } 575 /* This indicates end of file. Stop reading. */ 588 576 if (cbRead == 0) 589 577 { 590 fStop = true;591 578 fLoop = false; 592 fEOF = true; 593 // RTPrintf("EOF\n"); 579 ASMAtomicWriteBool(&pInt->fEOF, true); 594 580 break; 595 581 } … … 598 584 } 599 585 /* Update the SHA1 context with the next data block. */ 600 if (pInt->pSha1Storage->fCreateDigest) 586 if ( RT_SUCCESS(rc) 587 && pInt->pSha1Storage->fCreateDigest) 601 588 RTSha1Update(&pInt->ctx, pcBuf, cbAllRead); 602 589 /* Mark the block as full. */ … … 604 591 cbMemAllWrite += cbAllRead; 605 592 } 606 if (fEOF)607 ASMAtomicWriteBool(&pInt->fEOF, true);608 593 /* Reset the thread status and signal the main thread that we 609 594 * are finished. Use CmpXchg, so we not overwrite other states
Note:
See TracChangeset
for help on using the changeset viewer.

