(GDestroyNotify) g_object_unref);
}
- data->timeout_source = g_timeout_source_new (timeout_msec);
- g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
- g_source_set_callback (data->timeout_source,
- send_message_with_reply_timeout_cb,
- send_message_data_ref (data),
- (GDestroyNotify) send_message_data_unref);
- g_source_attach (data->timeout_source, data->main_context);
- g_source_unref (data->timeout_source);
+ if (timeout_msec != G_MAXINT)
+ {
+ data->timeout_source = g_timeout_source_new (timeout_msec);
+ g_source_set_priority (data->timeout_source, G_PRIORITY_DEFAULT);
+ g_source_set_callback (data->timeout_source,
+ send_message_with_reply_timeout_cb,
+ send_message_data_ref (data),
+ (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,
GUINT_TO_POINTER (*out_serial),
* @connection: A #GDBusConnection.
* @message: A #GDBusMessage.
* @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.
* @cancellable: A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
* @connection: A #GDBusConnection.
* @message: A #GDBusMessage.
* @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.
* @cancellable: A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
* @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.
* @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.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
* care about the result of the method invocation.
* @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.
* @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.
* @error: Return location for error or %NULL.
*
* @method_name: Name of method to invoke.
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @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.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't
* care about the result of the method invocation.
* @method_name: Name of method to invoke.
* @parameters: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
* @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.
* @error: Return location for error or %NULL.
*