diff -r a2a70ce3d4e8 -r 5f1cd966e0d9 applayerprotocols/httpservice/src/chttpservice.cpp --- a/applayerprotocols/httpservice/src/chttpservice.cpp Thu Jul 15 19:14:59 2010 +0300 +++ b/applayerprotocols/httpservice/src/chttpservice.cpp Thu Aug 19 10:27:19 2010 +0300 @@ -1,4 +1,4 @@ -// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -24,6 +24,8 @@ /** * The default 2-phase constructor to create a CHttpService instance * + * @publishedAll + * @prototype */ EXPORT_C CHttpService* CHttpService::NewL() { @@ -35,6 +37,8 @@ } /** * Destructor + * @publishedAll + * @prototype */ EXPORT_C CHttpService::~CHttpService() @@ -48,6 +52,8 @@ /** * Destructor of the inner class CHttpServiceStruct + * @publishedAll + * @prototype */ CHttpService::CHttpServiceStruct::~CHttpServiceStruct() { @@ -63,13 +69,18 @@ * * @return KErrNotFound if the string ID is not found in the HTTP string pool * otherwise KErrNone for success + * + * @publishedAll + * @prototype */ + EXPORT_C TInt CHttpService::String(TInt aStringId, TPtrC8& aPtr) { RStringF str = iHttpServiceStruct->iHttpSession.StringPool().StringF(aStringId, RHTTPSession::GetTable()); aPtr.Set(str.DesC()); return KErrNone; } + /** * Set the proxy that applies to all HTTP client transactions that "this" * CHttpService instance creates @@ -106,6 +117,8 @@ * @return Proxy address otherwise KNullDesC8 if the proxy information * is not set. * + * @publishedAll + * @prototype */ EXPORT_C const TDesC8& CHttpService::ProxyAddress() const @@ -130,6 +143,9 @@ * at any time. The default no. of connections that the CHttpService instance uses is 6. * * @param aValue aValue No. of connections + * + * @publishedAll + * @prototype */ EXPORT_C void CHttpService::SetMaxConnections(TInt aValue) @@ -144,6 +160,8 @@ /** * Returns the maximum no. of TCP connections that is set. * + * @publishedAll + * @prototype */ EXPORT_C TInt CHttpService::MaxConnections() const @@ -161,6 +179,13 @@ } +/** + * Sets the maximum number of transactions to be pipelined. + * @param aValue - number of transactions + * + * @publishedAll + * @prototype + */ EXPORT_C void CHttpService::SetMaxTransactionsToPipeline(TInt aValue) { RHTTPSession sess = iHttpServiceStruct->iHttpSession; @@ -170,6 +195,12 @@ connInfo.SetProperty(sp.StringF(HTTP::EMaxNumTransactionsToPipeline, RHTTPSession::GetTable()), THTTPHdrVal(aValue)); } +/** + * Returns the maximum number of transactions to be pipelined. + * + * @publishedAll + * @prototype + */ EXPORT_C TInt CHttpService::MaxTransactionsToPipeline() const { RHTTPSession sess = iHttpServiceStruct->iHttpSession; @@ -189,7 +220,10 @@ * for all HTTP client transactions. [For ex; User-Agent header] * * @param aStringId - Pre-defined String ID in the HTTP string pool - * @param aHeaderValue - Value for the header + * @param aHeaderValue - Value for the header + * + * @publishedAll + * @prototype */ EXPORT_C TInt CHttpService::AddRequestHeader(TInt aStringId, const THttpHeaderValueVariant& aHeaderValue) { @@ -206,7 +240,10 @@ * applicable for all HTTP client transactions. [For ex; User-Agent header] * * @param aHeaderName - Custom header name - * @param aHeaderValue - Value for the header + * @param aHeaderValue - Value for the header + * + * @publishedAll + * @prototype */ EXPORT_C TInt CHttpService::AddCustomRequestHeader(const TDesC8& aHeaderName, const TDesC8& aHeaderValue) { @@ -222,6 +259,14 @@ return err; } +/** + * This method facilitates to set to construct the authentication credentials to be passed by the application + * The derived class from MHTTPServiceAuthentication will be called from the framework, if authentication is required. + * @param aCallback - Derived class from MHTTPServiceAuthentication + * + * @publishedAll + * @prototype + */ EXPORT_C TInt CHttpService::SetAuthentication(MHTTPServiceAuthentication* aCallback) { TInt error = KErrGeneral; @@ -248,9 +293,49 @@ SetMaxTransactionsToPipeline(KMaxTransToPipeline); } +/** + * returns the CHttpNetworkConnection instance created by the framework. + * The class can be used to set the connection properties. + * + * @publishedAll + * @prototype + */ EXPORT_C CHttpNetworkConnection* CHttpService::HttpNetworkConnection() { CHttpNetworkConnection *httpNetworkConn = CHttpNetworkConnection::New(); httpNetworkConn->SetHttpService(this); return httpNetworkConn; } + +void CHttpService::RemoveUnwantedFilters() + { + THTTPFilterRegistration filterInfo; + RStringPool stringPool = iHttpServiceStruct->iHttpSession.StringPool(); + + RHTTPFilterCollection filterArray = iHttpServiceStruct->iHttpSession.FilterCollection(); + THTTPFilterIterator iter = filterArray.Query(); + const TStringTable& st = RHTTPSession::GetTable(); + + iter.First(); + + while (!iter.AtEnd()) + { + // Get next filter registration info + filterInfo = iter(); + RStringF filterName = stringPool.StringF(filterInfo.iName); + switch(filterName.Index(st)) + { + //dont remove these filters + case HTTP::EClient: + case HTTP::EProtocolHandler: + case HTTP::EValidation: + case HTTP::ERedirect: + case HTTP::EHttpConnectFilter: + break; + //anything other than above, remove. + default: + filterArray.RemoveFilter(filterName); + } + ++iter; + } + }