datacommsserver/esockserver/ssock/ss_intsock.cpp
changeset 4 928ed51ddc43
parent 0 dfb7c4ff071f
child 12 8b5d60ce1e94
--- a/datacommsserver/esockserver/ssock/ss_intsock.cpp	Fri Jan 22 10:58:59 2010 +0200
+++ b/datacommsserver/esockserver/ssock/ss_intsock.cpp	Tue Jan 26 13:09:14 2010 +0200
@@ -1195,10 +1195,19 @@
 					ret = KErrNoMemory;
 					}
 				}
-			if(ret == KErrNone && (iOptions & KOptBlocking))
-				{
-				completeReq = EFalse;
-				}
+			if(ret == KErrNone)
+			    {
+                if(iOptions & KOptBlocking)
+                    {
+                    completeReq = EFalse;
+                    }
+                else if(iBlockedOperations & EWriteFlowedOff)
+                    {
+                    //it should return KErrWouldBlock instead of KErrNone
+                    //but it returns KErrNone for backward compatibility.
+                    iSendData.Free();
+                    }
+			    }
 			}
 		}
 	else	// !IsStream()
@@ -1317,8 +1326,12 @@
 			if (nwr == 0)
 				{
 				// Flow unable to accept data but not erroring
-				completeReq = EFalse;
-				iSendData.Assign(data);
+                // WriteFlowedOff
+                if(iOptions & KOptBlocking)
+                    {
+                    completeReq = EFalse;
+                    iSendData.Assign(data);
+                    }
 				}
 
 			if (iErrorOperationMask & (MSessionControlNotify::EErrorSend))