[Webkit-unassigned] [Bug 61287] [UNIX] Don't use SOCK_DGRAM in socketpair()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 26 03:59:14 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=61287





--- Comment #22 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-05-26 03:59:14 PST ---
(In reply to comment #21)
> (In reply to comment #20)
> > When you say the message is buffered redundantly, what do you mean? 
> 
> I mean, SOCK_STREAM sockets are buffered. The socket API doesn't say when and what amount of data is sent.

Yes, note that STREAM socket would only be used if SOCK_SEQPACKET is not available.

> I also mean:
> Kernel does not guarantee anything regrading the message sizes.
> 
> In other words:
> With stream socket, possible non-message-border-aligned data has to survive across your read buffer. Thus you need to buffer fractional messages in your application code.

Yes, but we use the same buffer by simply moving the outstanding memory at the beginning of the buffer after processing every message, then we simply make sure to not read more memory that what is available in the buffer. You could also read more than one message with a single recvmsg() reducing the amount of syscalls. 

> Quickly glancing to the diff I would say your patch doesn't take this into account, but again, sorry if I'm wrong.

Yes, it handles it for both the bytes read and the file descriptors received using a single buffer in both cases.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list