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