mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Bug 633356 - (GDBus) Make G_MAXINT mean no timeout
Don't register a timeout function in the case that G_MAXINT is given for the timeout length.
This commit is contained in:
parent
cd4f818b30
commit
fac2a8278e
@ -1776,14 +1776,17 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connect
|
|||||||
(GDestroyNotify) g_object_unref);
|
(GDestroyNotify) g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
data->timeout_source = g_timeout_source_new (timeout_msec);
|
if (timeout_msec != G_MAXINT)
|
||||||
g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
|
{
|
||||||
g_source_set_callback (data->timeout_source,
|
data->timeout_source = g_timeout_source_new (timeout_msec);
|
||||||
send_message_with_reply_timeout_cb,
|
g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
|
||||||
send_message_data_ref (data),
|
g_source_set_callback (data->timeout_source,
|
||||||
(GDestroyNotify) send_message_data_unref);
|
send_message_with_reply_timeout_cb,
|
||||||
g_source_attach (data->timeout_source, data->main_context);
|
send_message_data_ref (data),
|
||||||
g_source_unref (data->timeout_source);
|
(GDestroyNotify) send_message_data_unref);
|
||||||
|
g_source_attach (data->timeout_source, data->main_context);
|
||||||
|
g_source_unref (data->timeout_source);
|
||||||
|
}
|
||||||
|
|
||||||
g_hash_table_insert (connection->map_method_serial_to_send_message_data,
|
g_hash_table_insert (connection->map_method_serial_to_send_message_data,
|
||||||
GUINT_TO_POINTER (*out_serial),
|
GUINT_TO_POINTER (*out_serial),
|
||||||
@ -1798,7 +1801,8 @@ g_dbus_connection_send_message_with_reply_unlocked (GDBusConnection *connect
|
|||||||
* @connection: A #GDBusConnection.
|
* @connection: A #GDBusConnection.
|
||||||
* @message: A #GDBusMessage.
|
* @message: A #GDBusMessage.
|
||||||
* @flags: Flags affecting how the message is sent.
|
* @flags: Flags affecting how the message is sent.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds, -1 to use the default
|
||||||
|
* timeout or %G_MAXINT for no timeout.
|
||||||
* @out_serial: Return location for serial number assigned to @message when sending it or %NULL.
|
* @out_serial: Return location for serial number assigned to @message when sending it or %NULL.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
||||||
@ -1940,7 +1944,8 @@ send_message_with_reply_sync_cb (GDBusConnection *connection,
|
|||||||
* @connection: A #GDBusConnection.
|
* @connection: A #GDBusConnection.
|
||||||
* @message: A #GDBusMessage.
|
* @message: A #GDBusMessage.
|
||||||
* @flags: Flags affecting how the message is sent.
|
* @flags: Flags affecting how the message is sent.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds, -1 to use the default
|
||||||
|
* timeout or %G_MAXINT for no timeout.
|
||||||
* @out_serial: Return location for serial number assigned to @message when sending it or %NULL.
|
* @out_serial: Return location for serial number assigned to @message when sending it or %NULL.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
@ -4995,7 +5000,8 @@ g_dbus_connection_call_done (GObject *source,
|
|||||||
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
||||||
* @reply_type: The expected type of the reply, or %NULL.
|
* @reply_type: The expected type of the reply, or %NULL.
|
||||||
* @flags: Flags from the #GDBusCallFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds, -1 to use the default
|
||||||
|
* timeout or %G_MAXINT for no timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
||||||
* care about the result of the method invocation.
|
* care about the result of the method invocation.
|
||||||
@ -5161,7 +5167,8 @@ g_dbus_connection_call_finish (GDBusConnection *connection,
|
|||||||
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
|
||||||
* @reply_type: The expected type of the reply, or %NULL.
|
* @reply_type: The expected type of the reply, or %NULL.
|
||||||
* @flags: Flags from the #GDBusCallFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the default timeout.
|
* @timeout_msec: The timeout in milliseconds, -1 to use the default
|
||||||
|
* timeout or %G_MAXINT for no timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
*
|
*
|
||||||
|
@ -2214,7 +2214,8 @@ get_destination_for_call (GDBusProxy *proxy)
|
|||||||
* @method_name: Name of method to invoke.
|
* @method_name: Name of method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusCallFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
* @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning
|
||||||
|
* "infinite") or -1 to use the proxy default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
|
||||||
* care about the result of the method invocation.
|
* care about the result of the method invocation.
|
||||||
@ -2381,7 +2382,8 @@ g_dbus_proxy_call_finish (GDBusProxy *proxy,
|
|||||||
* @method_name: Name of method to invoke.
|
* @method_name: Name of method to invoke.
|
||||||
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
|
||||||
* @flags: Flags from the #GDBusCallFlags enumeration.
|
* @flags: Flags from the #GDBusCallFlags enumeration.
|
||||||
* @timeout_msec: The timeout in milliseconds or -1 to use the proxy default timeout.
|
* @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning
|
||||||
|
* "infinite") or -1 to use the proxy default timeout.
|
||||||
* @cancellable: A #GCancellable or %NULL.
|
* @cancellable: A #GCancellable or %NULL.
|
||||||
* @error: Return location for error or %NULL.
|
* @error: Return location for error or %NULL.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user