All pastes #916464 Raw Edit

Anonymous

public cpp v1 · immutable
#916464 ·published 2008-02-24 17:58 UTC
rendered paste body
// Upload the next chunk to the server.void WiredTransferSocket::sendNextFileChunk(qint64 theOffset) {	const int tmpChunkSize = 32000;		if( pSendingFile && pTransfer.pTransferType==1 ) {				qDebug() << "Sending"<<theOffset<<"bytes";		pTransfer.pOffset += theOffset;		pTransfer.pDoneSize = pTransfer.pOffset;		if(!pFile->atEnd()) { // Done!			pFile->seek(pTransfer.pOffset);			qDebug() << "Sending"<<tmpChunkSize<<"bytes at pos"<<pFile->pos();			QByteArray tmpData = pFile->read(tmpChunkSize);			pSocket->write(tmpData);			if(pFile->atEnd()) {				qDebug() << "We are done. Close.";				pSocket->disconnectFromHost();			}		}	}}