applayerprotocols/httpservice/src/chttpservice.cpp
branchRCL_3
changeset 7 337070b4fa18
parent 0 b16258d2340f
child 9 2611c08ee28e
equal deleted inserted replaced
3:5ee1d9ce5878 7:337070b4fa18
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 #include "chttpservice.h"
    16 #include "chttpservice.h"
    17 #include "httpclientutils.h"
    17 #include "httpclientutils.h"
    18 
    18 #include "chttpclientauthentication.h" 
       
    19 #include "mhttpserviceauthentication.h" 
    19 const TInt KMaxNoOfConnections = 6;
    20 const TInt KMaxNoOfConnections = 6;
    20 const TInt KMaxTransToPipeline = 5;
    21 const TInt KMaxTransToPipeline = 5;
    21 
    22 
    22 /**
    23 /**
    23  * The default 2-phase constructor to create a CHttpService instance
    24  * The default 2-phase constructor to create a CHttpService instance
    41 	    {
    42 	    {
    42 	iHttpServiceStruct->iHttpSession.Close();
    43 	iHttpServiceStruct->iHttpSession.Close();
    43 	    }
    44 	    }
    44 	delete iHttpServiceStruct;
    45 	delete iHttpServiceStruct;
    45 	}
    46 	}
       
    47 
       
    48 /**
       
    49  * Destructor of the inner class CHttpServiceStruct
       
    50  */ 
       
    51 CHttpService::CHttpServiceStruct::~CHttpServiceStruct()
       
    52     {
       
    53     delete iHttpClientAuthentication;
       
    54     }
    46 
    55 
    47 /**
    56 /**
    48  * Retrieves the equivalent string for a give string ID from the 
    57  * Retrieves the equivalent string for a give string ID from the 
    49  * HTTP string pool
    58  * HTTP string pool
    50  * 
    59  * 
   210 	TInt err = iHttpServiceStruct->iSessionHeaders.SetRawField(str, aHeaderValue, KFieldSeparator);
   219 	TInt err = iHttpServiceStruct->iSessionHeaders.SetRawField(str, aHeaderValue, KFieldSeparator);
   211 	str.Close();
   220 	str.Close();
   212 	return err;
   221 	return err;
   213 	}
   222 	}
   214 
   223 
       
   224 EXPORT_C TInt CHttpService::SetAuthentication(MHTTPServiceAuthentication* aCallback)
       
   225     {
       
   226     TInt error = KErrGeneral;
       
   227     iHttpServiceStruct->iHttpClientAuthentication = CHttpClientAuthentication::New(iHttpServiceStruct->iHttpSession, aCallback);
       
   228     if(iHttpServiceStruct->iHttpClientAuthentication)
       
   229         error = KErrNone;
       
   230     return error;
       
   231     }
       
   232 
   215 /**
   233 /**
   216  * Constructor
   234  * Constructor
   217  */
   235  */
   218 CHttpService::CHttpService()
   236 CHttpService::CHttpService()
   219 : iHttpServiceStruct(NULL)
   237 : iHttpServiceStruct(NULL)