2 --- bus/driver.c 10 Aug 2004 03:06:59 -0000 1.52
3 +++ bus/driver.c 17 Sep 2004 09:14:49 -0000 1.55
6 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
8 + if (bus_connection_is_active (connection))
10 + /* We already handled an Hello message for this connection. */
11 + dbus_set_error (error, DBUS_ERROR_FAILED,
12 + "Already handled an Hello message");
16 /* Note that when these limits are exceeded we don't disconnect the
17 * connection; we just sort of leave it hanging there until it times
18 * out or disconnects itself or is dropped due to the max number of
20 DBusString service_name;
24 + dbus_uint32_t flags;
26 BusRegistry *registry;
30 DBusString service_name;
32 + dbus_bool_t service_exists;
35 BusRegistry *registry;
41 + if (strcmp (name, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS) == 0)
43 + service_exists = TRUE;
47 + _dbus_string_init_const (&service_name, name);
48 + service = bus_registry_lookup (registry, &service_name);
49 + service_exists = service != NULL;
52 - _dbus_string_init_const (&service_name, name);
53 - service = bus_registry_lookup (registry, &service_name);
55 reply = dbus_message_new_method_return (message);
61 if (!dbus_message_append_args (reply,
62 - DBUS_TYPE_BOOLEAN, service != NULL,
63 + DBUS_TYPE_BOOLEAN, service_exists,
71 - const char *base_name;
73 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
79 - const char *base_name;
81 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
84 --- bus/dispatch.c 10 Aug 2004 03:06:59 -0000 1.61
85 +++ bus/dispatch.c 17 Sep 2004 09:14:49 -0000 1.62
87 * but the correct thing may include OOM errors.
90 +check_double_hello_message (BusContext *context,
91 + DBusConnection *connection)
93 + DBusMessage *message;
94 + dbus_uint32_t serial;
99 + dbus_error_init (&error);
102 + _dbus_verbose ("check_double_hello_message for %p\n", connection);
104 + message = dbus_message_new_method_call (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS,
105 + DBUS_PATH_ORG_FREEDESKTOP_DBUS,
106 + DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS,
109 + if (message == NULL)
112 + if (!dbus_connection_send (connection, message, &serial))
114 + dbus_message_unref (message);
118 + dbus_message_unref (message);
121 + /* send our message */
122 + bus_test_run_clients_loop (TRUE);
124 + dbus_connection_ref (connection); /* because we may get disconnected */
125 + block_connection_until_message_from_bus (context, connection);
127 + if (!dbus_connection_get_is_connected (connection))
129 + _dbus_verbose ("connection was disconnected\n");
131 + dbus_connection_unref (connection);
136 + dbus_connection_unref (connection);
138 + message = pop_message_waiting_for_memory (connection);
139 + if (message == NULL)
141 + _dbus_warn ("Did not receive a reply to %s %d on %p\n",
142 + "Hello", serial, connection);
146 + verbose_message_received (connection, message);
148 + if (!dbus_message_has_sender (message, DBUS_SERVICE_ORG_FREEDESKTOP_DBUS))
150 + _dbus_warn ("Message has wrong sender %s\n",
151 + dbus_message_get_sender (message) ?
152 + dbus_message_get_sender (message) : "(none)");
156 + if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_ERROR)
158 + warn_unexpected (connection, message, "method return for Hello");
162 + if (!check_no_leftovers (context))
168 + dbus_error_free (&error);
171 + dbus_message_unref (message);
176 +/* returns TRUE if the correct thing happens,
177 + * but the correct thing may include OOM errors.
180 check_get_connection_unix_user (BusContext *context,
181 DBusConnection *connection)
183 @@ -2243,7 +2333,9 @@
184 ; /* good, this is a valid response */
186 else if (dbus_message_is_error (message,
187 - DBUS_ERROR_SPAWN_CHILD_EXITED))
188 + DBUS_ERROR_SPAWN_CHILD_EXITED) ||
189 + dbus_message_is_error (message,
190 + DBUS_ERROR_SPAWN_EXEC_FAILED))
192 ; /* good, this is expected also */
194 @@ -2917,6 +3009,9 @@
195 if (!check_hello_message (context, foo))
196 _dbus_assert_not_reached ("hello message failed");
198 + if (!check_double_hello_message (context, foo))
199 + _dbus_assert_not_reached ("double hello message failed");
201 if (!check_add_match_all (context, foo))
202 _dbus_assert_not_reached ("AddMatch message failed");