summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-12-19 00:11:20 +0000
committerHavoc Pennington <hp@redhat.com>2004-12-19 00:11:20 +0000
commitf3228b477df95ba247c90cc54189ce6d62059251 (patch)
tree59fa3a8b8a3a81606d2ac5e7ecf88fafc7adb967
parentb360305cdae87c8cb5d0f8cb167c8626238fc4e8 (diff)
2004-12-18 Havoc Pennington <hp@redhat.com>
* dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII macro * dbus/dbus-message.c: fix a comment, and add a still-unused not-implemented function * dbus/dbus-marshal.h: fix comment * dbus/dbus-internals.h (_DBUS_ISASCII): new macro
-rw-r--r--ChangeLog12
-rw-r--r--dbus/dbus-internals.h2
-rw-r--r--dbus/dbus-marshal.h2
-rw-r--r--dbus/dbus-message.c18
-rw-r--r--dbus/dbus-string.c3
5 files changed, 33 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4783db89..dfe5c6cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-12-18 Havoc Pennington <hp@redhat.com>
+
+ * dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII
+ macro
+
+ * dbus/dbus-message.c: fix a comment, and add a still-unused
+ not-implemented function
+
+ * dbus/dbus-marshal.h: fix comment
+
+ * dbus/dbus-internals.h (_DBUS_ISASCII): new macro
+
2004-12-17 Joe Shaw <joeshaw@novell.com>
* mono/DBusType/Byte.cs, mono/DBusType/Int32.cs,
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index 7e3c458f..8560d4ec 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -198,6 +198,8 @@ char** _dbus_dup_string_array (const char **array);
#undef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
+#define _DBUS_ISASCII(c) ((c) != '\0' && (((c) & ~0x7f) == 0))
+
typedef void (* DBusForeachFunction) (void *element,
void *data);
diff --git a/dbus/dbus-marshal.h b/dbus/dbus-marshal.h
index 0a34920f..dccfc1db 100644
--- a/dbus/dbus-marshal.h
+++ b/dbus/dbus-marshal.h
@@ -345,4 +345,4 @@ dbus_bool_t _dbus_marshal_validate_arg (const DBusString *str,
dbus_bool_t _dbus_type_is_valid (int typecode);
-#endif /* DBUS_PROTOCOL_H */
+#endif /* DBUS_MARSHAL_H */
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index df1c789a..143ac96a 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -2325,6 +2325,21 @@ dbus_message_append_args (DBusMessage *message,
return retval;
}
+/* Swap into our byte order if message isn't already.
+ * Done only when required, which allows the bus to avoid
+ * ever doing this as it routes messages.
+ */
+static void
+_dbus_message_ensure_our_byte_order (DBusMessage *message)
+{
+ if (message->byte_order == DBUS_COMPILER_BYTE_ORDER)
+ return;
+
+
+
+
+}
+
/**
* Gets arguments from a message given a variable argument list.
* The variable argument list should contain the type of the
@@ -5188,7 +5203,8 @@ decode_string_field (const DBusString *data,
/* FIXME because the service/interface/member/error names are already
* validated to be in the particular ASCII subset, UTF-8 validating
* them could be skipped as a probably-interesting optimization.
- * The UTF-8 validation definitely shows up in profiles.
+ * The UTF-8 validation shows up in callgrind-type profiles but
+ * not so much in sample/time-based profiles.
*/
static dbus_bool_t
decode_header_data (const DBusString *data,
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
index 627fbb06..1188c6cb 100644
--- a/dbus/dbus-string.c
+++ b/dbus/dbus-string.c
@@ -2394,8 +2394,7 @@ _dbus_string_validate_ascii (const DBusString *str,
end = s + len;
while (s != end)
{
- if (_DBUS_UNLIKELY (*s == '\0' ||
- ((*s & ~0x7f) != 0)))
+ if (_DBUS_UNLIKELY (!_DBUS_ISASCII (*s)))
return FALSE;
++s;