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