Browse Source

* fix #26007 move size=0 of r27762 to OS specific code, otherwise it prohibits
async reading of the stream. (windows first reads streams, then executes
readmessage)

git-svn-id: trunk@28305 -

marco 11 years ago
parent
commit
1ab8e2381f

+ 1 - 0
packages/fcl-process/src/os2/simpleipc.inc

@@ -171,6 +171,7 @@ begin
   Owner.FMsgType := Hdr.MsgType;
   Owner.FMsgType := Hdr.MsgType;
   if Hdr.MsgLen > 0 then
   if Hdr.MsgLen > 0 then
     begin
     begin
+      Owner.FMsgData.Size:=0;
       Owner.FMsgData.Seek (0, soFromBeginning);
       Owner.FMsgData.Seek (0, soFromBeginning);
       Owner.FMsgData.CopyFrom (FStream, Hdr.MsgLen);
       Owner.FMsgData.CopyFrom (FStream, Hdr.MsgLen);
     end
     end

+ 0 - 1
packages/fcl-process/src/simpleipc.pp

@@ -351,7 +351,6 @@ begin
   CheckActive;
   CheckActive;
   FBusy:=True;
   FBusy:=True;
   Try
   Try
-    FMsgData.Size:=0;
     FIPCComm.ReadMessage;
     FIPCComm.ReadMessage;
     If Assigned(FOnMessage) then
     If Assigned(FOnMessage) then
       FOnMessage(Self);
       FOnMessage(Self);

+ 1 - 0
packages/fcl-process/src/unix/simpleipc.inc

@@ -261,6 +261,7 @@ begin
   M:=MsgData;
   M:=MsgData;
   if count > 0 then
   if count > 0 then
     begin
     begin
+    M.Size:=0;
     M.Seek(0,soFrombeginning);
     M.Seek(0,soFrombeginning);
     M.CopyFrom(FStream,Count);
     M.CopyFrom(FStream,Count);
     end
     end

+ 1 - 0
packages/fcl-process/src/win/simpleipc.inc

@@ -169,6 +169,7 @@ Var
 begin
 begin
   CDS:=PCopyDataStruct(Msg.Lparam);
   CDS:=PCopyDataStruct(Msg.Lparam);
   Owner.FMsgType:=CDS^.dwData;
   Owner.FMsgType:=CDS^.dwData;
+  Owner.FMsgData.Size:=0;
   Owner.FMsgData.Seek(0,soFrombeginning);
   Owner.FMsgData.Seek(0,soFrombeginning);
   Owner.FMsgData.WriteBuffer(CDS^.lpData^,CDS^.cbData);
   Owner.FMsgData.WriteBuffer(CDS^.lpData^,CDS^.cbData);
 end;
 end;

+ 1 - 0
packages/fcl-process/src/wince/simpleipc.inc

@@ -168,6 +168,7 @@ Var
 
 
 begin
 begin
   CDS:=PCopyDataStruct(Msg.Lparam);
   CDS:=PCopyDataStruct(Msg.Lparam);
+  Owner.FMsgData.Size:=0;
   Owner.FMsgData.Seek(0,soFrombeginning);
   Owner.FMsgData.Seek(0,soFrombeginning);
   Owner.FMsgData.WriteBuffer(CDS^.lpData^,CDS^.cbData);
   Owner.FMsgData.WriteBuffer(CDS^.lpData^,CDS^.cbData);
 end;
 end;