accessoryservices/remotecontrolfw/server/src/server.cpp
branchRCL_3
changeset 21 ccb4f6b3db21
parent 20 1ddbe54d0645
child 22 8cb079868133
--- a/accessoryservices/remotecontrolfw/server/src/server.cpp	Thu Aug 19 11:09:10 2010 +0300
+++ b/accessoryservices/remotecontrolfw/server/src/server.cpp	Tue Aug 31 16:29:05 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2004-2009 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"
@@ -1740,36 +1740,28 @@
 	LOGINCOMINGDELIVERED;
 	TInt err = KErrNone;
 
-	if ( aSess.ClientAvailable() )
+	// First off check if the client supports this
+	if(!aSess.SupportedMessage(aMsg))
+        {
+        err = KErrArgument;
+        
+        // 'Take ownership' of it by destroying it- it's finished with.
+        delete &aMsg;
+        }
+	else if ( aSess.CurrentReceiveMessage().Handle() )
 		{
-		// First off check if the client supports this
-		if(!aSess.SupportedMessage(aMsg))
-			{
-			err = KErrArgument;
-
-			// 'Take ownership' of it by destroying it- it's finished with.
-			delete &aMsg;
-			}
-		else if ( aSess.CurrentReceiveMessage().Handle() )
-			{
-			// If the client can take the message now put it on the right queue.
+		// If the client can take the message now put it on the right queue.
 
-			err = aSess.WriteMessageToClient (aMsg);
-			// If the message was a command, and it was delivered with no error,
-			// then put it in the 'incoming delivered' log. Otherwise, delete it
-			// because it's finished with.
-			if ((aMsg.MsgType() == ERemConCommand) || (aMsg.MsgType() == ERemConNotifyCommand))
+		err = aSess.WriteMessageToClient (aMsg);
+		// If the message was a command, and it was delivered with no error, 
+		// then put it in the 'incoming delivered' log. Otherwise, delete it 
+		// because it's finished with.
+		if ((aMsg.MsgType() == ERemConCommand) || (aMsg.MsgType() == ERemConNotifyCommand))
+			{
+			if (err == KErrNone )
 				{
-				if (err == KErrNone )
-					{
-					// We'll need to remember it for the response coming back.
-					IncomingDelivered().Append(aMsg);
-					}
-				else
-					{
-					// 'Take ownership' of it by destroying it- it's finished with.
-					delete &aMsg;
-					}
+				// We'll need to remember it for the response coming back.
+				IncomingDelivered().Append(aMsg); 
 				}
 			else
 				{
@@ -1779,19 +1771,12 @@
 			}
 		else
 			{
-			IncomingPendingDelivery().Append(aMsg);
+			// 'Take ownership' of it by destroying it- it's finished with.			
+			delete &aMsg;
 			}
 		}
 	else
 		{
-		// The client has not yet registered the interfaces they're interested
-		// in, so put the message on the incoming pending delivery queue until
-		// they do.
-		// Return KErrNone to avoid sending a reject. We're assuming that the
-		// client will eventually successfully receive the message, as we
-		// don't have a better basis on which to operate. This is identical to
-		// the case where a client doesn't have an outstanding receive request
-		// at this time.
 		IncomingPendingDelivery().Append(aMsg);
 		}