[Bug 33656] New: NamedPipe datagrams need to be _really_ datagrams
http://bugs.winehq.org/show_bug.cgi?id=33656 Bug #: 33656 Summary: NamedPipe datagrams need to be _really_ datagrams Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs(a)winehq.org ReportedBy: joe_rocks(a)hotmail.com CC: adam.r.martinson(a)gmail.com, adys.wh(a)gmail.com, asb(a)asbradbury.org, berillions(a)gmail.com, dank(a)kegel.com, davilando(a)gmail.com, djelinski1(a)gmail.com, ernst(a)planetcoms.co.za, euug3576+winebugs(a)gmail.com, focht(a)gmx.net, grinnz(a)gmail.com, jjmckenzie51(a)gmail.com, jonnybarnes(a)gmail.com, knaprigt(a)gmail.com, kyle.devir(a)gmx.com, lkcl(a)lkcl.net, l_bratch(a)yahoo.co.uk, m.b.lankhorst(a)gmail.com, mooroon2(a)mail.ru, napoliste(a)gmail.com, rmlipman(a)gmail.com, saulius2(a)gmail.com, surfing86(a)live.it, techtonik(a)gmail.com, trilavia(a)gmail.com, update.microsoft(a)mail.ru, valentyn.pavliuchenko(a)gmail.com, vegarh(a)gmail.com Classification: Unclassified +++ This bug was initially created as a clone of Bug #17195 +++ ok, after a little bit of investigation, i think i understand the pipes code enough to be able to say what's going on, and i'm seeing something like this: process 1: recvpipe = CreateNamedPipe("\\pipe\fred") ReadFile(recvpipe, buffer, &length); printf(length) ===> 43 ReadPipe(recvpipe, buffer, &length); /* no data */ process 2: sendpipe = CreateNamedPipe("\\pipe\fred") length = 9; WriteFile(sendpipe, buffer, &length); length = 34; WriteFile(sendpipe, buffer, &length); what's happening is that the data being sent down the pipes isn't being done as datagrams. the implementation is using a stream-based fd. the solution is: you _must_ implement a protocol on top of the pipes which sends the length (as a 32-bit int, whatever) which is read off the fd, followed by the data stream of _exactly_ that length. _must_. there's no two ways about this. the protocol of Pipes is unfortunately a combination of both datagrams and streams. datagrams because the lengths of data sent are absolute and inviolate. streams because the data order and reliability are _also_ absolute and inviolate. you can't use datagrams (because they're unreliable). you can't expect all unixen to support datagrams on top of unix sockets (if that's what's being used). so - you have to send the length, as part of the implementation of the pipe-data-send. sending a length will also solve the issue of trying to send zero-length pipe datagrams. as a first implementation, you _might_ be able to get away with assuming that when someone asks for some data, they _will_ provide a buffer big enough. ... actually... i don't see any ERR_MORE_DATA error codes in NtReadFile, so that would explain... this is going to get messy :) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33656 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE --- Comment #1 from Alexandre Julliard <julliard(a)winehq.org> 2013-05-25 16:26:07 CDT --- (In reply to comment #0)
+++ This bug was initially created as a clone of Bug #17195 +++
Don't do that, one bug is enough. *** This bug has been marked as a duplicate of bug 17195 *** -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33656 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #2 from Bruno Jesus <00cpxxx(a)gmail.com> 2013-06-05 09:15:52 CDT --- Closing duplicate bugs. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org