<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - File descriptor leak in gdk_wayland_selection_request_target()"
href="https://bugzilla.gnome.org/show_bug.cgi?id=751414#c14">Comment # 14</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - File descriptor leak in gdk_wayland_selection_request_target()"
href="https://bugzilla.gnome.org/show_bug.cgi?id=751414">bug 751414</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=mcatanzaro%40gnome.org" title="Michael Catanzaro <mcatanzaro@gnome.org>"> <span class="fn">Michael Catanzaro</span></a>
</span></b>
<pre>I will test your patches now.
Anyway, so now it's clear to me that GTK+ is not intended to handle the case
where another client calls wl_data_offer_receive() multiple times in a row
without reading the data.
I was doing this to handle drops in Chrome (works with drags from weston-dnd,
fails with drags from GTK+):
* foreach offered MIME type Chrome could ever possibly accept
* call wl_data_offer_receive()
* Pass all received fds to another process via internal IPC (UNIX domain
socket)
* In the other process, read() the data from each fd
The read() currently never completes (without your patches applied; I will test
them now), presumably due to the missing cancel. (Note: I have to receive data
in each possible MIME type even if it won't be used in order to hook up to
Chrome's existing cross-platform drag-and-drop abstraction.)
To work properly with GTK+, I will need to modify my code to do the following:
* foreach offered MIME type Chrome could ever possibly accept
* call wl_data_offer_receive()
* Pass the received fd to the other process over internal IPC
* In the other process, read() the data from each fd
* Close the fd
* Tell the original process it's safe to use wl_data_offer_receive() again
Correct?
Do you consider this a deficiency in GTK+ worth changing eventually? (But if
so, we'd need a plan to prevent the drag destination from causing clients to
use arbitrarily many fds.) Or would it be better to change the Wayland protocol
documentation to indicate that wl_data_offer_receive() should not be used
multiple times in a row without first closing the previously-received pipe?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>