After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629503 - Add async versions of g_unix_connection_{receive,send}_credentials
Add async versions of g_unix_connection_{receive,send}_credentials
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.22.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-09-13 11:27 UTC by Guillaume Desmottes
Modified: 2012-01-18 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GUnixConnection: add async variant for send/receive_credentials() (12.75 KB, patch)
2012-01-16 13:53 UTC, Xavier Claessens
needs-work Details | Review
GUnixConnection: add async variant for send/receive_credentials() (13.51 KB, patch)
2012-01-17 06:48 UTC, Xavier Claessens
reviewed Details | Review

Description Guillaume Desmottes 2010-09-13 11:27:03 UTC
As said in a comment in gunixconnection.c, I'd need an async version of g_unix_connection_send_credentials() and g_unix_connection_receive_credentials().

Depending of the way we'll solve bug #629267 this API should maybe include the byte sent/received.
Comment 1 Xavier Claessens 2012-01-16 13:53:22 UTC
Created attachment 205361 [details] [review]
GUnixConnection: add async variant for send/receive_credentials()
Comment 2 Xavier Claessens 2012-01-16 13:53:53 UTC
git branch: http://cgit.collabora.com/git/user/xclaesse/glib.git/log/?h=async-creds
Comment 3 Dan Winship 2012-01-16 16:14:24 UTC
Comment on attachment 205361 [details] [review]
GUnixConnection: add async variant for send/receive_credentials()

You need to update gio/gio.symbols.

The indentation should match the existing indentation style. Eg:

>+  if (!g_unix_connection_send_credentials ((GUnixConnection *) object,
>+          cancellable, &error))

the args on the second line should line up with the args on the first line.

Also, use G_UNIX_CONNECTION(), not a plain C cast.

>+ * Returns: %TRUE if the operation was successfull, otherwise %FALSE.

one "l" in "successful"

>+  if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
>+          error))
>+    return FALSE;
>+
>+  g_return_val_if_fail (g_simple_async_result_is_valid (result,
>+      G_OBJECT (connection), g_unix_connection_send_credentials_async), FALSE);

the g_return_val_if_fail() should come first. (in both _finish funcs)
Comment 4 Xavier Claessens 2012-01-17 06:48:50 UTC
Created attachment 205423 [details] [review]
GUnixConnection: add async variant for send/receive_credentials()
Comment 5 Dan Winship 2012-01-18 14:17:52 UTC
Comment on attachment 205423 [details] [review]
GUnixConnection: add async variant for send/receive_credentials()

you need to update gio/gio.symbols as well. OK to commit after fixing that.
Comment 6 Xavier Claessens 2012-01-18 14:22:54 UTC
Done. Merged. Thanks.