Index: ChangeLog =================================================================== RCS file: /cvs/dbus/dbus/ChangeLog,v retrieving revision 1.895 diff -u -p -r1.895 ChangeLog --- ChangeLog 8 Sep 2005 18:54:42 -0000 1.895 +++ ChangeLog 10 Sep 2005 20:35:19 -0000 @@ -1,3 +1,28 @@ +2005-09-10 Mark McLoughlin + + * dbus/dbus-auth.c: (record_mechanisms): don't + retry the first auth mechanism because we know + we're just going to get rejected again. + + * dbus/dbus-keyring.c: (_dbus_keyring_reload): + Fix thinko ... and what a nasty little bugger to + track down you were ... + + * dbus/dbus-connection.c: + (_dbus_connection_add_watch), + (_dbus_connection_remove_watch): add note about + these needing the connection to be locked. + (_dbus_connection_get_dispatch_status_unlocked): + set status to DATA_REMAINS when we queue the + disconnected message. + + * bus/dispatch.c: + (bus_dispatch): fix warning. + (check_existent_service_no_auto_start): + Expect ChildSignaled error too. + (check_existent_hello_from_self): fix another + couple of warnings. + Index: bus/dispatch.c =================================================================== RCS file: /cvs/dbus/dbus/bus/dispatch.c,v retrieving revision 1.71 diff -u -p -r1.71 dispatch.c --- bus/dispatch.c 15 Jul 2005 15:21:43 -0000 1.71 +++ bus/dispatch.c 10 Sep 2005 20:35:22 -0000 @@ -271,8 +271,7 @@ bus_dispatch (DBusConnection *connection message, service_name, &error)) { _DBUS_ASSERT_ERROR_IS_SET (&error); - _dbus_verbose ("bus_activation_activate_service() failed\n"); - ("Failed: %s\n", error.name); + _dbus_verbose ("bus_activation_activate_service() failed: %s\n", error.name); goto out; } @@ -2475,6 +2474,8 @@ check_existent_service_no_auto_start (Bu else if (dbus_message_is_error (message, DBUS_ERROR_SPAWN_CHILD_EXITED) || dbus_message_is_error (message, + DBUS_ERROR_SPAWN_CHILD_SIGNALED) || + dbus_message_is_error (message, DBUS_ERROR_SPAWN_EXEC_FAILED)) { ; /* good, this is expected also */ @@ -2821,8 +2822,6 @@ check_existent_hello_from_self (BusConte { DBusMessage *message; dbus_uint32_t serial; - dbus_bool_t retval; - const char *base_service; const char *text; message = dbus_message_new_method_call (EXISTENT_SERVICE_NAME, @@ -2862,25 +2861,20 @@ check_existent_hello_from_self (BusConte if (message == NULL) { _dbus_warn ("Failed to pop message! Should have been reply from RunHelloFromSelf message\n"); - goto out; + return FALSE; } if (dbus_message_get_reply_serial (message) != serial) { _dbus_warn ("Wrong reply serial\n"); - goto out; + dbus_message_unref (message); + return FALSE; } dbus_message_unref (message); message = NULL; - retval = TRUE; - - out: - if (message) - dbus_message_unref (message); - - return retval; + return TRUE; } Index: dbus/dbus-auth.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-auth.c,v retrieving revision 1.44 diff -u -p -r1.44 dbus-auth.c --- dbus/dbus-auth.c 1 Aug 2005 18:59:02 -0000 1.44 +++ dbus/dbus-auth.c 10 Sep 2005 20:35:23 -0000 @@ -1668,14 +1668,22 @@ record_mechanisms (DBusAuth *aut * it lists things in that order anyhow. */ - _dbus_verbose ("%s: Adding mechanism %s to list we will try\n", - DBUS_AUTH_NAME (auth), mech->mechanism); + if (mech != &all_mechanisms[0]) + { + _dbus_verbose ("%s: Adding mechanism %s to list we will try\n", + DBUS_AUTH_NAME (auth), mech->mechanism); - if (!_dbus_list_append (& DBUS_AUTH_CLIENT (auth)->mechs_to_try, - (void*) mech)) + if (!_dbus_list_append (& DBUS_AUTH_CLIENT (auth)->mechs_to_try, + (void*) mech)) + { + _dbus_string_free (&m); + goto nomem; + } + } + else { - _dbus_string_free (&m); - goto nomem; + _dbus_verbose ("%s: Already tried mechanism %s; not adding to list we will try\n", + DBUS_AUTH_NAME (auth), mech->mechanism); } } else Index: dbus/dbus-connection.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-connection.c,v retrieving revision 1.110 diff -u -p -r1.110 dbus-connection.c --- dbus/dbus-connection.c 26 Aug 2005 17:34:59 -0000 1.110 +++ dbus/dbus-connection.c 10 Sep 2005 20:35:27 -0000 @@ -594,6 +594,7 @@ protected_change_watch (DBusConnection * available. Otherwise records the watch to be added when said * function is available. Also re-adds the watch if the * DBusAddWatchFunction changes. May fail due to lack of memory. + * Connection lock should be held when calling this. * * @param connection the connection. * @param watch the watch to add. @@ -612,6 +613,7 @@ _dbus_connection_add_watch (DBusConnecti * Removes a watch using the connection's DBusRemoveWatchFunction * if available. It's an error to call this function on a watch * that was not previously added. + * Connection lock should be held when calling this. * * @param connection the connection. * @param watch the watch to remove. @@ -3264,6 +3266,8 @@ _dbus_connection_get_dispatch_status_unl _dbus_connection_queue_synthesized_message_link (connection, connection->disconnect_message_link); connection->disconnect_message_link = NULL; + + status = DBUS_DISPATCH_DATA_REMAINS; } /* Dump the outgoing queue, we aren't going to be able to Index: dbus/dbus-keyring.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-keyring.c,v retrieving revision 1.29 diff -u -p -r1.29 dbus-keyring.c --- dbus/dbus-keyring.c 6 Sep 2005 22:38:54 -0000 1.29 +++ dbus/dbus-keyring.c 10 Sep 2005 20:35:27 -0000 @@ -482,7 +482,7 @@ _dbus_keyring_reload (DBusKeyring *keyri DBusKey *new; /* Don't load more than the max. */ - if (n_keys >= (add_new ? MAX_KEYS_IN_FILE : MAX_KEYS_IN_FILE - 1)) + if (n_keys >= (add_new ? MAX_KEYS_IN_FILE - 1 : MAX_KEYS_IN_FILE)) break; next = 0;