Reliable Datagram / Stream behaviour of NT Pipes

Luke Kenneth Casson Leighton lkcl at lkcl.net
Fri Jan 30 13:26:55 CST 2009


On Fri, Jan 30, 2009 at 6:41 PM, Juan Lang <juan.lang at gmail.com> wrote:
> Hi Luke,

 hi juan :)

>> the issue with the implementation of nt named pipes on top of _just_
>> streams (unix sockets) is this: two packets sent get blatted into one
>> read.
>
> You are correct.  We've known about that bug for ages, but never got
> around to fixing it.  See e.g. Mike McCormack's interview and his
> comments on message mode:
> http://www.winehq.org/interview/7

 ohhhh - message mode _that's_ what it's called :)  dang, that got
dragged out of long-term storage.  i remember seeing that in smb
packets.

>> ... i'm veery tempted to say "can i have a go at implementing this?"
>> but... i know it'll be ... how-to-say... eeenteresting :)
>>
>> should i try?
>
> Yes, by all means.

 this'll be interesting ha ha

>> would an extra server message need to be added (for read), so that the
>> server can keep track of how much data has been read back (of the
>> current datagram)?
>
> Possibly.  This is tricky too, because a named pipe handle can be
> shared across processes.

 eek.

>  You really want named pipe reads to block
> until a complete datagram is available.  What to do with short reads
> is something you'd have to figure out too.

 yep.

>  Some nice C test cases
> would go a long way toward a correct implementation.

 ok, then that's where i'll start.  i've got a qemu'd xp so i can
actually test that they work properly on nt.

 i've just dragged the tng source code out of cvs, first time in ages,
so there's plenty there to work from, really quite quickly.

 yaay! :)



More information about the wine-devel mailing list