realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegEventHandler.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : CSIPRegEventHandler.cpp
       
    15 // Part of     : SIP Profile Agent
       
    16 // implementation
       
    17 // Version     : 1.0
       
    18 //
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 // INCLUDE FILES
       
    24 #include "CSIPRegEventHandler.h"
       
    25 #include "CSIPRegEventSubscriber.h"
       
    26 #include "CSIPNotifyXmlBodyParser.h"
       
    27 #include "sipcontactelement.h"
       
    28 #include "sipregistrationelement.h"
       
    29 
       
    30 const TInt KMicroSecsInSec = 1000000;
       
    31 
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CSIPRegEventHandler::NewL
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CSIPRegEventHandler* CSIPRegEventHandler::NewL(
       
    38     CSIPNotifyXmlBodyParser& aXMLParser,
       
    39     const TDesC8& aLocalIP,
       
    40     CDeltaTimer& aDeltaTimer,
       
    41     CSIPConnection& aConnection,
       
    42     MSIPRegistrationContext& aContext,
       
    43     CUri8& aUserIdentity,
       
    44     MSIPRegEventObserver& aObserver,
       
    45     CSipProfileAgentConfigExtension& aConfigExtension)
       
    46 	{
       
    47 	CSIPRegEventHandler* self = 
       
    48 	    CSIPRegEventHandler::NewLC(aXMLParser,aLocalIP,aDeltaTimer,
       
    49 	        aConnection,aContext,aUserIdentity,aObserver,aConfigExtension);
       
    50 	CleanupStack::Pop();
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CSIPRegEventHandler::NewLC
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CSIPRegEventHandler* CSIPRegEventHandler::NewLC(
       
    59     CSIPNotifyXmlBodyParser& aXMLParser,
       
    60     const TDesC8& aLocalIP,
       
    61     CDeltaTimer& aDeltaTimer,
       
    62     CSIPConnection& aConnection,
       
    63     MSIPRegistrationContext& aContext,
       
    64     CUri8& aUserIdentity,
       
    65     MSIPRegEventObserver& aObserver,
       
    66     CSipProfileAgentConfigExtension& aConfigExtension)
       
    67 	{
       
    68 	CSIPRegEventHandler* self = 
       
    69 	    new(ELeave)CSIPRegEventHandler(aXMLParser,aDeltaTimer,aConnection,
       
    70 	        aContext,aObserver);
       
    71 	CleanupStack::PushL(self);
       
    72 	self->ConstructL(aLocalIP,aUserIdentity,aConfigExtension);
       
    73 	return self;
       
    74 	}
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CSIPRegEventHandler::CSIPRegEventHandler
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 CSIPRegEventHandler::CSIPRegEventHandler(
       
    81     CSIPNotifyXmlBodyParser& aXMLParser,
       
    82     CDeltaTimer& aDeltaTimer,
       
    83     CSIPConnection& aConnection,
       
    84     MSIPRegistrationContext& aContext,
       
    85     MSIPRegEventObserver& aObserver)
       
    86  : iXMLParser(aXMLParser),
       
    87    iDeltaTimer(aDeltaTimer),
       
    88    iConnection(aConnection),
       
    89    iRegistrationContext(aContext),
       
    90    iObserver(aObserver),
       
    91    iDeltaTimerCallBack(ReSubscribeTimerExpired,this),
       
    92    iFirstNotifyProcessed(EFalse)
       
    93 	{
       
    94 	iDeltaTimerEntry.Set(iDeltaTimerCallBack);
       
    95 	}
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CSIPRegEventHandler::ConstructL
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 void CSIPRegEventHandler::ConstructL(const TDesC8& aLocalIP,
       
   102                                      CUri8& aUserIdentity,
       
   103                                      CSipProfileAgentConfigExtension& aConfigExtension)
       
   104 	{
       
   105     iLocalIP = aLocalIP.AllocL();
       
   106 	iUserId = CUri8::NewL(aUserIdentity.Uri());
       
   107     // String constants for XML
       
   108     RStringPool& stringPool = iXMLParser.StringPool();
       
   109     iStrFull = stringPool.OpenStringL(_L8("full"));
       
   110 	iStrActive = stringPool.OpenStringL(_L8("active"));
       
   111     iStrTerminated = stringPool.OpenStringL(_L8("terminated"));
       
   112     iStrShortened = stringPool.OpenStringL(_L8("shortened"));
       
   113     iStrRejected = stringPool.OpenStringL(_L8("rejected"));
       
   114     iStrDeactivated = stringPool.OpenStringL(_L8("deactivated"));
       
   115     iStrUnregistered = stringPool.OpenStringL(_L8("unregistered"));
       
   116     iStrProbation = stringPool.OpenStringL(_L8("probation"));
       
   117     iStrExpired = stringPool.OpenStringL(_L8("expired"));
       
   118 	// Subscriber
       
   119 	iSubscriber = CSIPRegEventSubscriber::NewL(iXMLParser,
       
   120 	                                           iConnection,
       
   121 	                                           iRegistrationContext,
       
   122 	                                           *iUserId,
       
   123 	                                           *this,aConfigExtension);
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CSIPRegEventHandler::~CSIPRegEventHandler
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 CSIPRegEventHandler::~CSIPRegEventHandler()
       
   131 	{
       
   132 	iDeltaTimer.Remove(iDeltaTimerEntry);
       
   133 	delete iSubscriber;
       
   134 	iStrFull.Close();
       
   135 	iStrActive.Close();
       
   136 	iStrTerminated.Close();
       
   137     iStrShortened.Close();
       
   138     iStrRejected.Close();
       
   139     iStrDeactivated.Close();
       
   140     iStrUnregistered.Close();
       
   141     iStrProbation.Close();
       
   142     iStrExpired.Close();
       
   143 	delete iUserId;
       
   144 	delete iLocalIP;
       
   145 	}
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CSIPRegEventHandler::SubscriptionFailedL
       
   149 // From MSIPRegEventSubscriberObserver
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 void CSIPRegEventHandler::SubscriptionFailedL()
       
   153     {
       
   154     iObserver.RegEventSubscriptionFailedL();
       
   155     }
       
   156 
       
   157 // -----------------------------------------------------------------------------
       
   158 // CSIPRegEventHandler::SubscriptionFailedL
       
   159 // From MSIPRegEventSubscriberObserver
       
   160 // -----------------------------------------------------------------------------
       
   161 //    
       
   162 void CSIPRegEventHandler::SubscriptionFailedL(TInt aRetryAfter)
       
   163     {
       
   164     ReSubscribeAfterL(aRetryAfter);
       
   165     iObserver.RegEventSubscriptionActive();
       
   166     }
       
   167 		
       
   168 // -----------------------------------------------------------------------------
       
   169 // CSIPRegEventHandler::RegEventNotSupportedByNetworkL
       
   170 // From MSIPRegEventSubscriberObserver
       
   171 // -----------------------------------------------------------------------------
       
   172 //		
       
   173 void CSIPRegEventHandler::RegEventNotSupportedByNetworkL()
       
   174     {
       
   175     delete iSubscriber;
       
   176     iSubscriber = NULL;
       
   177     // The observer does not have to know that subscription failed,
       
   178     // since in this case we are dealing with 
       
   179     // IMS implentation that does not support reg-event and 
       
   180     // the observer can consider the profile registered.
       
   181     iObserver.RegEventSubscriptionActive();  
       
   182     }
       
   183     
       
   184 // -----------------------------------------------------------------------------
       
   185 // CSIPRegEventHandler::ReRegister
       
   186 // From MSIPRegEventSubscriberObserver
       
   187 // -----------------------------------------------------------------------------
       
   188 //   
       
   189 void CSIPRegEventHandler::ReRegister()
       
   190     {
       
   191     iObserver.ReRegister();
       
   192     }    
       
   193    
       
   194 // -----------------------------------------------------------------------------
       
   195 // CSIPRegEventHandler::NotifyReceived
       
   196 // From MSIPRegEventSubscriberObserver
       
   197 // -----------------------------------------------------------------------------
       
   198 //    
       
   199 void CSIPRegEventHandler::NotifyReceivedL(CSIPRegInfoElement& aNotifyData)
       
   200     {
       
   201     TBool terminated = EFalse;
       
   202     if (iFirstNotifyProcessed)
       
   203         {
       
   204         if (aNotifyData.Version() == iRegEventVersion+1)
       
   205             {
       
   206             // process data
       
   207             HandleRegInfoL(aNotifyData,terminated);
       
   208             if (!terminated)
       
   209                 {
       
   210                 iRegEventVersion = aNotifyData.Version();
       
   211                 }
       
   212             else
       
   213                 {
       
   214                 iRegEventVersion = 0;
       
   215                 }
       
   216             }
       
   217         else if (aNotifyData.Version() > iRegEventVersion+1)
       
   218             {
       
   219             // discard data and refresh subscription
       
   220             iSubscriber->RefreshL();
       
   221             iRegEventVersion = 0;
       
   222             iFirstNotifyProcessed = EFalse;
       
   223             }            
       
   224         else  
       
   225             {
       
   226             // discard data: aNotifyData.Version() <= iRegEventVersion
       
   227             }
       
   228         }
       
   229     else
       
   230         {
       
   231         if (aNotifyData.State() != iStrFull)
       
   232             {
       
   233             iSubscriber->RefreshL();
       
   234             }
       
   235         else
       
   236             {
       
   237             HandleRegInfoL(aNotifyData,terminated);
       
   238             if (!terminated)
       
   239                 {
       
   240                 iRegEventVersion = aNotifyData.Version();
       
   241                 iFirstNotifyProcessed = ETrue;
       
   242                 iObserver.RegEventSubscriptionActive();              
       
   243                 }
       
   244             }
       
   245         }
       
   246     }
       
   247         
       
   248 // -----------------------------------------------------------------------------
       
   249 // CSIPRegEventHandler::TerminatedL
       
   250 // From MSIPRegEventSubscriberObserver
       
   251 // -----------------------------------------------------------------------------
       
   252 //
       
   253 void CSIPRegEventHandler::TerminatedL(CSIPRegInfoElement& aNotifyData,
       
   254                                       TInt aRetryAfter)
       
   255     {
       
   256     if (aRetryAfter < 0)
       
   257         {
       
   258         delete iSubscriber;
       
   259         iSubscriber = NULL;  
       
   260         iObserver.RegistrationTerminated();
       
   261         }
       
   262     else
       
   263         {
       
   264         if (AllLocalContactsTerminated(aNotifyData))
       
   265             {
       
   266             delete iSubscriber;
       
   267             iSubscriber = NULL;  
       
   268             iObserver.RegistrationTerminated();            
       
   269             }
       
   270         else
       
   271             {
       
   272             ReSubscribeAfterL(aRetryAfter);
       
   273             }
       
   274         }
       
   275     }
       
   276     
       
   277 // -----------------------------------------------------------------------------
       
   278 // CSIPRegEventHandler::SubscribeL
       
   279 // -----------------------------------------------------------------------------
       
   280 //	
       
   281 void CSIPRegEventHandler::SubscribeL()
       
   282     {
       
   283     if (iSubscriber)
       
   284         {
       
   285         iSubscriber->SubscribeL();
       
   286         }
       
   287     }
       
   288     
       
   289 // -----------------------------------------------------------------------------
       
   290 // CSIPRegEventHandler::RefreshL
       
   291 // -----------------------------------------------------------------------------
       
   292 //	
       
   293 void CSIPRegEventHandler::RefreshL()
       
   294     {
       
   295     if (iSubscriber)
       
   296         {
       
   297         iSubscriber->RefreshL();
       
   298         }
       
   299     }
       
   300 
       
   301 // -----------------------------------------------------------------------------
       
   302 // CSIPRegEventHandler::HasTransaction
       
   303 // -----------------------------------------------------------------------------
       
   304 // 	    
       
   305 TBool CSIPRegEventHandler::HasTransaction(
       
   306     const CSIPTransactionBase& aTransaction) const
       
   307     {
       
   308     if (iSubscriber)
       
   309         {    
       
   310         return iSubscriber->HasTransaction(aTransaction);
       
   311         }
       
   312     return EFalse;
       
   313     }
       
   314 
       
   315 // -----------------------------------------------------------------------------
       
   316 // CSIPRegEventHandler::HasTransaction
       
   317 // -----------------------------------------------------------------------------
       
   318 //
       
   319 TBool CSIPRegEventHandler::HasRefresh(const CSIPRefresh& aRefresh) const
       
   320     {
       
   321     if (iSubscriber)
       
   322         {    
       
   323         return iSubscriber->HasRefresh(aRefresh);
       
   324         }
       
   325     return EFalse;
       
   326     }
       
   327     
       
   328 // -----------------------------------------------------------------------------
       
   329 // CSIPRegEventHandler::HasDialog
       
   330 // -----------------------------------------------------------------------------
       
   331 //    
       
   332 TBool CSIPRegEventHandler::HasDialog(const CSIPDialog& aDialog) const
       
   333     {
       
   334     if (iSubscriber)
       
   335         {
       
   336         return iSubscriber->HasDialog(aDialog);
       
   337         }
       
   338     return EFalse;
       
   339     }
       
   340     	
       
   341 // -----------------------------------------------------------------------------
       
   342 // CSIPRegEventHandler::RequestReceivedL
       
   343 // -----------------------------------------------------------------------------
       
   344 //	
       
   345 void CSIPRegEventHandler::RequestReceivedL(
       
   346     CSIPServerTransaction* aTransaction,
       
   347     CSIPDialog& aDialog)
       
   348     {
       
   349     if (iSubscriber)
       
   350         {    
       
   351         iSubscriber->RequestReceivedL(aTransaction,aDialog);
       
   352         }
       
   353     }
       
   354 	
       
   355 // -----------------------------------------------------------------------------
       
   356 // CSIPRegEventHandler::ResponseReceivedL
       
   357 // -----------------------------------------------------------------------------
       
   358 //					           
       
   359 void CSIPRegEventHandler::ResponseReceivedL(
       
   360     CSIPClientTransaction& aTransaction)
       
   361     {
       
   362     if (iSubscriber)
       
   363         {    
       
   364         iSubscriber->ResponseReceivedL(aTransaction);
       
   365         }
       
   366     }
       
   367     
       
   368 // -----------------------------------------------------------------------------
       
   369 // CSIPRegEventHandler::ErrorOccured
       
   370 // -----------------------------------------------------------------------------
       
   371 //
       
   372 void CSIPRegEventHandler::ErrorOccured(
       
   373     TInt aError,
       
   374     CSIPTransactionBase& aTransaction)
       
   375     {
       
   376     if (iSubscriber)
       
   377         {    
       
   378         iSubscriber->ErrorOccured(aError,aTransaction);
       
   379         }
       
   380     }
       
   381     
       
   382 // -----------------------------------------------------------------------------
       
   383 // CSIPRegEventHandler::ErrorOccured
       
   384 // -----------------------------------------------------------------------------
       
   385 //    
       
   386 void CSIPRegEventHandler::ErrorOccured(TInt aError,
       
   387                                        CSIPDialog& aDialog)
       
   388     {
       
   389     if (iSubscriber)
       
   390         {    
       
   391         iSubscriber->ErrorOccured(aError,aDialog);
       
   392         }
       
   393     }
       
   394     
       
   395 // -----------------------------------------------------------------------------
       
   396 // CSIPRegEventHandler::ReSubscribeTimerExpired
       
   397 // A callback for CDeltaTimer
       
   398 // -----------------------------------------------------------------------------
       
   399 //    
       
   400 TInt CSIPRegEventHandler::ReSubscribeTimerExpired(TAny* aPtr)
       
   401     {
       
   402     CSIPRegEventHandler* self = reinterpret_cast<CSIPRegEventHandler*>(aPtr);
       
   403     TRAP_IGNORE(self->ReSubscribeL())
       
   404     return ETrue;
       
   405     }
       
   406 
       
   407 // -----------------------------------------------------------------------------
       
   408 // CSIPRegEventHandler::ReSubscribeAfterL
       
   409 // -----------------------------------------------------------------------------
       
   410 //
       
   411 void CSIPRegEventHandler::ReSubscribeAfterL(TInt aRetryAfter)
       
   412     {
       
   413     if (aRetryAfter <= 0)
       
   414         {
       
   415         ReSubscribeL();
       
   416         }
       
   417     else
       
   418         {
       
   419         iDeltaTimer.Remove(iDeltaTimerEntry);
       
   420         TTimeIntervalMicroSeconds32 interval(aRetryAfter*KMicroSecsInSec);
       
   421         iDeltaTimer.Queue(interval,iDeltaTimerEntry);    
       
   422         }
       
   423     }
       
   424  
       
   425 // -----------------------------------------------------------------------------
       
   426 // CSIPRegEventHandler::ReSubscribeL
       
   427 // -----------------------------------------------------------------------------
       
   428 //    
       
   429 void CSIPRegEventHandler::ReSubscribeL()
       
   430     {
       
   431     if (iSubscriber)
       
   432         {
       
   433         iSubscriber->ReSubscribeL();
       
   434         iRegEventVersion = 0;
       
   435         iFirstNotifyProcessed = EFalse;        
       
   436         }                                    
       
   437     }
       
   438 
       
   439 // -----------------------------------------------------------------------------
       
   440 // CSIPRegEventHandler::HandleRegInfoL
       
   441 // -----------------------------------------------------------------------------
       
   442 //
       
   443 void CSIPRegEventHandler::HandleRegInfoL(
       
   444     CSIPRegInfoElement& aElement,
       
   445     TBool& aTerminated)
       
   446     {
       
   447     aTerminated = EFalse;
       
   448     TBool localIPFound = EFalse;
       
   449     RPointerArray<CSIPRegistrationElement>& regElements =
       
   450         aElement.RegistrationElements();
       
   451         
       
   452     for (TInt i=0; !aTerminated && i < regElements.Count(); i++)
       
   453         {
       
   454         CSIPRegistrationElement* element = regElements[i];
       
   455         if (element)
       
   456             {
       
   457             HandleRegistrationElementL(*element,aTerminated,localIPFound);
       
   458             }
       
   459         }
       
   460     if (!aTerminated && !localIPFound && aElement.State() == iStrFull)
       
   461         {
       
   462         aTerminated = ETrue;
       
   463         if (iFirstNotifyProcessed)
       
   464             {
       
   465             iObserver.ReRegister();
       
   466             }
       
   467         else
       
   468             {
       
   469             iObserver.RegEventSubscriptionFailedL();
       
   470             }
       
   471         }
       
   472     }
       
   473 
       
   474 // -----------------------------------------------------------------------------
       
   475 // CSIPRegEventHandler::HandleRegistrationElementL
       
   476 // -----------------------------------------------------------------------------
       
   477 //
       
   478 void CSIPRegEventHandler::HandleRegistrationElementL(
       
   479     CSIPRegistrationElement& aElement,
       
   480     TBool& aTerminated,
       
   481     TBool& aLocalIPFound)
       
   482     {
       
   483     aTerminated = EFalse;
       
   484     TUint expirationTime = KMaxTUint;
       
   485     TBool updateExpirationTime = EFalse;
       
   486     RString registrationState = aElement.State();
       
   487     RPointerArray<CSIPContactElement>& contacts = aElement.ContactElements();
       
   488     for (TInt i=0; !aTerminated && i < contacts.Count(); i++)
       
   489         {
       
   490         CSIPContactElement* contact = contacts[i];
       
   491         if (HasLocalIP(*contact))
       
   492             {
       
   493             aLocalIPFound = ETrue;
       
   494             RString event = contact->Event();
       
   495              // Network initiated RE-registration
       
   496             if (registrationState == iStrActive &&
       
   497                 contact->State() == iStrActive &&
       
   498                 event == iStrShortened &&
       
   499                 contact->HasExpires())
       
   500                 {
       
   501                 updateExpirationTime = ETrue;
       
   502                 if (expirationTime > contact->Expires())
       
   503                     {
       
   504                     expirationTime = contact->Expires();
       
   505                     }
       
   506                 }
       
   507             // Network initiated DE-registration
       
   508             TInt compareErr = aElement.AOR().Uri().Equivalent(iUserId->Uri());
       
   509             if (compareErr == KErrNoMemory)
       
   510                 {
       
   511                 User::Leave(KErrNoMemory);
       
   512                 }
       
   513             if (compareErr == KErrNone && contact->State() == iStrTerminated)
       
   514                 {
       
   515                 if (event == iStrRejected || 
       
   516                     event == iStrTerminated ||
       
   517                     event == iStrUnregistered ||
       
   518                     event == iStrProbation)
       
   519                     {
       
   520                     iObserver.RegistrationTerminated();
       
   521                     aTerminated = ETrue;
       
   522                     }           
       
   523                 if (!aTerminated && 
       
   524                     (event == iStrDeactivated || event == iStrExpired))
       
   525                     {
       
   526                     iObserver.RegistrationDeactivated();
       
   527                     aTerminated = ETrue;
       
   528                     }
       
   529                 }
       
   530             }
       
   531         }
       
   532     if (!aTerminated && updateExpirationTime)
       
   533         {
       
   534         iObserver.ExpirationTimeUpdatedL(expirationTime);
       
   535         }
       
   536     }
       
   537   
       
   538 // -----------------------------------------------------------------------------
       
   539 // CSIPRegEventHandler::AllLocalContactsTerminated
       
   540 // -----------------------------------------------------------------------------
       
   541 //   
       
   542 TBool CSIPRegEventHandler::AllLocalContactsTerminated(
       
   543     CSIPRegInfoElement& aNotifyData) const
       
   544     {
       
   545     TInt terminatedLocalContactCount = 0;
       
   546     TInt localContactCount = 0;
       
   547     
       
   548     RPointerArray<CSIPRegistrationElement>& regElements =
       
   549         aNotifyData.RegistrationElements();
       
   550         
       
   551     for (TInt i=0; i < regElements.Count(); i++)
       
   552         {
       
   553         RPointerArray<CSIPContactElement>& contacts = 
       
   554             regElements[i]->ContactElements();
       
   555         for (TInt j=0; j < contacts.Count(); j++)
       
   556             {
       
   557             CSIPContactElement* contact = contacts[j];
       
   558             if (contact && HasLocalIP(*contact))
       
   559                 {
       
   560                 localContactCount++;
       
   561                 if (contact->State() == iStrTerminated)
       
   562                     {
       
   563                     terminatedLocalContactCount++;
       
   564                     }
       
   565                 }
       
   566             }
       
   567         }
       
   568         
       
   569     if (localContactCount > 0 && 
       
   570         localContactCount == terminatedLocalContactCount)
       
   571         {
       
   572         return ETrue;
       
   573         }
       
   574         
       
   575     return EFalse;
       
   576     }
       
   577   
       
   578 // -----------------------------------------------------------------------------
       
   579 // CSIPRegEventHandler::HasLocalIP
       
   580 // -----------------------------------------------------------------------------
       
   581 //  
       
   582 TBool CSIPRegEventHandler::HasLocalIP(const CSIPContactElement& aContact) const
       
   583     {
       
   584     TPtrC8 host(aContact.Uri8().Uri().Extract(EUriHost));
       
   585     return (host.CompareF(*iLocalIP) == 0);
       
   586     }