b5b37d1e18538ebe5ef29c113b8a694dfc2ef924
[platform/upstream/dbus.git] / ChangeLog
1 2003-08-19  Havoc Pennington  <hp@pobox.com>
2
3         * dbus/dbus-message.c (decode_string_field): support FIELD_SENDER
4         (dbus_message_is_error): fix this function
5
6         * bus/dbus-daemon-1.1: clarify logic on when <deny>/<allow> rules
7         match
8
9         * bus/policy.c (bus_client_policy_check_can_receive): fix code to
10         reflect clarified man page
11         (bus_client_policy_check_can_send): ditto
12         
13         * bus/session.conf.in: fixup
14
15         * bus/system.conf.in: fixup
16
17 2003-08-18  Havoc Pennington  <hp@redhat.com>
18
19         * dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix
20
21         * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
22         dumb bug created earlier (wrong order of args to
23         decode_header_data())
24         
25         * tools/dbus-send.c: port
26
27         * tools/dbus-print-message.c (print_message): port
28
29         * test/data/*messages: port all messages over
30         
31         * dbus/dbus-message-builder.c: support including 
32         message type
33         
34         * bus/driver.c: port over
35         
36         * bus/dispatch.c: port over to new stuff
37
38         * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
39         rename disconnect signal to "Disconnected"
40
41 2003-08-17  Havoc Pennington  <hp@pobox.com>
42
43         This doesn't compile yet, but syncing up so I can hack on it from
44         work. What are branches for if not broken code? ;-)
45         
46         * dbus/dbus-protocol.h: remove DBUS_HEADER_FIELD_NAME, add
47         DBUS_HEADER_FIELD_INTERFACE, DBUS_HEADER_FIELD_MEMBER,
48         DBUS_HEADER_FIELD_ERROR_NAME
49         
50         * dbus/dbus-hash.c: Introduce DBUS_HASH_TWO_STRINGS as hack to use
51         for the interface+member pairs
52         (string_hash): change to use g_str_hash algorithm
53         (find_direct_function, find_string_function): refactor these to
54         share most code.
55         
56         * dbus/dbus-message.c: port all of this over to support 
57         interface/member fields instead of name field
58
59         * dbus/dbus-object-registry.c: port over
60         
61         * dbus/dbus-string.c (_dbus_string_validate_interface): rename
62         from _dbus_string_validate_name
63
64         * bus/dbus-daemon-1.1: change file format for the 
65         <deny>/<allow> stuff to match new message naming scheme
66
67         * bus/policy.c: port over
68
69         * bus/config-parser.c: parse new format
70         
71 2003-08-16  Havoc Pennington  <hp@pobox.com>
72
73         * dbus/dbus-object-registry.c (add_and_remove_objects): remove
74         broken assertion
75
76         * glib/dbus-gproxy.c: some hacking
77
78 2003-08-15  Havoc Pennington  <hp@redhat.com>
79
80         * dbus/dbus-pending-call.c (dbus_pending_call_block): implement
81
82         * dbus/dbus-connection.c
83         (dbus_connection_send_with_reply_and_block): factor out internals;
84         change to convert any error replies to DBusError instead of 
85         returning them as a message
86
87 2003-08-15  Havoc Pennington  <hp@pobox.com>
88
89         * dbus/dbus-connection.c, 
90         dbus/dbus-pending-call.c: Finish the pending call stuff
91
92 2003-08-14  Havoc Pennington  <hp@redhat.com>
93
94         * dbus/dbus-pending-call.c: start on new object that will replace
95         DBusMessageHandler and ReplyHandlerData for tracking outstanding
96         replies
97
98         * dbus/dbus-gproxy.c: start on proxy object used to communicate
99         with remote interfaces
100
101         * dbus/dbus-gidl.c: do the boring boilerplate in here
102         
103 2003-08-12  Havoc Pennington  <hp@pobox.com>
104
105         * bus/dispatch.c (bus_dispatch): make this return proper 
106         DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD
107
108         * dbus/dbus-errors.c (dbus_set_error): use
109         _dbus_string_append_printf_valist
110
111         * dbus/dbus-string.c (_dbus_string_append_printf_valist)
112         (_dbus_string_append_printf): new
113
114         * dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to
115         UNKNOWN_METHOD
116
117         * dbus/dbus-connection.c (dbus_connection_dispatch): handle
118         DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a
119         message is unhandled.
120
121 2003-08-11  Havoc Pennington  <hp@pobox.com>
122
123         * bus/test.c (client_disconnect_handler): change to return
124         HANDLED (would have been REMOVE_MESSAGE)
125
126         * dbus/dbus-object.h (enum DBusHandlerResult): rename to
127         HANDLED/NOT_YET_HANDLED instead of
128         REMOVE_MESSAGE/ALLOW_MORE_HANDLERS to make it clearer how it 
129         should be used.
130
131 2003-08-10  Havoc Pennington  <hp@pobox.com>
132
133         * tools/dbus-send.c (main): add --type argument, for now
134         supporting only method_call and signal types.
135
136         * tools/dbus-print-message.c: print message type
137
138         * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
139         init connection->objects
140
141         * doc/dbus-specification.sgml: fix sgml
142
143         * bus/*.c: port over to object-instance API changes
144
145         * test/test-service.c: ditto
146         
147         * dbus/dbus-message.c (dbus_message_create_header): allow #NULL
148         name, we will have to fix up the rest of the code to also handle
149         this
150         (dbus_message_new): generic message-creation call
151         (set_string_field): allow appending name field
152
153 2003-08-06  Havoc Pennington  <hp@pobox.com>
154
155         * dbus/dbus-object-registry.c: implement signal connection 
156         and dispatch
157
158         * dbus/dbus-connection.c (_dbus_connection_unref_unlocked): new
159
160         * dbus/dbus-internals.c (_dbus_memdup): new function
161
162 2003-08-02  Havoc Pennington  <hp@pobox.com>
163
164         * dbus/dbus-message.c (dbus_message_get_no_reply)
165         (dbus_message_set_no_reply): add these and remove
166         set_is_error/get_is_error
167
168         * dbus/dbus-protocol.h, doc/dbus-specification.sgml: 
169         remove the ERROR flag, since there's now an ERROR type
170
171 2003-08-01  Havoc Pennington  <hp@pobox.com>
172
173         * dbus/dbus-object-registry.c (_dbus_object_registry_handle_and_unlock):
174         implement
175
176         * dbus/dbus-message.c (dbus_message_get_type): new function
177
178         * doc/dbus-specification.sgml: add "type" byte to messages
179
180 2003-08-01  Havoc Pennington  <hp@pobox.com>
181
182         * dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce
183         a message type enum to distinguish kinds of message
184         (DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message 
185         that need not be replied to
186
187 2003-08-01  Havoc Pennington  <hp@pobox.com>
188
189         * dbus/dbus-marshal.c: adapt to DBusObjectID changes
190         (unpack_8_octets): fix no-64-bit-int bug
191
192         * dbus/dbus-object-registry.c (validate_id): validate the 
193         connection ID bits, not just the instance ID.
194
195         * dbus/dbus-connection.c (_dbus_connection_init_id): initialize
196         the connection-global 33 bits of the object ID
197
198         * dbus/dbus-object-registry.c (info_from_entry): fill in 
199         object ID in the new way
200
201         * dbus/dbus-objectid.h: rather than high/low bits, specifically 
202         define server/client/instance bits.
203
204 2003-07-30  Havoc Pennington  <hp@pobox.com>
205
206         * dbus/dbus-connection.c (dbus_connection_register_object): fix
207         build
208
209 2003-07-13  Havoc Pennington  <hp@pobox.com>
210
211         * dbus/dbus-object.h (struct DBusObjectVTable): add padding
212         fields to DBusObjectVTable and DBusObjectInfo
213
214 2003-07-12  Havoc Pennington  <hp@pobox.com>
215
216         * dbus/dbus-object-registry.c: implement unit test,
217         fix bugs discovered in process
218
219         * dbus/dbus-connection.c: remove handler_table and
220         register_handler(), add DBusObjectRegistry usage
221
222         * dbus/dbus-objectid.c (dbus_object_id_is_null)
223         (dbus_object_id_set_null): new functions
224
225 2003-07-08  Havoc Pennington  <hp@pobox.com>
226
227         * dbus/dbus-object.c: implement some of this
228
229         * dbus/dbus-object-registry.c
230         (_dbus_object_registry_add_and_unlock): fill in the object_id out
231         param
232         (_dbus_object_registry_new): handle OOM
233
234 2003-07-08  Havoc Pennington  <hp@pobox.com>
235
236         * dbus/dbus-object.h: sketch out an API for registering objects
237         with a connection, that allows us to use as little as 24 bytes
238         per object and lets application code represent an object in 
239         any conceivable way.
240
241         * dbus/dbus-object-registry.c: implement the hard bits of the
242         DBusConnection aspect of object API. Not yet wired up.
243         
244 2003-07-06  Havoc Pennington  <hp@pobox.com>
245
246         * dbus/dbus-marshal.c (_dbus_marshal_set_object_id): new function
247         (_dbus_marshal_object_id): new
248         (_dbus_demarshal_object_id): new
249         (_dbus_marshal_get_arg_end_pos): support object ID type, and
250         consolidate identical switch cases. Don't conditionalize handling
251         of DBUS_TYPE_UINT64, need to handle the type always.
252         (_dbus_marshal_validate_arg): consolidate identical cases, and
253         handle DBUS_TYPE_OBJECT_ID
254
255         * dbus/dbus-objectid.c: new file with DBusObjectID data type.
256
257         * dbus/dbus-protocol.h: add DBUS_TYPE_OBJECT_ID
258
259 2003-06-29  Havoc Pennington  <hp@pobox.com>
260
261         * mono/Test.cs (class Test): fire up a main loop and run it
262
263         * mono/DBus.cs (DBus): don't g_thread_init since it can only be
264         done once, the app has to do it
265
266 2003-06-26  Havoc Pennington  <hp@pobox.com>
267
268         * mono/Connection.cs: set up connection with the glib main loop
269
270 2003-07-01  Havoc Pennington  <hp@redhat.com>
271
272         * doc/dbus-specification.sgml: clarify the format of a type code,
273         change suggested by Jim Blandy
274
275 2003-06-29  Miloslav Trmac  <mitr@volny.cz>
276
277         * doc/Makefile.am:
278         * tools/Makefile.am: Don't assume srcdir == builddir.
279
280         * dbus/dbus-memory.c (dbus_realloc): Don't check guards after shrinking
281         the allocated block.
282         (_dbus_memory_test): New function.
283         * dbus/dbus-test.h: Add _dbus_memory_test ().
284         * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Call it.
285
286         * dbus/dbus-message.c (decode_header_data): Use %.4s instead
287         of %c%c%c%c.
288         (dbus_message_new): Remove obsolete @todo.
289
290         * dbus/dbus-marshal.c (_dbus_marshal_set_int64)
291         (_dbus_marshal_set_uint64): Fix comment.
292
293         * dbus/dbus-message.c (append_int_field, append_uint_field): Don't
294         hardcode FIELD_REPLY_SERIAL.
295
296         * dbus/dbus-mainloop.c (_dbus_loop_remove_watch)
297         (_dbus_loop_remove_timeout): Cast function pointers to (void *) for %p
298
299         * configure.in: Add -D_POSIX_C_SOURCE=199309L -DBSD_SOURCE to CFLAGS
300         and disable DBUS_USE_ATOMIC_INT_486 when --enable-ansi is used
301
302 2003-06-24  Havoc Pennington  <hp@pobox.com>
303
304         * mono/*.cs: Use IntPtr.Zero instead of ((IntPtr) 0)
305
306 2003-06-23  Anders Carlsson  <andersca@codefactory.se>
307
308         * configure.in:
309         * gcj/.cvsignore:
310         * gcj/Hello.java:
311         * gcj/Makefile.am:
312         * gcj/TestMessage.java: (TestMessage), (TestMessage.main):
313         * gcj/org/.cvsignore:
314         * gcj/org/Makefile.am:
315         * gcj/org/freedesktop/.cvsignore:
316         * gcj/org/freedesktop/Makefile.am:
317         * gcj/org/freedesktop/dbus/.cvsignore:
318         * gcj/org/freedesktop/dbus/Makefile.am:
319         * gcj/org/freedesktop/dbus/Message.java: (Message),
320         (Message.Message):
321         * gcj/org/freedesktop/dbus/natMessage.cc:
322         Fix the build system.
323
324 2003-06-22  Havoc Pennington  <hp@pobox.com>
325
326         * mono/Connection.cs: add more bindings
327
328         * dbus/dbus-threads.c (dbus_threads_init): allow calling this
329         more than once.
330
331 2003-06-22  Havoc Pennington  <hp@pobox.com>
332
333         * mono/Connection.cs, mono/DBus.cs, mono/Error.cs:
334         Start wrapping more stuff.
335
336 2003-06-22  Havoc Pennington  <hp@pobox.com>
337
338         * mono/Message.cs: implement Message.Wrap() that ensures we only
339         have a single C# wrapper per DBusMessage, assuming it works which
340         it probably doesn't.
341
342         * dbus/dbus-message.c (dbus_message_allocate_data_slot): new
343         (dbus_message_free_data_slot): new
344         (dbus_message_set_data): new
345         (dbus_message_get_data): new
346
347 2003-06-22  Havoc Pennington  <hp@pobox.com>
348
349         * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_unref)
350         (_dbus_data_slot_allocator_alloc): rework these to keep a
351         reference count on each slot and automatically manage a global
352         slot ID variable passed in by address
353
354         * bus/bus.c: convert to new dataslot API
355
356         * dbus/dbus-bus.c: convert to new dataslot API
357
358         * dbus/dbus-connection.c: convert to new dataslot API
359
360         * dbus/dbus-server.c: convert to new dataslot API
361
362         * glib/dbus-gmain.c: ditto
363
364         * bus/test.c: ditto
365
366         * bus/connection.c: ditto
367
368 2003-06-22  Anders Carlsson  <andersca@codefactory.se>
369
370         * configure.in: Add AM_PROG_GCJ and move AM_PROG_LIBTOOL
371         after the gcj checks so that the correct configuration tags
372         will be added to libtool.
373
374         * dbus-glib-1.pc.in: No need to specify any includes since
375         dbus-1.pc.in has those.
376
377 2003-06-22  Havoc Pennington  <hp@pobox.com>
378
379         * mono/*, gcj/*, configure.in, Makefile.am:
380         Check in makefiles and subdirs for mono and gcj bindings.
381         Neither binding actually exists, just trying to get through
382         all the build and other boring bits.
383
384 2003-06-21  Philip Blundell  <philb@gnu.org>
385
386         * tools/dbus-monitor.1: Updated.
387
388         * tools/dbus-send.1: Likewise.
389
390 2003-06-20  Anders Carlsson  <andersca@codefactory.se>
391
392         * dbus/dbus-transport-unix.c (unix_handle_watch): Check
393         for hangup and error after checking read so we won't discard
394         pending data if both hangup and read are set.
395
396 2003-06-19  Philip Blundell  <philb@gnu.org>
397
398         * tools/dbus-print-message.c (print_message): Handle BOOLEAN.
399
400         * tools/dbus-send.c: Accept both --system and --session.
401
402         * tools/dbus-monitor.c: Same here.
403
404 2003-06-19  Anders Carlsson  <andersca@codefactory.se>
405
406         * glib/dbus-glib.h: Fix so that dbus-glib.h can be used
407         from C++ (Patch by Miloslav Trmac).
408
409 2003-06-15  Joe Shaw  <joe@assbarn.com>
410
411         * configure.in: Check for socklen_t.
412
413         * dbus/dbus-sysdeps.c: Define socklen_t if it's not defined.
414
415         * test/test-segfault.c: Add #include <sys/time.h>
416
417         * tools/Makefile.am: Add DBUS_X_CFLAGS to the INCLUDES since
418         dbus-launch needs it.
419
420 2003-06-09  Havoc Pennington  <hp@redhat.com>
421
422         * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): don't use
423         SUN_LEN, it breaks abstract socket usage
424
425         * dbus/dbus-internals.c (_dbus_verbose_real): only print PID at
426         starts of lines.
427
428 2003-06-04  Havoc Pennington  <hp@pobox.com>
429
430         * dbus/dbus-server.c (dbus_server_listen): allow abstract sockets
431         using unix:abstract=/foo, and when listening in a tmpdir
432         i.e. unix:tmpdir=/tmp, always use abstract sockets if we can.
433
434         * dbus/dbus-transport.c (_dbus_transport_open): support
435         unix:abstract=/foo
436
437         * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
438         support abstract sockets
439
440         * dbus/dbus-transport-unix.c
441         (_dbus_transport_new_for_domain_socket): support abstract sockets
442
443         * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract"
444         toggle as an argument, implement abstract namespace support
445         (_dbus_listen_unix_socket): ditto
446
447         * configure.in: add --enable-abstract-sockets and implement
448         a configure check for autodetection of the right value.
449
450 2003-06-01  Havoc Pennington  <hp@pobox.com>
451
452         * tools/dbus-cleanup-sockets.c: add utility to clean up sockets
453         in /tmp (though on Linux this will end up being useless,
454         when we add abstract namespace support)
455
456         * configure.in: define DBUS_SESSION_SOCKET_DIR in addition to
457         subst'ing it
458
459 2003-05-28  Colin Walters  <walters@verbum.org>
460
461         * tools/dbus-monitor.c (main): Fix silly typo (s/--session/--system/).
462
463 2003-05-18  Anders Carlsson  <andersca@codefactory.se>
464
465         * dbus/dbus-message.c (dbus_message_new): Remove @todo.
466
467 2003-05-17  Colin Walters  <walters@gnu.org>
468
469         * tools/dbus-send.c: Don't exit with an error code if --help was
470         passed.  Default to using the session bus instead of the system
471         one.
472
473         * tools/dbus-launch.c: Ditto.
474
475         * tools/dbus-monitor.c: Ditto.
476
477         * tools/dbus-send.1: Update with new arguments.
478
479         * tools/dbus-launch.c: Emit code to export variables.  New
480         arguments -s and -c to specify shell syntax, and a bit of code to
481         autodetect syntax.  Also, allow specifying a program to run.
482
483         * tools/dbus-launch.1: Update with new arguments.
484
485         * tools/dbus-send.1: Ditto.
486
487         * tools/dbus-monitor.1: Ditto.
488
489 2003-05-17  Havoc Pennington  <hp@pobox.com>
490
491         * bus/config-parser.c (merge_included): merge in policies from
492         child configuration file.
493
494         * bus/policy.c (bus_policy_merge): function to merge two policies
495         together
496
497 2003-05-16  Havoc Pennington  <hp@redhat.com>
498
499         * dbus/dbus-connection.c: disable verbose lock spew
500
501         * tools/dbus-send.c: add --print-reply command line option
502
503         * tools/dbus-print-message.h (print_message): new util function
504         shared by dbus-send and dbus-monitor
505
506         * tools/dbus-monitor.c (handler_func): exit on disconnect
507
508         * dbus/dbus-transport-unix.c (do_reading): if the transport is
509         disconnected, don't try to use the read_watch
510
511         * dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL
512         so we can find this bug more easily
513
514 2003-05-16  Havoc Pennington  <hp@redhat.com>
515
516         * bus/policy.c (free_rule_list_func): avoid a crash when passed
517         NULL as DBusHashTable is annoyingly likely to do.
518
519 2003-05-16  Colin Walters  <walters@verbum.org>
520
521         * tools/dbus-monitor.c: Add --session argument and usage()
522         function.
523
524         * tools/dbus-monitor.1: Update with new --session arg.
525
526         * bus/Makefile.am (install-data-hook): Create
527         $(libdir)/dbus-1.0/services so that the session bus is happy.
528
529 2003-05-15  Havoc Pennington  <hp@redhat.com>
530
531         * dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work
532         on non-x86. ifdef's are evil.
533
534 2003-05-15  Havoc Pennington  <hp@redhat.com>
535
536         * configure.in: 0.11
537
538         * NEWS: update
539
540         * bus/Makefile.am (initddir): apparently we are supposed to put
541         init scripts in /etc/rc.d/init.d not /etc/init.d
542
543         * bus/Makefile.am: remove the "you must --enable-tests to make
544         check" as it broke distcheck
545
546         * bus/Makefile.am (install-data-hook): create /etc/dbus-1/system.d
547
548 2003-05-13  James Willcox  <jwillcox@gnome.org>
549
550         * configure.in:
551         * bus/activation.c: (bus_activation_service_created),
552         (bus_activation_activate_service):
553         * bus/driver.c: (bus_driver_send_service_deleted),
554         (bus_driver_send_service_created), (bus_driver_send_service_lost),
555         (bus_driver_send_service_acquired),
556         (bus_driver_send_welcome_message),
557         (bus_driver_handle_list_services):
558         * bus/session.conf.in:
559         * dbus/dbus-bus.c: (dbus_bus_acquire_service),
560         (dbus_bus_service_exists), (dbus_bus_activate_service):
561         * dbus/dbus-bus.h:
562
563         Add some convenience API which lets you activate a service, and did a
564         bunch of s/0/DBUS_TYPE_INVALID/ in calls to dbus_message_append_args()
565         and dbus_message_get_args()
566
567 2003-05-11  Havoc Pennington  <hp@pobox.com>
568
569         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
570         calling _dbus_marshal_validate_arg() for every byte in a byte
571         array, etc.
572
573         * dbus/dbus-message-handler.c: use atomic reference counting to
574         reduce number of locks slightly; the global lock in here sucks
575
576         * dbus/dbus-connection.c
577         (_dbus_connection_update_dispatch_status_and_unlock): variant of
578         update_dispatch_status that can be called with lock held; then use
579         in a couple places to reduce locking/unlocking
580         (dbus_connection_send): hold the lock over the whole function
581         instead of acquiring it twice.
582
583         * dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM
584
585         * bus/connection.c (bus_connections_setup_connection): fix access
586         to already-freed memory.
587
588         * dbus/dbus-connection.c: keep a little cache of linked list
589         nodes, to avoid using the global linked list alloc lock in the
590         normal send-message case. Instead we just use the connection lock
591         that we already have to take.
592
593         * dbus/dbus-list.c (_dbus_list_find_last): new function
594
595         * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
596         change to use a struct for the atomic type; fix docs,
597         they return value before increment, not after increment.
598
599         * dbus/dbus-string.c (_dbus_string_append_4_aligned)
600         (_dbus_string_append_8_aligned): new functions to try to
601         microoptimize this operation.
602         (reallocate_for_length): break this out of set_length(), to
603         improve profile info, and also so we can consider inlining the
604         set_length() part.
605
606         * dbus/dbus-message.c (dbus_message_new_empty_header): init data
607         strings with some preallocation, cuts down on our calls to realloc
608         a fair bit. Though if we can get the "move entire string to empty
609         string" optimization below to kick in here, it would be better.
610
611         * dbus/dbus-string.c (_dbus_string_move): just call
612         _dbus_string_move_len
613         (_dbus_string_move_len): add a special case for moving
614         an entire string into an empty string; we can just
615         swap the string data instead of doing any reallocs.
616         (_dbus_string_init_preallocated): new function
617
618 2003-05-11  Havoc Pennington  <hp@pobox.com>
619
620         Write a "test-profile" that does echo client-server with threads;
621         profile reveals lock contention, memcpy/realloc of buffers, and
622         UTF-8 validation as hot spots. 20% of lock contention eliminated
623         with dbus_atomic_inc/dec implementation on x86.  Much remaining
624         contention is global mempool locks for GList and DBusList.
625
626         * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add
627         x86 implementation
628
629         * dbus/dbus-connection.c (struct DBusConnection): use
630         dbus_atomic_t for the reference count
631
632         * dbus/dbus-message.c (struct DBusMessage): declare
633         dbus_atomic_t values as volatile
634
635         * configure.in: code to detect ability to use atomic integer
636         operations in assembly, from GLib patch
637
638         * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every
639         time, tired of it being wrong in threads and forked processes
640
641         * glib/test-profile.c: a little program to bounce messages back
642         and forth between threads and eat CPU
643
644         * dbus/dbus-connection.c: add debug spew macros for debugging
645         thread locks; include config.h at top; fix deadlock in
646         dbus_connection_flush()
647
648 2003-05-08  Havoc Pennington  <hp@pobox.com>
649
650         * dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov
651         data from getting written, and there wasn't a good reason to
652         use _exit really.
653
654         * test/decode-gcov.c (mark_inside_dbus_build_tests): don't count
655         dbus_verbose lines in test coverage
656         (main): add list of functions sorted by # of untested blocks
657         to the coverage report
658
659         * dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS
660
661         * dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage
662
663         * dbus/dbus-message-handler.c (_dbus_message_handler_test):
664         extend test coverage
665
666         * test/data/auth/cancel.auth-script: test canceling an
667         authentication
668
669         * dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they
670         aren't used. in CVS history if we end up needing them.
671
672 2003-05-04  Havoc Pennington  <hp@pobox.com>
673
674         * dbus/dbus-message-handler.c (_dbus_message_handler_test): add
675         unit test
676
677         * dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this
678         function, which assumed length was in # of strings, not bytes
679
680         * dbus/dbus-message.c (_dbus_message_test): add tests for some
681         missing coverage
682
683         * dbus/dbus-connection.c
684         (_dbus_connection_queue_received_message): disable function for
685         now, we are only using it in test mode
686
687         * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
688         remove a mistaken FIXME
689
690 2003-05-04  Havoc Pennington  <hp@pobox.com>
691
692         * dbus/dbus-connection.c (dbus_connection_preallocate_send):
693         unlock mutex on successful return, patch from Anders Gustafsson
694
695 2003-05-04  Havoc Pennington  <hp@pobox.com>
696
697         * dbus-glib-1.pc.in (Requires): fix dependencies, from
698         Anders Gustafsson
699
700 2003-05-04  Havoc Pennington  <hp@pobox.com>
701
702         * tools/dbus-launch.c: implement
703
704         * bus/main.c (main), bus/bus.c (bus_context_new):
705         implement --print-pid and --fork
706
707 2003-05-03  Havoc Pennington  <hp@redhat.com>
708
709         * dbus/dbus-address.c (dbus_parse_address): fix bug when a key in
710         the address had no value, and add to test suite. Fix and
711         regression test from Miloslav Trmac
712
713 2003-05-03  Havoc Pennington  <hp@pobox.com>
714
715         * dbus/dbus-watch.c (dbus_watch_handle): warn and return if a
716         watch is invalid when handled
717
718         * tools/Makefile.am, tools/dbus-launch.c, tools/dbus-launch.1: add
719         dbus-launch utility to launch the bus from a shell script.  Didn't
720         actually implement dbus-launch yet, it's just a placeholder still.
721
722 2003-05-03  Havoc Pennington  <hp@pobox.com>
723
724         * bus/Makefile.am, bus/dbus-daemon-1.1.in: man page for the
725         daemon; also documents daemon config file, so replaces
726         doc/config-file.txt. Corrected some stuff from config-file.txt in
727         the process of moving it.
728
729 2003-05-03  Havoc Pennington  <hp@pobox.com>
730
731         * tools/Makefile.am, tools/dbus-send.1, tools/dbus-monitor.1:
732         add some man pages
733
734 2003-05-03  Colin Walters  <walters@verbum.org>
735
736         * dbus/dbus-sysdeps.c (fill_user_info): Test against
737         DBUS_UID_UNSET to determine whether to do a uid lookup or not.
738
739         * Makefile.am: Update to use new .pc versioning scheme.
740
741 2003-05-02  Havoc Pennington  <hp@redhat.com>
742
743         * bus/system.conf.in: allow send/receive to/from message bus
744         service
745
746 2003-04-30  Havoc Pennington  <hp@redhat.com>
747
748         * configure.in: print a note when building with unit tests and
749         without assertions
750
751 2003-04-30  Havoc Pennington  <hp@redhat.com>
752
753         * Makefile.am: add a check-local that complains if you didn't
754         configure with --enable-tests
755
756 2003-04-29  Havoc Pennington  <hp@redhat.com>
757
758         * glib/dbus-gmain.c: docs cleanups
759
760         * dbus/dbus-types.h: add docs on int64 types
761
762         * dbus/dbus-memory.c: fix docs to avoid putting private API in
763         public API docs section
764
765 2003-04-29  Havoc Pennington  <hp@redhat.com>
766
767         * dbus-1.pc.in, dbus-glib-1.pc.in: rename these from
768         dbus-1.0.pc.in, dbus-glib-1.0.pc.in. As these change with the
769         parallel install API version, not with the D-BUS package version.
770
771         * HACKING: move some of README over here
772
773         * README: updates, and document API/ABI policy
774
775         * configure.in: reindentation
776
777 2003-04-29  Havoc Pennington  <hp@redhat.com>
778
779         * dbus/dbus.h: add "you have to define DBUS_API_SUBJECT_TO_CHANGE
780         to use this library" to be sure people have the right
781         expectations.
782
783 2003-04-28  Havoc Pennington  <hp@redhat.com>
784
785         * configure.in: add --enable-docs which by default is auto yes if
786         doxygen and db2html found, no otherwise; but can be forced on/off
787
788         * doc/Makefile.am: conditionalize whether to build docs on
789         --enable-docs
790
791 2003-04-28  Havoc Pennington  <hp@redhat.com>
792
793         * configure.in: 0.10
794
795         * NEWS: update
796
797         * bus/system.conf.in: add <includedir>system.d</includedir>
798
799         * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when
800         username was provided but not uid
801
802         * bus/config-parser.c (struct BusConfigParser): keep track of
803         whether the parser is toplevel or was included; change some
804         of the error handling if it's included.
805
806 2003-04-27  Havoc Pennington  <hp@pobox.com>
807
808         Unbreak my code...
809
810         * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
811         report correct status if we finish processing authentication
812         inside this function.
813
814         * bus/activation.c (try_send_activation_failure): use
815         bus_transaction_send_error_reply
816
817         * bus/connection.c (bus_connection_get_groups): return an error
818         explaining the problem
819
820         * bus/bus.c (bus_context_check_security_policy): implement
821         restriction here that inactive connections can only send the
822         hello message. Also, allow bus driver to send anything to
823         any recipient.
824
825         * bus/connection.c (bus_connection_complete): create the
826         BusClientPolicy here instead of on-demand.
827         (bus_connection_get_policy): don't return an error
828
829         * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
830         sender field in message being replied to
831
832         * bus/bus.c (bus_context_check_security_policy): fix silly typo
833         causing it to return FALSE always
834
835         * bus/policy.c (bus_client_policy_check_can_send): fix bug where
836         we checked sender rather than destination
837
838 2003-04-25  Havoc Pennington  <hp@redhat.com>
839
840         test suite is slightly hosed at the moment, will fix soon
841
842         * bus/connection.c (bus_connections_expire_incomplete): fix to
843         properly disable the timeout when required
844         (bus_connection_set_name): check whether we can remove incomplete
845         connections timeout after we complete each connection.
846
847         * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
848         probably still broken.
849
850         * bus/services.c (bus_registry_acquire_service): implement max
851         number of services owned, and honor allow/deny rules on which
852         services a connection can own.
853
854         * bus/connection.c (bus_connection_get_policy): report errors here
855
856         * bus/activation.c: implement limit on number of pending
857         activations
858
859 2003-04-25  Havoc Pennington  <hp@redhat.com>
860
861         * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
862         where we used >= 0 instead of != DBUS_UID_UNSET.
863
864 2003-04-25  Havoc Pennington  <hp@redhat.com>
865
866         * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
867         were toggled without add/remove, fix from Anders Gustafsson
868
869 2003-04-24  Havoc Pennington  <hp@redhat.com>
870
871         * test/data/valid-config-files/basic.conf: add <limit> tags to
872         this test
873
874         * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
875         <limit> tag in configuration file.
876
877 2003-04-24  Havoc Pennington  <hp@redhat.com>
878
879         * bus/dispatch.c: somehow missed some name_is
880
881         * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
882         (_dbus_timeout_set_interval): new
883
884         * bus/connection.c (bus_connections_setup_connection): record time
885         when each connection is first set up, and expire them after the
886         auth timeout passes.
887
888 2003-04-24  Havoc Pennington  <hp@redhat.com>
889
890         * dbus/dbus-message.c (dbus_message_name_is): rename
891         (dbus_message_service_is): rename
892         (dbus_message_sender_is): rename
893         (dbus_message_get_service): rename
894
895 2003-04-24  Havoc Pennington  <hp@redhat.com>
896
897         * configure.in: add --enable-checks
898
899         * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
900
901         * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
902         to use thread locks.
903         (_dbus_connection_handler_destroyed_locked): move some private
904         functions into proper docs group
905
906         * dbus/dbus-internals.h: add _dbus_return_if_fail,
907         _dbus_return_val_if_fail
908
909         Throughout: use dbus_return_if_fail
910
911 2003-04-23  James Willcox  <jwillcox@gnome.org>
912
913         * glib/dbus-glib.h:
914         * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source),
915         (dbus_connection_setup_with_g_main),
916         (dbus_server_setup_with_g_main):
917         * glib/test-dbus-glib.c: (main):
918         * glib/test-thread-client.c: (main):
919         * glib/test-thread-server.c: (new_connection_callback), (main):
920         * tools/dbus-monitor.c: (main):
921
922         Added a GMainContext argument to dbus_connection_setup_with_g_main()
923         and dbus_server_setup_with_g_main().
924
925 2003-04-20  Havoc Pennington  <hp@pobox.com>
926
927         * doc/dbus-specification.sgml: document the restrictions on
928         message and service names
929
930 2003-04-22  Havoc Pennington  <hp@redhat.com>
931
932         * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
933         support, and do some code cleanups to share more code and
934         speed up array marshal/demarshal.
935
936         * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
937
938         * configure.in: generate dbus-arch-deps.h
939
940         * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
941         64-bit typecodes
942
943 2003-04-22  Havoc Pennington  <hp@redhat.com>
944
945         * test/data/valid-messages/opposite-endian.message: fix test
946         to use proper type for rply field
947
948         * test/data/invalid-messages: add tests for below validation
949
950         * dbus/dbus-message.c (decode_header_data): validate field types,
951         and validate that named fields are valid names
952         (decode_name_field): consider messages in the
953         org.freedesktop.Local. namespace to be invalid.
954
955         * dbus/dbus-string.c (_dbus_string_validate_name): new
956
957 2003-04-19  Havoc Pennington  <hp@pobox.com>
958
959         * bus/driver.c (bus_driver_handle_hello): check limits and
960         return an error if they are exceeded.
961
962         * bus/connection.c: maintain separate lists of active and inactive
963         connections, and a count of each. Maintain count of completed
964         connections per user. Implement code to check connection limits.
965
966         * dbus/dbus-list.c (_dbus_list_unlink): export
967
968         * bus/bus.c (bus_context_check_security_policy): enforce a maximum
969         number of bytes in the message queue for a connection
970
971 2003-04-18  Havoc Pennington  <hp@pobox.com>
972
973         * dbus/dbus-auth.c (record_mechanisms): memleak fixes
974
975         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
976         memleaks
977
978         * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
979         on realloc be sure to update the pointer in the keyring
980
981         * dbus/dbus-string.c (_dbus_string_zero): compensate for align
982         offset to avoid writing to unallocated memory
983
984         * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
985         try the next mechanism, so we properly handle OOM
986
987         * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
988         on OOM.
989         (_dbus_keyring_new): fix OOM bug
990         (_dbus_keyring_new_homedir): always set error; impose a maximum
991         number of keys we'll load from the file, mostly to speed up the
992         test suite and make its OOM checks more useful, but also for
993         general sanity.
994
995         * dbus/dbus-auth.c (process_error_server): reject authentication
996         if we get an error from the client
997         (process_cancel): on cancel, send REJECTED, per the spec
998         (process_error_client): send CANCEL if we get an error from the
999         server.
1000
1001 2003-04-18  Havoc Pennington  <hp@pobox.com>
1002
1003         * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
1004         debug spew
1005
1006         * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
1007         handling problem
1008
1009         * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
1010         about DBUS_TEST_HOMEDIR once
1011
1012         * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
1013         the environment
1014
1015         * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
1016         config file so we test the right thing
1017
1018         Throughout: assorted docs improvements
1019
1020 2003-04-18  Havoc Pennington  <hp@pobox.com>
1021
1022         * glib/dbus-gmain.c: adapt to watch changes
1023
1024         * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
1025
1026         * dbus/dbus-server.h: remove dbus_server_handle_watch
1027
1028         * dbus/dbus-connection.h: remove dbus_connection_handle_watch
1029
1030         * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
1031         like DBusTimeout, so we don't need dbus_connection_handle_watch
1032         etc.
1033
1034 2003-04-17  Havoc Pennington  <hp@redhat.com>
1035
1036         * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
1037         database usage so it all goes via the DBusUserDatabase cache.
1038
1039 2003-04-17  Havoc Pennington  <hp@redhat.com>
1040
1041         * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix logic so that if
1042         there was an OOM watch we skipped, we always return TRUE so we
1043         iterate again to have a look at it again. Fixes test suite hang.
1044         Code rearrangement also lets us lose some memset and only iterate
1045         over callbacks once.
1046
1047         * bus/driver.c (bus_driver_handle_message): sense of test for
1048         reply was backward
1049
1050 2003-04-16  Havoc Pennington  <hp@pobox.com>
1051
1052         * doc/dbus-specification.sgml: make spec say serials are unsigned
1053
1054         * dbus/dbus-message.h: change message serials to unsigned
1055
1056         * dbus/dbus-connection.c: adapt to message serials being unsigned
1057
1058 2003-04-15  Havoc Pennington  <hp@pobox.com>
1059
1060         * bus/bus.c: create and keep around a shared DBusUserDatabase
1061         object.
1062
1063         * bus/connection.c (bus_connection_get_groups): don't cache
1064         groups for user in the connection object, since user database
1065         object now does that.
1066
1067 2003-04-16  Havoc Pennington  <hp@redhat.com>
1068
1069         * dbus/dbus-message.c (_dbus_message_add_size_counter): keep a
1070         list of size counters
1071         (_dbus_message_loader_putback_message_link): put back a popped link
1072
1073         * dbus/dbus-connection.c
1074         (dbus_connection_set_max_live_messages_size): rename
1075         max_received_size
1076         (dbus_connection_get_outgoing_size): get size of outgoing
1077         queue
1078         (_dbus_connection_set_connection_counter): remove this cruft
1079
1080 2003-04-14  Havoc Pennington  <hp@redhat.com>
1081
1082         * dbus/dbus-userdb.c: user database abstraction, mostly to get
1083         caching, but at some point we might want to be able to use a
1084         different database.
1085
1086         * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses
1087         SHA1 conf file to test the sha1 auth mechanism, since the regular
1088         test always uses EXTERNAL when available.
1089
1090         * configure.in,
1091         test/data/valid-config-files/debug-allow-all-sha1.conf.in:
1092         add conf file that requires use of sha1 auth
1093
1094 2003-04-13  Havoc Pennington  <hp@pobox.com>
1095
1096         * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
1097         from Philip Blundell to send messages and monitor them.
1098
1099 2003-04-13  Havoc Pennington  <hp@pobox.com>
1100
1101         * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
1102         callbacks
1103
1104         * test/data/valid-config-files/debug-allow-all.conf.in: allow all
1105         users
1106
1107         * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
1108         fix to only recover unused bytes if we're already authenticated
1109         (_dbus_transport_get_is_authenticated): fix to still mark us
1110         authenticated if there are unused bytes.
1111
1112         * bus/dispatch.c: implement security policy checking
1113
1114         * bus/connection.c (bus_transaction_send_from_driver): new
1115
1116         * bus/bus.c (bus_context_check_security_policy): new
1117
1118         * bus/dispatch.c (send_service_nonexistent_error): delete this,
1119         now we just set the DBusError and it gets converted to an error
1120         reply.
1121
1122         * bus/connection.c (allow_user_function): enable code using actual
1123         data from the config file
1124
1125         * bus/policy.c (list_allows_user): handle wildcard rules for
1126         user/group connection perms
1127
1128 2003-04-13  Havoc Pennington  <hp@pobox.com>
1129
1130         * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
1131
1132         * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
1133
1134         * bus/policy.c (bus_policy_append_mandatory_rule)
1135         (bus_policy_append_default_rule, bus_policy_append_user_rule)
1136         (bus_policy_append_group_rule): new functions
1137
1138 2003-04-12  Havoc Pennington  <hp@pobox.com>
1139
1140         * bus/config-parser.c (bus_config_parser_new): fix a memleak
1141
1142         * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
1143         the pid/gid/uid, just for paranoia.
1144
1145         * test/break-loader.c (randomly_do_n_things): find a byte
1146         containing a type code, and randomly change it to a different
1147         type code.
1148
1149 2003-04-12  Havoc Pennington  <hp@pobox.com>
1150
1151         * bus/policy.h: change BusPolicy to be the thing from the config
1152         file, and rename old BusPolicy to BusClientPolicy
1153
1154         * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
1155         match change in how policy works
1156
1157         * dbus/dbus-internals.h: mark assert_not_reached as
1158         __attribute((noreturn))__
1159
1160 2003-04-11  Havoc Pennington  <hp@redhat.com>
1161
1162         * doc/dbus-specification.sgml: fix a spot with the wrong name for
1163         the broadcast service. Use boolean return for ServiceExists.
1164
1165 2003-04-11  Havoc Pennington  <hp@redhat.com>
1166
1167         * configure.in: add another directory to look for qt in.
1168
1169 2003-04-11  Havoc Pennington  <hp@redhat.com>
1170
1171         * AUTHORS: add Colin Walters
1172
1173 2003-04-11  Havoc Pennington  <hp@redhat.com>
1174
1175         * NEWS: update
1176
1177         * configure.in: 0.9
1178
1179 2003-04-11  Havoc Pennington  <hp@redhat.com>
1180
1181         * bus/messagebus.in: remove pid file when stopping the
1182         message bus, since the bus won't have privileges to remove it
1183         itself.
1184
1185 2003-04-11  Havoc Pennington  <hp@redhat.com>
1186
1187         * bus/bus.c (bus_context_new): move credentials change after
1188         creating pidfile
1189
1190 2003-04-11  Havoc Pennington  <hp@pobox.com>
1191
1192         * test/decode-gcov.c: add "below average functions" to the
1193         coverage report, and change how some of the code works.
1194
1195         * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
1196         not in the coverage stats.
1197
1198         * test/test-service.c (main): use _dbus_verbose not fprintf in a
1199         couple places so running the test suite doesn't result in megaspam.
1200
1201 2003-04-11  Havoc Pennington  <hp@pobox.com>
1202
1203         * bus/dispatch.c (check_existent_service_activation): accept a no
1204         memory error in a place we didn't before
1205
1206         * bus/test.c (bus_test_run_everything): remove hacky "do it twice
1207         in case the first one failed," since the test suite is less
1208         broken now.
1209
1210 2003-04-10  Havoc Pennington  <hp@pobox.com>
1211
1212         * bus/dispatch.c (check_segfault_service_activation): add test
1213         for launching an executable that just crashes.
1214
1215         * test/test-segfault.c (main): try setting coredumpsize to 0 so we
1216         don't leave a million cores. We'll see how portable this is.
1217
1218 2003-04-10  Havoc Pennington  <hp@pobox.com>
1219
1220         * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
1221         the possible parent failures before we fork, so that we don't
1222         fail to create a babysitter after creating the child.
1223
1224         * bus/activation.c (bus_activation_activate_service): kill child
1225         if we don't successfully complete the activation.
1226
1227 2003-04-10  Havoc Pennington  <hp@redhat.com>
1228
1229         * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
1230         the connection if it's disconnected
1231
1232         * bus/activation.c (bus_activation_service_created): use new
1233         transaction features to roll back removal of pending activation if
1234         we don't successfully create the service after all. Don't remove
1235         pending activation if the function fails.
1236
1237         * dbus/dbus-list.c (_dbus_list_insert_before_link)
1238         (_dbus_list_insert_after_link): new code to facilitate
1239         services.c fixes
1240
1241         * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
1242         new functionality, so we can preallocate the ability to insert
1243         into a hash table.
1244
1245         * bus/connection.c (bus_transaction_add_cancel_hook): new function
1246         allowing us to put custom hooks in a transaction to be used for
1247         cancelling said transaction
1248
1249         * doc/dbus-specification.sgml: add some discussion of secondary
1250         service owners, and disallow zero-length service names
1251
1252         * bus/services.c (bus_registry_acquire_service): new function,
1253         splits out part of bus_driver_handle_acquire_service() and fixes
1254         a bug where we didn't remove the service doing the acquiring
1255         from the secondary queue if we failed to remove the current owner
1256         from the front of the queue.
1257
1258 2003-04-10  Alexander Larsson  <alexl@redhat.com>
1259
1260         * doc/dbus-specification.sgml:
1261         s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
1262
1263 2003-04-10  Alexander Larsson  <alexl@redhat.com>
1264
1265         * bus/.cvsignore:
1266         * glib/.cvsignore:
1267         * test/.cvsignore:
1268         Added files to cvsignore
1269
1270         * dbus/dbus-message.h:
1271         * dbus/dbus-message.c: (dbus_message_iter_get_named):
1272         Make get_named() take two out argument and return a boolean.
1273         (dbus_message_iter_get_args_valist):
1274         Update usage of get_named().
1275         (dbus_message_iter_append_byte):
1276         Fix typo
1277         (dbus_message_iter_append_named)
1278         Fix typo
1279         (message_iter_test), (check_message_handling_type), (_dbus_message_test):
1280         More tests.
1281
1282 2003-04-10  Alexander Larsson  <alexl@redhat.com>
1283
1284         * dbus/dbus-marshal.[ch]:
1285         Add array_type_pos argument to _dbus_marshal_validate_arg.
1286         Let you pass a NULL end_pos to _dbus_marshal_validate_type.
1287
1288         * dbus/dbus-message.[ch]:
1289         Multi-dimensional arrays have full type specification in the
1290         outermost array. Iter code re-arranged to handle this.
1291         Added some more iter tests.
1292
1293         * doc/dbus-specification.sgml:
1294         Add me to authors.
1295         Remove old FIXME.
1296         Update new array encoding description.
1297         Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
1298
1299         * test/data/invalid-messages/array-with-mixed-types.message:
1300         * test/data/valid-messages/array-of-array-of-uint32.message:
1301         Change to the new array format.
1302
1303         * test/data/invalid-messages/too-short-dict.message:
1304         Fix bug in test.
1305
1306         * test/data/valid-messages/recursive-types.message:
1307         Fix up and extend test.
1308
1309 2003-04-10  Havoc Pennington  <hp@pobox.com>
1310
1311         * bus/dispatch.c: lots of fixes
1312
1313         * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
1314         (_dbus_loop_iterate): remove old "quit if no callbacks" code,
1315         that was crack, broke the test service.
1316
1317         * dbus/dbus-transport.c (_dbus_transport_open): fix error
1318         handling to avoid piling up errors if we get a failure on the
1319         first address.
1320
1321         * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
1322         pid in assertion failures.
1323
1324         * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
1325         to some fixed size of file descriptor array. Don't return TRUE
1326         anytime a timeout exists, that led to lots of busy loop silliness
1327         in the tests.
1328
1329 2003-04-09  Havoc Pennington  <hp@redhat.com>
1330
1331         * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
1332         I'd checked this in earlier but hadn't.
1333
1334 2003-04-09  Havoc Pennington  <hp@redhat.com>
1335
1336         * bus/dispatch.c (bus_dispatch_test): get a bit further through
1337         the activation test (man this is getting old!)
1338
1339 2003-04-09  Havoc Pennington  <hp@redhat.com>
1340
1341         * test/test-utils.c: use dispatch status function to fix this up
1342
1343         * bus/connection.c (connection_watch_callback): don't dispatch
1344         from here
1345         (connection_timeout_callback): don't dispatch from here
1346         (bus_connections_setup_connection): set the dispatch status function
1347         (bus_connection_disconnected): unset it
1348
1349         * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function
1350         used to add a connection to be dispatched
1351         (_dbus_loop_iterate): do the dispatching at the end of each
1352         iteration
1353
1354         * dbus/dbus-connection.c
1355         (dbus_connection_set_dispatch_status_function): new function
1356         allowing us to fix up main loop usage
1357         (_dbus_connection_last_unref): free all the various function
1358         user data
1359         (dbus_connection_dispatch): call the DispatchStatusFunction
1360         whenever this function returns
1361         (dbus_connection_handle_watch): call DispatchStatusFunction
1362         (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction
1363         (reply_handler_timeout): call DispatchStatusFunction
1364         (dbus_connection_flush): call DispatchStatusFunction
1365
1366 2003-04-09  Havoc Pennington  <hp@redhat.com>
1367
1368         * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
1369         a memory leak
1370
1371         * bus/dispatch.c (check_service_activated): fix bug in test
1372
1373         * dbus/dbus-mainloop.c (check_timeout): fix this up
1374
1375         * dbus/dbus-internals.c (_dbus_verbose_real): include PID in
1376         verbose output so we can sort out output from different processes,
1377         e.g. in the activation case.
1378
1379 2003-04-08  Colin Walters  <walters@gnu.org>
1380
1381         * bus/bus.c (struct BusContext) [pidfile]: New member, to store
1382         the pid file.
1383         (bus_context_new): Set it.
1384         (bus_context_unref): Use it to delete the pid file.
1385
1386 2003-04-08  Havoc Pennington  <hp@redhat.com>
1387
1388         * test/data/invalid-messages/array-with-mixed-types.message:
1389         regression test that fails for the moment
1390
1391         * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
1392         tests for convenience
1393
1394         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
1395         array of nil, it broke things.
1396
1397         * test/data/invalid-messages/array-of-nil.message: regression test
1398
1399         * test/data/valid-messages/array-of-array-of-uint32.message:
1400         happened to write this so added it to suite
1401
1402 2003-04-08  Havoc Pennington  <hp@redhat.com>
1403
1404         * bus/driver.c (bus_driver_handle_acquire_service): init
1405         retval/reply before checking name
1406
1407         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
1408         recursion depth argument
1409
1410         * dbus/dbus-message.h (struct DBusMessageIter): put some padding
1411         in the public struct for future extension
1412
1413         * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
1414         typo
1415
1416         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
1417         message
1418
1419         * doc/dbus-specification.sgml: fix typo
1420
1421 2003-04-08  Alexander Larsson  <alexl@redhat.com>
1422
1423         Implemented recursive types, named types and new-style iters
1424
1425         * bus/driver.c:
1426         * glib/test-thread-client.c: (thread_func):
1427         * glib/test-thread-server.c: (handle_test_message):
1428         * test/test-service.c: (handle_echo):
1429         Update to new api
1430
1431         * dbus/Makefile.am:
1432         * dbus/dbus-dict.c:
1433         * dbus/dbus-dict.h:
1434         * dbus/dbus.h
1435         Remove DBusDict
1436
1437         * dbus/dbus-internals.c: (_dbus_type_to_string):
1438         Update for new types.
1439
1440         * dbus/dbus-marshal.[ch]:
1441         Implement recursive types and the new marshalling format.
1442         Remove hardcoded dict marshalling.
1443         Marshal named types.
1444
1445         * dbus/dbus-message-builder.c:
1446         Add BYTE_ARRAY.
1447         Remove references to old types
1448
1449         * dbus/dbus-message.[ch]:
1450         New non-refcounted iter API that supports recursive iters.
1451         Use iters for appending, including support for recursive
1452         iters.
1453         Add byte and named type support.
1454         Update everything to new marshalling formats.
1455         Add tests for new API.
1456
1457         * dbus/dbus-protocol.h:
1458         Remove old array types.
1459         Add types: BYTE, ARRAY, DICT, NAMED
1460
1461         * dbus/dbus-string.c:
1462         * dbus/dbus-sysdeps.c:
1463         Make parse_double locale safe.
1464
1465         * dbus/dbus-test-main.c:
1466         Call setlocale.
1467
1468         * dbus/dbus-test.c:
1469         Kill dict test
1470
1471         * doc/dbus-specification.sgml:
1472         Update spec
1473
1474         * test/data/incomplete-messages/missing-body.message:
1475         * test/data/invalid-messages/bad-boolean.message:
1476         * test/data/invalid-messages/bad-boolean-array.message:
1477         * test/data/invalid-messages/boolean-array-length-too-long.message-raw:
1478         * test/data/invalid-messages/boolean-has-no-value.message-raw:
1479         * test/data/invalid-messages/too-short-dict.message:
1480         * test/data/valid-messages/dict-simple.message:
1481         * test/data/valid-messages/dict.message:
1482         * test/data/valid-messages/emptiness.message:
1483         * test/data/valid-messages/lots-of-arguments.message:
1484         * test/data/valid-messages/no-padding.message:
1485         * test/data/valid-messages/recursive-types.message:
1486         Add missing NAME fields
1487         Fix up dicts & arrays
1488
1489         * test/data/invalid-messages/dict-with-nil-value.message:
1490         Removed, this is not invalid anymore.
1491
1492         * test/data/valid-messages/recursive-types.message:
1493         Add new test for deeply recursive types.
1494
1495 2003-04-07  Havoc Pennington  <hp@pobox.com>
1496
1497         * bus/driver.c (bus_driver_handle_acquire_service): return an
1498         error if you try to acquire a service that starts with ':'
1499
1500 2003-04-07  Havoc Pennington  <hp@redhat.com>
1501
1502         * doc/dbus-specification.sgml: require that base service names
1503         start with ':' and that the base service is created/deleted
1504         as first and last things a connection does on the bus
1505
1506         * bus/dispatch.c (check_existent_service_activation): lots more
1507         work on the activation test; it doesn't fully pass yet...
1508
1509         * test/test-service.c (main): fix so we don't memleak the
1510         connection to the message bus
1511         (filter_func): accept a message asking us to exit
1512
1513 2003-04-06  Havoc Pennington  <hp@pobox.com>
1514
1515         * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
1516         from Colin Walters
1517
1518         * configure.in: fixes to Qt detection from Colin Walters
1519
1520         * doc/Makefile.am: Only remove generated docbook dirs if they
1521         exist, from Colin Walters
1522
1523         * dbus/dbus-bus.c: change how we set well-known connections to
1524         NULL, so that it works if a single connection is stored in
1525         two well-known array slots.
1526
1527         * test/Makefile.am: remove a lot of stuff that isn't immediately
1528         useful, it's in CVS history if we want it.
1529
1530         * test/test-service.c: use dbus-mainloop instead of that
1531         watch.[hc] crack
1532
1533 2003-04-06  Havoc Pennington  <hp@pobox.com>
1534
1535         * dbus/Makefile.am: split lists of sources into stuff that goes in
1536         the library, util functions that go in the lib and are also used
1537         elsewhere, and util functions that are used in tests/daemon but
1538         don't go in the lib.
1539
1540         * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
1541         here so it can be used in test binaries also
1542
1543 2003-04-06  Havoc Pennington  <hp@pobox.com>
1544
1545         * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
1546         here in the parent process, so we can return an error if it
1547         fails. Also, move some of the code into the child so the parent
1548         is less hosed if we fail midway through.
1549
1550         * bus/bus.c (bus_context_new): move pidfile detection further up
1551         in the function, before we start overwriting sockets and such.
1552
1553         * bus/messagebus.in: adjust this a bit, not sure if it will work.
1554
1555         * configure.in: add --with-system-pid-file and --with-system-socket
1556
1557 2003-04-06  Colin Walters  <walters@verbum.org>
1558
1559         * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
1560
1561         * bus/system.conf.in: Declare a pidfile.
1562
1563         * bus/bus.c (bus_context_new): Test for an existing pid file, and
1564         create one (if appropriate).
1565
1566         * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
1567         (struct BusConfigParser) [pidfile]: New.
1568         (element_type_to_name, merge_included, start_busconfig_child)
1569         (bus_config_parser_end_element, bus_config_parser_content): Handle it.
1570         (bus_config_parser_unref): Free it.
1571         (bus_config_parser_get_pidfile): New function.
1572
1573         * bus/config-parser.h (_dbus_write_pid_file): Prototype.
1574
1575         * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
1576
1577         * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
1578
1579         * dbus/dbus-sysdeps.h: Prototype it.
1580
1581 2003-04-06  Havoc Pennington  <hp@pobox.com>
1582
1583         * bus/bus.c (bus_context_new): print the address in here, rather
1584         than in main(), because we need to do it before forking the daemon
1585
1586         * bus/dispatch.c (send_service_nonexistent_error): set the sender
1587         on the service nonexistent error
1588
1589         * bus/driver.c (bus_driver_handle_acquire_service): set the
1590         sender on the AcquireService reply
1591
1592         * test/data/valid-config-files/debug-allow-all.conf.in: Make test
1593         server also listen on a UNIX socket so services can connect to it.
1594
1595 2003-04-06  Havoc Pennington  <hp@pobox.com>
1596
1597         * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
1598         so it detects deadlocks and also we actually init threads when
1599         debugging.
1600
1601 2003-04-06  Havoc Pennington  <hp@pobox.com>
1602
1603         * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
1604         save the domain socket name, and unlink it when we disconnect the
1605         server. Means that at least when we exit normally, we won't leave
1606         a bunch of junk in /tmp
1607
1608         * dbus/dbus-transport-unix.c
1609         (_dbus_transport_new_for_domain_socket): code cleanup (nicer
1610         memory management). (I was making a real change here but then
1611         didn't)
1612
1613 2003-04-06  Havoc Pennington  <hp@pobox.com>
1614
1615         * bus/bus.c (bus_context_new): fix wrong handling of
1616         server_data_slot_unref() in the error case.
1617
1618         * dbus/dbus-internals.h (_dbus_assert): change so it passes
1619         "(condition) != 0" to _dbus_real_assert so that
1620         "_dbus_assert (pointer)" doesn't cause a warning
1621
1622         * bus/main.c (main): accept --print-address option to print out
1623         the message bus address
1624
1625         * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
1626
1627         * dbus/dbus-transport.c (_dbus_transport_open): special error for
1628         "tmpdir" option to unix: address on client side
1629
1630         * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
1631         to unix: address
1632
1633         * configure.in (TEST_SOCKET_DIR): locate a temporary directory
1634         we can use to create sockets in the test suite.
1635
1636         * bus/main.c (signal_handler): on SIGTERM, exit the daemon
1637         cleanly. To be used for testing.
1638
1639         * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
1640
1641         * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
1642
1643         * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
1644         handle trying to call this when there's no servers active
1645
1646 2003-04-05  Havoc Pennington  <hp@pobox.com>
1647
1648         * NEWS: update
1649
1650         * configure.in: 0.8
1651
1652 2003-04-05  Havoc Pennington  <hp@pobox.com>
1653
1654         * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
1655         crash on startup. Need to get "try starting the daemon"
1656         in the test suite I guess. ;-)
1657
1658         * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
1659         tracked the number of open connections; it's better done in
1660         application-specific code as you want it to span all servers etc.
1661
1662 2003-04-05  Havoc Pennington  <hp@pobox.com>
1663
1664         * bus/Makefile.am (install-data-hook): add missing DESTDIR,
1665         patch from Colin Walters
1666
1667 2003-04-05  Havoc Pennington  <hp@pobox.com>
1668
1669         * doc/config-file.txt (Elements): fix docs of <auth> to reflect
1670         reality; in fact multiple mechanisms are allowed.
1671
1672         * dbus/dbus-internals.c (_dbus_real_assert)
1673         (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
1674         _dbus_assert_not_reached() into functions, so that they don't show
1675         up in basic block counts for test coverage, and don't use up as
1676         much disk space. Does mean slower execution speed though, so
1677         assumes --disable-asserts is the normal production case.
1678
1679 2003-04-05  Havoc Pennington  <hp@pobox.com>
1680
1681         * test/Makefile.am (dist-hook): also dist *.in files
1682
1683         * NEWS: update
1684
1685         * configure.in: 0.7
1686
1687 2003-04-05  Havoc Pennington  <hp@pobox.com>
1688
1689         * dbus/dbus-string.c: docs warning
1690
1691         * dbus/dbus-spawn.c: missing docs
1692
1693         * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
1694
1695 2003-04-05  Havoc Pennington  <hp@pobox.com>
1696
1697         * bus/loop.c (bus_loop_iterate): fix the timeout code, using
1698         magic from GLib
1699
1700         * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
1701         to -1 once we've reaped the babysitter
1702         (_dbus_babysitter_handle_watch): do as much work as we can, not
1703         just one go of it
1704
1705         * bus/activation.c: add code using DBusBabysitter so that we
1706         handle it when a service fails to start up properly.
1707         (bus_activation_service_created): don't remove the activation
1708         entries as we go, just let them get removed when we free the pending
1709         activation. Unref reply messages after sending them.
1710
1711 2003-04-05  Havoc Pennington  <hp@pobox.com>
1712
1713         * test/decode-gcov.c (main): print per-directory stats in the report
1714
1715         * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
1716
1717 2003-04-05  Havoc Pennington  <hp@pobox.com>
1718
1719         * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
1720
1721         * test/decode-gcov.c: hack up a little program to suck data
1722         out of gcov files. Yes this is sort of silly.
1723
1724         * configure.in: define something in config.h and do an
1725         AM_CONDITIONAL when gcov is enabled
1726
1727 2003-04-04  Havoc Pennington  <hp@redhat.com>
1728
1729         * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
1730         return a "babysitter" object that is used to monitor the status of
1731         the spawned process and reap it when required.
1732
1733         * test/test-segfault.c, test/test-exit.c,
1734         test/test-sleep-forever.c: binaries that do various lame things,
1735         used in the test suite.
1736
1737         * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
1738
1739 2003-04-03  Havoc Pennington  <hp@pobox.com>
1740
1741         * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
1742         in preparation for modifying it, dbus-sysdeps is getting
1743         a bit unmanageable.
1744
1745 2003-04-03  Havoc Pennington  <hp@redhat.com>
1746
1747         * bus/loop.h, bus/loop.c: make the mainloop an object so we can
1748         have multiple ones
1749
1750         * bus/*.[hc]: adapt to mainloop change
1751
1752 2003-04-03  Havoc Pennington  <hp@redhat.com>
1753
1754         * bus/activation.c (load_directory): fix up memleaks
1755         (bus_activation_entry_free): free the entry
1756
1757         * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
1758         we get one from the message bus; fix memleaks.
1759
1760         * dbus/dbus-message.c (dbus_set_error_from_message): new function
1761
1762 2003-04-03  Havoc Pennington  <hp@pobox.com>
1763
1764         * bus/config-parser.c (bus_config_parser_unref): free
1765         list of mechanisms, bug discovered by test suite enhancements
1766         (putting system.conf and session.conf into suite)
1767
1768         * test/Makefile.am, test/test-service.c: add placeholder for a
1769         test service that we'll activate as part of test suite. Doesn't
1770         do anything yet.
1771
1772         * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
1773         setting NULL value, and use system malloc not dbus_malloc()
1774         when we have unavoidable memleakage.
1775
1776         * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
1777         didn't work, and support DBUS_BUS_ACTIVATION.
1778
1779         * bus/activation.c (child_setup): pass our well-known bus type to
1780         the child
1781
1782         * bus/config-parser.c: support <type> to specify well-known type
1783
1784         * doc/dbus-specification.sgml: document the env variables to
1785         locate well-known buses and find service activator
1786
1787 2003-04-02  Havoc Pennington  <hp@redhat.com>
1788
1789         * test/Makefile.am (all-local): add a rule to copy tests to
1790         builddir, so we can have generated tests. Use this to remove the
1791         silly hack for testing system.conf and session.conf. Will use this
1792         shortly to generate .service files pointing to test binaries.
1793
1794 2003-04-02  Havoc Pennington  <hp@redhat.com>
1795
1796         * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
1797         current alloc and needed new length, not max of the doubled
1798         allocation and needed new length. Also, when building tests,
1799         don't do the double-allocation stuff, just realloc every time.
1800
1801 2003-04-02  Havoc Pennington  <hp@redhat.com>
1802
1803         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
1804         in error messages
1805         (_dbus_string_get_dirname): new
1806         (_dbus_sysdeps_test): new
1807         (_dbus_directory_open): include dirnames in error messages
1808
1809         * bus/config-parser.c: interpret <include> and <includedir> and
1810         <servicedir> relative to config file location if the given
1811         filename is not absolute.
1812
1813         * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
1814
1815 2003-04-02  Havoc Pennington  <hp@redhat.com>
1816
1817         * bus/connection.c (bus_transaction_send_error_reply): set sender
1818         service for the error, and unref the reply on success
1819
1820         * bus/activation.c: convert to use BusTransaction so OOM can be
1821         handled correctly
1822         (bus_activation_service_created): set sender of the message
1823
1824 2003-04-01  Havoc Pennington  <hp@redhat.com>
1825
1826         * bus/config-parser.c, bus/bus.c: implement <servicedir> and
1827         <includedir> (at least mostly)
1828
1829         * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
1830         first, then the user ID
1831
1832 2003-04-01  Havoc Pennington  <hp@pobox.com>
1833
1834         * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
1835         function
1836
1837         * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
1838
1839         * dbus/dbus-internals.c (_dbus_dup_string_array): new function
1840
1841         * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
1842         socket 0777, and unlink any existing socket.
1843
1844         * bus/bus.c (bus_context_new): change our UID/GID and fork if
1845         the configuration file so specifies; set up auth mechanism
1846         restrictions
1847
1848         * bus/config-parser.c (bus_config_parser_content): add support
1849         for <fork> option and fill in code for <auth>
1850
1851         * bus/system.conf.in: add <fork/> to default configuration,
1852         and limit auth mechanisms to EXTERNAL
1853
1854         * doc/config-file.txt (Elements): add <fork>
1855
1856         * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
1857         (_dbus_change_identity): new function
1858
1859 2003-03-31  Havoc Pennington  <hp@redhat.com>
1860
1861         * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
1862         (_dbus_listen_unix_socket): fix off-by-one error in null
1863         termination spotted by Nalin
1864
1865 2003-03-31  Havoc Pennington  <hp@redhat.com>
1866
1867         * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
1868         DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
1869         having a real home directory available.
1870
1871 2003-03-31  Havoc Pennington  <hp@redhat.com>
1872
1873         * bus/Makefile.am (install-data-hook): create /var/run/dbus
1874
1875         * bus/messagebus.in: add init script for Red Hat /etc/init.d
1876
1877         * configure.in: add support for specifying a style of init script
1878         to install
1879
1880 2003-03-31  Havoc Pennington  <hp@redhat.com>
1881
1882         Fix some annoying DBusString API and fix all affected code.
1883
1884         * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
1885         max_length argument
1886         (_dbus_string_get_data): change to return string instead of using
1887         an out param
1888         (_dbus_string_get_const_data): ditto
1889         (_dbus_string_get_data_len): ditto
1890         (_dbus_string_get_const_data_len): ditto
1891
1892 2003-03-31  Havoc Pennington  <hp@redhat.com>
1893
1894         * bus/main.c (main): fix up the command line arguments to be nicer
1895
1896 2003-03-31  Havoc Pennington  <hp@redhat.com>
1897
1898         * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
1899         define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
1900         final location that lands in the config file
1901
1902         * bus/config-loader-expat.c (bus_config_load): fix type of
1903         XML_Parser variable
1904
1905         * doc/TODO: remove TODO item for dbus_bus_get()
1906
1907         * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
1908
1909 2003-03-31  Havoc Pennington  <hp@pobox.com>
1910
1911         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
1912         (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
1913         argument since they are always client side
1914
1915         * dbus/dbus-server.c (dbus_server_get_address): new function
1916
1917         * bus/main.c (main): take the configuration file as an argument.
1918
1919         * test/data/valid-config-files/debug-allow-all.conf: new file to
1920         use with dispatch.c tests for example
1921
1922         * bus/test-main.c (main): require test data dir
1923
1924         * bus/bus.c (bus_context_new): change this to take a
1925         configuration file name as argument
1926
1927         * doc/config-file.txt (Elements): add <servicedir>
1928
1929         * bus/system.conf, bus/session.conf: new files
1930
1931         * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
1932         well-known socket if none set
1933
1934         * configure.in: create system.conf and session.conf
1935
1936 2003-03-30  Havoc Pennington  <hp@pobox.com>
1937
1938         * bus/config-parser.c: hacking
1939
1940         * dbus/dbus-memory.c: don't use DBusList for the list of stuff
1941         to shut down, since it could cause weirdness with the DBusList
1942         lock
1943
1944         * dbus/dbus-list.c (_dbus_list_test): add tests for the
1945         link-oriented stack routines
1946         (alloc_link): free the mempool if the first alloc from it fails
1947
1948         * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
1949
1950         * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
1951         from GLib
1952         (_dbus_string_skip_white): new
1953
1954         * doc/config-file.txt (Elements): add <includedir>
1955
1956 2003-03-28  Havoc Pennington  <hp@pobox.com>
1957
1958         * dbus/dbus-string.c (_dbus_string_copy_data_len)
1959         (_dbus_string_copy_data): new functions
1960
1961 2003-03-28  Anders Carlsson  <andersca@codefactory.se>
1962
1963         * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
1964         * dbus/dbus-bus.h:
1965         Add dbus_bus_get.
1966
1967         * dbus/dbus-memory.c:
1968         Fix a doc comment.
1969
1970 2003-03-28  Havoc Pennington  <hp@pobox.com>
1971
1972         * bus/test.c (bus_test_flush_bus): remove the sleep from here,
1973         I think it may have just been superstition. Not sure.
1974
1975         * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
1976         failures that were not being handled.
1977
1978         * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
1979
1980         * dbus/dbus-memory.c: add ability to set number of mallocs in a
1981         row that will fail on out-of-memory.
1982
1983         * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
1984         function for testing out-of-memory handling.
1985
1986         * bus/config-loader-expat.c (memsuite): don't wrap the dbus
1987         allocation functions, they do map exactly to the expat ones.
1988
1989 2003-03-27  Havoc Pennington  <hp@redhat.com>
1990
1991         * bus/config-loader-libxml.c (bus_config_load): add another error
1992         check
1993
1994 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
1995
1996         * doc/TODO:
1997         Add note about automatic service activation.
1998
1999         * doc/dbus-specification.sgml:
2000         Rename the specification and clarify a few things.
2001
2002 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
2003
2004         * Doxyfile.in:
2005         * dbus/dbus-address.c:
2006         * dbus/dbus-dict.c:
2007         * dbus/dbus-marshal.c:
2008         * dbus/dbus-server-debug-pipe.c:
2009         * dbus/dbus-transport-unix.c:
2010         Fix documentation warnings.
2011
2012 2003-03-26  Havoc Pennington  <hp@pobox.com>
2013
2014         * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
2015         after every test so it's quick and easy to see which leaked, and
2016         so we test multiple dbus_shutdown() calls
2017
2018         * configure.in: change configure.in XML stuff to also support
2019         expat
2020
2021         * config-loader-libxml.c: some hacking
2022
2023         * config-loader-expat.c: some hacking
2024
2025         * config-parser.c: some hacking, plus tests
2026
2027 2003-03-25  Havoc Pennington  <hp@redhat.com>
2028
2029         * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
2030
2031         * configure.in: add --with-xml option to specify XML library,
2032         right now only libxml is supported.
2033
2034         * bus/config-loader-libxml.c, config-parser.c: sync some minor
2035         nonworking code between home and work, still just stubs
2036
2037 2003-03-24  Havoc Pennington  <hp@redhat.com>
2038
2039         * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
2040         file
2041
2042         * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
2043         NULL argument for "message" if the error is a well-known one,
2044         fill in a generic message in this case.
2045
2046         * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
2047         favor of DBusError
2048
2049         * bus/test.c (bus_test_flush_bus): add
2050
2051         * bus/policy.c (bus_policy_test): test code stub
2052
2053 2003-03-24  Havoc Pennington  <hp@pobox.com>
2054
2055         * bus/connection.c (bus_connections_setup_connection): set up
2056         the "can this user connect" function, but it always returns
2057         TRUE until we have a config file parser so we can have a config
2058         file that allows connections.
2059
2060 2003-03-23  Havoc Pennington  <hp@pobox.com>
2061
2062         * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
2063         DBUS_BUILD_TESTS, actually alloc/free a block of memory for
2064         the mutex, so we can check for proper memory management
2065         and OOM handling.
2066
2067         * dbus/dbus-dataslot.c: remove the mutex from
2068         DBusDataSlotAllocator and lock it manually when using it,
2069         to simplify fitting it into the global slots framework.
2070
2071         * dbus/dbus-threads.c (init_static_locks): rework how we're
2072         handling global locks so they are easily shut down.
2073
2074         * bus/policy.c (bus_policy_append_rule): fix
2075
2076         * bus/test-main.c (main): check for memleaks
2077
2078         * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
2079         test suite check for memleaks
2080
2081         * dbus/dbus-memory.c: add support in test mode for tracking
2082         number of outstanding blocks
2083
2084 2003-03-23  Havoc Pennington  <hp@pobox.com>
2085
2086         * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
2087         policies code
2088
2089         * dbus/dbus-hash.h: add ULONG hash keys
2090
2091         * dbus/dbus-sysdeps.c (_dbus_get_groups): new
2092         (_dbus_get_group_id): new function
2093
2094 2003-03-20  Havoc Pennington  <hp@redhat.com>
2095
2096         * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
2097         new function
2098         (dbus_connection_get_unix_user): new function
2099
2100 2003-03-20  Havoc Pennington  <hp@pobox.com>
2101
2102         * bus/connection.c (bus_connection_send_oom_error): assert that
2103         message has a sender
2104         (connection_execute_transaction): ditto
2105         (bus_connection_preallocate_oom_error): fix to set the sender, and
2106         set recipient to the destination service, not the bus driver
2107
2108         * bus/policy.c: hacking
2109
2110         * dbus/dbus-message.c (dbus_message_service_is): new function
2111         (dbus_message_sender_is): new
2112
2113 2003-03-19  Havoc Pennington  <hp@redhat.com>
2114
2115         * bus/policy.c: start sketching code for policy restrictions on
2116         what connections can do.
2117
2118 2003-03-18  Havoc Pennington  <hp@redhat.com>
2119
2120         * doc/TODO: some notes on high-level todo items. Little nitpick
2121         stuff is all in @todo, so no need to add it here.
2122
2123         * doc/config-file.txt: some notes on how config file might look
2124
2125 2003-03-18  Anders Carlsson  <andersca@codefactory.se>
2126
2127         * configure.in: 0.6
2128
2129         * NEWS: Update.
2130
2131 2003-03-17  Havoc Pennington  <hp@redhat.com>
2132
2133         * dbus/dbus-internals.h: add gcc attributes so that
2134         our printf-style functions warn on bad arguments to
2135         format
2136
2137         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
2138         format bug
2139
2140         * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
2141         printf format bug
2142
2143 2003-03-17  Havoc Pennington  <hp@redhat.com>
2144
2145         * bus/test-main.c (main): make it print something as it runs
2146         so make check doesn't look stuck
2147
2148         * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
2149         from CVS, now obsolete
2150
2151 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
2152
2153         * bus/dispatch.c: (bus_dispatch):
2154         Refetch the service name since it may have been reallocated
2155         when dbus_message_set_sender was called.
2156
2157         * dbus/dbus-sysdeps.c: (_dbus_accept):
2158         Add address and address length variables and use them to stop
2159         valgrind from complaining.
2160
2161 2003-03-17  Havoc Pennington  <hp@pobox.com>
2162
2163         All tests pass, no memleaks, no valgrind complaints.
2164
2165         * bus/test.c: refcount handler_slot
2166
2167         * bus/connection.c (bus_connections_new): refcount
2168         connection_data_slot
2169
2170         * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
2171         bytes so that auth scripts pass.
2172
2173         * bus/dispatch.c: init message_handler_slot so it gets allocated
2174         properly
2175
2176         * bus/dispatch.c (message_handler_slot_ref): fix memleak
2177
2178         * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
2179         dealloc server_pipe_hash when no longer used for benefit of
2180         leak checking
2181
2182         * dbus/dbus-auth.c (process_command): memleak fix
2183
2184         * bus/dispatch.c (check_hello_message): memleak fix
2185
2186 2003-03-16  Havoc Pennington  <hp@pobox.com>
2187
2188         * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
2189
2190 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
2191
2192         * bus/activation.c (bus_activation_activate_service): Append
2193         the pending activation entry to the list of pending activations.
2194
2195 2003-03-16  Havoc Pennington  <hp@pobox.com>
2196
2197         * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
2198         connections
2199
2200         * dbus/dbus-address.c (create_entry): fix OOM handling when
2201         failing to alloc entry->method
2202
2203 2003-03-16  Havoc Pennington  <hp@pobox.com>
2204
2205         * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
2206         the watch
2207
2208         * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
2209         add some missing dbus_set_result
2210
2211         * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
2212         alloc the DBusMessageHandler
2213
2214         * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
2215         the transport here, since we call this from the finalizer; it
2216         resulted in a double-finalize.
2217
2218         * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
2219         where we tried to use transport->connection that was NULL,
2220         happened when transport was disconnected early on due to OOM
2221
2222         * bus/*.c: adapt to handle OOM for watches/timeouts
2223
2224         * dbus/dbus-transport-unix.c: port to handle OOM during
2225         watch handling
2226
2227         * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
2228         reference to unused bytes instead of a copy
2229
2230         * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
2231         out of memory
2232
2233         * dbus/dbus-connection.c (dbus_connection_handle_watch): return
2234         FALSE on OOM
2235
2236         * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
2237         of memory
2238
2239 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
2240
2241         * doc/dbus-specification.sgml:
2242         Document reply message for ActivateService.
2243
2244 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
2245
2246         * bus/activation.c: (bus_pending_activation_entry_free),
2247         (bus_pending_activation_free), (bus_activation_new),
2248         (bus_activation_unref), (bus_activation_service_created),
2249         (bus_activation_activate_service):
2250         * bus/activation.h:
2251         * bus/bus.c: (bus_context_new):
2252         * bus/desktop-file.c: (new_section):
2253         * bus/driver.c: (bus_driver_send_service_deleted),
2254         (bus_driver_handle_activate_service):
2255         * bus/services.c: (bus_registry_new), (bus_registry_ensure):
2256         * bus/services.h:
2257         * dbus/dbus-connection.c:
2258         (dbus_connection_send_with_reply_and_block):
2259         * dbus/dbus-message.c: (dbus_message_append_args_valist):
2260         * dbus/dbus-protocol.h:
2261         Make activation work better. Now pending activations will be queued
2262         and the daemon won't try to activate services that are already registered.
2263
2264 2003-03-16  Havoc Pennington  <hp@pobox.com>
2265
2266         * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
2267         connection data
2268
2269         * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
2270         DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
2271
2272 2003-03-16  Havoc Pennington  <hp@pobox.com>
2273
2274         * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
2275         this. always run the test suite before commit...
2276
2277         * bus/*: adapt to DBusConnection API changes
2278
2279         * glib/dbus-gmain.c: adapt to DBusConnection API changes,
2280         requires renaming stuff to avoid dbus_connection_dispatch name
2281         conflict.
2282
2283         * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
2284         function
2285
2286         * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
2287         separate from _dbus_message_loader_return_buffer()
2288
2289         * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
2290         this, because it's now always broken to use; the number of
2291         messages in queue vs. the number still buffered by the message
2292         loader is undefined/meaningless. Should use
2293         dbus_connection_get_dispatch_state().
2294         (dbus_connection_dispatch): rename from
2295         dbus_connection_dispatch_message
2296
2297 2003-03-16  Havoc Pennington  <hp@pobox.com>
2298
2299         * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
2300         implementation
2301
2302 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
2303
2304         * dbus/dbus-connection.c:
2305         (dbus_connection_send_with_reply_and_block):
2306         Decrease connection->n_incoming when removing an entry
2307         from the list.
2308         * dbus/dbus-dict.c: (dbus_dict_entry_free),
2309         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
2310         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
2311         (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
2312         (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
2313         (dbus_dict_get_byte_array):
2314         Handle NULL arrays and strings. Also add support for byte arrays.
2315
2316         * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
2317         (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
2318         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2319         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2320         (_dbus_demarshal_dict), (demarshal_and_validate_len),
2321         (_dbus_marshal_validate_arg), (_dbus_marshal_test):
2322         * dbus/dbus-marshal.h:
2323         Add support for marshalling and demarshalling empty arrays and strings.
2324
2325         * dbus/dbus-message.c: (dbus_message_append_args_valist),
2326         (dbus_message_append_string_array),
2327         (dbus_message_iter_get_boolean),
2328         (dbus_message_iter_get_boolean_array),
2329         (dbus_message_iter_get_int32_array),
2330         (dbus_message_iter_get_uint32_array),
2331         (dbus_message_iter_get_double_array),
2332         (dbus_message_iter_get_byte_array),
2333         (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
2334         (check_message_handling):
2335         Add support for getting empty arrays and dicts.
2336
2337         * dbus/dbus-string.c: (_dbus_string_validate_utf8):
2338         Don't do any validation at all for now, that's better than just checking
2339         for ASCII.
2340
2341         * test/data/valid-messages/emptiness.message:
2342         New test message with lots of empty arrays.
2343
2344 2003-03-16  Havoc Pennington  <hp@pobox.com>
2345
2346         * dbus/dbus-connection.c
2347         (_dbus_connection_queue_received_message_link): new function that
2348         can't fail due to OOM
2349
2350         * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
2351         new function pops a message together with a list link
2352         containing it.
2353
2354         * dbus/dbus-transport-unix.c (queue_messages): use new link-based
2355         message queuing functions to avoid needing to alloc memory
2356
2357 2003-03-16  Havoc Pennington  <hp@pobox.com>
2358
2359         Oops - test code was only testing failure of around 30 of the
2360         mallocs in the test path, but it turns out there are 500+
2361         mallocs. I believe this was due to misguided linking setup such
2362         that there was one copy of dbus_malloc etc. in the daemon and one
2363         in the shared lib, and only daemon mallocs were tested. In any
2364         case, the test case now tests all 500+ mallocs, and doesn't pass
2365         yet, though there are lots of fixes in this patch.
2366
2367         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
2368         this so that it doesn't need to allocate memory, since it
2369         has no way of indicating failure due to OOM (and would be
2370         annoying if it did).
2371
2372         * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
2373
2374         * bus/Makefile.am: rearrange to create two self-contained
2375         libraries, to avoid having libraries with overlapping symbols.
2376         that was resulting in weirdness, e.g. I'm pretty sure there
2377         were two copies of global static variables.
2378
2379         * dbus/dbus-internals.c: move the malloc debug stuff to
2380         dbus-memory.c
2381
2382         * dbus/dbus-list.c (free_link): free list mempool if it becomes
2383         empty.
2384
2385         * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
2386
2387         * dbus/dbus-address.c (dbus_parse_address): free list nodes
2388         on failure.
2389
2390         * bus/dispatch.c (bus_dispatch_add_connection): free
2391         message_handler_slot when no longer using it, so
2392         memory leak checkers are happy for the test suite.
2393
2394         * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
2395
2396         * bus/bus.c (new_connection_callback): disconnect in here if
2397         bus_connections_setup_connection fails.
2398
2399         * bus/connection.c (bus_connections_unref): fix to free the
2400         connections
2401         (bus_connections_setup_connection): if this fails, don't
2402         disconnect the connection, just be sure there are no side
2403         effects.
2404
2405         * dbus/dbus-string.c (undo_alignment): unbreak this
2406
2407         * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
2408         leaking
2409         (_dbus_auth_new): fix the order in which we free strings
2410         on OOM failure
2411
2412         * bus/connection.c (bus_connection_disconnected): fix to
2413         not send ServiceDeleted multiple times in case of memory
2414         allocation failure
2415
2416         * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
2417         get the base service name
2418         (dbus_bus_register_client): don't return base service name,
2419         instead store it on the DBusConnection and have an accessor
2420         function for it.
2421         (dbus_bus_register_client): rename dbus_bus_register()
2422
2423         * bus/dispatch.c (check_hello_message): verify that other
2424         connections on the bus also got the correct results, not
2425         just the one sending hello
2426
2427 2003-03-15  Havoc Pennington  <hp@pobox.com>
2428
2429         Make it pass the Hello handling test including all OOM codepaths.
2430         Now to do other messages...
2431
2432         * bus/services.c (bus_service_remove_owner): fix crash when
2433         removing owner from an empty list of owners
2434         (bus_registry_ensure): don't leave service in the list of
2435         a connection's owned services if we fail to put the service
2436         in the hash table.
2437
2438         * bus/connection.c (bus_connection_preallocate_oom_error): set
2439         error flag on the OOM error.
2440
2441         * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
2442         handle _dbus_transport_set_connection failure
2443
2444         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
2445         to create watches up front and simply enable/disable them as
2446         needed.
2447         (unix_connection_set): this can now fail on OOM
2448
2449         * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
2450         of enabling/disabling a watch or timeout.
2451
2452         * bus/loop.c (bus_loop_iterate): don't touch disabled
2453         watches/timeouts
2454
2455         * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
2456
2457 2003-03-15  Havoc Pennington  <hp@pobox.com>
2458
2459         * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
2460         write useful test code, after all that futzing around ;-)
2461
2462         Test does not yet pass because we can't handle OOM in
2463         _dbus_transport_messages_pending (basically,
2464         dbus_connection_preallocate_send() does not prealloc the write
2465         watch). To fix this, I think we need to add new stuff to
2466         set_watch_functions, namely a SetEnabled function so we can alloc
2467         the watch earlier, then enable it later.
2468
2469         * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
2470         dbus-memory.c to the convenience lib
2471
2472         * bus/test.c: rename some static functions to keep them clearly
2473         distinct from stuff in connection.c. Handle client disconnection.
2474
2475 2003-03-14  Havoc Pennington  <hp@pobox.com>
2476
2477         * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
2478         transport, tests more of the real codepath. Set up clients
2479         with bus_setup_debug_client.
2480
2481         * bus/test.c (bus_setup_debug_client): function to set up debug
2482         "clients" on the main loop
2483
2484         * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
2485         support
2486
2487         * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
2488         server type
2489
2490         * dbus/dbus-server-debug.c: support a debug server based on pipes
2491
2492         * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
2493         (_dbus_close): new function
2494
2495         * configure.in: check for socketpair
2496
2497 2003-03-14  Havoc Pennington  <hp@redhat.com>
2498
2499         * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
2500         cheesy hack
2501
2502         * dbus/dbus-transport-debug.c: rework this a good bit to be
2503         less complicated. hopefully still works.
2504
2505         * dbus/dbus-server-debug.c (handle_new_client): remove timeout
2506         manually
2507
2508         * glib/dbus-gmain.c (timeout_handler): don't remove timeout
2509         after running it
2510
2511         * dbus/dbus-message.c (dbus_message_copy): rename from
2512         dbus_message_new_from_message, fix it up to copy
2513         all the message fields, add test case
2514
2515         * bus/dispatch.c (bus_dispatch_test): add some more test code,
2516         not quite passing yet
2517
2518 2003-03-14  Havoc Pennington  <hp@pobox.com>
2519
2520         * bus/loop.c (bus_loop_iterate): add this so we can "run loop
2521         until no work remains" in test code. (the large diff here
2522         is just code movement, no actual changes)
2523
2524         * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
2525         1, no point waiting around for test code.
2526         (_dbus_server_debug_accept_transport): unref the timeout
2527         after adding it (right?)
2528
2529         * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
2530
2531 2003-03-13  Havoc Pennington  <hp@redhat.com>
2532
2533         * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
2534         out of memory
2535
2536         * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
2537         of memory
2538
2539         * dbus/dbus-connection.h: Make AddWatchFunction and
2540         AddTimeoutFunction return a bool so they can fail on out-of-memory
2541
2542         * bus/bus.c (bus_context_new): set up timeout handlers
2543
2544         * bus/connection.c (bus_connections_setup_connection): set up
2545         timeout handlers
2546
2547         * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
2548         can fail
2549
2550         * bus/bus.c (bus_context_new): adapt to changes
2551
2552         * bus/connection.c: adapt to changes
2553
2554         * test/watch.c: adapt to DBusWatch changes
2555
2556         * bus/dispatch.c (bus_dispatch_test): started adding this but
2557         didn't finish
2558
2559 2003-03-14  Anders Carlsson  <andersca@codefactory.se>
2560
2561         * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
2562
2563 2003-03-13  Havoc Pennington  <hp@pobox.com>
2564
2565         * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
2566         set up a test framework as for the library
2567
2568 2003-03-12  Havoc Pennington  <hp@pobox.com>
2569
2570         Throughout: purge global variables, introduce BusActivation,
2571         BusConnections, BusRegistry, etc. objects instead.
2572
2573         * bus/bus.h, bus/bus.c: introduce BusContext as a global
2574         message bus object
2575
2576         * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
2577         going to redo this a bit differently I think
2578
2579 2003-03-12  Havoc Pennington  <hp@redhat.com>
2580
2581         Mega-patch that gets the message bus daemon initially handling
2582         out-of-memory. Work still needed. Also lots of random
2583         moving stuff to DBusError instead of ResultCode.
2584
2585         * dbus/dbus-list.c (_dbus_list_length_is_one): new function
2586
2587         * dbus/dbus-connection.c
2588         (dbus_connection_send_with_reply_and_block): use DBusError
2589
2590         * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
2591         DBusResultCode
2592
2593         * dbus/dbus-connection.c (dbus_connection_send): drop the result
2594         code here, as the only failure possible is OOM.
2595
2596         * bus/connection.c (bus_connection_disconnect):
2597         rename bus_connection_disconnected as it's a notification only
2598
2599         * bus/driver.c (bus_driver_handle_acquire_service): don't free
2600         "name" on get_args failure, should be done by get_args;
2601         don't disconnect client for bad args, just return an error.
2602         (bus_driver_handle_service_exists): ditto
2603
2604         * bus/services.c (bus_services_list): NULL-terminate returned array
2605
2606         * bus/driver.c (bus_driver_send_service_lost)
2607         (bus_driver_send_service_acquired): send messages from driver to a
2608         specific client to the client's unique name, not to the broadcast
2609         service.
2610
2611         * dbus/dbus-message.c (decode_header_data): reject messages that
2612         contain no name field
2613         (_dbus_message_get_client_serial): rename to
2614         dbus_message_get_serial and make public
2615         (_dbus_message_set_serial): rename from set_client_serial
2616         (_dbus_message_set_reply_serial): make public
2617         (_dbus_message_get_reply_serial): make public
2618
2619         * bus/connection.c (bus_connection_foreach): allow stopping
2620         iteration by returning FALSE from foreach function.
2621
2622         * dbus/dbus-connection.c (dbus_connection_send_preallocated)
2623         (dbus_connection_free_preallocated_send)
2624         (dbus_connection_preallocate_send): new API for sending a message
2625         without possibility of malloc failure.
2626         (dbus_connection_send_message): rename to just
2627         dbus_connection_send (and same for whole function family)
2628
2629         * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
2630
2631         * dbus/dbus-sysdeps.c (_dbus_exit): new function
2632
2633         * bus/activation.c: handle/return errors
2634
2635         * dbus/dbus-errors.h: add more DBUS_ERROR #define
2636
2637         * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
2638         (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
2639         (_dbus_result_from_errno): move to this file
2640
2641 2003-03-10  Anders Carlsson  <andersca@codefactory.se>
2642
2643         * dbus/dbus-marshal.c:
2644         (_dbus_marshal_set_string):
2645         Take a length argument so we can marshal the correct string
2646         length.
2647
2648         (_dbus_marshal_dict), (_dbus_demarshal_dict),
2649         (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
2650         (_dbus_marshal_test):
2651         * dbus/dbus-marshal.h:
2652         Add support for marshalling and demarshalling dicts.
2653
2654         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2655         Add support for TYPE DICT.
2656
2657         * dbus/dbus-message.c: (set_string_field):
2658         Adjust header padding.
2659
2660         (dbus_message_append_args_valist), (dbus_message_append_dict),
2661         (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
2662         (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
2663         (check_message_handling), (check_have_valid_message):
2664         * dbus/dbus-message.h:
2665         Add functions for setting and getting dicts.
2666
2667         * dbus/dbus-protocol.h:
2668         Add DBUS_TYPE_DICT.
2669
2670         * dbus/dbus.h:
2671         Add dbus-dict.h
2672
2673         * doc/dbus-specification.sgml:
2674         Add information about how dicts are marshalled.
2675
2676         * test/data/invalid-messages/dict-with-nil-value.message:
2677         * test/data/invalid-messages/too-short-dict.message:
2678         * test/data/valid-messages/dict-simple.message:
2679         * test/data/valid-messages/dict.message:
2680         Add sample messages containing dicts.
2681
2682 2003-03-08  Anders Carlsson  <andersca@codefactory.se>
2683
2684         * dbus/dbus-dict.h: Add DBUS_END_DECLS.
2685
2686 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
2687
2688         * dbus/Makefile.am:
2689         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
2690         (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
2691         (dbus_dict_set_int32), (dbus_dict_set_uint32),
2692         (dbus_dict_set_double), (dbus_dict_set_string),
2693         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
2694         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
2695         (dbus_dict_set_string_array), (_dbus_dict_test):
2696         * dbus/dbus-dict.h:
2697         Fix according to comments from Havoc.
2698
2699 2003-03-06  Michael Meeks  <michael@server.home>
2700
2701         * configure.in: if we don't have kde-config, disable have_qt.
2702
2703 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
2704
2705         * dbus/Makefile.am:
2706         Add dbus-dict.[ch]
2707
2708         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
2709         (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
2710         (dbus_dict_remove), (dbus_dict_get_value_type),
2711         (dbus_dict_get_keys), (dbus_dict_put_boolean),
2712         (dbus_dict_put_int32), (dbus_dict_put_uint32),
2713         (dbus_dict_put_double), (dbus_dict_put_string),
2714         (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
2715         (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
2716         (dbus_dict_put_string_array), (dbus_dict_get_boolean),
2717         (dbus_dict_get_int32), (dbus_dict_get_uint32),
2718         (dbus_dict_get_double), (dbus_dict_get_string),
2719         (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
2720         (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
2721         (dbus_dict_get_string_array), (_dbus_dict_test):
2722         * dbus/dbus-dict.h:
2723         Add DBusDict implementation
2724
2725         * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
2726         * dbus/dbus-test.h:
2727         Add _dbus_dict_test
2728
2729 2003-03-04  Havoc Pennington  <hp@pobox.com>
2730
2731         * test/data/auth/*: adapt to changes
2732
2733         * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
2734         USERID_BASE64 and change USERNAME_BASE64 to put in username not
2735         userid
2736
2737         * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
2738         more stuff from being in a context name, to make the protocol
2739         simpler to deal with
2740
2741         * dbus/dbus-errors.c (dbus_error_has_name): new function
2742         (dbus_error_is_set): new function
2743
2744         * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
2745         with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
2746
2747         * dbus/dbus-connection.c (dbus_connection_flush): also read
2748         messages during a flush operation
2749
2750         * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
2751
2752 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
2753
2754         * configure.in: Check for gethostbyname on Solaris.
2755
2756         * dbus/dbus-transport.c: (_dbus_transport_open):
2757         Remove duplicate "tcp" entry.
2758
2759         * doc/dbus-specification.sgml:
2760         Clarify some things.
2761
2762 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
2763
2764         * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
2765         * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
2766         (_dbus_keyring_test):
2767         * dbus/dbus-md5.c: (_dbus_md5_compute):
2768         * dbus/dbus-sha.c: (_dbus_sha_compute):
2769         Plug memory leaks.
2770
2771 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
2772
2773         * README: Add some things.
2774
2775 2003-03-04  Anders Carlsson  <andersca@codefactory.se>
2776
2777         * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
2778         after case DBUS_TYPE_BOOELAN.
2779
2780 2003-03-02  Havoc Pennington  <hp@pobox.com>
2781
2782         * test/break-loader.c (randomly_set_extreme_ints): add test that
2783         sets really huge and small integers
2784
2785         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
2786         that length of boolean array fits in the string, and that
2787         string has room for boolean value in single-bool case.
2788
2789         * dbus/dbus-message-builder.c (_dbus_message_data_load): add
2790         optional value to "ALIGN" command which is what to fill the
2791         alignment with.
2792
2793         * test/data/valid-messages/no-padding.message: add regression
2794         test for the message padding problem
2795
2796 2003-03-02  Havoc Pennington  <hp@pobox.com>
2797
2798         * dbus/dbus-message.c (decode_header_data): fix to always init
2799         message_padding, from Benjamin Dauvergne
2800
2801 2003-03-02  Havoc Pennington  <hp@pobox.com>
2802
2803         * configure.in: 0.5
2804
2805         * NEWS: Update.
2806
2807 2003-03-01  Joe Shaw  <joe@assbarn.com>
2808
2809         * configure.in: Check for "struct cmsgcred" and try to access its
2810         members for BSD-like unices.
2811
2812         * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
2813         _dbus_read_credentials_unix_socket().
2814         (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
2815         read() for reading the credential byte off the unix socket.  Use
2816         struct cmsgcred on systems that support it.
2817
2818 2003-02-27  Alexander Larsson  <alexl@redhat.com>
2819
2820         * glib/Makefile.am:
2821         * configure.in:
2822         Make gthreads-2.0 dependency optional. Don't build thread test if
2823         its not found.
2824
2825 2003-02-27  Havoc Pennington  <hp@pobox.com>
2826
2827         * dbus/dbus-connection.c
2828         (dbus_connection_send_message_with_reply_and_block): fix doh!
2829         doh! doh! bug that resulted in never removing a reply from the
2830         queue, no wonder we called get_reply_serial so much ;-)
2831
2832         * dbus/dbus-message.c (struct DBusMessage): cache reply serial
2833         and client serial instead of demarshaling them every time
2834
2835 2003-02-27  Havoc Pennington  <hp@pobox.com>
2836
2837         * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
2838         more inlined, using dbus-string-private.h, speeds things up
2839         substantially
2840
2841         * dbus/dbus-string.c (_dbus_string_free): apply align offset
2842         when freeing the string
2843         (_dbus_string_steal_data): fix for align offset
2844         (undo_alignment): new function
2845
2846 2003-02-26  Havoc Pennington  <hp@redhat.com>
2847
2848         All kinds of audit fixes from Owen, plus initial attempt to
2849         handle unaligned memory returned from malloc.
2850
2851         * dbus/dbus-string.c (_dbus_string_init): clamp max length to
2852         leave room for align_offset and nul byte
2853         (fixup_alignment): function to track an align_offset and
2854         ensure real->str is aligned
2855         (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
2856         to allow a nul byte plus align offset
2857         (_dbus_string_lock): fix overflow issue
2858         (_dbus_string_init_const_len): add assertions on sanity of len,
2859         assign allocated to be ALLOCATION_PADDING larger than len
2860         (set_length): fixup the overflow handling
2861         (_dbus_string_get_data_len): fix overflow in assertion
2862         (open_gap): detect overflow in size of gap to be opened
2863         (_dbus_string_lengthen): add overflow check
2864         (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
2865         (_dbus_string_append): add overflow check
2866         (_dbus_string_append_unichar): overflow
2867         (_dbus_string_delete): fix overflow in assertion
2868         (_dbus_string_copy_len): overflow in assertion
2869         (_dbus_string_replace_len): overflows in assertions
2870         (_dbus_string_find): change to implement in terms of
2871         _dbus_string_find_to
2872         (_dbus_string_find_to): assorted fixage
2873         (_dbus_string_equal_c_str): assert c_str != NULL,
2874         fix logic so the function works
2875         (_dbus_string_ends_with_c_str): fix overflow thingy
2876         (_dbus_string_base64_encode): overflow fix
2877         (_dbus_string_validate_ascii): overflow
2878         (_dbus_string_validate_nul): overflow
2879
2880 2003-02-26  Havoc Pennington  <hp@redhat.com>
2881
2882         * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
2883
2884 2003-02-26  Alexander Larsson  <alexl@redhat.com>
2885
2886         * configure.in:
2887         Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
2888
2889         * dbus/dbus-connection.c:
2890         * dbus/dbus-connection.h:
2891         Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
2892         Add dbus_connection_set_wakeup_main_function and use it when queueing
2893         incoming and outgoing messages.
2894
2895
2896         * dbus/dbus-dataslot.c:
2897         Threadsafe usage of DBusDataSlotAllocator
2898
2899         * dbus/dbus-message.c: (dbus_message_get_args_iter):
2900         dbus_new can fail.
2901
2902         * dbus/dbus-server-unix.c:
2903         Add todo comment
2904
2905         * glib/dbus-gmain.c:
2906         Implement the new wakeup functions for glib.
2907
2908         * glib/Makefile.am:
2909         * glib/test-thread-client.c:
2910         * glib/test-thread-server.c:
2911         * glib/test-thread.h:
2912         Initial cut at some thread test code. Not really done yet.
2913
2914 2003-02-26  Havoc Pennington  <hp@pobox.com>
2915
2916         * dbus/dbus-connection.c
2917         (dbus_connection_send_message_with_reply_and_block): fix crash
2918         where we ref'd the outgoing message instead of the returned reply
2919
2920         * dbus/dbus-transport-unix.c (do_authentication): check read watch
2921         at the end of this function, so if we didn't need to read for
2922         authentication, we reinstall it for receiving messages
2923
2924         * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
2925         a NULL sender for peer-to-peer case
2926
2927         * dbus/dbus-transport-unix.c (check_read_watch): handle
2928         !authenticated case correctly
2929
2930         * glib/dbus-gmain.c: add support for DBusServer
2931
2932         * dbus/dbus-server.c: add data slot support
2933
2934         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
2935         return values and handle errors
2936
2937         * dbus/dbus-dataslot.c: factor out the data slot stuff from
2938         DBusConnection
2939
2940         * Doxyfile.in (INPUT): add glib subdir
2941
2942         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
2943         setup_with_g_main instead of hookup_with_g_main; write docs
2944
2945 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
2946
2947         * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
2948         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2949         * dbus/dbus-message.c: (dbus_message_append_boolean),
2950         (dbus_message_append_boolean_array),
2951         (dbus_message_get_args_valist), (_dbus_message_test):
2952         * dbus/dbus-message.h:
2953         * doc/dbus-specification.sgml:
2954         Various fixes as pointed out by Havoc.
2955
2956         * test/data/invalid-messages/bad-boolean-array.message:
2957         * test/data/invalid-messages/bad-boolean.message:
2958         Add invalid boolean value test cases.
2959
2960 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
2961
2962         * dbus/dbus-internals.c: (_dbus_type_to_string):
2963         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2964         (_dbus_marshal_validate_arg):
2965         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2966         * dbus/dbus-message.c: (dbus_message_append_args_valist),
2967         (dbus_message_append_boolean), (dbus_message_append_boolean_array),
2968         (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
2969         (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
2970         (dbus_message_iter_get_double),
2971         (dbus_message_iter_get_boolean_array), (message_iter_test):
2972         * dbus/dbus-message.h:
2973         * dbus/dbus-protocol.h:
2974         * doc/dbus-specification.sgml:
2975         * test/data/valid-messages/lots-of-arguments.message:
2976         Add support for boolean and boolean array types.
2977
2978 2003-02-23  Havoc Pennington  <hp@pobox.com>
2979
2980         * dbus/dbus-keyring.c: finish most of this implementation and
2981         simple unit test
2982
2983         * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
2984         these barf if the error isn't cleared to NULL
2985
2986         * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
2987         (_dbus_create_directory): new function
2988
2989         * dbus/dbus-errors.c (dbus_set_error): fix warning
2990
2991         * dbus/dbus-string.c (_dbus_string_hex_encode): new function
2992         (_dbus_string_hex_decode): new function
2993         (test_hex_roundtrip): test code
2994
2995         * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
2996
2997         * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
2998
2999         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
3000         the save-to-temp/rename trick to atomically write the new file
3001         (_dbus_string_parse_uint): new function
3002
3003 2003-02-22  Havoc Pennington  <hp@pobox.com>
3004
3005         * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
3006
3007 2003-02-22  Havoc Pennington  <hp@pobox.com>
3008
3009         * dbus/dbus-message.c (dbus_message_iter_get_string_array):
3010         (dbus_message_iter_get_byte_array): Fix up doxygen warnings
3011
3012         * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
3013
3014         * dbus/test/data/sha-1: add US government test suite for SHA-1
3015
3016 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
3017
3018         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
3019         Make string arrays NULL-terminated.
3020
3021         * dbus/dbus-memory.c: (dbus_free_string_array):
3022         * dbus/dbus-memory.h:
3023         New function for freeing NULL-terminated string arrays.
3024
3025         * dbus/dbus-message-builder.c: (append_quoted_string),
3026         (_dbus_message_data_load):
3027         Add support for array types.
3028
3029         * dbus/dbus-message.c: (check_message_handling):
3030         Add more types as test cases.
3031
3032         * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
3033         (_dbus_string_parse_double):
3034         Add the start offset to the end offset.
3035
3036         * test/data/valid-messages/lots-of-arguments.message:
3037         New test message with lots of arguments.
3038
3039 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
3040
3041         * dbus/dbus-message.c: (dbus_message_append_nil),
3042         (dbus_message_append_int32), (dbus_message_append_uint32),
3043         (dbus_message_append_double), (dbus_message_append_string),
3044         (dbus_message_append_int32_array),
3045         (dbus_message_append_uint32_array),
3046         (dbus_message_append_double_array),
3047         (dbus_message_append_byte_array),
3048         (dbus_message_append_string_array):
3049         Fix all out-of-memory handling in these functions.
3050
3051 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
3052
3053         * dbus/dbus-message.c: (dbus_message_append_nil):
3054         Fix a silly.
3055
3056 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
3057
3058         * dbus/dbus-message.c: (dbus_message_append_args_valist),
3059         (dbus_message_append_nil), (dbus_message_append_int32_array),
3060         (dbus_message_append_uint32_array),
3061         (dbus_message_append_double_array),
3062         (dbus_message_append_byte_array),
3063         (dbus_message_append_string_array), (dbus_message_get_args_valist),
3064         (dbus_message_iter_get_int32_array),
3065         (dbus_message_iter_get_uint32_array),
3066         (dbus_message_iter_get_double_array),
3067         (dbus_message_iter_get_byte_array),
3068         (dbus_message_iter_get_string_array):
3069
3070         * dbus/dbus-message.h:
3071         Add functions for appending and getting arrays.
3072
3073 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
3074
3075         * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
3076         element size at least 8 bytes, fixes mempool tests on
3077         64-bit machines.
3078
3079 2003-02-20  Alexander Larsson  <alexl@redhat.com>
3080
3081         * dbus/dbus-transport-unix.c (unix_do_iteration):
3082         Unlock the connection mutex during a blocking select call.
3083         Add todo about how we need a way to wake up the select.
3084
3085         * dbus/dbus-connection-internal.h:
3086         * dbus/dbus-connection.c:
3087         Add _dbus_connection_lock and _dbus_connection_unlock.
3088
3089 2003-02-19  Havoc Pennington  <hp@pobox.com>
3090
3091         * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
3092         Doxyfile.in, not Doxyfile
3093
3094         * dbus/dbus-keyring.c: do some hacking on this
3095
3096         * dbus/dbus-sysdeps.c (_dbus_delete_file): new
3097
3098         * dbus/dbus-errors.c (dbus_set_error_const): do not call
3099         dbus_error_init
3100         (dbus_set_error): remove dbus_error_init, check for message ==
3101         NULL *before* we sprintf into it, and add @todo about including
3102         system headers in this file
3103
3104         * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
3105
3106         * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
3107
3108         * dbus/dbus-sysdeps.c (get_user_info): break this function out to
3109         get various bits of user information based on either username
3110         or user ID
3111         (_dbus_homedir_from_username): new function
3112
3113 2003-02-19  Anders Carlsson  <andersca@codefactory.se>
3114
3115         * configure.in:
3116         Add check for nonposix getpwnam_r
3117
3118         * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
3119         Align the pool element size to a sizeof (void *) boundary.
3120
3121         * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
3122         (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
3123         General Solaris fixes.
3124
3125         * test/data/valid-messages/simplest-manual.message:
3126         Explicitly state that we want little-endian packing.
3127
3128 2003-02-19  Mikael Hallendal  <micke@codefactory.se>
3129
3130         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
3131
3132         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
3133         Added to create a transport connecting using a tcp/ip socket.
3134
3135         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
3136         to a tcp socket at given host and port.
3137         (_dbus_listen_tcp_socket): added to listen on tcp socket for given
3138         hostname and port.
3139
3140         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
3141
3142         * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
3143         Added to create a server listening on a TCP/IP socket.
3144
3145 2003-02-19  Havoc Pennington  <hp@pobox.com>
3146
3147         Throughout: mop up all the Doxygen warnings and undocumented
3148         stuff.
3149
3150         * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
3151         to search any paths.
3152
3153         * dbus/dbus-threads.c: move global mutex initializers to
3154         dbus-internals.h, multiple prototypes was confusing doxygen
3155         besides being kind of ugly
3156
3157         * Doxyfile (PREDEFINED): have Doxygen define
3158         DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
3159         docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
3160         (do not abuse the feature! it's for stuff like the autogenerated
3161         macros in dbus-md5.c, not just for things you don't feel like
3162         documenting...)
3163
3164 2003-02-18  Havoc Pennington  <hp@pobox.com>
3165
3166         * dbus/dbus-string.c (_dbus_string_zero): new function
3167
3168         * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
3169         wrap it in some dbus-friendly API
3170
3171         * dbus/dbus-types.h: add 16-bit types
3172
3173 2003-02-18  Joe Shaw  <joe@assbarn.com>
3174
3175         * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
3176         credentials from our currently running process.
3177         (get_word): Fix a buglet where we were copying the entire length
3178         instead of relative to our position.
3179
3180         * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
3181         keys on the stack... it's 640k of data.
3182
3183         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
3184         read the credentials byte off the socket, even if we don't have
3185         SO_PEERCRED.
3186         (_dbus_poll): Implement poll() using select() for systems which
3187         don't have it.
3188
3189         * glib/test-dbus-glib.c (main): Print out an error if no
3190         parameters are given.
3191
3192         * test/data/auth/fallback.auth-script: Added.  Tests that a client
3193         can fallback to a secondary auth mechanism if the first fails.
3194
3195 2003-02-18  Havoc Pennington  <hp@pobox.com>
3196
3197         * AUTHORS: add Alex
3198
3199 2003-02-17  Havoc Pennington  <hp@pobox.com>
3200
3201         * doc/dbus-specification.sgml: lots of cosmetic
3202         cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
3203         env variable to DBUS_BUS_ADDRESS, s/client/application/,
3204         s/server/bus/ (except in authentication section). Add a section
3205         "Message Bus Message Routing"
3206
3207 2003-02-17  Anders Carlsson  <andersca@codefactory.se.>
3208
3209         Release 0.4
3210
3211         * NEWS: Update
3212
3213 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
3214
3215         * doc/dbus-specification.sgml:
3216         Specification updates.
3217
3218 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
3219
3220         * bus/activation.c: (bus_activation_init), (child_setup),
3221         (bus_activation_activate_service):
3222         * bus/activation.h:
3223         * bus/main.c: (main):
3224         Set DBUS_ADDRESS environment variable.
3225
3226         * dbus/dbus-errors.c: (dbus_set_error):
3227         Don't use va_copy since that's a C99 feature.
3228
3229         * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
3230         (_dbus_spawn_async):
3231         * dbus/dbus-sysdeps.h:
3232         Add child_setup_func to _dbus_spawn_async.
3233
3234         * doc/dbus-specification.sgml:
3235         Update specification.
3236
3237         * test/spawn-test.c: (setup_func), (main):
3238         Fix test.
3239
3240 2003-02-17  Alexander Larsson  <alexl@redhat.com>
3241
3242         * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
3243         Added todo.
3244
3245 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
3246
3247         * doc/.cvsignore:
3248         * doc/Makefile.am:
3249         * doc/dbus-test-plan.sgml:
3250         Add test plan document.
3251
3252         * test/Makefile.am:
3253         Fix distcheck.
3254
3255 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
3256
3257         * dbus/dbus-message.c: (decode_header_data),
3258         (_dbus_message_loader_return_buffer):
3259         Set the header padding amount when loading a message.
3260
3261 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
3262
3263         * bus/dispatch.c: (send_one_message):
3264         Only send broadcast messages to registered connections.
3265
3266         * dbus/dbus-message.c: (dbus_message_name_is):
3267         * dbus/dbus-message.h:
3268         New convenience function.
3269
3270         * dbus/dbus-transport-debug.c: (do_reading):
3271         Only dispatch one message per run.
3272
3273         * test/Makefile.am:
3274         * test/bus-test.c: (new_connection_callback), (die),
3275         (test_hello_client1_handler), (test_hello_client2_handler),
3276         (test_hello_replies), (main):
3277
3278         * test/bus-test-loop.[ch]:
3279         Add these.
3280
3281 2003-02-16  Havoc Pennington  <hp@pobox.com>
3282
3283         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
3284         backward conditional
3285
3286 2003-02-16  Alexander Larsson  <alexl@redhat.com>
3287
3288         * dbus/dbus-connection.c:
3289         Implement sent_message_with_reply. (with_reply_and block is still
3290         busted).
3291         Made dispatch_message not lose message if OOM.
3292
3293         * dbus/dbus-errors.h:
3294         Add NoReply error (for reply timeouts).
3295
3296 2003-02-16  Alexander Larsson  <alexl@redhat.com>
3297
3298         * dbus/dbus-hash.c (_dbus_hash_table_unref):
3299         Actually free keys and values when destroying hashtable.
3300
3301 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
3302
3303         * dbus/dbus-auth.c: (client_try_next_mechanism):
3304         Plug a leak.
3305
3306         * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
3307         Return TRUE if there's no thread implementation around.
3308
3309         * glib/dbus-gmain.c: (free_source),
3310         (dbus_connection_hookup_with_g_main):
3311         Make sure to remove the GSource when the connection is finalized.
3312
3313 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
3314
3315         * bus/dispatch.c: (bus_dispatch_message_handler):
3316         * dbus/dbus-errors.h:
3317         Return an error if someone tries to send a message to a service
3318         that doesn't exist.
3319
3320 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
3321
3322         * bus/activation.c: (load_directory), (bus_activation_init),
3323         (bus_activation_activate_service):
3324         * bus/activation.h:
3325         * bus/driver.c:
3326         (bus_driver_handle_activate_service), (bus_driver_handle_message):
3327         More work on the activation handling.
3328
3329         * dbus/dbus-errors.h:
3330         Add some error messages
3331
3332         * dbus/dbus-message.c: (dbus_message_new_error_reply):
3333         * dbus/dbus-message.h:
3334         New function that creates an error message.
3335
3336         * dbus/dbus-protocol.h:
3337         Add ACTIVATE_SERVER message.
3338
3339         * dbus/dbus-server-unix.c: (unix_handle_watch),
3340         (_dbus_server_new_for_domain_socket):
3341         Call _dbus_fd_set_close_on_exec.
3342
3343         * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
3344         (_dbus_spawn_async), (_dbus_disable_sigpipe),
3345         (_dbus_fd_set_close_on_exec):
3346         * dbus/dbus-sysdeps.h:
3347         Add _dbus_fd_set_close_on exec function. Also add function that checks
3348         that all open fds are set to close-on-exec and warns otherwise.
3349
3350         * dbus/dbus-transport-unix.c:
3351         (_dbus_transport_new_for_domain_socket):
3352         Call _dbus_fd_set_close_on_exec.
3353
3354 2003-02-16  Havoc Pennington  <hp@pobox.com>
3355
3356         * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
3357         allow people to avoid setting SIGPIPE to SIG_IGN
3358         (_dbus_connection_new_for_transport): disable SIGPIPE unless
3359         we've been asked not to
3360
3361 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
3362
3363         * dbus/dbus-list.c: (_dbus_list_append_link),
3364         (_dbus_list_prepend_link):
3365         * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
3366         (dbus_realloc):
3367         Warning fixes.
3368
3369 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
3370
3371         * bus/Makefile.am:
3372         * bus/activation.c: (bus_activation_entry_free),
3373         (add_desktop_file_entry), (load_directory), (bus_activation_init):
3374         * bus/activation.h:
3375         * bus/main.c: (main):
3376         Add simple activation support, doesn't work yet though.
3377
3378 2003-02-15   Zack Rusin  <zack@kde.org>
3379
3380         * qt/dbus-qthread.cpp:  small casting fix
3381
3382 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
3383
3384         * dbus/dbus-errors.c: (dbus_set_error):
3385         * dbus/dbus-errors.h:
3386         Add a few errors and make dbus_set_error void.
3387
3388         * dbus/dbus-sysdeps.c:
3389         (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
3390         (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
3391         * dbus/dbus-sysdeps.h:
3392         Add _dbus_spawn_async.
3393
3394         * test/spawn-test.c: (main):
3395         Test for _dbus_spawn_async.
3396
3397 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
3398
3399         * dbus/dbus-internals.h:
3400         Fix build without tests.
3401
3402         * dbus/dbus-list.c: (alloc_link):
3403         Fix a segfault when a malloc fails.
3404
3405         * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
3406         (dbus_malloc0), (dbus_realloc):
3407         Add support for malloc debugging.
3408
3409 2003-02-15  Alexander Larsson  <alexl@redhat.com>
3410
3411         * dbus/dbus-threads.c:
3412         * dbus/dbus-threads.h:
3413         Add condvars. Remove static mutext from API.
3414         Implement static mutexes by initializing them from threads_init.
3415
3416         * glib/dbus-gthread.c:
3417         * qt/dbus-qthread.cpp:
3418         Update with the thread api changes.
3419
3420
3421         * dbus/dbus-list.c:
3422         * dbus/dbus-list.h:
3423         Turn StaticMutex into normal mutex + init function.
3424         Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
3425         _dbus_list_append_link, _dbus_list_prepend_link
3426
3427
3428         * dbus/dbus-sysdeps.c:
3429         * dbus/dbus-sysdeps.h:
3430         New type dbus_atomic_t, and new functions _dbus_atomic_inc,
3431         _dbus_atomic_dec. Only slow fallback implementation at the moment.
3432
3433         * dbus/dbus-protocol.h:
3434         Add DBUS_MESSAGE_LOCAL_DISCONNECT define
3435
3436         * dbus/dbus-message.c:
3437         Make ref/unref atomic.
3438         Fix some docs.
3439
3440         * dbus/dbus-connection-internal.h:
3441         * dbus/dbus-connection.c:
3442         * dbus/dbus-connection.h:
3443         Make threadsafe.
3444         Change _peek to _borrow,_return & _steal_borrowed.
3445         Change disconnect callback to event.
3446         Make dbus_connection_dispatch_messages reentrant.
3447
3448         * dbus/dbus-transport.c:
3449         Don't ref the connection on calls to the transport
3450         implementation.
3451
3452         * dbus/dbus-message-handler.c:
3453         Make threadsafe.
3454
3455         * glib/dbus-gmain.c:
3456         Don't use peek_message anymore
3457
3458         * test/Makefile.am:
3459         * test/debug-thread.c:
3460         * test/debug-thread.h:
3461         Simple thread implementation that asserts() on deadlocks in
3462         single-threaded code.
3463
3464         * test/bus-test.c:
3465         (main) Call debug_threads_init.
3466
3467         * test/watch.c:
3468         Use disconnect message instead of disconnect callback.
3469
3470         * bus/connection.c:
3471         * bus/connection.h:
3472         Don't call dbus_connection_set_disconnect_function. Instead export
3473         bus_connection_disconnect.
3474
3475         * bus/dispatch.c:
3476         Call bus_connection_disconnect when we get a disconnected message.
3477
3478 2003-02-15  Havoc Pennington  <hp@pobox.com>
3479
3480         * dbus/dbus-message.c (dbus_message_new): fool around with the
3481         docs
3482
3483 2003-02-14  Havoc Pennington  <hp@pobox.com>
3484
3485         * dbus/dbus-mempool.c: fail if the debug functions so indicate
3486
3487         * dbus/dbus-memory.c: fail if the debug functions indicate we
3488         should
3489
3490         * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
3491         (_dbus_decrement_fail_alloc_counter): debug functions to
3492         simulate memory allocation failures
3493
3494 2003-02-14  Havoc Pennington  <hp@pobox.com>
3495
3496         * dbus/dbus-errors.h (struct DBusError): add a word of padding
3497         to DBusError
3498
3499 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3500
3501         * bus/driver.c: (bus_driver_handle_hello):
3502         * bus/driver.h:
3503         * bus/services.c: (bus_service_lookup):
3504         Reorder message sending so we get a more sane order.
3505
3506         * test/bus-test.c: (message_handler):
3507         Fix tyop.
3508
3509 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3510
3511         * bus/driver.c: (bus_driver_send_service_deleted),
3512         (bus_driver_send_service_created), (bus_driver_send_service_lost),
3513         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
3514         (bus_driver_send_welcome_message),
3515         (bus_driver_handle_list_services),
3516         (bus_driver_handle_acquire_service),
3517         (bus_driver_handle_service_exists):
3518         * dbus/dbus-bus.c: (dbus_bus_register_client),
3519         (dbus_bus_acquire_service), (dbus_bus_service_exists):
3520         * dbus/dbus-errors.c: (dbus_result_to_string):
3521         * dbus/dbus-errors.h:
3522         * dbus/dbus-message.c: (dbus_message_append_args),
3523         (dbus_message_append_args_valist), (dbus_message_get_args),
3524         (dbus_message_get_args_valist), (dbus_message_get_args_iter),
3525         (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
3526         (dbus_message_iter_get_byte_array),
3527         (dbus_message_iter_get_string_array), (message_iter_test),
3528         (check_message_handling), (_dbus_message_test):
3529         * dbus/dbus-message.h:
3530         * test/bus-test.c: (main):
3531         Change fields to arguments in messages, so that they won't be
3532         confused with header fields.
3533
3534         * glib/test-dbus-glib.c: (main):
3535         Remove append_fields from hello message.
3536
3537 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3538
3539         * dbus/dbus-errors.c:
3540         * dbus/dbus-message.c:
3541         * dbus/dbus-string.c:
3542         Documentation fixes.
3543
3544 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3545
3546         * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
3547         (remove_timeout):
3548         Implement support for timeouts in dbus-glib.
3549
3550 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3551
3552         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
3553         * dbus/dbus-message.c: (process_test_subdir):
3554         * test/break-loader.c: (find_breaks_based_on):
3555         Plug some memory leaks.
3556
3557 2003-02-13  Richard Hult  <rhult@codefactory.se>
3558
3559         * bus/main.c: Fix build.
3560
3561         * dbus/dbus-errors.h:
3562         * dbus/dbus-errors.c: Fix copyright for Anders.
3563
3564 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3565
3566         * bus/Makefile.am:
3567         Add utils.[ch]
3568
3569         * bus/connection.c: (bus_connection_foreach):
3570         Fix a warning.
3571
3572         * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
3573         (unescape_string), (new_section), (parse_section_start),
3574         (parse_key_value), (report_error), (bus_desktop_file_load),
3575         (bus_desktop_file_get_string):
3576         * bus/desktop-file.h:
3577         Use DBusError for error reporting.
3578
3579         * bus/dispatch.c: (send_one_message),
3580         (bus_dispatch_message_handler):
3581         * bus/driver.c: (bus_driver_send_service_deleted),
3582         (bus_driver_send_service_created), (bus_driver_send_service_lost),
3583         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
3584         (bus_driver_send_welcome_message),
3585         (bus_driver_handle_list_services),
3586         (bus_driver_handle_acquire_service),
3587         (bus_driver_handle_service_exists):
3588         * bus/loop.c: (bus_loop_run):
3589         * bus/main.c:
3590         Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
3591
3592         * bus/utils.c: (bus_wait_for_memory):
3593         * bus/utils.h:
3594         New files with general utility functions.
3595
3596         * dbus/dbus-internals.h:
3597         Remove _DBUS_HANDLE_OOM.
3598
3599 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3600
3601         * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
3602         (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
3603         * dbus/dbus-errors.h:
3604         Add DBusError structure.
3605
3606 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3607
3608         * test/data/valid-messages/standard-acquire-service.message:
3609         * test/data/valid-messages/standard-hello.message:
3610         * test/data/valid-messages/standard-list-services.message:
3611         * test/data/valid-messages/standard-service-exists.message:
3612         Add some standard messages.
3613
3614 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3615
3616         * bus/driver.c: (bus_driver_send_welcome_message),
3617         (bus_driver_handle_list_services),
3618         (bus_driver_handle_acquire_service),
3619         (bus_driver_handle_service_exists), (bus_driver_handle_message):
3620         Update for API changes in libdbus.
3621
3622         * dbus/dbus-message.c: (dbus_message_new_reply):
3623         * dbus/dbus-message.h:
3624         Remove the name argument. The spec states that replies shouldn't
3625         have a name.
3626
3627 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
3628
3629         * bus/desktop-file.c: (parse_section_start), (parse_key_value),
3630         (report_error), (bus_desktop_file_load), (lookup_section),
3631         (lookup_line), (bus_desktop_file_get_raw),
3632         (bus_desktop_file_get_string):
3633         * bus/desktop-file.h:
3634         Some fixes, and new functions for getting a key value from a section.
3635
3636 2003-02-13  Havoc Pennington  <hp@pobox.com>
3637
3638         * test/data/auth/fail-after-n-attempts.auth-script: new test
3639
3640         * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
3641         reject the client.
3642
3643 2003-02-13  Havoc Pennington  <hp@pobox.com>
3644
3645         * dbus/dbus-auth.c (handle_server_data_external_mech): args to
3646         dbus_credentials_match were backward
3647
3648         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
3649         NO_CREDENTIALS and ROOT_CREDENTIALS
3650
3651         * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
3652         into here. Never process more commands after we've reached an
3653         end state; store further data as unused bytes.
3654
3655         * test/data/auth/*: add more auth tests
3656
3657         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
3658         command to match exact string and EXPECT_UNUSED to match unused
3659         bytes
3660
3661         * test/Makefile.am (dist-hook): fix to dist all the test stuff
3662
3663 2003-02-12  Havoc Pennington  <hp@pobox.com>
3664
3665         * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
3666         \r off of popped lines
3667
3668         * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
3669         scripts
3670
3671         * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
3672         SEND, append \r\n
3673
3674 2003-02-12  Havoc Pennington  <hp@pobox.com>
3675
3676         * dbus/Makefile.am: remove break-loader from the build, since it
3677         moved.
3678
3679         * configure.in: add --enable-gcov to turn on coverage profiling
3680         flags and disable optimization
3681
3682 2003-02-10  Havoc Pennington  <hp@pobox.com>
3683
3684         * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
3685         initial cut at test framework for DBusAuth from laptop.
3686         Doesn't quite work yet but it compiles and I need to get
3687         it off the 266mhz laptop. ;-)
3688
3689         * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
3690         fix a memleak in error case
3691
3692 2003-02-12  Anders Carlsson  <andersca@codefactory.se>
3693
3694         * bus/Makefile.am:
3695         * bus/desktop-file.c:
3696         * bus/desktop-file.h:
3697         Add a desktop file parser.
3698
3699 2003-02-11  Zack Rusin  <zack@kde.org>
3700
3701         * qt/message.[h|cpp]: sample implementation
3702         of the KDE wrapper for DBusMessage
3703
3704 2003-02-09  Zack Rusin  <zack@kde.org>
3705
3706         * test/bus-test.c: make_it_compile
3707         * doc/dbus-specification.sgml: minimal semantic fix
3708
3709 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
3710
3711         Release 0.3
3712
3713         * NEWS: Update
3714
3715 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
3716
3717         * dbus/Makefile.am:
3718         * dbus/dbus-break-loader.c:
3719         * test/Makefile.am:
3720         * test/break-loader.c:
3721         Move dbus-break-loader to test/ and rename it to break-loader.
3722
3723 2003-02-02  Havoc Pennington  <hp@pobox.com>
3724
3725         * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
3726         for code to manage cookies in your home directory
3727
3728         * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
3729
3730         * dbus/dbus-auth.c (get_state): impose a maximum number of tries
3731         to authenticate, then disconnect the client.
3732
3733 2003-02-03  Alexander Larsson  <alexl@redhat.com>
3734
3735         * dbus/dbus-message.c (dbus_message_append_fields):
3736         Correct docs.
3737
3738 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3739
3740         * doc/dbus-specification.sgml:
3741         Update address format section.
3742
3743 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3744
3745         * test/Makefile.am:
3746         * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
3747         (message_handler), (new_connection_callback), (loop_quit),
3748         (loop_run), (main):
3749         Add bus test.
3750
3751 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3752
3753         * bus/driver.c: (bus_driver_handle_service_exists):
3754         Simplify the code a bit.
3755
3756         * dbus/dbus-bus.c: (dbus_bus_service_exists):
3757         Fix a silly.
3758
3759 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3760
3761         * bus/Makefile.am:
3762         Add libdbus-daemon.la and link to it.
3763
3764 2003-02-01  James Willcox  <jwillcox@gnome.org>
3765
3766         * bus/driver.c: (bus_driver_handle_own_service):
3767         Actually include the service reply code in the message.
3768
3769 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3770
3771         * bus/driver.c: (bus_driver_handle_service_exists):
3772         Don't unref the incoming message.
3773
3774 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3775
3776         * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
3777
3778 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
3779
3780         * dbus/dbus-server.c: (dbus_server_listen):
3781         * dbus/dbus-transport.c: (_dbus_transport_open):
3782         ifdef out the calls to the debug transport and server.
3783
3784 2003-02-02  Alexander Larsson  <alexl@redhat.com>
3785
3786         * dbus/dbus-watch.c (dbus_watch_get_flags):
3787         Add note in the docs that ERROR or HANGUP won't be returned
3788         and are assumed always on.
3789
3790         * glib/dbus-gmain.c (add_watch):
3791         Always add IO_ERR | IO_HUP
3792
3793         * dbus/dbus-message.h:
3794         Add semicolon after dbus_message_iter_get_string_array().
3795         Makes qt code build again
3796
3797 2003-02-01  Anders Carlsson  <andersca@codefactory.se>
3798
3799         * bus/driver.c: (create_unique_client_name),
3800         (bus_driver_handle_hello):
3801         Don't take a name, just use a numeric id to identify
3802         each client.
3803
3804         * dbus/Makefile.am:
3805         * dbus/dbus-bus.c: (dbus_bus_register_client),
3806         (dbus_bus_acquire_service), (dbus_bus_service_exists):
3807         * dbus/dbus-bus.h:
3808         Add new convenience functions for communicating with the bus.
3809
3810         * dbus/dbus-message.h:
3811
3812         * dbus/dbus-protocol.h:
3813         Fix a typo.
3814
3815 2003-02-01  Alexander Larsson  <alexl@redhat.com>
3816
3817         * dbus/dbus-message.c (dbus_message_append_fields):
3818         Add some more doc comments.
3819
3820 2003-02-01  Havoc Pennington  <hp@pobox.com>
3821
3822         * dbus/dbus-break-loader.c (randomly_modify_length): change
3823         a 4-byte value in the message as if it were a length
3824
3825         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
3826         execute bit on saved files
3827
3828 2003-02-01  Havoc Pennington  <hp@pobox.com>
3829
3830         * dbus/dbus-break-loader.c (main): new program to find messages
3831         that break the loader.
3832
3833         * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
3834         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
3835
3836         * dbus/dbus-string.c (_dbus_string_set_byte): new
3837
3838 2003-01-31  Havoc Pennington  <hp@pobox.com>
3839
3840         * dbus/dbus-message.c: refactor the test code to be more general,
3841         in preparation for writing a "randomly permute test cases to
3842         try to break the loader" program.
3843
3844 2003-01-31  Havoc Pennington  <hp@pobox.com>
3845
3846         * doc/dbus-specification.sgml: work on the specification
3847
3848         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
3849         the protocol version of the message.
3850
3851         * dbus/dbus-protocol.h: drop special _REPLY names, the spec
3852         no longer specifies that.
3853         (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
3854         1/2/3/4)
3855
3856         * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
3857         "break" for DBUS_TYPE_NIL, remove @todo
3858
3859 2003-01-31  Havoc Pennington  <hp@pobox.com>
3860
3861         * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
3862         just set_is_error/get_is_error as this is a commonly-used
3863         function, and write docs.
3864
3865 2003-01-31  Anders Carlsson  <andersca@codefactory.se>
3866
3867         * dbus/dbus-address.c: (dbus_address_entry_free):
3868         Free key and value lists.
3869
3870         * dbus/dbus-internals.c: (_dbus_type_to_string):
3871         Add the types we didn't have.
3872
3873         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
3874         (_dbus_marshal_validate_arg):
3875         Add NIL types.
3876
3877         * dbus/dbus-message.c: (dbus_message_set_sender):
3878         Remove todo about being able to set sender to NULL.
3879
3880         (dbus_message_set_is_error_reply),
3881         (dbus_message_get_is_error_reply):
3882         * dbus/dbus-message.h:
3883         New functions.
3884
3885         * dbus/dbus-protocol.h:
3886         Add error reply flag.
3887
3888         * test/data/valid-messages/opposite-endian.message:
3889         Add NIL type to test.
3890
3891 2003-01-31  Havoc Pennington  <hp@pobox.com>
3892
3893         * doc/dbus-specification.sgml: fully specify the header.  Add
3894         flags and major protocol version, and change header/body len to
3895         unsigned.
3896
3897         * dbus/dbus-message-builder.c (append_saved_length): append length
3898         as uint32
3899
3900         * dbus/dbus-message.c (dbus_message_create_header): change header
3901         length and body length to unsigned. Add the new fields from the
3902         spec
3903         (_dbus_message_loader_return_buffer): unsigned header/body len
3904
3905 2003-01-30  Havoc Pennington  <hp@pobox.com>
3906
3907         * dbus/dbus-auth.c: rework to use only REJECTED, no
3908         MECHANISMS
3909
3910         * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
3911         use REJECTED, suggested by Mark McLoughlin
3912
3913 2003-01-30  Havoc Pennington  <hp@pobox.com>
3914
3915         * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
3916         a better way to report errors here. e.g.  "unix address lacks
3917         path" or something. also "no such file" when the path doesn't
3918         exist, etc.
3919
3920         * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
3921         leaking list nodes
3922         (dbus_parse_address): add @todo about documenting address format,
3923         and allowing , and ; to be escaped
3924
3925 2003-01-30  Anders Carlsson  <andersca@codefactory.se>
3926
3927         * dbus/Makefile.am:
3928         Add dbus-address.[ch]
3929
3930         * dbus/dbus-address.c: (dbus_address_entry_free),
3931         (dbus_address_entries_free), (create_entry),
3932         (dbus_address_entry_get_method), (dbus_address_entry_get_value),
3933         (dbus_parse_address), (_dbus_address_test):
3934         * dbus/dbus-address.h:
3935         New files for dealing with address parsing.
3936
3937         * dbus/dbus-connection.c:
3938         Document timeout functions.
3939
3940         * dbus/dbus-message.c:
3941         Document dbus_message_new_from_message.
3942
3943         * dbus/dbus-server-debug.c:
3944         Document.
3945
3946         * dbus/dbus-server.c: (dbus_server_listen):
3947         Parse address and use correct server implementation.
3948
3949         * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
3950         * dbus/dbus-string.h:
3951         New function with test.
3952
3953         * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
3954         * dbus/dbus-test.h:
3955         Add address tests.
3956
3957         * dbus/dbus-transport-debug.c:
3958         Document.
3959
3960         * dbus/dbus-transport.c: (_dbus_transport_open):
3961         Parse address and use correct transport implementation.
3962
3963 2003-01-30  Havoc Pennington  <hp@pobox.com>
3964
3965         * dbus/dbus-message.c: use message->byte_order instead of
3966         DBUS_COMPILER_BYTE_ORDER throughout.
3967         (dbus_message_create_header): pad header to align the
3968         start of the body of the message to 8-byte boundary
3969
3970         * dbus/dbus-marshal.h: make all the demarshalers take const
3971         DBusString arguments.
3972
3973         * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
3974         validate message args here, so we don't have to do slow validation
3975         later, and so we catch bad messages as they are incoming. Also add
3976         better checks on header_len and body_len. Also fill in
3977         message->byte_order
3978
3979         * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
3980         implemented properly)
3981         (_dbus_string_validate_nul): new function to check all-nul
3982
3983         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
3984         get_arg_end_pos and remove all validation
3985         (_dbus_marshal_validate_arg): actually do validation here.
3986
3987 2003-01-29  Havoc Pennington  <hp@pobox.com>
3988
3989         * dbus/dbus-message.c (check_message_handling): fix assertion
3990         failure on set_client_serial
3991
3992 2003-01-28  Havoc Pennington  <hp@pobox.com>
3993
3994         * dbus/dbus-server-debug.c: Add doc section comments
3995
3996         * dbus/dbus-transport-debug.c: add doc section comments
3997
3998 2003-01-28  Havoc Pennington  <hp@redhat.com>
3999
4000         * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
4001         the reverse order from how I had it
4002         (_dbus_string_base64_encode): reverse encoding order. I was
4003         basically byteswapping everything during encoding.
4004
4005 2003-01-28  Anders Carlsson  <andersca@codefactory.se>
4006
4007         * dbus/dbus-connection-internal.h:
4008         * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
4009         (_dbus_connection_remove_timeout):
4010         Add functions for adding and removing timeouts.
4011
4012         * dbus/dbus-message.c: (dbus_message_new_from_message):
4013         Add new function that takes a message and creates an exact
4014         copy of it, but with the refcount set to 1.
4015         (check_message_handling):
4016         Fix build error.
4017
4018         * dbus/dbus-server-protected.h:
4019         * dbus/dbus-server.c: (_dbus_server_init_base),
4020         (_dbus_server_finalize_base), (_dbus_server_add_timeout),
4021         (dbus_server_set_timeout_functions):
4022         (_dbus_server_remove_timeout):
4023         New functions so that a server can add and remove timeouts.
4024
4025         (dbus_server_listen):
4026         Add commented out call to dbus_server_debug_new.
4027
4028         * dbus/dbus-timeout.c: (_dbus_timeout_new):
4029         Actually set the handler, doh.
4030
4031         * dbus/dbus-transport.c: (_dbus_transport_open):
4032         Add commented out call to dbus_transport_debug_client_new.
4033
4034         * dbus/Makefile.am:
4035         Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
4036
4037 2003-01-28  Havoc Pennington  <hp@pobox.com>
4038
4039         * dbus/dbus-message.c (check_message_handling): function to check
4040         on the loaded message, iterates over it etc.
4041
4042 2003-01-28  Havoc Pennington  <hp@pobox.com>
4043
4044         * test/Makefile.am (dist-hook): fix make distdir
4045
4046         * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
4047
4048 2003-01-27  Havoc Pennington  <hp@pobox.com>
4049
4050         * dbus/dbus-mempool.c (time_for_size): replace printf with
4051         _dbus_verbose
4052
4053         * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
4054         empty lines; fix the SAVE_LENGTH stuff to be
4055         START_LENGTH/END_LENGTH so it actually works; couple other
4056         bugfixes
4057
4058         * test/Makefile.am (dist-hook): add dist-hook for .message files
4059
4060         * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
4061         can be constant or locked.
4062         (_dbus_string_free): allow freeing a const string as
4063         documented/intended
4064
4065         * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
4066
4067         * dbus/dbus-test-main.c (main): take an argument which is the
4068         directory containing test data
4069
4070         * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
4071         argument to this and load all the messages in test/data/
4072         checking that they can be loaded or not loaded as appropriate.
4073
4074 2003-01-27  Anders Carlsson  <andersca@codefactory.se>
4075
4076         * bus/dispatch.c: (bus_dispatch_message_handler):
4077         Dispatch messages sent to services.
4078
4079         * bus/driver.c: (bus_driver_send_service_deleted),
4080         (bus_driver_send_service_created), (bus_driver_send_service_lost),
4081         (bus_driver_send_service_acquired):
4082         Add helper functions for sending service related messages.
4083
4084         (bus_driver_send_welcome_message):
4085         Send HELLO_REPLY instead of WELCOME.
4086
4087         (bus_driver_handle_list_services):
4088         Send LIST_SERVICES_REPLY instead of SERVICES.
4089
4090         (bus_driver_handle_own_service),
4091         (bus_driver_handle_service_exists):
4092         New message handlers.
4093
4094         (bus_driver_handle_message):
4095         Invoke new message handlers.
4096
4097         (bus_driver_remove_connection):
4098         Don't remove any services here since that's done automatically
4099         by bus_service_remove_owner now.
4100
4101         * bus/driver.h:
4102         New function signatures.
4103
4104         * bus/services.c: (bus_service_add_owner):
4105         Send ServiceAcquired message if we're the only primary owner.
4106
4107         (bus_service_remove_owner):
4108         Send ServiceAcquired/ServiceLost messages.
4109
4110         (bus_service_set_prohibit_replacement),
4111         (bus_service_get_prohibit_replacement):
4112         Functions for setting prohibit replacement.
4113
4114         (bus_service_has_owner):
4115         New function that checks if a connection is in the owner queue of
4116         a certain service.
4117
4118         * bus/services.h:
4119         Add new function signatures.
4120
4121         * dbus/dbus-list.c: (_dbus_list_test):
4122         Add tests for _dbus_list_remove_last and traversing the list backwards.
4123
4124         * dbus/dbus-list.h:
4125         Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
4126         go any further, so return NULL then.
4127
4128         * dbus/dbus-protocol.h:
4129         Add new messages, service flags and service replies.
4130
4131 2003-01-26  Havoc Pennington  <hp@pobox.com>
4132
4133         * dbus/dbus-message-builder.c: implement, completely untested.
4134
4135         * test/data/*: add data to be used in testing.
4136         ".message" files are our simple loadable text format.
4137         ".message-raw" will be binary dumps of messages.
4138
4139         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
4140
4141 2003-01-26  Havoc Pennington  <hp@pobox.com>
4142
4143         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
4144
4145         * dbus/dbus-errors.c (dbus_result_to_string): add
4146         file errors
4147
4148         * dbus/dbus-message-builder.c: new file, will contain code to load
4149         up messages from files. Not implemented yet.
4150
4151 2003-01-26  Havoc Pennington  <hp@pobox.com>
4152
4153         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
4154         the sender by setting to NULL
4155
4156 2003-01-26  Havoc Pennington  <hp@pobox.com>
4157
4158         The unit tests pass, but otherwise untested.  If it breaks, the
4159         tests should have been better. ;-)
4160
4161         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
4162         the connection.
4163
4164         * dbus/dbus-message.c: redo everything so we maintain
4165         message->header as the only copy of the various fields.
4166         This avoids the possibility of out-of-memory in some cases,
4167         for example dbus_message_lock() can't run out of memory anymore,
4168         and avoids extra copying. Figured I may as well go ahead and do
4169         this since it was busted for dbus_message_lock to not return
4170         failure on OOM, and dbus_message_write_header was totally
4171         unchecked for OOM. Also fixed some random other bugs.
4172
4173         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
4174         that strings are nul-terminated. Also, end_pos can be equal
4175         to string length just not greater than, I think.
4176         (_dbus_marshal_set_int32): new function
4177         (_dbus_marshal_set_uint32): new function
4178         (_dbus_marshal_set_string): new function
4179
4180         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
4181         a warning, init timeout_list to NULL
4182         (dbus_connection_send_message): don't use uninitialized variable
4183         "serial"
4184
4185         * dbus/dbus-string.c (_dbus_string_replace_len): new function
4186
4187 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
4188
4189         * bus/driver.c: (bus_driver_handle_hello),
4190         (bus_driver_send_welcome_message):
4191         Plug leaks
4192
4193 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
4194
4195         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
4196         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
4197         (dbus_connection_unref):
4198         * dbus/dbus-marshal.c: (_dbus_marshal_test):
4199         * dbus/dbus-message.c: (dbus_message_unref),
4200         Plug memory leaks.
4201
4202         (dbus_message_get_fields):
4203         Remove debugging printout.
4204
4205         (_dbus_message_loader_return_buffer):
4206         Don't store the header string.
4207
4208         (_dbus_message_test):
4209         Plug leaks.
4210
4211 2003-01-26  Richard Hult  <rhult@codefactory.se>
4212
4213         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
4214         the file descriptor list, since it can change under us.
4215
4216 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4217
4218         * glib/dbus-gmain.c: (dbus_connection_prepare),
4219         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
4220         (remove_watch), (dbus_connection_hookup_with_g_main):
4221         Rewrite the glib handling to use its own GSource instead of a
4222         GIOChannel so we can catch messages put in the queue while waiting
4223         for a reply.
4224
4225 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4226
4227         * bus/Makefile.am:
4228         * bus/connection.c: (connection_disconnect_handler),
4229         (connection_watch_callback), (bus_connection_setup):
4230         * bus/dispatch.c: (send_one_message),
4231         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
4232         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
4233         * bus/dispatch.h:
4234         * bus/driver.c: (bus_driver_send_service_deleted),
4235         (bus_driver_send_service_created), (bus_driver_handle_hello),
4236         (bus_driver_send_welcome_message),
4237         (bus_driver_handle_list_services), (bus_driver_remove_connection),
4238         (bus_driver_handle_message):
4239         * bus/driver.h:
4240         Refactor code, put the message dispatching in its own file. Use
4241         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
4242         is disconnected.
4243
4244 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4245
4246         * dbus/dbus-internals.h:
4247         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
4248
4249         * dbus/dbus-message.c: (dbus_message_get_sender):
4250         * dbus/dbus-message.h:
4251         Implement dbus_message_get_sender.
4252
4253         * dbus/dbus-protocol.h:
4254         Add message and service defines.
4255
4256 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4257
4258         * dbus/dbus-connection.c: (dbus_connection_send_message):
4259         * dbus/dbus-message-internal.h:
4260         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
4261         (dbus_message_write_header):
4262         Remove _dbus_messag_unlock and don't set the client serial on a
4263         message if one already exists.
4264
4265 2003-01-24  Havoc Pennington  <hp@pobox.com>
4266
4267         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
4268         list_pool
4269
4270         * bus/driver.c (bus_driver_handle_list_services): fix a leak
4271         on OOM
4272
4273 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4274
4275         * dbus/dbus-list.c: (alloc_link), (free_link):
4276         Use a memory pool for the links.
4277
4278 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4279
4280         * bus/connection.c: (bus_connection_foreach):
4281         * bus/connection.h:
4282         Add new bus_connection_foreach function.
4283
4284         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
4285         Add function that broadcasts a message to all clients.
4286
4287         (bus_driver_send_service_created), (bus_driver_handle_hello),
4288         (bus_driver_send_welcome_message),
4289         (bus_driver_handle_list_services), (bus_driver_message_handler):
4290         Implement functions that take care of listing services, and notifying
4291         clients when new services are created.
4292
4293         * bus/services.c: (bus_services_list):
4294         * bus/services.h:
4295         Add new function that returns an array of strings with the currently
4296         registered services.
4297
4298         * glib/dbus-glib.h:
4299         * glib/dbus-gmain.c:
4300         Update copyright year.
4301
4302 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
4303
4304         * dbus/dbus-connection.c: (dbus_connection_send_message):
4305         Unlock the message in case it was sent earlier.
4306
4307         (dbus_connection_send_message_with_reply_and_block):
4308         Remove the reply message from the list.
4309
4310         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
4311         Set array_len and new_pos correctly.
4312
4313         (_dbus_marshal_test):
4314         Remove debug output.
4315
4316         * dbus/dbus-message-internal.h:
4317         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
4318         New function that returns the reply serial.
4319
4320         (_dbus_message_unlock):
4321         New function that unlocks a message and resets its header.
4322
4323         (dbus_message_append_string_array),
4324         (dbus_message_get_fields_valist),
4325         (dbus_message_iter_get_field_type),
4326         (dbus_message_iter_get_string_array),
4327         (dbus_message_get_fields),
4328         (dbus_message_append_fields_valist):
4329         Handle string arrays.
4330
4331         (dbus_message_set_sender):
4332         Make this function public since the bus daemon needs it.
4333
4334         (decode_header_data):
4335         Set the reply serial to -1 initially.
4336
4337         * dbus/dbus-message.h:
4338         Add dbus_message_set_sender.
4339
4340 2003-01-24  Havoc Pennington  <hp@pobox.com>
4341
4342         * doc/dbus-specification.sgml: add some stuff
4343
4344 2003-01-22  Havoc Pennington  <hp@pobox.com>
4345
4346         * doc/dbus-specification.sgml: Start to document the protocol.
4347
4348 2003-01-22  Havoc Pennington  <hp@pobox.com>
4349
4350         * dbus/dbus-connection.c
4351         (dbus_connection_send_message_with_reply_and_block): add some @todo
4352
4353         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
4354
4355 2003-01-21  Havoc Pennington  <hp@pobox.com>
4356
4357         (patch untested because can't compile)
4358
4359         * bus/driver.c (create_unique_client_name): make this function
4360         never recycle client names. Also, caller should initialize
4361         the DBusString.
4362
4363         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
4364
4365 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
4366
4367         * dbus/dbus-marshal.c: (_dbus_marshal_double),
4368         (_dbus_marshal_int32), (_dbus_marshal_uint32),
4369         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
4370         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
4371         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
4372         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
4373         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
4374         * dbus/dbus-marshal.h:
4375         * dbus/dbus-protocol.h:
4376         Add support for marshalling and demarshalling integer, double
4377         and string arrays.
4378
4379 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
4380
4381         * bus/Makefile.am:
4382         Add driver.[ch]
4383
4384         * bus/connection.c: (connection_disconnect_handler):
4385         Remove the connection from the bus driver's list.
4386
4387         (connection_watch_callback): Dispatch messages.
4388
4389         (free_connection_data): Free connection name.
4390
4391         (bus_connection_setup): Add connection to the bus driver's list.
4392         (bus_connection_remove_owned_service):
4393         (bus_connection_set_name), (bus_connection_get_name):
4394         Add functions for setting and getting the connection's name.
4395
4396         * bus/connection.h:
4397         Add function headers.
4398
4399         * bus/driver.c: (create_unique_client_name),
4400         (bus_driver_handle_hello_message),
4401         (bus_driver_send_welcome_message), (bus_driver_message_handler),
4402         (bus_driver_add_connection), (bus_driver_remove_connection):
4403         * bus/driver.h:
4404         * bus/main.c:
4405         * bus/services.c: (bus_service_free):
4406         * bus/services.h:
4407         New file that handles communication and registreation with the bus
4408         itself.
4409
4410 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
4411
4412         * dbus/dbus-connection.c: (dbus_connection_send_message):
4413         Add a new client_serial parameter.
4414
4415         (dbus_connection_send_message_with_reply):
4416         Remove a @todo since we've implemented the blocking function.
4417
4418         (dbus_connection_send_message_with_reply_and_block):
4419         New function that sends a message and waits for a reply and
4420         then returns the reply.
4421
4422         * dbus/dbus-connection.h:
4423         Add new functions.
4424
4425         * dbus/dbus-errors.c: (dbus_result_to_string):
4426         * dbus/dbus-errors.h:
4427         Add new DBUS_RESULT.
4428
4429         * dbus/dbus-message-internal.h:
4430         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
4431         (_dbus_message_set_sender), (dbus_message_write_header),
4432         (dbus_message_new_reply), (decode_header_data),
4433         (_dbus_message_loader_return_buffer), (_dbus_message_test):
4434         * dbus/dbus-message.h:
4435         Add new functions that set the reply serial and sender.
4436         Also marshal and demarshal them correctly and add test.
4437
4438         * dbus/dbus-protocol.h:
4439         Add new DBUS_MESSAGE_TYPE_SENDER.
4440
4441         * glib/dbus-glib.h:
4442         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
4443         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
4444         (dbus_connection_hookup_with_g_main):
4445         * glib/test-dbus-glib.c: (main):
4446         Rewrite to use GIOChannel and remove the GSource crack.
4447
4448         * test/echo-client.c: (main):
4449         * test/watch.c: (check_messages):
4450         Update for changed APIs
4451
4452 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
4453
4454         * dbus/Makefile.am: Add dbus-timeout.[cħ]
4455
4456         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
4457         Create a DBusTimeoutList.
4458         (dbus_connection_set_timeout_functions): Add new function to
4459         set timeout callbacks
4460
4461         * dbus/dbus-connection.h: Add public DBusTimeout API.
4462
4463         * dbus/dbus-message.c: (dbus_message_get_service):
4464         * dbus/dbus-message.h:  New function.
4465
4466         * dbus/dbus-server.c: Fix small doc typo.
4467
4468         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
4469
4470 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
4471
4472         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
4473         of the string, just as long as specified.
4474
4475 2003-01-19  Havoc Pennington  <hp@pobox.com>
4476
4477         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
4478         new function
4479
4480         * dbus/dbus-server.c (dbus_server_set_max_connections)
4481         (dbus_server_get_max_connections, dbus_server_get_n_connections):
4482         keep track of current number of connections, and add API for
4483         setting a max (but haven't implemented enforcing the max yet)
4484
4485 2003-01-18  Havoc Pennington  <hp@pobox.com>
4486
4487         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
4488         reading/writing if read_watch != NULL or write_watch != NULL.
4489
4490         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
4491         the message loader code to actually load message->header and
4492         message->body into the newly-created message.
4493
4494         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
4495         in OOM case
4496
4497         * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
4498         (dbus_connection_get_max_message_size)
4499         (dbus_connection_set_max_live_messages_size)
4500         (dbus_connection_get_max_live_messages_size): implement some
4501         resource limitation functions
4502
4503         * dbus/dbus-resources.c: new file implementing some of the
4504         resource limits stuff
4505
4506         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
4507         missing docs, add @todo to handle OOM etc.
4508
4509         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
4510         docs
4511
4512 2003-01-18  Havoc Pennington  <hp@pobox.com>
4513
4514         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
4515         connection if it hasn't been already.
4516
4517         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
4518         replace with DisconnectFunction.
4519
4520 2003-01-18  Havoc Pennington  <hp@pobox.com>
4521
4522         Building --disable-verbose-mode --disable-asserts --disable-tests
4523         cuts the library from 112K to 45K or so
4524
4525         * configure.in: check for varargs macro support,
4526         add --enable-verbose-mode, --enable-asserts.
4527
4528         * dbus/dbus-internals.h (_dbus_assert): support
4529         DBUS_DISABLE_ASSERT
4530         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
4531
4532 2003-01-18  Havoc Pennington  <hp@pobox.com>
4533
4534         * dbus/dbus-test.c: include config.h so that tests actually run
4535
4536         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
4537         so the failure mode when that assumption fails will be plenty
4538         obvious.
4539
4540 2003-01-18  Havoc Pennington  <hp@pobox.com>
4541
4542         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
4543
4544         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
4545         the distribution
4546
4547         * test/Makefile.am: don't use special variable "TESTS" for echo-*
4548         since we don't want to use those in make check
4549
4550 2003-01-15  Havoc Pennington  <hp@redhat.com>
4551
4552         Release 0.2
4553
4554         * NEWS: update
4555
4556 2003-01-15  Havoc Pennington  <hp@redhat.com>
4557
4558         * test/Makefile.am: fix so that test source code ends up in the
4559         distribution on make distcheck
4560
4561 2003-01-15  Havoc Pennington  <hp@redhat.com>
4562
4563         Release 0.1.
4564
4565         * NEWS: update
4566
4567 2003-01-15  Havoc Pennington  <hp@redhat.com>
4568
4569         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
4570         fix build when --disable-tests
4571
4572         * Makefile.am (EXTRA_DIST): put HACKING in here
4573
4574         * HACKING: document procedure for making a tarball release.
4575
4576 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
4577
4578         * bus/connection.c: (connection_error_handler),
4579         (bus_connection_setup):
4580         * bus/main.c: (main):
4581         Make sure that the DBusConnectionData struct is NULLed
4582         out to prevent a segfault.
4583
4584         * dbus/dbus-errors.c: (dbus_result_to_string):
4585         * dbus/dbus-errors.h:
4586         * dbus/dbus-message.c: (dbus_message_get_fields),
4587         (dbus_message_get_fields_valist), (_dbus_message_test):
4588         * dbus/dbus-message.h:
4589         Make dbus_message_get_fields return a result code so we can
4590         track invalid fields as well as oom.
4591
4592 2003-01-11  Havoc Pennington  <hp@pobox.com>
4593
4594         * configure.in: change --enable-test/--enable-ansi action-if-given
4595         to enable_foo=$enableval instead of enable_foo=yes
4596
4597 2003-01-08  Havoc Pennington  <hp@pobox.com>
4598
4599         * dbus/dbus-string.c (_dbus_string_align_length): new function
4600
4601         * dbus/dbus-test-main.c: move main() for test app here
4602         * dbus/dbus-test.c
4603         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
4604         symbol to run tests, because dbus-test isn't in the main
4605         library
4606
4607         Code review nitpicks.
4608
4609         * dbus/dbus-message.c (dbus_message_write_header): add newlines
4610         for people with narrow emacs ;-). Assert client_serial was filled
4611         in. Assert message->name != NULL.
4612         (dbus_message_append_fields): have "first_field_type" arg separate
4613         from va list, needed for C++ binding that also uses varargs IIRC
4614         and helps with type safety
4615         (dbus_message_new): add @todo about using DBusString to store
4616         service/name internally
4617         (dbus_message_new): don't leak ->service and ->name on OOM later
4618         in the function
4619         (dbus_message_unref): free the service name
4620         (dbus_message_get_fields): same change to varargs
4621         i.e. first_field_type
4622         (_dbus_message_loader_return_buffer): assert that the message data
4623         is aligned (if not it's a bug in our code). Put in verbose griping
4624         about why we set corrupted = TRUE.
4625         (decode_header_data): add FIXME that char* is evil.  Was going to
4626         add FIXME about evil locale-specific string.h strncmp, but just
4627         switched to wacky string-as-uint32 optimization. Move check for
4628         "no room for field name" above get_const_data_len() to avoid
4629         assertion failure in get_const_data_len if we have trailing 2
4630         bytes or the like. Check for service and name fields being
4631         provided twice. Don't leak service/name on error. Require field
4632         names to be aligned to 4 bytes.
4633
4634         * dbus/dbus-marshal.c: move byte swap stuff to header
4635         (_dbus_pack_int32): uscore-prefix
4636         (_dbus_unpack_int32): uscore-prefix
4637         (_dbus_unpack_uint32): export
4638         (_dbus_demarshal_string): add @todo complaining about use of
4639         memcpy()
4640         (_dbus_marshal_get_field_end_pos): add @todo about bad error
4641         handling allowing corrupt data to go unchecked
4642
4643 2003-01-08  Havoc Pennington  <hp@redhat.com>
4644
4645         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
4646         to the select() as needed for authentication. (should be using
4647         _dbus_poll() not select, but for another day)
4648
4649         * dbus/dbus.h: include dbus/dbus-protocol.h
4650
4651 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
4652
4653         * dbus/Makefile.am (dbusinclude_HEADERS): Install
4654         dbus-connection.h
4655
4656 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
4657
4658         * dbus/dbus-internals.c: (_dbus_type_to_string):
4659         New function that returns a string describing a type.
4660
4661         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
4662         * dbus/dbus-marshal.h:
4663         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
4664         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
4665         (dbus_message_iter_get_byte_array):
4666         * dbus/dbus-message.h:
4667         Add new convenience functions for appending and getting message fields.
4668         Also add demarshalling routines for byte arrays.
4669
4670 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
4671
4672         * dbus/dbus-connection-internal.h:
4673         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
4674         (_dbus_connection_get_next_client_serial),
4675         (dbus_connection_send_message):
4676         * dbus/dbus-internals.h:
4677         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
4678         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
4679         (_dbus_marshal_uint32), (_dbus_demarshal_double),
4680         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
4681         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
4682         (_dbus_verbose_bytes), (_dbus_marshal_test):
4683         * dbus/dbus-marshal.h:
4684         * dbus/dbus-message-internal.h:
4685         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
4686         (dbus_message_write_header), (_dbus_message_lock),
4687         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
4688         (dbus_message_get_name), (dbus_message_append_int32),
4689         (dbus_message_append_uint32), (dbus_message_append_double),
4690         (dbus_message_append_string), (dbus_message_append_byte_array),
4691         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
4692         (dbus_message_iter_unref), (dbus_message_iter_has_next),
4693         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
4694         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
4695         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
4696         (decode_header_data), (_dbus_message_loader_return_buffer),
4697         (message_iter_test), (_dbus_message_test):
4698         * dbus/dbus-message.h:
4699         * dbus/dbus-protocol.h:
4700         * dbus/dbus-test.c: (main):
4701         * dbus/dbus-test.h:
4702         * glib/test-dbus-glib.c: (message_handler), (main):
4703         * test/echo-client.c: (main):
4704         * test/watch.c: (check_messages):
4705         Make messages sendable and receivable for real.
4706
4707 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
4708
4709         * dbus/dbus-marshal.c: (_dbus_marshal_double),
4710         (_dbus_marshal_string), (_dbus_marshal_byte_array):
4711         * dbus/dbus-message.c: (dbus_message_append_int32),
4712         (dbus_message_append_uint32), (dbus_message_append_double),
4713         (dbus_message_append_string), (dbus_message_append_byte_array):
4714         Handle OOM restoration.
4715
4716 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
4717
4718         * dbus/dbus-marshal.c: (_dbus_marshal_string),
4719         (_dbus_demarshal_string), (_dbus_marshal_test):
4720         * dbus/dbus-marshal.h:
4721         * dbus/dbus-message.c: (dbus_message_get_name),
4722         Document these functions.
4723
4724         (dbus_message_append_int32), (dbus_message_append_uint32),
4725         (dbus_message_append_double), (dbus_message_append_string),
4726         (dbus_message_append_byte_array):
4727         * dbus/dbus-message.h:
4728         Add functions for adding message fields of different types.
4729
4730         * dbus/dbus-protocol.h:
4731         Add the different types.
4732
4733 2003-01-05  Havoc Pennington  <hp@pobox.com>
4734
4735         * bus/connection.c: implement routines for handling connections,
4736         first thing is keeping a list of owned services on each connection
4737         and setting up watches etc.
4738
4739         * bus/services.c: implement a mapping from service names to lists
4740         of connections
4741
4742         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
4743
4744         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
4745         to use static mutexes for global data
4746
4747         * dbus/dbus-connection.c (dbus_connection_set_data): add new
4748         collection of functions to set/get application-specific data
4749         on the DBusConnection.
4750
4751 2003-01-04  Havoc Pennington  <hp@pobox.com>
4752
4753         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
4754         (_dbus_poll): new function
4755
4756         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
4757         copied from GLib
4758
4759         * bus/loop.c: initial code for the daemon main loop
4760
4761 2003-01-04  Havoc Pennington  <hp@pobox.com>
4762
4763         * test/watch.c (error_handler): make it safe if the error handler
4764         is called multiple times (if we s/error handler/disconnect
4765         handler/ we should just guarantee it's called only once)
4766
4767         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
4768         error handler on disconnect (it's quite possible we should
4769         just change the error handler to a "disconnect handler," I'm
4770         not sure we have any other meaningful errors)
4771
4772         * configure.in: check for getpwnam_r
4773
4774         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
4775         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
4776         mechanism as in SASL spec, using socket credentials
4777
4778         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
4779         (_dbus_send_credentials_unix_socket): new function
4780
4781         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
4782         dbus_accept()
4783         (_dbus_write): only check errno if <0 returned
4784         (_dbus_write_two): ditto
4785
4786 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
4787
4788         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
4789         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
4790         (_dbus_marshal_test):
4791         * dbus/dbus-marshal.h:
4792         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
4793         to _dbus_marshal_utf8_string. Also fix some tests.
4794
4795 2002-12-28  Harri Porten  <porten@kde.org>
4796
4797         * configure.in: added check for C++ compiler and a very cheesy
4798         check for the Qt integration
4799
4800         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
4801
4802         * qt/Makefile.am: added
4803
4804         * qt/.cvsignore: added
4805
4806         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
4807         latter, added #ifdef QT_THREAD_SUPPORT guard.
4808
4809         * dbus/Makefile.am: added missing headers for make dist
4810
4811 2002-12-28  Kristian Rietveld  <kris@gtk.org>
4812
4813         * dbus/Makefile.am: fixup export-symbols-regex.
4814
4815 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
4816
4817         * acinclude.m4: Add this file and put the
4818         PKG_CHECK_MODULE macro in it.
4819
4820 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
4821
4822         * dbus/dbus-marshal.c: (_dbus_marshal_string),
4823         (_dbus_demarshal_double), (_dbus_demarshal_int32),
4824         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4825         (_dbus_marshal_test):
4826         Make the demarshalling routines align the pos argument.
4827         Add string marshalling tests and fix the obvious bugs
4828         discovered.
4829
4830 2002-12-26  Havoc Pennington  <hp@pobox.com>
4831
4832         * dbus/dbus-auth.c: fixes fixes fixes
4833
4834         * dbus/dbus-transport-unix.c: wire up support for
4835         encoding/decoding data on the wire
4836
4837         * dbus/dbus-auth.c (_dbus_auth_encode_data)
4838         (_dbus_auth_decode_data): append to target string
4839         instead of nuking it.
4840
4841 2002-12-26  Havoc Pennington  <hp@pobox.com>
4842
4843         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
4844         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
4845         doh
4846
4847         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
4848         avoid swap_bytes() overhead (ignoring possible assembly stuff for
4849         now). Main point is because I wanted unpack_uint32 to implement
4850         _dbus_verbose_bytes
4851         (_dbus_verbose_bytes): new function
4852
4853         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
4854
4855         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
4856         mechanism to handle a corrupt message stream
4857         (_dbus_message_loader_new): fix preallocation to only prealloc,
4858         not prelengthen
4859
4860         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
4861         (_dbus_string_test): enhance tests for copy/move and fix the
4862         functions
4863
4864         * dbus/dbus-transport-unix.c: Hold references in more places to
4865         avoid reentrancy problems
4866
4867         * dbus/dbus-transport.c: ditto
4868
4869         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
4870         leak reference count in no-message case
4871
4872         * test/watch.c (do_mainloop): handle adding/removing watches
4873         during iteration over the watches. Also, ref the connection/server
4874         stored on a watch, so we don't try to mangle a destroyed one.
4875
4876         * dbus/dbus-transport-unix.c (do_authentication): perform
4877         authentication
4878
4879         * dbus/dbus-auth.c (get_state): add a state
4880         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
4881         (_dbus_auth_get_unused_bytes): append the unused bytes
4882         to the passed in string, rather than prepend
4883
4884         * dbus/dbus-transport.c (_dbus_transport_init_base): create
4885         the auth conversation DBusAuth
4886
4887         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
4888         (_dbus_transport_new_for_domain_socket): when creating a
4889         transport, pass in whether it's a client-side or server-side
4890         transport so we know which DBusAuth to create
4891
4892 2002-12-03  Havoc Pennington  <hp@pobox.com>
4893
4894         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
4895         _after_ finalizing the derived members
4896         (unix_connection_set): unref watch if we fail to add it
4897
4898         * dbus/dbus-connection.c (dbus_connection_unref): delete the
4899         transport first, so that the connection owned by the
4900         transport will be valid as the transport finalizes.
4901
4902         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
4903         if necessary, and remove watches from the connection.
4904
4905         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
4906
4907 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
4908
4909         * dbus/dbus-marshal.c: (_dbus_marshal_string),
4910         (_dbus_demarshal_double), (_dbus_demarshal_int32),
4911         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4912         (_dbus_marshal_test):
4913         * dbus/dbus-marshal.h:
4914         Add string marshal functions and have the demarshal functions
4915         return the new position.
4916
4917 2002-12-25  Havoc Pennington  <hp@pobox.com>
4918
4919         * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
4920         it is a simple protocol that just maps directly to SASL.
4921
4922         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
4923         initial implementation, not actually used yet.
4924
4925         * dbus/dbus-string.c (_dbus_string_find): new function
4926         (_dbus_string_equal): new function
4927         (_dbus_string_base64_encode): new function
4928         (_dbus_string_base64_decode): new function
4929
4930 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
4931
4932         * dbus/Makefile.am:
4933         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
4934         (_dbus_marshal_int32), (_dbus_marshal_uint32),
4935         (_dbus_demarshal_double), (_dbus_demarshal_int32),
4936         (_dbus_demarshal_uint32), (_dbus_marshal_test):
4937         * dbus/dbus-marshal.h:
4938         * dbus/dbus-protocol.h:
4939         * dbus/dbus-test.c: (main):
4940         * dbus/dbus-test.h:
4941         Add un-optimized marshalling/demarshalling routines.
4942
4943 2002-12-25  Harri Porten  <porten@kde.org>
4944
4945         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
4946
4947 2002-12-24  Zack Rusin  <zack@kde.org>
4948
4949         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
4950         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
4951         main loop stuff
4952
4953 2002-12-24  Havoc Pennington  <hp@pobox.com>
4954
4955         * glib/dbus-gthread.c: fix include
4956
4957         * glib/dbus-glib.h: rename DBusMessageHandler for now.
4958         I think glib API needs to change, though, as you don't
4959         want to use DBusMessageFunction, you want to use the
4960         DBusMessageHandler object. Probably
4961         dbus_connection_open_with_g_main_loop()
4962         and dbus_connection_setup_g_main_loop() or something like that
4963         (but think of better names...) that just create a connection
4964         that has watch/timeout functions etc. already set up.
4965
4966         * dbus/dbus-connection.c
4967         (dbus_connection_send_message_with_reply): new function just to
4968         show how the message handler helps us deal with replies.
4969
4970         * dbus/dbus-list.c (_dbus_list_remove_last): new function
4971
4972         * dbus/dbus-string.c (_dbus_string_test): free a string that
4973         wasn't
4974
4975         * dbus/dbus-hash.c: use memory pools for the hash entries
4976         (rebuild_table): be more paranoid about overflow, and
4977         shrink table when we can
4978         (_dbus_hash_test): reduce number of sprintfs and write
4979         valid C89. Add tests for case where we grow and then
4980         shrink the hash table.
4981
4982         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
4983
4984         * dbus/dbus-connection.c (dbus_connection_register_handler)
4985         (dbus_connection_unregister_handler): new functions
4986
4987         * dbus/dbus-message.c (dbus_message_get_name): new
4988
4989         * dbus/dbus-list.c: fix docs typo
4990
4991         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
4992         an object representing a handler for messages.
4993
4994 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
4995
4996         * glib/dbus-glib.h:
4997         * glib/dbus-gthread.c: (dbus_gthread_init):
4998         Don't use the gdbus prefix for public functions.
4999
5000 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
5001
5002         * Makefile.am:
5003         * configure.in:
5004         Add GLib checks and fixup .pc files
5005
5006         * glib/Makefile.am:
5007         * glib/dbus-glib.h:
5008         * glib/dbus-gmain.c: (gdbus_connection_prepare),
5009         (gdbus_connection_check), (gdbus_connection_dispatch),
5010         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
5011         (dbus_connection_gsource_new):
5012         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
5013         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
5014         * glib/test-dbus-glib.c: (message_handler), (main):
5015         Add GLib support.
5016
5017 2002-12-15  Harri Porten  <porten@kde.org>
5018
5019         * autogen.sh: check for libtoolize before attempting to use it
5020
5021         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
5022         struct.
5023
5024         * .cvsignore: ignore more stamp files
5025
5026         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
5027
5028         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
5029         without make install.
5030
5031 2002-12-15  Havoc Pennington  <hp@pobox.com>
5032
5033         * dbus/dbus-threads.c: add thread stubs that a higher library
5034         layer can fill in. e.g. the GLib wrapper might fill them in with
5035         GThread stuff. We still need to use this thread API to
5036         thread-safe-ize the library.
5037
5038 2002-12-12  Havoc Pennington  <hp@pobox.com>
5039
5040         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
5041         below new interfaces and include fewer system headers.
5042
5043         * dbus/dbus-sysdeps.c (_dbus_read): new function
5044         (_dbus_write): new function
5045         (_dbus_write_two): new function
5046         (_dbus_connect_unix_socket): new function
5047         (_dbus_listen_unix_socket): new function
5048
5049         * dbus/dbus-message-internal.h: change interfaces to use
5050         DBusString
5051
5052 2002-12-11  Havoc Pennington  <hp@pobox.com>
5053
5054         * dbus/dbus-types.h: add dbus_unichar
5055
5056         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
5057
5058         * dbus/dbus-connection.c (dbus_connection_send_message): return
5059         TRUE on success
5060
5061         * dbus/dbus-transport.c: include dbus-watch.h
5062
5063         * dbus/dbus-connection.c: include dbus-message-internal.h
5064
5065         * HACKING: add file with coding guidelines stuff.
5066
5067         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
5068         handling here, for security purposes (as in vsftpd). Not actually
5069         using this class yet.
5070
5071         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
5072         system/libc usage here, as in vsftpd, for ease of auditing (and
5073         should also simplify portability). Haven't actually moved all the
5074         system/libc usage into here yet.
5075
5076 2002-11-25  Havoc Pennington  <hp@pobox.com>
5077
5078         * dbus/dbus-internals.c (_dbus_verbose): fix to not
5079         always print the first verbose message.
5080
5081 2002-11-24  Havoc Pennington  <hp@pobox.com>
5082
5083         * test/echo-client.c, test/echo-server.c: cheesy test
5084         clients.
5085
5086         * configure.in (AC_CHECK_FUNCS): check for writev
5087
5088         * dbus/dbus-message.c (_dbus_message_get_network_data): new
5089         function
5090
5091         * dbus/dbus-list.c (_dbus_list_foreach): new function
5092
5093         * dbus/dbus-internals.c (_dbus_verbose): new function
5094
5095         * dbus/dbus-server.c, dbus/dbus-server.h: public object
5096         representing a server that listens for connections.
5097
5098         * dbus/.cvsignore: create
5099
5100         * dbus/dbus-errors.h, dbus/dbus-errors.c:
5101         public API for reporting errors
5102
5103         * dbus/dbus-connection.h, dbus/dbus-connection.c:
5104         public object representing a connection that
5105         sends/receives messages. (Same object used for
5106         both client and server.)
5107
5108         * dbus/dbus-transport.h, dbus/dbus-transport.c:
5109         Basic abstraction for different kinds of stream
5110         that we might read/write messages from.
5111
5112 2002-11-23  Havoc Pennington  <hp@pobox.com>
5113
5114         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
5115         _DBUS_INT_MAX
5116
5117         * dbus/dbus-test.c (main): add list test, and include
5118         dbus-test.h as intended
5119
5120         * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
5121         (_dbus_hash_table_remove_int): return value indicates
5122         whether the entry existed to remove
5123
5124         * dbus/dbus-list.c: add linked list utility class,
5125         with docs and tests
5126
5127         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
5128         array sometimes.
5129
5130 2002-11-23  Havoc Pennington  <hp@pobox.com>
5131
5132         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
5133         DBUS_END_DECLS to nothing, that should fix this once and for all
5134
5135         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
5136
5137         * dbus/dbus-message.c, dbus/dbus-hash.c:
5138         add some missing @brief
5139
5140 2002-11-23  Havoc Pennington  <hp@pobox.com>
5141
5142         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
5143         to avoid confusing Doxygen
5144
5145         * dbus/dbus-hash.c: @} not }@
5146
5147         * dbus/dbus-message.c (struct DBusMessage): split out
5148         internals docs
5149
5150 2002-11-23  Havoc Pennington  <hp@pobox.com>
5151
5152         * configure.in: pile on more warning flags if using gcc
5153
5154         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
5155         to document static functions
5156
5157         * configure.in: add summary to end of configure so it
5158         looks nice and attractive
5159
5160         * dbus/dbus-hash.c: finish implementation and write unit
5161         tests and docs
5162
5163         * configure.in: add --enable-tests to enable unit tests
5164
5165         * dbus/dbus-test.c: test program to run unit tests
5166         for all files in dbus/*, initially runs a test for
5167         dbus-hash.c
5168
5169         * dbus/dbus-internals.h: file to hold some internal utility stuff
5170
5171 2002-11-22  Havoc Pennington  <hp@redhat.com>
5172
5173         * dbus/dbus-hash.c: copy in Tcl hash table, not yet
5174         "ported" away from Tcl
5175
5176         * dbus/dbus-types.h: header for types such as dbus_bool_t
5177
5178 2002-11-22  Havoc Pennington  <hp@redhat.com>
5179
5180         * dbus/dbus.h: fixups for doc warnings
5181
5182         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
5183         macros
5184         (QUIET): make it quiet so we can see warnings
5185
5186         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
5187
5188 2002-11-22  Havoc Pennington  <hp@redhat.com>
5189
5190         * Makefile.am: include "Doxyfile" target in all-local
5191
5192         * configure.in: generate the Doxyfile
5193
5194         * Doxyfile.in: move Doxyfile here, so we can use
5195         configure to generate a Doxyfile with the right
5196         version number etc.
5197
5198 2002-11-22  Havoc Pennington  <hp@redhat.com>
5199
5200         * dbus/dbus-message.c: move inline docs into .c file
5201
5202         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
5203         so all docs are under doc/
5204         (MAN_EXTENSION): generate man pages. Use extension
5205         ".3dbus" which matches ".3qt" on my system,
5206         I guess this is OK, I don't know really.
5207         (FILE_PATTERNS): look for .c files not .h, makes sense
5208         for plain C I think
5209
5210 2002-11-22  Havoc Pennington  <hp@pobox.com>
5211
5212         * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
5213         because any app can be a server, and any app can be a client,
5214         the bus is a special kind of server.
5215
5216 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
5217
5218         * Doxyfile : adding. Still needs Makefile rules to be generated
5219         automatically (just run "doxygen" in the toplevel dir for now to
5220         generate docs)
5221
5222         * dbus/dbus-message.h : Adding sample docs (javadoc since
5223         resembles gtk-doc a little more)
5224
5225         * dbus/dbus.h : Adding sample docs
5226
5227 2002-11-21  Havoc Pennington  <hp@redhat.com>
5228
5229         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
5230         so we can allow ourselves to include files directly,
5231         instead of having to use dbus.h
5232
5233         * dbus/dbus.h: fill in
5234
5235         * dbus/dbus-message.h: sketch out a sample header file.
5236         Include griping if you include it directly instead of
5237         via dbus.h
5238
5239         * dbus/dbus-macros.h: new file with macros for extern "C",
5240         TRUE/FALSE, NULL, etc.
5241
5242         * doc/file-boilerplate.c: put include guards in here
5243
5244 2002-11-21  Havoc Pennington  <hp@redhat.com>
5245
5246         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
5247
5248         * COPYING: include the GPL as well, and license code
5249         under both AFL and GPL.
5250
5251 2002-11-21  Havoc Pennington  <hp@redhat.com>
5252
5253         * acconfig.h: get rid of this
5254
5255         * autogen.sh (run_configure): add --no-configure option
5256
5257         * configure.in: remove AC_ARG_PROGRAM to make
5258         autoconf complain less. add AC_PREREQ.
5259         add AC_DEFINE third arg.
5260
5261 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
5262
5263         * doc/Makefile.am:
5264         Fix references so we can distcheck.
5265
5266 2002-11-21  Havoc Pennington  <hp@redhat.com>
5267
5268         * Initial module creation
5269