[Webkit-unassigned] [Bug 238797] [GTK][WPE] RemoteInspector add support for IPv6

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 5 05:43:49 PDT 2022


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

--- Comment #5 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 456686
  --> https://bugs.webkit.org/attachment.cgi?id=456686
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456686&action=review

>>>> Source/WebKit/UIProcess/Inspector/glib/RemoteInspectorHTTPServer.cpp:83
>>>> +        inspectorServerAddress.reset(g_strdup_printf("%s:%u", host.get(), inspectorPort));
>>> 
>>> Is there any reason why cannot use g_inet_address_to_string() always here
>>> instead of checking the address family and performing the conversion by
>>> hand? A quick test shows that it should work as inteded:
>> 
>> Yes, g_inet_address_to_string() always returns the address without the square brackets. We could create a new GSocketInetAddress with the required port and then call to_string, but I just avoided to create another GObject.
> 
> That's InetSocketAddress, not InetAddress. That gio APIS are quite confusing wityh so many address classes

But here we *do* have a GInetSocketAddress, note how in line 77 above there
is an explicit checked cast using the G_INET_SOCKET_ADDRESS() macro. Note
that the _to_string() method is virtual, and overriden by GInetSocketAddress:
when using g_inet_address_to_string() on a GInetSocketAddress the overriden
method from GInetSocketAddress will be used.

The above can just be:

    GUniquePtr<char> inspectorServerAddress(g_inet_address_to_string(G_INET_ADDRESS(socketAddress.get()));

 Hence,
if one calls g_inet_address_to_string() the implementa

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220405/29f8ee0f/attachment.htm>


More information about the webkit-unassigned mailing list