All pastes #2073504 Raw Edit

Miscellany

public cpp v1 · immutable
#2073504 ·published 2011-06-02 03:00 UTC
rendered paste body
clientRequest* IllbdrClient::GetCompletedRequest(){	// First off, do we even have a completed chunk?	if( !IsCompleteChunkAvailable() ) return NULL;	// We do! Then lets get the data out of that buffer	clientHeader ch = BufferSocket::ReadVar<clientHeader>();	LPVOID rawData = malloc( ch.chunkSize + sizeof( DWORD ) );	BufferSocket::Read( rawData, ch.chunkSize );	// OK, now that we have that data, we must remove all	//  decompression and encryption applied	if( ch.command & netflagCompressed ) // Compression was applied	{		ch.chunkSize ^= netflagCompressed;	}	if( ch.command & netflagEncrypted ) // Encryption was applied	{		ch.command ^= netflagEncrypted;	}	// Ok, create our struct and return it	clientRequest* cRet = new clientRequest;	cRet->cCmd = ch.command;	cRet->cData = rawData;}