Lines Matching refs:connections
81 BusConnections *connections; member
111 static void bus_connection_drop_pending_replies (BusConnections *connections,
125 return bus_context_get_loop (d->connections->context); in connection_get_loop()
130 get_connections_for_uid (BusConnections *connections, in get_connections_for_uid() argument
138 val = _dbus_hash_table_lookup_uintptr (connections->completed_by_user, in get_connections_for_uid()
147 adjust_connections_for_uid (BusConnections *connections, in adjust_connections_for_uid() argument
153 current_count = get_connections_for_uid (connections, uid); in adjust_connections_for_uid()
167 _dbus_hash_table_remove_uintptr (connections->completed_by_user, uid); in adjust_connections_for_uid()
174 retval = _dbus_hash_table_insert_uintptr (connections->completed_by_user, in adjust_connections_for_uid()
203 matchmaker = bus_context_get_matchmaker (d->connections->context); in bus_connection_disconnected()
223 while ((transaction = bus_transaction_new (d->connections->context)) == NULL) in bus_connection_disconnected()
280 _dbus_list_remove_link (&d->connections->completed, d->link_in_connection_list); in bus_connection_disconnected()
282 d->connections->n_completed -= 1; in bus_connection_disconnected()
286 if (!adjust_connections_for_uid (d->connections, in bus_connection_disconnected()
293 _dbus_list_remove_link (&d->connections->incomplete, d->link_in_connection_list); in bus_connection_disconnected()
295 d->connections->n_incomplete -= 1; in bus_connection_disconnected()
298 _dbus_assert (d->connections->n_incomplete >= 0); in bus_connection_disconnected()
299 _dbus_assert (d->connections->n_completed >= 0); in bus_connection_disconnected()
302 bus_connection_drop_pending_replies (d->connections, connection); in bus_connection_disconnected()
382 return bus_context_allow_unix_user (d->connections->context, uid); in allow_unix_user_function()
418 BusConnections *connections; in bus_connections_new() local
423 connections = dbus_new0 (BusConnections, 1); in bus_connections_new()
424 if (connections == NULL) in bus_connections_new()
427 connections->completed_by_user = _dbus_hash_table_new (DBUS_HASH_UINTPTR, in bus_connections_new()
429 if (connections->completed_by_user == NULL) in bus_connections_new()
432 connections->expire_timeout = _dbus_timeout_new (100, /* irrelevant */ in bus_connections_new()
434 connections, NULL); in bus_connections_new()
435 if (connections->expire_timeout == NULL) in bus_connections_new()
438 _dbus_timeout_set_enabled (connections->expire_timeout, FALSE); in bus_connections_new()
440 connections->pending_replies = bus_expire_list_new (bus_context_get_loop (context), in bus_connections_new()
443 connections); in bus_connections_new()
444 if (connections->pending_replies == NULL) in bus_connections_new()
448 connections->expire_timeout)) in bus_connections_new()
451 connections->refcount = 1; in bus_connections_new()
452 connections->context = context; in bus_connections_new()
454 return connections; in bus_connections_new()
457 bus_expire_list_free (connections->pending_replies); in bus_connections_new()
459 _dbus_timeout_unref (connections->expire_timeout); in bus_connections_new()
461 _dbus_hash_table_unref (connections->completed_by_user); in bus_connections_new()
463 dbus_free (connections); in bus_connections_new()
471 bus_connections_ref (BusConnections *connections) in bus_connections_ref() argument
473 _dbus_assert (connections->refcount > 0); in bus_connections_ref()
474 connections->refcount += 1; in bus_connections_ref()
476 return connections; in bus_connections_ref()
480 bus_connections_unref (BusConnections *connections) in bus_connections_unref() argument
482 _dbus_assert (connections->refcount > 0); in bus_connections_unref()
483 connections->refcount -= 1; in bus_connections_unref()
484 if (connections->refcount == 0) in bus_connections_unref()
487 while (connections->incomplete != NULL) in bus_connections_unref()
491 connection = connections->incomplete->data; in bus_connections_unref()
499 _dbus_assert (connections->n_incomplete == 0); in bus_connections_unref()
502 while (connections->completed != NULL) in bus_connections_unref()
506 connection = connections->completed->data; in bus_connections_unref()
514 _dbus_assert (connections->n_completed == 0); in bus_connections_unref()
516 bus_expire_list_free (connections->pending_replies); in bus_connections_unref()
518 _dbus_loop_remove_timeout (bus_context_get_loop (connections->context), in bus_connections_unref()
519 connections->expire_timeout); in bus_connections_unref()
521 _dbus_timeout_unref (connections->expire_timeout); in bus_connections_unref()
523 _dbus_hash_table_unref (connections->completed_by_user); in bus_connections_unref()
525 dbus_free (connections); in bus_connections_unref()
592 bus_connections_setup_connection (BusConnections *connections, in bus_connections_setup_connection() argument
606 d->connections = connections; in bus_connections_setup_connection()
666 bus_context_get_loop (connections->context), in bus_connections_setup_connection()
679 if (!_dbus_loop_queue_dispatch (bus_context_get_loop (connections->context), connection)) in bus_connections_setup_connection()
686 _dbus_list_append_link (&connections->incomplete, d->link_in_connection_list); in bus_connections_setup_connection()
687 connections->n_incomplete += 1; in bus_connections_setup_connection()
696 bus_connections_expire_incomplete (connections); in bus_connections_setup_connection()
701 if (connections->n_incomplete > in bus_connections_setup_connection()
702 bus_context_get_max_incomplete_connections (connections->context)) in bus_connections_setup_connection()
706 _dbus_assert (connections->incomplete != NULL); in bus_connections_setup_connection()
714 dbus_connection_close (connections->incomplete->data); in bus_connections_setup_connection()
767 bus_connections_expire_incomplete (BusConnections *connections) in bus_connections_expire_incomplete() argument
773 if (connections->incomplete != NULL) in bus_connections_expire_incomplete()
780 auth_timeout = bus_context_get_auth_timeout (connections->context); in bus_connections_expire_incomplete()
782 link = _dbus_list_get_first_link (&connections->incomplete); in bus_connections_expire_incomplete()
785 DBusList *next = _dbus_list_get_next_link (&connections->incomplete, link); in bus_connections_expire_incomplete()
819 bus_expire_timeout_set_interval (connections->expire_timeout, in bus_connections_expire_incomplete()
826 BusConnections *connections = data; in expire_incomplete_timeout() local
831 bus_connections_expire_incomplete (connections); in expire_incomplete_timeout()
919 foreach_active (BusConnections *connections, in foreach_active() argument
925 link = _dbus_list_get_first_link (&connections->completed); in foreach_active()
929 DBusList *next = _dbus_list_get_next_link (&connections->completed, link); in foreach_active()
941 foreach_inactive (BusConnections *connections, in foreach_inactive() argument
947 link = _dbus_list_get_first_link (&connections->incomplete); in foreach_inactive()
951 DBusList *next = _dbus_list_get_next_link (&connections->incomplete, link); in foreach_inactive()
972 bus_connections_foreach_active (BusConnections *connections, in bus_connections_foreach_active() argument
976 foreach_active (connections, function, data); in bus_connections_foreach_active()
988 bus_connections_foreach (BusConnections *connections, in bus_connections_foreach() argument
992 if (!foreach_active (connections, function, data)) in bus_connections_foreach()
995 foreach_inactive (connections, function, data); in bus_connections_foreach()
999 bus_connections_get_context (BusConnections *connections) in bus_connections_get_context() argument
1001 return connections->context; in bus_connections_get_context()
1012 bus_connections_increment_stamp (BusConnections *connections) in bus_connections_increment_stamp() argument
1014 connections->stamp += 1; in bus_connections_increment_stamp()
1029 if (d->stamp == d->connections->stamp) in bus_connection_mark_stamp()
1033 d->stamp = d->connections->stamp; in bus_connection_mark_stamp()
1047 return d->connections->context; in bus_connection_get_context()
1059 return d->connections; in bus_connection_get_connections()
1071 return bus_context_get_registry (d->connections->context); in bus_connection_get_registry()
1083 return bus_context_get_activation (d->connections->context); in bus_connection_get_activation()
1095 return bus_context_get_matchmaker (d->connections->context); in bus_connection_get_matchmaker()
1230 update_peak (&d->connections->peak_match_rules_per_conn, d->n_match_rules); in bus_connection_add_match_rule_link()
1232 d->connections->total_match_rules += 1; in bus_connection_add_match_rule_link()
1233 update_peak (&d->connections->peak_match_rules, in bus_connection_add_match_rule_link()
1234 d->connections->total_match_rules); in bus_connection_add_match_rule_link()
1269 d->connections->total_match_rules -= 1; in bus_connection_remove_match_rule()
1299 update_peak (&d->connections->peak_bus_names_per_conn, in bus_connection_add_owned_service_link()
1302 d->connections->total_bus_names += 1; in bus_connection_add_owned_service_link()
1303 update_peak (&d->connections->peak_bus_names, in bus_connection_add_owned_service_link()
1304 d->connections->total_bus_names); in bus_connection_add_owned_service_link()
1339 d->connections->total_bus_names -= 1; in bus_connection_remove_owned_service()
1379 d->policy = bus_context_create_client_policy (d->connections->context, in bus_connection_complete()
1400 if (!adjust_connections_for_uid (d->connections, in bus_connection_complete()
1412 _dbus_list_unlink (&d->connections->incomplete, in bus_connection_complete()
1414 d->connections->n_incomplete -= 1; in bus_connection_complete()
1415 _dbus_list_append_link (&d->connections->completed, in bus_connection_complete()
1417 d->connections->n_completed += 1; in bus_connection_complete()
1419 _dbus_assert (d->connections->n_incomplete >= 0); in bus_connection_complete()
1420 _dbus_assert (d->connections->n_completed > 0); in bus_connection_complete()
1423 bus_connections_expire_incomplete (d->connections); in bus_connection_complete()
1454 bus_connections_check_limits (BusConnections *connections, in bus_connections_check_limits() argument
1460 if (connections->n_completed >= in bus_connections_check_limits()
1461 bus_context_get_max_completed_connections (connections->context)) in bus_connections_check_limits()
1470 if (get_connections_for_uid (connections, uid) >= in bus_connections_check_limits()
1471 bus_context_get_max_connections_per_user (connections->context)) in bus_connections_check_limits()
1496 bus_pending_reply_send_no_reply (BusConnections *connections, in bus_pending_reply_send_no_reply() argument
1543 BusConnections *connections = data; in bus_pending_reply_expired() local
1557 transaction = bus_transaction_new (connections->context); in bus_pending_reply_expired()
1561 if (!bus_pending_reply_send_no_reply (connections, in bus_pending_reply_expired()
1569 bus_expire_list_remove_link (connections->pending_replies, link); in bus_pending_reply_expired()
1578 bus_connection_drop_pending_replies (BusConnections *connections, in bus_connection_drop_pending_replies() argument
1589 link = bus_expire_list_get_first_link (connections->pending_replies); in bus_connection_drop_pending_replies()
1595 next = bus_expire_list_get_next_link (connections->pending_replies, in bus_connection_drop_pending_replies()
1609 bus_expire_list_remove_link (connections->pending_replies, in bus_connection_drop_pending_replies()
1628 bus_expire_list_recheck_immediately (connections->pending_replies); in bus_connection_drop_pending_replies()
1639 BusConnections *connections; member
1649 if (!bus_expire_list_remove (d->connections->pending_replies, in cancel_pending_reply()
1675 bus_connections_expect_reply (BusConnections *connections, in bus_connections_expect_reply() argument
1697 link = bus_expire_list_get_first_link (connections->pending_replies); in bus_connections_expect_reply()
1712 link = bus_expire_list_get_next_link (connections->pending_replies, in bus_connections_expect_reply()
1719 bus_context_get_max_replies_per_connection (connections->context)) in bus_connections_expect_reply()
1751 if (!bus_expire_list_add (connections->pending_replies, in bus_connections_expect_reply()
1766 bus_expire_list_remove (connections->pending_replies, &pending->expire_item); in bus_connections_expect_reply()
1773 cprd->connections = connections; in bus_connections_expect_reply()
1790 BusConnections *connections; member
1800 bus_expire_list_add_link (d->connections->pending_replies, in cancel_check_pending_reply()
1816 _dbus_assert (!bus_expire_list_contains_item (d->connections->pending_replies, in check_pending_reply_data_free()
1831 bus_connections_check_reply (BusConnections *connections, in bus_connections_check_reply() argument
1847 link = bus_expire_list_get_first_link (connections->pending_replies); in bus_connections_check_reply()
1860 link = bus_expire_list_get_next_link (connections->pending_replies, in bus_connections_check_reply()
1889 cprd->connections = connections; in bus_connections_check_reply()
1891 bus_expire_list_unlink (connections->pending_replies, in bus_connections_check_reply()
1894 _dbus_assert (!bus_expire_list_contains_item (connections->pending_replies, link->data)); in bus_connections_check_reply()
1922 DBusList *connections; member
2117 if (!_dbus_list_prepend (&transaction->connections, connection)) in bus_transaction_send()
2163 while ((connection = _dbus_list_pop_first (&transaction->connections))) in bus_transaction_cancel_and_free()
2166 _dbus_assert (transaction->connections == NULL); in bus_transaction_cancel_and_free()
2224 while ((connection = _dbus_list_pop_first (&transaction->connections))) in bus_transaction_execute_and_free()
2227 _dbus_assert (transaction->connections == NULL); in bus_transaction_execute_and_free()
2246 _dbus_list_remove (&to_send->transaction->connections, in bus_connection_remove_transactions()
2321 bus_connections_get_n_active (BusConnections *connections) in bus_connections_get_n_active() argument
2323 return connections->n_completed; in bus_connections_get_n_active()
2327 bus_connections_get_n_incomplete (BusConnections *connections) in bus_connections_get_n_incomplete() argument
2329 return connections->n_incomplete; in bus_connections_get_n_incomplete()
2333 bus_connections_get_total_match_rules (BusConnections *connections) in bus_connections_get_total_match_rules() argument
2335 return connections->total_match_rules; in bus_connections_get_total_match_rules()
2339 bus_connections_get_peak_match_rules (BusConnections *connections) in bus_connections_get_peak_match_rules() argument
2341 return connections->peak_match_rules; in bus_connections_get_peak_match_rules()
2345 bus_connections_get_peak_match_rules_per_conn (BusConnections *connections) in bus_connections_get_peak_match_rules_per_conn() argument
2347 return connections->peak_match_rules_per_conn; in bus_connections_get_peak_match_rules_per_conn()
2351 bus_connections_get_total_bus_names (BusConnections *connections) in bus_connections_get_total_bus_names() argument
2353 return connections->total_bus_names; in bus_connections_get_total_bus_names()
2357 bus_connections_get_peak_bus_names (BusConnections *connections) in bus_connections_get_peak_bus_names() argument
2359 return connections->peak_bus_names; in bus_connections_get_peak_bus_names()
2363 bus_connections_get_peak_bus_names_per_conn (BusConnections *connections) in bus_connections_get_peak_bus_names_per_conn() argument
2365 return connections->peak_bus_names_per_conn; in bus_connections_get_peak_bus_names_per_conn()