On Fri Jun 16 17:31:25 2023 +0000, Zebediah Figura wrote:
> Do we need to bother with the client thread here? (Could we potentially
> make the client socket nonblocking instead?)
No; making the client socket nonblocking with `ioctlsocket()` causes it to instantly return with `WSAEWOULDBLOCK`. [Microsoft's documentation](https://learn.microsoft.com/en-us/windows/win32/winsock/wind… notes:
> It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36050
On Fri Jun 16 17:31:21 2023 +0000, Zebediah Figura wrote:
> Can the length be less than the whole size of sun_path? As always we
> should test for this.
Windows 10 does not throw an error if the length is less than `sizeof(struct sockaddr_un)`; it successfully created a socket when I passed a length of `sizeof(addr.sun_family) + strlen(addr.sun_path) - 1` (minus), though the path was truncated by one character.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36049
On Fri Jun 16 17:31:21 2023 +0000, Zebediah Figura wrote:
> I don't think the {} construction is portable. We have offsetof() for
> this anyway.
It's portable for C99 if I hadn't forgotten to include the `0` (and C23 as-is), but Wine does use C89. I'll replace it with an `offsetof()`.
It's worth noting that this entire initializer is only portable for C99 due to the use of designators.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36048
On Fri Jun 16 17:31:27 2023 +0000, Zebediah Figura wrote:
> Similarly this isn't going to work without converting from Unix to win32 paths.
In addition to the size mismatch issue, if the conversion must be lossless, it's not practical to provide a Windows path for a Unix one, since relativity, UNC prefixes, etc. would probably change.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36047
On Fri Jun 16 17:31:20 2023 +0000, Zebediah Figura wrote:
> This can't work, though; we need to convert it to Unix first. (Or print
> a FIXME and fail for DGRAM sockets.)
> Linux man-pages call out returning sizeof(sockaddr_un) as okay on Linux,
> but is it portable? We may want to return strlen()+1 just to be safe.
Converting the path cannot realistically be done due to size differences for the same path:
```
$ echo -n 'C:\tmp\foo.sock' | wc -c
15
$ winepath 'C:\tmp\foo.sock' | tr -d '\n' | wc -c
47
```
For the same reason as needing to change directories to actually bind and connect, path translation in these functions and their server equivalents is not feasible.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36046
On Fri Jun 16 17:31:23 2023 +0000, Zebediah Figura wrote:
> We shouldn't need this anymore now that we're pssing the real unix path, right?
This is still needed because we need to change directories to the Unix path. We can't use the provided Unix path directly because the Unix path length can be larger than the Windows path due to the wineprefix, and that length may exceed `sizeof(sun_path)` even if the Windows path length does not.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2786#note_36045
Initializing to NULL makes it more clear that the initial value is only
used as a parameter to realloc.
--
v2: hhctrl: Initialize item->items to NULL in parse_index_sitemap_object (scan-build).
https://gitlab.winehq.org/wine/wine/-/merge_requests/3089
Adds the tray icons implementation based on org.kde.StatusNotifierItem interface usage. Does allow restarting StatusNotifierWatcher object, but will fallback to XEMBED or internal tray, if wine gets initialized when there is no StatusNotifierWatcher object registered.
--
v18: winesni.drv: replaced the dbus connection logic with a single connection per each SNI object
winesni.drv: wrap functions with pthread mutex locking
winesni.drv: implement basic balloon notification support
explorer: add winesni.drv tray implementation support
winesni.drv: add KDE StatusNotifierItem implementation for tray
https://gitlab.winehq.org/wine/wine/-/merge_requests/2808