• Home
  • Raw
  • Download

Lines Matching refs:server

97 _dbus_server_init_base (DBusServer             *server,  in _dbus_server_init_base()  argument
101 server->vtable = vtable; in _dbus_server_init_base()
102 server->refcount.value = 1; in _dbus_server_init_base()
104 server->address = NULL; in _dbus_server_init_base()
105 server->watches = NULL; in _dbus_server_init_base()
106 server->timeouts = NULL; in _dbus_server_init_base()
108 if (!_dbus_string_init (&server->guid_hex)) in _dbus_server_init_base()
111 _dbus_generate_uuid (&server->guid); in _dbus_server_init_base()
113 if (!_dbus_uuid_encode (&server->guid, &server->guid_hex)) in _dbus_server_init_base()
116 server->address = copy_address_with_guid_appended (address, in _dbus_server_init_base()
117 &server->guid_hex); in _dbus_server_init_base()
118 if (server->address == NULL) in _dbus_server_init_base()
121 _dbus_mutex_new_at_location (&server->mutex); in _dbus_server_init_base()
122 if (server->mutex == NULL) in _dbus_server_init_base()
125 server->watches = _dbus_watch_list_new (); in _dbus_server_init_base()
126 if (server->watches == NULL) in _dbus_server_init_base()
129 server->timeouts = _dbus_timeout_list_new (); in _dbus_server_init_base()
130 if (server->timeouts == NULL) in _dbus_server_init_base()
133 _dbus_data_slot_list_init (&server->slot_list); in _dbus_server_init_base()
135 _dbus_verbose ("Initialized server on address %s\n", server->address); in _dbus_server_init_base()
140 _dbus_mutex_free_at_location (&server->mutex); in _dbus_server_init_base()
141 server->mutex = NULL; in _dbus_server_init_base()
142 if (server->watches) in _dbus_server_init_base()
144 _dbus_watch_list_free (server->watches); in _dbus_server_init_base()
145 server->watches = NULL; in _dbus_server_init_base()
147 if (server->timeouts) in _dbus_server_init_base()
149 _dbus_timeout_list_free (server->timeouts); in _dbus_server_init_base()
150 server->timeouts = NULL; in _dbus_server_init_base()
152 if (server->address) in _dbus_server_init_base()
154 dbus_free (server->address); in _dbus_server_init_base()
155 server->address = NULL; in _dbus_server_init_base()
157 _dbus_string_free (&server->guid_hex); in _dbus_server_init_base()
169 _dbus_server_finalize_base (DBusServer *server) in _dbus_server_finalize_base() argument
175 _dbus_assert (!server->have_server_lock); in _dbus_server_finalize_base()
177 _dbus_assert (server->disconnected); in _dbus_server_finalize_base()
180 _dbus_data_slot_list_free (&server->slot_list); in _dbus_server_finalize_base()
182 dbus_server_set_new_connection_function (server, NULL, NULL, NULL); in _dbus_server_finalize_base()
184 _dbus_watch_list_free (server->watches); in _dbus_server_finalize_base()
185 _dbus_timeout_list_free (server->timeouts); in _dbus_server_finalize_base()
187 _dbus_mutex_free_at_location (&server->mutex); in _dbus_server_finalize_base()
189 dbus_free (server->address); in _dbus_server_finalize_base()
191 dbus_free_string_array (server->auth_mechanisms); in _dbus_server_finalize_base()
193 _dbus_string_free (&server->guid_hex); in _dbus_server_finalize_base()
209 protected_change_watch (DBusServer *server, in protected_change_watch() argument
219 HAVE_LOCK_CHECK (server); in protected_change_watch()
226 watches = server->watches; in protected_change_watch()
229 server->watches = NULL; in protected_change_watch()
230 _dbus_server_ref_unlocked (server); in protected_change_watch()
231 SERVER_UNLOCK (server); in protected_change_watch()
246 SERVER_LOCK (server); in protected_change_watch()
247 server->watches = watches; in protected_change_watch()
248 _dbus_server_unref_unlocked (server); in protected_change_watch()
264 _dbus_server_add_watch (DBusServer *server, in _dbus_server_add_watch() argument
267 HAVE_LOCK_CHECK (server); in _dbus_server_add_watch()
268 return protected_change_watch (server, watch, in _dbus_server_add_watch()
280 _dbus_server_remove_watch (DBusServer *server, in _dbus_server_remove_watch() argument
283 HAVE_LOCK_CHECK (server); in _dbus_server_remove_watch()
284 protected_change_watch (server, watch, in _dbus_server_remove_watch()
300 _dbus_server_toggle_watch (DBusServer *server, in _dbus_server_toggle_watch() argument
306 HAVE_LOCK_CHECK (server); in _dbus_server_toggle_watch()
307 protected_change_watch (server, watch, in _dbus_server_toggle_watch()
326 protected_change_timeout (DBusServer *server, in protected_change_timeout() argument
336 HAVE_LOCK_CHECK (server); in protected_change_timeout()
342 timeouts = server->timeouts; in protected_change_timeout()
345 server->timeouts = NULL; in protected_change_timeout()
346 _dbus_server_ref_unlocked (server); in protected_change_timeout()
347 SERVER_UNLOCK (server); in protected_change_timeout()
362 SERVER_LOCK (server); in protected_change_timeout()
363 server->timeouts = timeouts; in protected_change_timeout()
364 _dbus_server_unref_unlocked (server); in protected_change_timeout()
382 _dbus_server_add_timeout (DBusServer *server, in _dbus_server_add_timeout() argument
385 return protected_change_timeout (server, timeout, in _dbus_server_add_timeout()
397 _dbus_server_remove_timeout (DBusServer *server, in _dbus_server_remove_timeout() argument
400 protected_change_timeout (server, timeout, in _dbus_server_remove_timeout()
416 _dbus_server_toggle_timeout (DBusServer *server, in _dbus_server_toggle_timeout() argument
420 protected_change_timeout (server, timeout, in _dbus_server_toggle_timeout()
433 _dbus_server_ref_unlocked (DBusServer *server) in _dbus_server_ref_unlocked() argument
435 _dbus_assert (server != NULL); in _dbus_server_ref_unlocked()
436 _dbus_assert (server->refcount.value > 0); in _dbus_server_ref_unlocked()
438 HAVE_LOCK_CHECK (server); in _dbus_server_ref_unlocked()
441 _dbus_atomic_inc (&server->refcount); in _dbus_server_ref_unlocked()
443 _dbus_assert (server->refcount.value > 0); in _dbus_server_ref_unlocked()
445 server->refcount.value += 1; in _dbus_server_ref_unlocked()
455 _dbus_server_unref_unlocked (DBusServer *server) in _dbus_server_unref_unlocked() argument
461 _dbus_assert (server != NULL); in _dbus_server_unref_unlocked()
462 _dbus_assert (server->refcount.value > 0); in _dbus_server_unref_unlocked()
464 HAVE_LOCK_CHECK (server); in _dbus_server_unref_unlocked()
467 last_unref = (_dbus_atomic_dec (&server->refcount) == 1); in _dbus_server_unref_unlocked()
469 _dbus_assert (server->refcount.value > 0); in _dbus_server_unref_unlocked()
471 server->refcount.value -= 1; in _dbus_server_unref_unlocked()
472 last_unref = (server->refcount.value == 0); in _dbus_server_unref_unlocked()
477 _dbus_assert (server->disconnected); in _dbus_server_unref_unlocked()
479 SERVER_UNLOCK (server); in _dbus_server_unref_unlocked()
481 _dbus_assert (server->vtable->finalize != NULL); in _dbus_server_unref_unlocked()
483 (* server->vtable->finalize) (server); in _dbus_server_unref_unlocked()
544 DBusServer *server; in dbus_server_listen() local
556 server = NULL; in dbus_server_listen()
569 &server, in dbus_server_listen()
574 _dbus_assert (server != NULL); in dbus_server_listen()
581 _dbus_assert (server == NULL); in dbus_server_listen()
589 _dbus_assert (server == NULL); in dbus_server_listen()
596 _dbus_assert (server == NULL); in dbus_server_listen()
609 _dbus_assert (server == NULL); in dbus_server_listen()
632 if (server == NULL) in dbus_server_listen()
658 return server; in dbus_server_listen()
669 dbus_server_ref (DBusServer *server) in dbus_server_ref() argument
671 _dbus_return_val_if_fail (server != NULL, NULL); in dbus_server_ref()
672 _dbus_return_val_if_fail (server->refcount.value > 0, NULL); in dbus_server_ref()
675 _dbus_atomic_inc (&server->refcount); in dbus_server_ref()
677 SERVER_LOCK (server); in dbus_server_ref()
678 _dbus_assert (server->refcount.value > 0); in dbus_server_ref()
680 server->refcount.value += 1; in dbus_server_ref()
681 SERVER_UNLOCK (server); in dbus_server_ref()
684 return server; in dbus_server_ref()
696 dbus_server_unref (DBusServer *server) in dbus_server_unref() argument
702 _dbus_return_if_fail (server != NULL); in dbus_server_unref()
703 _dbus_return_if_fail (server->refcount.value > 0); in dbus_server_unref()
706 last_unref = (_dbus_atomic_dec (&server->refcount) == 1); in dbus_server_unref()
708 SERVER_LOCK (server); in dbus_server_unref()
710 _dbus_assert (server->refcount.value > 0); in dbus_server_unref()
712 server->refcount.value -= 1; in dbus_server_unref()
713 last_unref = (server->refcount.value == 0); in dbus_server_unref()
715 SERVER_UNLOCK (server); in dbus_server_unref()
721 _dbus_assert (server->disconnected); in dbus_server_unref()
723 _dbus_assert (server->vtable->finalize != NULL); in dbus_server_unref()
725 (* server->vtable->finalize) (server); in dbus_server_unref()
738 dbus_server_disconnect (DBusServer *server) in dbus_server_disconnect() argument
740 _dbus_return_if_fail (server != NULL); in dbus_server_disconnect()
741 _dbus_return_if_fail (server->refcount.value > 0); in dbus_server_disconnect()
743 SERVER_LOCK (server); in dbus_server_disconnect()
744 _dbus_server_ref_unlocked (server); in dbus_server_disconnect()
746 _dbus_assert (server->vtable->disconnect != NULL); in dbus_server_disconnect()
748 if (!server->disconnected) in dbus_server_disconnect()
751 server->disconnected = TRUE; in dbus_server_disconnect()
753 (* server->vtable->disconnect) (server); in dbus_server_disconnect()
756 SERVER_UNLOCK (server); in dbus_server_disconnect()
757 dbus_server_unref (server); in dbus_server_disconnect()
766 dbus_server_get_is_connected (DBusServer *server) in dbus_server_get_is_connected() argument
770 _dbus_return_val_if_fail (server != NULL, FALSE); in dbus_server_get_is_connected()
772 SERVER_LOCK (server); in dbus_server_get_is_connected()
773 retval = !server->disconnected; in dbus_server_get_is_connected()
774 SERVER_UNLOCK (server); in dbus_server_get_is_connected()
787 dbus_server_get_address (DBusServer *server) in dbus_server_get_address() argument
791 _dbus_return_val_if_fail (server != NULL, NULL); in dbus_server_get_address()
793 SERVER_LOCK (server); in dbus_server_get_address()
794 retval = _dbus_strdup (server->address); in dbus_server_get_address()
795 SERVER_UNLOCK (server); in dbus_server_get_address()
823 dbus_server_get_id (DBusServer *server) in dbus_server_get_id() argument
827 _dbus_return_val_if_fail (server != NULL, NULL); in dbus_server_get_id()
829 SERVER_LOCK (server); in dbus_server_get_id()
831 _dbus_string_copy_data (&server->guid_hex, &retval); in dbus_server_get_id()
832 SERVER_UNLOCK (server); in dbus_server_get_id()
858 dbus_server_set_new_connection_function (DBusServer *server, in dbus_server_set_new_connection_function() argument
866 _dbus_return_if_fail (server != NULL); in dbus_server_set_new_connection_function()
868 SERVER_LOCK (server); in dbus_server_set_new_connection_function()
869 old_free_function = server->new_connection_free_data_function; in dbus_server_set_new_connection_function()
870 old_data = server->new_connection_data; in dbus_server_set_new_connection_function()
872 server->new_connection_function = function; in dbus_server_set_new_connection_function()
873 server->new_connection_data = data; in dbus_server_set_new_connection_function()
874 server->new_connection_free_data_function = free_data_function; in dbus_server_set_new_connection_function()
875 SERVER_UNLOCK (server); in dbus_server_set_new_connection_function()
898 dbus_server_set_watch_functions (DBusServer *server, in dbus_server_set_watch_functions() argument
908 _dbus_return_val_if_fail (server != NULL, FALSE); in dbus_server_set_watch_functions()
910 SERVER_LOCK (server); in dbus_server_set_watch_functions()
911 watches = server->watches; in dbus_server_set_watch_functions()
912 server->watches = NULL; in dbus_server_set_watch_functions()
915 SERVER_UNLOCK (server); in dbus_server_set_watch_functions()
922 SERVER_LOCK (server); in dbus_server_set_watch_functions()
929 server->watches = watches; in dbus_server_set_watch_functions()
930 SERVER_UNLOCK (server); in dbus_server_set_watch_functions()
951 dbus_server_set_timeout_functions (DBusServer *server, in dbus_server_set_timeout_functions() argument
961 _dbus_return_val_if_fail (server != NULL, FALSE); in dbus_server_set_timeout_functions()
963 SERVER_LOCK (server); in dbus_server_set_timeout_functions()
964 timeouts = server->timeouts; in dbus_server_set_timeout_functions()
965 server->timeouts = NULL; in dbus_server_set_timeout_functions()
968 SERVER_UNLOCK (server); in dbus_server_set_timeout_functions()
975 SERVER_LOCK (server); in dbus_server_set_timeout_functions()
982 server->timeouts = timeouts; in dbus_server_set_timeout_functions()
983 SERVER_UNLOCK (server); in dbus_server_set_timeout_functions()
1002 dbus_server_set_auth_mechanisms (DBusServer *server, in dbus_server_set_auth_mechanisms() argument
1007 _dbus_return_val_if_fail (server != NULL, FALSE); in dbus_server_set_auth_mechanisms()
1009 SERVER_LOCK (server); in dbus_server_set_auth_mechanisms()
1020 dbus_free_string_array (server->auth_mechanisms); in dbus_server_set_auth_mechanisms()
1021 server->auth_mechanisms = copy; in dbus_server_set_auth_mechanisms()
1023 SERVER_UNLOCK (server); in dbus_server_set_auth_mechanisms()
1087 dbus_server_set_data (DBusServer *server, in dbus_server_set_data() argument
1096 _dbus_return_val_if_fail (server != NULL, FALSE); in dbus_server_set_data()
1098 SERVER_LOCK (server); in dbus_server_set_data()
1101 &server->slot_list, in dbus_server_set_data()
1106 SERVER_UNLOCK (server); in dbus_server_set_data()
1127 dbus_server_get_data (DBusServer *server, in dbus_server_get_data() argument
1132 _dbus_return_val_if_fail (server != NULL, NULL); in dbus_server_get_data()
1134 SERVER_LOCK (server); in dbus_server_get_data()
1137 &server->slot_list, in dbus_server_get_data()
1140 SERVER_UNLOCK (server); in dbus_server_get_data()
1164 DBusServer *server; in _dbus_server_test() local
1173 server = dbus_server_listen (valid_addresses[i], &error); in _dbus_server_test()
1174 if (server == NULL) in _dbus_server_test()
1181 id = dbus_server_get_id (server); in _dbus_server_test()
1183 address = dbus_server_get_address (server); in _dbus_server_test()
1196 dbus_server_disconnect (server); in _dbus_server_test()
1197 dbus_server_unref (server); in _dbus_server_test()