config.guess
config.h
config.h.in
+*.bb
+*.bbg
+*.da
+*.gcov
+2003-02-16 Havoc Pennington <hp@pobox.com>
+
+ * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
+ allow people to avoid setting SIGPIPE to SIG_IGN
+ (_dbus_connection_new_for_transport): disable SIGPIPE unless
+ we've been asked not to
+
2003-02-15 Anders Carlsson <andersca@codefactory.se>
* dbus/dbus-list.c: (_dbus_list_append_link),
*.lo
*.la
dbus-daemon-1
+*.bb
+*.bbg
+*.da
+*.gcov
*.lo
*.la
dbus-test
+*.bb
+*.bbg
+*.gcov
+*.da
/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dbus-bus.h Convenience functions for communicating with the bus.
+/* dbus-bus.c Convenience functions for communicating with the bus.
*
* Copyright (C) 2003 CodeFactory AB
*
/** default timeout value when waiting for a message reply */
#define DEFAULT_TIMEOUT_VALUE (15 * 1000)
+static dbus_bool_t _dbus_modify_sigpipe = TRUE;
+
/** Opaque typedef for DBusDataSlot */
typedef struct DBusDataSlot DBusDataSlot;
/** DBusDataSlot is used to store application data on the connection */
disconnect_link = _dbus_list_alloc_link (disconnect_message);
if (disconnect_link == NULL)
goto error;
+
+ if (_dbus_modify_sigpipe)
+ _dbus_disable_sigpipe ();
connection->refcount = 1;
connection->mutex = mutex;
* Allocates an integer ID to be used for storing application-specific
* data on any DBusConnection. The allocated ID may then be used
* with dbus_connection_set_data() and dbus_connection_get_data().
- * If allocation fails, -1 is returned.
+ * If allocation fails, -1 is returned. Again, the allocated
+ * slot is global, i.e. all DBusConnection objects will
+ * have a slot with the given integer ID reserved.
*
* @returns -1 on failure, otherwise the data slot ID
*/
return res;
}
+/**
+ * This function sets a global flag for whether dbus_connection_new()
+ * will set SIGPIPE behavior to SIG_IGN.
+ *
+ * @param will_modify_sigpipe #TRUE to allow sigpipe to be set to SIG_IGN
+ */
+void
+dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe)
+{
+ _dbus_modify_sigpipe = will_modify_sigpipe;
+}
+
/* This must be called with the connection lock not held to avoid
* holding it over the free_data callbacks, so it can basically
* only be called at last unref
void* dbus_connection_get_data (DBusConnection *connection,
int slot);
+void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
+
void dbus_connection_set_max_message_size (DBusConnection *connection,
long size);
long dbus_connection_get_max_message_size (DBusConnection *connection);
return FALSE;
}
+/**
+ * signal (SIGPIPE, SIG_IGN);
+ */
+void
+_dbus_disable_sigpipe (void)
+{
+ signal (SIGPIPE, SIG_IGN);
+}
+
/** @} end of sysdeps */
dbus_bool_t _dbus_spawn_async (char **argv,
DBusError *error);
-
+
+void _dbus_disable_sigpipe (void);
+
DBUS_END_DECLS;
#endif /* DBUS_SYSDEPS_H */
*.lo
*.la
test-dbus-glib
+*.bb
+*.bbg
+*.da
+*.gcov
Makefile.in
*.lo
*.la
-
+*.bb
+*.bbg
+*.da
+*.gcov
echo-client
bus-test
unbase64
+*.bb
+*.bbg
+*.da
+*.gcov
+break-loader
+spawn-test
--- /dev/null
+## this tests that after retrying too often we fail
+
+SERVER
+NO_CREDENTIALS
+
+# 1
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_COMMAND REJECTED
+EXPECT_STATE WAITING_FOR_INPUT
+
+# 2
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_COMMAND REJECTED
+EXPECT_STATE WAITING_FOR_INPUT
+
+# 3
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_COMMAND REJECTED
+EXPECT_STATE WAITING_FOR_INPUT
+
+# 4
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_COMMAND REJECTED
+EXPECT_STATE WAITING_FOR_INPUT
+
+# 5
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_COMMAND REJECTED
+EXPECT_STATE WAITING_FOR_INPUT
+
+# 6
+SEND 'AUTH EXTERNAL USERNAME_BASE64'
+EXPECT_STATE NEED_DISCONNECT
--- /dev/null
+## message with a 'name' header field and unknown 'unkn' field
+
+## VALID_HEADER includes a LENGTH Header and LENGTH Body
+VALID_HEADER
+FIELD_NAME name
+TYPE STRING
+STRING 'org.freedesktop.Foo'
+FIELD_NAME unkn
+TYPE INT32
+INT32 0xfeeb
+ALIGN 8
+END_LENGTH Header
+START_LENGTH Body
+END_LENGTH Body