VirtualBox

Changeset 33659 in vbox


Ignore:
Timestamp:
Nov 1, 2010 2:46:15 PM (14 years ago)
Author:
vboxsync
Message:

Main-OVF: cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImplIO.cpp

    r33652 r33659  
    493493                size_t cbAvail = RTCircBufUsed(pInt->pCircBuf);
    494494                size_t cbMemAllRead = 0;
    495                 bool fStop = false;
    496                 bool fEOF = false;
    497495                /* First loop over all the free memory in the circular
    498496                 * memory buffer (could be turn around at the end). */
     
    500498                {
    501499                    if (   cbMemAllRead == cbAvail
    502                         || fStop == true)
     500                        || fLoop == false)
    503501                        break;
    504502                    char *pcBuf;
     
    521519                        if (RT_FAILURE(rc))
    522520                        {
    523                             fStop = true;
    524521                            fLoop = false;
    525                             break;
    526                         }
    527                         if (cbWritten == 0)
    528                         {
    529                             fStop = true;
    530                             fLoop = false;
    531                             fEOF = true;
    532 //                            RTPrintf("EOF\n");
    533522                            break;
    534523                        }
     
    537526                    }
    538527                    /* Update the SHA1 context with the next data block. */
    539                     if (pInt->pSha1Storage->fCreateDigest)
     528                    if (   RT_SUCCESS(rc)
     529                        && pInt->pSha1Storage->fCreateDigest)
    540530                        RTSha1Update(&pInt->ctx, pcBuf, cbAllWritten);
    541531                    /* Mark the block as empty. */
     
    554544                size_t cbAvail = RTCircBufFree(pInt->pCircBuf);
    555545                size_t cbMemAllWrite = 0;
    556                 bool fStop = false;
    557                 bool fEOF = false;
    558546                /* First loop over all the available memory in the circular
    559547                 * memory buffer (could be turn around at the end). */
     
    561549                {
    562550                    if (   cbMemAllWrite == cbAvail
    563                         || fStop == true)
     551                        || fLoop == false)
    564552                        break;
    565553                    char *pcBuf;
     
    582570                        if (RT_FAILURE(rc))
    583571                        {
    584                             fStop = true;
    585572                            fLoop = false;
    586573                            break;
    587574                        }
     575                        /* This indicates end of file. Stop reading. */
    588576                        if (cbRead == 0)
    589577                        {
    590                             fStop = true;
    591578                            fLoop = false;
    592                             fEOF = true;
    593 //                            RTPrintf("EOF\n");
     579                            ASMAtomicWriteBool(&pInt->fEOF, true);
    594580                            break;
    595581                        }
     
    598584                    }
    599585                    /* Update the SHA1 context with the next data block. */
    600                     if (pInt->pSha1Storage->fCreateDigest)
     586                    if (   RT_SUCCESS(rc)
     587                        && pInt->pSha1Storage->fCreateDigest)
    601588                        RTSha1Update(&pInt->ctx, pcBuf, cbAllRead);
    602589                    /* Mark the block as full. */
     
    604591                    cbMemAllWrite += cbAllRead;
    605592                }
    606                 if (fEOF)
    607                     ASMAtomicWriteBool(&pInt->fEOF, true);
    608593                /* Reset the thread status and signal the main thread that we
    609594                 * are finished. Use CmpXchg, so we not overwrite other states
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette