227 // Close the log file and the connection to the server. |
296 // Close the log file and the connection to the server. |
228 TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("Log file closed."))); |
297 TLSLOG(KSenHttpChannelLogChannelBase , KMinLogLevel,(_L("Log file closed."))); |
229 TLSLOG_CLOSE(KSenHttpChannelLogChannelBase); |
298 TLSLOG_CLOSE(KSenHttpChannelLogChannelBase); |
230 } |
299 } |
231 |
300 |
232 // This function expects that RConnection has been connected |
301 TInt CSenHttpChannelImpl::SetIapPrefsL( TUint32 aIapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer ) |
233 // and that RConnection has already been opened! |
302 { |
234 /* |
303 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("- SetIapPrefsL , IAP ID (%d)"), aIapId)); |
235 void CSenHttpChannelImpl::SetIapPrefsL(TUint32 aIapId, |
304 |
236 RConnection& aConnection, |
|
237 RSocketServ& aSocketServer) |
|
238 { |
|
239 // Check whether IAP ID is not equal with the one that is currently in effect: |
305 // Check whether IAP ID is not equal with the one that is currently in effect: |
240 if(iExplicitIapDefined && iIapId == aIapId ) |
306 if(iExplicitIapDefined && iIapId == aIapId ) |
241 { |
307 { |
242 return; // nothing to do |
308 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id is same as currently in effect"); |
243 } |
309 return KErrNone; |
244 |
310 } |
245 LOG_WRITEFORMAT((_L8("- SetIapPrefsL: Re-setting IAP ID (%d)"), aIapId)); |
311 else |
|
312 { |
|
313 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id different with the currently in effect"); |
|
314 } |
|
315 |
246 |
316 |
247 // Check if socket server (connection) is already open.. |
317 // Check if socket server (connection) is already open.. |
248 if( iExplicitIapDefined ) |
318 if( iExplicitIapDefined ) |
249 { |
319 { |
250 // Socket server opened once before for some other IAP |
320 // Socket server opened once before for some other IAP |
251 LOG_WRITE_L("- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop"); |
321 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop"); |
252 aConnection.Stop(); |
322 aConnection.Stop(); |
253 } |
323 } |
254 else |
324 else |
255 { |
325 { |
256 aConnection.Stop(); // prompted from user |
|
257 iSess.DisconnectL(); |
|
258 iSess.ConnectL(); |
|
259 |
|
260 // Connect to a socket server |
326 // Connect to a socket server |
261 LOG_WRITE_L("- SetIapPrefsL: Connecting to new socket server"); |
327 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Connecting to new socket server"); |
262 User::LeaveIfError(aSocketServer.Connect()); |
328 User::LeaveIfError( aSocketServer.Connect() ); |
263 |
329 |
264 // Open new connection |
330 // Open new connection |
265 LOG_WRITE_L("- SetIapPrefsL: Opening new RConnection using the socket server."); |
331 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Opening new RConnection using the socket server."); |
266 User::LeaveIfError(aConnection.Open(aSocketServer)); |
332 User::LeaveIfError( aConnection.Open(aSocketServer) ); |
267 } |
333 } |
268 |
334 |
269 // Set the IAP selection preferences (IAP ID, do not prompt) |
335 // Set the IAP selection preferences (IAP ID, do not prompt) |
270 TCommDbConnPref pref; |
336 TInt retVal = SetID(aIapId, aDialogPref, aConnection, aSocketServer); |
271 pref.SetIapId( aIapId ); |
337 |
272 |
|
273 TCommDbDialogPref dialogPref; |
|
274 dialogPref = ECommDbDialogPrefDoNotPrompt; |
|
275 pref.SetDialogPreference(dialogPref); |
|
276 |
|
277 // Start the connection with the new preferences |
|
278 LOG_WRITE_L("- SetIapPrefsL: Calling RConnection::Start with new IAP prefs"); |
|
279 aConnection.Start(pref); |
|
280 |
|
281 // Get the connection "handle" from the HTTP session |
338 // Get the connection "handle" from the HTTP session |
282 RHTTPConnectionInfo connInfo = iSess.ConnectionInfo(); |
339 RHTTPConnectionInfo connInfo = iSess.ConnectionInfo(); |
283 |
340 |
284 // Attach socket server |
341 // Attach socket server |
285 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketServ, |
342 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketServ, |
288 |
345 |
289 // Attach connection |
346 // Attach connection |
290 TInt connPtr = REINTERPRET_CAST(TInt, &aConnection); |
347 TInt connPtr = REINTERPRET_CAST(TInt, &aConnection); |
291 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketConnection, |
348 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketConnection, |
292 RHTTPSession::GetTable()), |
349 RHTTPSession::GetTable()), |
293 THTTPHdrVal(connPtr)); |
350 THTTPHdrVal(connPtr)); |
294 |
351 return retVal; |
295 // Remember the IAP id that is being set; there is |
352 } |
296 // no direct API to query effective IAP ID from CommsDB. |
353 |
297 iExplicitIapDefined = ETrue; |
354 TInt CSenHttpChannelImpl::SetID(TUint32 aId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer, TBool aSNAP) |
298 iIapId = aIapId; |
355 { |
299 } |
356 /* |
300 */ |
357 * Single click connectivity feature has been implemented by CSock (RConnection class). |
301 |
358 * According to this client no need to set the IAP ID. |
302 |
359 * Automatically RConnection will use the suitable IAP |
303 /* |
360 */ |
304 void CSenHttpChannelImpl::SetupConnectionWithIapPrefsL( TUint32 aIapId, |
361 TInt retVal = KErrNone; |
305 RConnection& aConnection, |
362 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl called with ID [%d]"), aId)); |
306 RSocketServ& aSocketServer ) |
363 |
307 { |
364 #ifndef __ENABLE_ALR__ |
308 // Check whether IAP ID is not equal with the one that is currently in effect: |
365 if (iOCCenabled == EFalse) |
309 if(iExplicitIapDefined && iIapId == aIapId ) |
366 { |
310 { |
367 #endif |
311 return; // nothing to do |
368 if (aSNAP == EFalse) |
312 } |
369 { |
313 |
370 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- SetIAPID"); |
314 LOG_WRITEFORMAT((_L8("- SetIapPrefsL, IAP ID (%d)"), aIapId)); |
371 TCommDbConnPref pref; |
315 |
372 pref.SetIapId( aId ); |
316 // Check if socket server (connection) is already open.. |
373 TCommDbDialogPref dialogPref; |
317 if( iExplicitIapDefined ) |
374 if (aDialogPref) |
318 { |
375 { |
319 // Socket server opened once before for some other IAP |
376 dialogPref = ECommDbDialogPrefDoNotPrompt; |
320 LOG_WRITE_L("- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop"); |
377 } |
321 aConnection.Stop(); |
378 else |
322 } |
379 { |
323 else |
380 dialogPref = ECommDbDialogPrefPrompt; |
324 { |
381 } |
325 // Connect to a socket server |
382 pref.SetDialogPreference(dialogPref); |
326 LOG_WRITE_L("- SetIapPrefsL: Connecting to new socket server"); |
383 retVal = aConnection.Start(pref); |
327 User::LeaveIfError( aSocketServer.Connect() ); |
384 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("RConnection->Start retVal [%d]"), retVal)); |
328 |
385 } |
329 // Open new connection |
|
330 LOG_WRITE_L("- SetIapPrefsL: Opening new RConnection using the socket server."); |
|
331 User::LeaveIfError( aConnection.Open(aSocketServer) ); |
|
332 } |
|
333 |
|
334 // Set the IAP selection preferences (IAP ID, do not prompt) |
|
335 TCommDbConnPref pref; |
|
336 pref.SetIapId( aIapId ); |
|
337 |
|
338 TCommDbDialogPref dialogPref; |
|
339 dialogPref = ECommDbDialogPrefDoNotPrompt; |
|
340 pref.SetDialogPreference(dialogPref); |
|
341 |
|
342 // Start the connection with the new preferences |
|
343 LOG_WRITE_L("- SetIapPrefsL: Calling RConnection::Start with new IAP prefs"); |
|
344 aConnection.Start(pref); |
|
345 } |
|
346 |
|
347 |
|
348 void CSenHttpChannelImpl::AttachSocketServerAndConnectionWithHttpSession( TUint32 aIapId, |
|
349 RConnection& aConnection, |
|
350 RSocketServ& aSocketServer ) |
|
351 { |
|
352 if(iExplicitIapDefined && iIapId == aIapId ) |
|
353 { |
|
354 return; // nothing to do |
|
355 } |
|
356 |
|
357 // Get the connection "handle" from the HTTP session |
|
358 RHTTPConnectionInfo connInfo = iSess.ConnectionInfo(); |
|
359 |
|
360 // Attach socket server |
|
361 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketServ, |
|
362 RHTTPSession::GetTable()), |
|
363 THTTPHdrVal(aSocketServer.Handle())); |
|
364 |
|
365 // Attach connection |
|
366 TInt connPtr = REINTERPRET_CAST(TInt, &aConnection); |
|
367 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketConnection, |
|
368 RHTTPSession::GetTable()), |
|
369 THTTPHdrVal(connPtr)); |
|
370 |
|
371 // Remember the IAP id that is being set, because *at the moment*, |
|
372 // there is NO direct API to query effective IAP ID from CommsDB. |
|
373 iExplicitIapDefined = ETrue; |
|
374 iIapId = aIapId; |
|
375 } |
|
376 |
|
377 |
|
378 void CSenHttpChannelImpl::SetIapPrefsL( TUint32 aIapId, RConnection& aConnection, RSocketServ& aSocketServer ) |
|
379 { |
|
380 SetupConnectionWithIapPrefsL( aIapId, aConnection, aSocketServer ); |
|
381 AttachSocketServerAndConnectionWithHttpSession( aIapId, aConnection, aSocketServer ); |
|
382 } |
|
383 */ |
|
384 |
|
385 |
|
386 TInt CSenHttpChannelImpl::SetIapPrefsL( TUint32 aIapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer ) |
|
387 { |
|
388 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KNormalLogLevel, _L8("- SetIapPrefsL, IAP ID (%d)"), aIapId)); |
|
389 |
|
390 // Check whether IAP ID is not equal with the one that is currently in effect: |
|
391 if(iExplicitIapDefined && iIapId == aIapId ) |
|
392 { |
|
393 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id is same as currently in effect"); |
|
394 return KErrNone; |
|
395 } |
|
396 else |
386 else |
|
387 { |
|
388 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- SetSNAPID"); |
|
389 // Set the SNAP selection preferences (SNAP ID) |
|
390 TConnSnapPref pref; |
|
391 pref.SetSnap(aId); |
|
392 // Start the connection with the new preferences |
|
393 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetSnapPrefsL: Calling RConnection::Start with new SNAP prefs"); |
|
394 TInt retVal = aConnection.Start(pref); |
|
395 } |
|
396 #ifndef __ENABLE_ALR__ |
|
397 } |
|
398 else |
|
399 { |
|
400 if (aSNAP == EFalse) |
|
401 { |
|
402 /* If IAP id is zero, it is interpreted as |
|
403 * client's request for not requesting any specific IAP. |
|
404 * Default value is 0. |
|
405 * |
|
406 * If IAP id is set, SNAP id shall be zero. |
|
407 * If IAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown. |
|
408 * If IAP id is set, Connection selection dialog shall be disabled. |
|
409 * If IAP id is set, bearer set shall be EExtendedConnBearerUnknown. |
|
410 * If IAP id is set, forced roaming is disabled automatically. |
|
411 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection |
|
412 * selection dialog shall be enabled. |
|
413 */ |
|
414 |
|
415 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- Setting up OCC with IAP Settings"); |
|
416 TConnPrefList prefList; |
|
417 TExtendedConnPref extPrefs; |
|
418 //extPrefs.SetSnapPurpose( CMManager::ESnapPurposeUnknown); |
|
419 //TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- Setting up OCC Silent Connection"); |
|
420 //extPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent); |
|
421 //extPrefs.SetBearerSet(TExtendedConnBearer::EExtendedConnBearerUnknown); |
|
422 extPrefs.SetIapId(aId); |
|
423 extPrefs.SetSnapId(0); |
|
424 prefList.AppendL(&extPrefs); |
|
425 retVal = aConnection.Start(prefList); |
|
426 if(retVal == KErrNone) |
|
427 { |
|
428 iIapId = aId; |
|
429 } |
|
430 else |
|
431 { |
|
432 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP ->Start retVal [%d]"), retVal)); |
|
433 } |
|
434 } |
|
435 else |
|
436 { |
|
437 /** |
|
438 * Sets SNAP id. If SNAP id is zero, it is interpreted as |
|
439 * client's request for not requesting any specific SNAP. |
|
440 * Default value is 0. |
|
441 * |
|
442 * If SNAP id is set, IAP id shall be zero. |
|
443 * If SNAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown. |
|
444 * If SNAP id is set, Connection selection dialog shall be disabled. |
|
445 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection |
|
446 * selection dialog shall be enabled. |
|
447 */ |
|
448 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- Setting up OCC with SNAP Settings"); |
|
449 TConnPrefList prefList; |
|
450 TExtendedConnPref extPrefs; |
|
451 //extPrefs.SetSnapPurpose( CMManager::ESnapPurposeUnknown); |
|
452 //TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- Setting up OCC Silent Connection"); |
|
453 //extPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent); |
|
454 //extPrefs.SetBearerSet(TExtendedConnBearer::EExtendedConnBearerUnknown); |
|
455 if(aId == 0) |
397 { |
456 { |
398 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Iap Id different with the currently in effect"); |
457 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel, "- Setting SnapPurpose Internet"); |
399 } |
458 if(aDialogPref) //If it fails because of unavailibility of access points |
400 |
459 { |
401 |
460 extPrefs.SetSnapPurpose(CMManager::ESnapPurposeUnknown); |
402 // Check if socket server (connection) is already open.. |
461 extPrefs.SetConnSelectionDialog(ETrue); |
403 if( iExplicitIapDefined ) |
462 } |
404 { |
463 else |
405 // Socket server opened once before for some other IAP |
464 { |
406 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Re-using existing RConnection => calling RConnection::Stop"); |
465 extPrefs.SetSnapPurpose(CMManager::ESnapPurposeInternet); |
407 aConnection.Stop(); |
466 //extPrefs.SetNoteBehaviour(TExtendedConnPref::ENoteBehaviourConnSilent); |
408 } |
467 } |
409 else |
468 } |
410 { |
469 else |
411 // Connect to a socket server |
470 { |
412 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Connecting to new socket server"); |
471 extPrefs.SetSnapId(aId); |
413 User::LeaveIfError( aSocketServer.Connect() ); |
472 extPrefs.SetIapId(0); |
414 |
473 extPrefs.SetSnapPurpose(CMManager::ESnapPurposeUnknown); |
415 // Open new connection |
474 extPrefs.SetConnSelectionDialog(EFalse); |
416 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Opening new RConnection using the socket server."); |
475 } |
417 User::LeaveIfError( aConnection.Open(aSocketServer) ); |
476 prefList.AppendL(&extPrefs); |
418 } |
477 retVal = aConnection.Start(prefList); |
419 |
478 |
420 // Set the IAP selection preferences (IAP ID, do not prompt) |
479 if(retVal == KErrNone) |
421 /* |
480 { |
422 *Single click connectivity feature has been implemented by CSock (RConnection class). |
481 aConnection.GetIntSetting( _L("IAP\\Id"), iIapId); |
423 *According to this client no need to set the IAP ID. |
482 TName name; |
424 *Automatically RConnection will use the suitable IAP |
483 retVal = aConnection.Name(name); |
425 */ |
484 if(retVal == KErrNone) |
426 |
485 { |
427 |
486 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP Name [%S]"), &name)); |
428 TCommDbConnPref pref; |
487 } |
429 #ifndef __SINGLE_CLICK_CONNECTIVITY_ENABLED__ |
488 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("GetIntSetting returned IAP [%d]"), iIapId)); |
430 pref.SetIapId( aIapId ); |
489 } |
431 #else |
490 else |
432 pref.SetIapId( 0 ); //By default IAP ID is "0". IAP selection will take care by RConnection |
491 { |
433 #endif //__SINGLE_CLICK_CONNECTIVITY_ENABLED__ |
492 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("SNAP ->Start retVal [%d]"), retVal)); |
434 TCommDbDialogPref dialogPref; |
493 } |
435 |
494 } |
436 if (aDialogPref) |
495 } |
437 { |
496 #endif |
438 dialogPref = ECommDbDialogPrefDoNotPrompt; |
|
439 } |
|
440 else |
|
441 { |
|
442 dialogPref = ECommDbDialogPrefPrompt; |
|
443 } |
|
444 pref.SetDialogPreference(dialogPref); |
|
445 |
|
446 // Start the connection with the new preferences |
|
447 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"- SetIapPrefsL: Calling RConnection::Start with new IAP prefs"); |
|
448 |
|
449 TInt retVal =aConnection.Start(pref); |
|
450 |
|
451 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("RConnection->Start retVal [%d]"), retVal)); |
|
452 |
|
453 // Get the connection "handle" from the HTTP session |
|
454 RHTTPConnectionInfo connInfo = iSess.ConnectionInfo(); |
|
455 |
|
456 // Attach socket server |
|
457 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketServ, |
|
458 RHTTPSession::GetTable()), |
|
459 THTTPHdrVal(aSocketServer.Handle())); |
|
460 |
|
461 // Attach connection |
|
462 TInt connPtr = REINTERPRET_CAST(TInt, &aConnection); |
|
463 connInfo.SetPropertyL(iStringPool.StringF( HTTP::EHttpSocketConnection, |
|
464 RHTTPSession::GetTable()), |
|
465 THTTPHdrVal(connPtr)); |
|
466 |
|
467 // Remember the IAP id that is being set, because *at the moment*, |
|
468 // there is NO direct API to query effective IAP ID from CommsDB. |
|
469 if (!retVal) |
497 if (!retVal) |
470 { |
498 { |
471 #ifdef __SINGLE_CLICK_CONNECTIVITY_ENABLED__ |
499 iExplicitIapDefined = ETrue; |
472 //Since we are using by default setIapId "0". |
500 } |
473 //There won't be any explicitly defined Iap Id |
501 return retVal; |
474 iExplicitIapDefined = EFalse; |
502 } |
475 iIapId = 0; |
503 |
476 #else |
|
477 iExplicitIapDefined = ETrue; |
|
478 iIapId = aIapId; |
|
479 #endif //__SINGLE_CLICK_CONNECTIVITY_ENABLED__ |
|
480 } |
|
481 return retVal; |
|
482 } |
|
483 TInt CSenHttpChannelImpl::SetSnapPrefsL( TUint32 aSnapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer ) |
504 TInt CSenHttpChannelImpl::SetSnapPrefsL( TUint32 aSnapId, TBool aDialogPref, RConnection& aConnection, RSocketServ& aSocketServer ) |
484 { |
505 { |
485 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- CSenHttpChannelImpl::SetSnapPrefsL, SNAP ID (%d)"), aSnapId)); |
506 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("- CSenHttpChannelImpl::SetSnapPrefsL, SNAP ID (%d)"), aSnapId)); |
486 // Check whether SNAP ID is not equal with the one that is currently in effect: |
507 // Check whether SNAP ID is not equal with the one that is currently in effect: |
487 if(iExplicitIapDefined && iSnapId == aSnapId ) |
508 if(iExplicitIapDefined && iSnapId == aSnapId ) |
667 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL"); |
685 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL"); |
668 TUriParser8 uri; |
686 TUriParser8 uri; |
669 RStringF method; |
687 RStringF method; |
670 TPtrC8 deflate; |
688 TPtrC8 deflate; |
671 // Set IAP preferences, if such exist in properties (and not already in effect): |
689 // Set IAP preferences, if such exist in properties (and not already in effect): |
672 TUint32 iapId(KErrNone); |
690 TUint32 id(KErrNone); |
673 TBool doNotPrompt(ETrue); |
691 TBool prompt(ETrue); |
674 |
692 |
675 TInt retVal = aProps.IAPDialogL( doNotPrompt ); |
693 TInt retVal = aProps.IAPDialogL( prompt ); |
676 if ( retVal != KErrNone ) |
694 if ( retVal != KErrNone ) |
677 { |
695 { |
678 // by default, do not prompt (even if property does not exist!) |
696 // by default, do not prompt (even if property does not exist!) |
679 // => only if property is set, and has value "FALSE", show PROMPT |
697 // => only if property is set, and has value "FALSE", show PROMPT |
680 doNotPrompt = ETrue; |
698 prompt = ETrue; |
681 } |
699 } |
682 |
700 |
|
701 #ifndef __ENABLE_ALR__ |
683 // Independent of dialog preference (property's existance), if IAP was predefined, it must be set |
702 // Independent of dialog preference (property's existance), if IAP was predefined, it must be set |
684 if(((aProps.IapIdL(iapId)) == KErrNone)) |
703 if(((aProps.IapIdL(id)) == KErrNone)) |
685 { |
704 { |
686 retVal = SetIapPrefsL(iapId, doNotPrompt, iConnection, iSockServ); |
705 retVal = SetIapPrefsL(id, prompt, iConnection, iSockServ); |
687 } |
706 } |
688 else if(((aProps.SnapIdL(iapId)) == KErrNone)) |
707 else if(((aProps.SnapIdL(id)) == KErrNone)) |
689 { |
708 { |
690 retVal = SetSnapPrefsL(iapId, doNotPrompt, iConnection, iSockServ); |
709 retVal = SetSnapPrefsL(id, prompt, iConnection, iSockServ); |
691 } |
710 } |
692 else//to better control RConnection, we have to call Start by ourselve |
711 else//to better control RConnection, we have to call Start by ourselve |
693 { |
712 { |
694 retVal = SetSnapPrefsL(0, EFalse, iConnection, iSockServ); |
713 retVal = SetSnapPrefsL(0, EFalse, iConnection, iSockServ); |
695 if(retVal == KErrNotFound) |
714 if(retVal == KErrNotFound) |
696 { |
715 { |
697 retVal = SetIapPrefsL(0, EFalse, iConnection, iSockServ); |
716 if(iOCCenabled == EFalse) |
|
717 { |
|
718 retVal = SetIapPrefsL(0, EFalse, iConnection, iSockServ); |
|
719 } |
|
720 else |
|
721 { |
|
722 retVal = SetSnapPrefsL(0, prompt, iConnection, iSockServ); |
|
723 } |
698 } |
724 } |
699 } |
725 } |
700 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Set Snap/IAP prefs retVal [%d]"), retVal)); |
726 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("Set Snap/IAP prefs retVal [%d]"), retVal)); |
701 User::LeaveIfError(retVal); |
727 User::LeaveIfError(retVal); |
702 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL After User::Leave"); |
728 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::InvokeHttpMethodL After User::Leave"); |
703 TInt ret=iConnection.GetIntSetting(_L("IAP\\Id"), iUsedIapId); |
729 TInt ret= iConnection.GetIntSetting(_L("IAP\\Id"), iUsedIapId); |
704 // Check transport properties |
730 // Check transport properties |
|
731 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP/SNAP %d"), id)); |
|
732 #else |
|
733 retVal = SetIapPrefsL(id, prompt, iConnection, iSockServ); |
|
734 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP/SNAP %d"), id)); |
|
735 iUsedIapId = id; |
|
736 #endif |
|
737 |
705 CSenLayeredHttpTransportProperties::TSenHttpMethod httpMethod; |
738 CSenLayeredHttpTransportProperties::TSenHttpMethod httpMethod; |
706 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("IAP %d"), iapId)); |
739 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("PROMPT %d"), prompt)); |
707 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("DONT PROMPT %d"), doNotPrompt)); |
|
708 TInt retValHttpMethod = aProps.HttpMethodL(httpMethod); |
740 TInt retValHttpMethod = aProps.HttpMethodL(httpMethod); |
709 |
741 |
710 |
742 |
711 /*Installing the deflate filter based on the property values */ |
743 /*Installing the deflate filter based on the property values */ |
712 /*Once installed, the filter will be alive for on session lifetime */ |
744 /*Once installed, the filter will be alive for on session lifetime */ |
1875 |
1907 |
1876 TBool CSenHttpChannelImpl::EffectiveIapId( TUint32 &aIapId ) |
1908 TBool CSenHttpChannelImpl::EffectiveIapId( TUint32 &aIapId ) |
1877 { |
1909 { |
1878 TInt handle = iConnection.SubSessionHandle(); |
1910 TInt handle = iConnection.SubSessionHandle(); |
1879 if (handle>0) |
1911 if (handle>0) |
1880 { |
1912 { |
1881 TUint connEnum(0); |
1913 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::EffectiveIapId(): Current RConnection's subsession handle(%d)"), handle )); |
1882 TInt err = iConnection.EnumerateConnections(connEnum); |
1914 TUint connEnum(0); |
1883 if (!err && !connEnum) |
1915 TInt err = iConnection.EnumerateConnections(connEnum); |
1884 { |
1916 if (!err && !connEnum) |
1885 return EFalse; |
1917 { |
1886 } |
1918 return EFalse; |
1887 } |
1919 } |
1888 |
1920 } |
1889 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::EffectiveIapId(): Current RConnection's subsession handle(%d)"), iIapId )); |
1921 else |
1890 #ifdef _SENDEBUG |
1922 { |
|
1923 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," -> RConnection has not been initialized."); |
|
1924 } |
|
1925 |
1891 if( iExplicitIapDefined ) |
1926 if( iExplicitIapDefined ) |
1892 { |
1927 { |
1893 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8(" - IAP ID is known: %d"), iIapId )); |
1928 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8(" - IAP ID is known: %d"), iIapId )); |
1894 } |
1929 } |
1895 else |
1930 else |
1896 { |
1931 { |
1897 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," - IAP ID is not known."); |
1932 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," - IAP ID is not known."); |
1898 } |
1933 } |
1899 |
1934 |
1900 if( handle < KErrNone ) |
|
1901 { |
|
1902 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel," -> RConnection has not been initialized."); |
|
1903 } |
|
1904 #endif // _SENDEBUG |
|
1905 |
|
1906 if( handle && !iExplicitIapDefined ) |
1935 if( handle && !iExplicitIapDefined ) |
1907 { |
1936 { |
1908 // Eventhough IAP was not explicitely set (through Serene API), this |
1937 // Eventhough IAP was not explicitely set (through Serene API), this |
1909 // code can check what IAP end-user provided via IAP selection dialog: |
1938 // code can check what IAP end-user provided via IAP selection dialog: |
1910 TLSLOG_L(KSenHttpChannelLogChannelBase , KMinLogLevel,"CSenHttpChannelImpl::EffectiveIapId: about to call RConnection::GetIntSetting()"); |
|
1911 _LIT( KIapIdKey, "IAP\\Id" ); |
1939 _LIT( KIapIdKey, "IAP\\Id" ); |
1912 iConnection.GetIntSetting( KIapIdKey, iIapId); |
1940 iConnection.GetIntSetting( KIapIdKey, iIapId); |
1913 if ( iIapId > 0 ) |
1941 if ( iIapId > 0 ) |
1914 { |
1942 { |
1915 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("CSenHttpChannelImpl::EffectiveIapId(): end-user provided IAP(%d)"), iIapId )); |
1943 TLSLOG_FORMAT((KSenHttpChannelLogChannelBase , KMinLogLevel, _L8("---- GetIntSetting(): retuens IAP(%d)"), iIapId )); |
1916 // Treat the end-user selection as "explicit" definition as well(!): |
1944 // Treat the end-user selection as "explicit" definition as well(!): |
1917 iExplicitIapDefined = ETrue; |
1945 iExplicitIapDefined = ETrue; |
1918 } |
1946 } |
1919 } |
1947 } |
1920 if( iExplicitIapDefined ) |
1948 if( iExplicitIapDefined ) |