GNOME Bugzilla – Bug 734420
BroadwayServer support for unix socket listening
Last modified: 2014-08-15 00:31:46 UTC
Created attachment 282804 [details] [review] the patch At the present time broadway listens only for TCP/IP incoming display connections. This patch adds the support for listening on unix domain sockets too, adding the broadway_server_on_unix_socket_new() constructor and the commandline option --unixsocket [path] to broadwayd.
Review of attachment 282804 [details] [review]: Works well while running broadway http server behind apache mod_proxy (new ProxyPass directive implementation supports UDS).
Review of attachment 282804 [details] [review]: ::: gdk/broadway/broadway-server.c @@ +1283,3 @@ + if (address == NULL) + { + g_prefix_error (error, "Unspecified unix domain socket address"); This should be g_error_set(). Otherwise it will do nothing if error is not already set.
Created attachment 283243 [details] [review] updated patch Fixed as in comment #2
Review of attachment 283243 [details] [review]: The new commandline argument should also be added in docs/reference/gtk/broadwayd.xml ::: gdk/broadway/broadway-server.c @@ +1284,3 @@ + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "Unspecified unix domain socket address"); + return NULL; You're leaking the server object here @@ +1292,3 @@ + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_DATA, "Invalid unix domain socket address %s: ", address); + return NULL; And here @@ +1304,3 @@ + g_prefix_error (error, "Unable to listen to %s: ", server->address); + g_object_unref (socket_address); + return NULL; And here ::: gdk/broadway/broadwayd.c @@ +425,3 @@ { "port", 'p', 0, G_OPTION_ARG_INT, &http_port, "Httpd port", "PORT" }, { "address", 'a', 0, G_OPTION_ARG_STRING, &http_address, "Ip address to bind to ", "ADDRESS" }, + { "unixsocket", 'u', 0, G_OPTION_ARG_STRING, &unixsocket_address, "Unix domain socket address", "UXSOCK" }, I'd prefer to just use "ADDRESS" as the argument name here, instead of the slang-y "UXSOCK" @@ +494,3 @@ + server = broadway_server_on_unix_socket_new (unixsocket_address, &error); +#else + g_printerr ("Unix domain sockets unsupported\n"); Might be nicer to instead #ifdef the commandline argument, so you don't advertise a non-working argument and don't ever get here on non-UNIX platforms.
So the same leakings are present in broadway_server_new(), since I've replicated the constructor code from there.
Created attachment 283378 [details] [review] newly updated patch Fixed as in comment #4 The leaks in broadway_server_new() are reported in bug #734778
Review of attachment 283378 [details] [review]: Looks good now, thanks