From 2b09eb0937985015e1ecc42a8bd39f0bc4c84b17 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 18 Jun 2009 09:36:33 +0300 Subject: Fixed FTP default IAP setting. Accidentaly reverted by ce409be66. It is important to close the RConnection before calling setdefaultif. This because setdefaultif triesd to open the connection, and if it is already open it may fail. --- examples/network/ftp/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index 118dcfc..17423b8 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -112,15 +112,14 @@ static void setDefaultIapL() { User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name)); iap8Name.ZeroTerminate(); + conn.Stop(); + CleanupStack::PopAndDestroy(&conn); + CleanupStack::PopAndDestroy(&serv); + struct ifreq ifReq; strcpy( ifReq.ifr_name, (char*)iap8Name.Ptr()); User::LeaveIfError(setdefaultif( &ifReq )); - conn.Stop(); - conn.Close(); - serv.Close(); - CleanupStack::PopAndDestroy(&conn); - CleanupStack::PopAndDestroy(&serv); } monitor.Close(); CleanupStack::PopAndDestroy(&monitor); -- cgit v0.12