Esempio n. 1
0
EXPORT_C TBool CHTTPResponse::FindField(THttpHeaderField aField,
							   TPtrC8& aDesc,
							   TInt aStartIndex) const
    {
//	__LOG_ENTER(_L("CHTTPResponse::FindField (string)"));
//	__LOG1(_L("CHTTPResponse::FindField : searching for field type = %d"), aField);
    TInt index = LocateField(aField, aStartIndex);
    if (index >0)
        {
        TInt count = 0;
        for (count = index; (count < iResponse->Length()) &&
			(iResponse->Des()[count] != 0); count++) {};
        if (count <= iResponse->Length())
            {
            aDesc.Set(&(iResponse->Des()[index]), count-index);
//			__LOG(_L("CHTTPResponse::FindField : found string:"));
#ifdef _DEBUG
			DumpToLog(aDesc);
#endif
//			__LOG_RETURN;
            return ETrue;
            }
        }
//	__LOG(_L("CHTTPResponse::FindField : nothing found"));
//	__LOG_RETURN;
    return EFalse;
    }
Esempio n. 2
0
EXPORT_C void CHTTPResponse::AddResponse(HBufC8* aResponse)
    {
	__LOG_ENTER(_L("CHTTPResponse::AddResponse"));
    delete iResponse;
    iResponse = aResponse;
#ifdef _DEBUG
	DumpToLog(*aResponse);
#endif
	__LOG_RETURN;
    }
Esempio n. 3
0
BOOL FDMCSAPI fdmcsGenerateDistrib (FDMCS_SESSION pS, LPCSTR pszFile, LPSTR pszErrDesc)
{
	USE_FDMCS_SESSION (pSession, pS);

	try {
		pSession->Generate (pszFile);
	}
	catch (LPCSTR pszErr)
	{
		DumpToLog (pSession, pszFile, pszErr);

		if (pszErrDesc)
			lstrcpy (pszErrDesc, pszErr);
		return FALSE;
	}

	return TRUE;
}
Esempio n. 4
0
EXPORT_C TBool CHTTPResponse::FindBinaryDescField(THttpHeaderField aField,
										 TPtrC8& aDesc,
										 TInt aStartIndex) const
    {
    TInt index = LocateField(aField, aStartIndex);
    if (index >= 0)
        {
		TInt offset = 0;
		TInt fieldLength = iResponse->Des()[index];	// assume the length is in
													// a short integer
		if(fieldLength == 31)
			{
			// Nope : Code 31 indicates that the following bytes make a
			// UIntVar,  which indicates the number of data octets after it. 
			// The UIntVar itself could be composed of upto 5 bytes
			// Copy a full 5 bytes from the header
			// Note that actually fewer might have been used; 
			// the UIntVar to Int converter function returns the exact number 
			// that were used.
			TInt consumed = ParseUIntVar(iResponse->Des().Mid(index + 1), fieldLength);

			__ASSERT_DEBUG( consumed >= KErrNone, User::Invariant() );
			
			offset += consumed;			
			}
        else if (fieldLength > 127)
			{
 			// Oops be sneaky and reuse this single byte
 			// Because this is a special code
 			fieldLength = 1;		
 			offset = -1;
 			}

		if(fieldLength)
            {
            aDesc.Set(&(iResponse->Des()[index + offset + 1]), fieldLength);
#ifdef _DEBUG
			DumpToLog(aDesc);
#endif
            return ETrue;
            }
        }
    return EFalse;
    }