Changeset 24365 in vbox
- Timestamp:
- Nov 5, 2009 3:07:25 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 54389
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
r24353 r24365 275 275 276 276 AssertReturn(cbToWrite > 0, VINF_SUCCESS); 277 AssertReturn(cbToWrite < UINT32_MAX, VERR_OUT_OF_RANGE); 277 278 AssertReturn(pState->mfIsSource, VERR_INVALID_HANDLE); 278 279 … … 282 283 TELEPORTERTCPHDR Hdr; 283 284 Hdr.u32Magic = TELEPORTERTCPHDR_MAGIC; 284 Hdr.cb = RT_MIN( cbToWrite, TELEPORTERTCPHDR_MAX_SIZE);285 Hdr.cb = RT_MIN((uint32_t)cbToWrite, TELEPORTERTCPHDR_MAX_SIZE); 285 286 int rc = RTTcpWrite(pState->mhSocket, &Hdr, sizeof(Hdr)); 286 287 if (RT_FAILURE(rc)) … … 405 406 if (RT_FAILURE(rc)) 406 407 return rc; 407 size_t cb =RT_MIN(pState->mcbReadBlock, cbToRead);408 uint32_t cb = (uint32_t)RT_MIN(pState->mcbReadBlock, cbToRead); 408 409 rc = RTTcpRead(pState->mhSocket, pvBuf, cb, pcbRead); 409 410 if (RT_FAILURE(rc)) … … 415 416 if (pcbRead) 416 417 { 417 pState->moffStream += *pcbRead; 418 pState->mcbReadBlock -= *pcbRead; 418 cb = (uint32_t)*pcbRead; 419 pState->moffStream += cb; 420 pState->mcbReadBlock -= cb; 419 421 return VINF_SUCCESS; 420 422 } … … 569 571 * Wait for Console::Teleport to change the state. 570 572 */ 571 { AutoWriteLock autoLock( ); }573 { AutoWriteLock autoLock(this); } 572 574 573 575 BOOL fCancelled = TRUE; … … 683 685 hrc = pState->mptrConsole->teleporterSrc(pState); 684 686 687 /* Aaarg! setMachineState trashes error info on Windows, so we have to 688 complete things here on failure instead of right before cleanup. */ 689 if (FAILED(hrc)) 690 pState->mptrProgress->notifyComplete(hrc); 691 685 692 /* We can no longer be cancelled (success), or it doesn't matter any longer (failure). */ 686 693 pState->mptrProgress->setCancelCallback(NULL, NULL); … … 705 712 autoVMCaller.release(); 706 713 hrc = pState->mptrConsole->powerDown(); 714 pState->mptrProgress->notifyComplete(hrc); 707 715 } 708 716 else … … 763 771 } 764 772 autoLock.leave(); 765 766 pState->mptrProgress->notifyComplete(hrc);767 773 768 774 /*
Note:
See TracChangeset
for help on using the changeset viewer.