|
|
@ -906,7 +906,7 @@ bool BuildIdRequestTrans::Recv ( |
|
|
|
ManifestRequestTrans::ManifestRequestTrans ( |
|
|
|
ManifestRequestTrans::ManifestRequestTrans ( |
|
|
|
FNetCliFileManifestRequestCallback callback, |
|
|
|
FNetCliFileManifestRequestCallback callback, |
|
|
|
void * param, |
|
|
|
void * param, |
|
|
|
const wchar_t group[], |
|
|
|
const wchar_t group[], |
|
|
|
unsigned buildId |
|
|
|
unsigned buildId |
|
|
|
) : NetFileTrans(kManifestRequestTrans) |
|
|
|
) : NetFileTrans(kManifestRequestTrans) |
|
|
|
, m_callback(callback) |
|
|
|
, m_callback(callback) |
|
|
@ -943,9 +943,13 @@ void ManifestRequestTrans::Post () { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
plString ReadStringFromMsg(const wchar_t* curMsgPtr, unsigned* length) { |
|
|
|
void ReadStringFromMsg(const wchar_t* curMsgPtr, wchar_t* destPtr, unsigned* length) { |
|
|
|
(*length) = wcslen(curMsgPtr); |
|
|
|
if (!(*length)) { |
|
|
|
return plString::FromWchar(curMsgPtr, *length); |
|
|
|
size_t maxlen = wcsnlen(curMsgPtr, MAX_PATH - 1); // Hacky sack
|
|
|
|
|
|
|
|
(*length) = maxlen; |
|
|
|
|
|
|
|
destPtr[maxlen] = 0; // Don't do this on fixed length, because there's no room for it
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
memcpy(destPtr, curMsgPtr, *length * sizeof(wchar_t)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
@ -1001,8 +1005,8 @@ bool ManifestRequestTrans::Recv ( |
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// read in the clientFilename
|
|
|
|
// read in the clientFilename
|
|
|
|
unsigned filenameLen; |
|
|
|
unsigned filenameLen = 0; |
|
|
|
entry.clientName = ReadStringFromMsg(curChar, &filenameLen); |
|
|
|
ReadStringFromMsg(curChar, entry.clientName, &filenameLen); |
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
@ -1014,7 +1018,8 @@ bool ManifestRequestTrans::Recv ( |
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// read in the downloadFilename
|
|
|
|
// read in the downloadFilename
|
|
|
|
entry.downloadName = ReadStringFromMsg(curChar, &filenameLen); |
|
|
|
filenameLen = 0; |
|
|
|
|
|
|
|
ReadStringFromMsg(curChar, entry.downloadName, &filenameLen); |
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
@ -1026,7 +1031,8 @@ bool ManifestRequestTrans::Recv ( |
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// read in the md5
|
|
|
|
// read in the md5
|
|
|
|
entry.md5 = ReadStringFromMsg(curChar, &filenameLen); |
|
|
|
filenameLen = 32; |
|
|
|
|
|
|
|
ReadStringFromMsg(curChar, entry.md5, &filenameLen); |
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
@ -1038,7 +1044,8 @@ bool ManifestRequestTrans::Recv ( |
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// read in the md5 for compressed files
|
|
|
|
// read in the md5 for compressed files
|
|
|
|
entry.md5compressed = ReadStringFromMsg(curChar, &filenameLen); |
|
|
|
filenameLen = 32; |
|
|
|
|
|
|
|
ReadStringFromMsg(curChar, entry.md5compressed, &filenameLen); |
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
curChar += filenameLen; // advance the pointer
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
wchar_tCount -= filenameLen; // keep track of the amount remaining
|
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
|
if ((*curChar != L'\0') || (wchar_tCount <= 0)) |
|
|
|