2003-04-03 Havoc Pennington <hp@redhat.com>
[platform/upstream/dbus.git] / ChangeLog
1 2003-04-03  Havoc Pennington  <hp@redhat.com>
2
3         * bus/loop.h, bus/loop.c: make the mainloop an object so we can
4         have multiple ones
5
6         * bus/*.[hc]: adapt to mainloop change
7
8 2003-04-03  Havoc Pennington  <hp@redhat.com>
9
10         * bus/activation.c (load_directory): fix up memleaks
11         (bus_activation_entry_free): free the entry
12
13         * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
14         we get one from the message bus; fix memleaks.
15
16         * dbus/dbus-message.c (dbus_set_error_from_message): new function
17
18 2003-04-03  Havoc Pennington  <hp@pobox.com>
19
20         * bus/config-parser.c (bus_config_parser_unref): free 
21         list of mechanisms, bug discovered by test suite enhancements
22         (putting system.conf and session.conf into suite)
23
24         * test/Makefile.am, test/test-service.c: add placeholder for a
25         test service that we'll activate as part of test suite. Doesn't 
26         do anything yet.
27
28         * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by 
29         setting NULL value, and use system malloc not dbus_malloc() 
30         when we have unavoidable memleakage.
31
32         * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
33         didn't work, and support DBUS_BUS_ACTIVATION.
34         
35         * bus/activation.c (child_setup): pass our well-known bus type to
36         the child
37
38         * bus/config-parser.c: support <type> to specify well-known type
39
40         * doc/dbus-specification.sgml: document the env variables to 
41         locate well-known buses and find service activator
42
43 2003-04-02  Havoc Pennington  <hp@redhat.com>
44
45         * test/Makefile.am (all-local): add a rule to copy tests to
46         builddir, so we can have generated tests. Use this to remove the
47         silly hack for testing system.conf and session.conf. Will use this 
48         shortly to generate .service files pointing to test binaries.
49
50 2003-04-02  Havoc Pennington  <hp@redhat.com>
51
52         * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
53         current alloc and needed new length, not max of the doubled
54         allocation and needed new length. Also, when building tests, 
55         don't do the double-allocation stuff, just realloc every time.
56
57 2003-04-02  Havoc Pennington  <hp@redhat.com>
58
59         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
60         in error messages
61         (_dbus_string_get_dirname): new
62         (_dbus_sysdeps_test): new
63         (_dbus_directory_open): include dirnames in error messages
64
65         * bus/config-parser.c: interpret <include> and <includedir> and
66         <servicedir> relative to config file location if the given
67         filename is not absolute.
68
69         * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
70
71 2003-04-02  Havoc Pennington  <hp@redhat.com>
72
73         * bus/connection.c (bus_transaction_send_error_reply): set sender
74         service for the error, and unref the reply on success
75
76         * bus/activation.c: convert to use BusTransaction so OOM can be
77         handled correctly
78         (bus_activation_service_created): set sender of the message
79
80 2003-04-01  Havoc Pennington  <hp@redhat.com>
81
82         * bus/config-parser.c, bus/bus.c: implement <servicedir> and
83         <includedir> (at least mostly)
84
85         * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
86         first, then the user ID
87
88 2003-04-01  Havoc Pennington  <hp@pobox.com>
89
90         * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
91         function
92
93         * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
94
95         * dbus/dbus-internals.c (_dbus_dup_string_array): new function
96
97         * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
98         socket 0777, and unlink any existing socket.
99
100         * bus/bus.c (bus_context_new): change our UID/GID and fork if
101         the configuration file so specifies; set up auth mechanism 
102         restrictions
103
104         * bus/config-parser.c (bus_config_parser_content): add support
105         for <fork> option and fill in code for <auth> 
106
107         * bus/system.conf.in: add <fork/> to default configuration, 
108         and limit auth mechanisms to EXTERNAL
109
110         * doc/config-file.txt (Elements): add <fork>
111
112         * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
113         (_dbus_change_identity): new function
114
115 2003-03-31  Havoc Pennington  <hp@redhat.com>
116
117         * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket) 
118         (_dbus_listen_unix_socket): fix off-by-one error in null
119         termination spotted by Nalin
120
121 2003-03-31  Havoc Pennington  <hp@redhat.com>
122
123         * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
124         DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
125         having a real home directory available.
126
127 2003-03-31  Havoc Pennington  <hp@redhat.com>
128
129         * bus/Makefile.am (install-data-hook): create /var/run/dbus
130
131         * bus/messagebus.in: add init script for Red Hat /etc/init.d
132
133         * configure.in: add support for specifying a style of init script
134         to install
135
136 2003-03-31  Havoc Pennington  <hp@redhat.com>
137
138         Fix some annoying DBusString API and fix all affected code.
139         
140         * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
141         max_length argument
142         (_dbus_string_get_data): change to return string instead of using 
143         an out param
144         (_dbus_string_get_const_data): ditto
145         (_dbus_string_get_data_len): ditto
146         (_dbus_string_get_const_data_len): ditto
147
148 2003-03-31  Havoc Pennington  <hp@redhat.com>
149
150         * bus/main.c (main): fix up the command line arguments to be nicer
151
152 2003-03-31  Havoc Pennington  <hp@redhat.com>
153
154         * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
155         define DBUS_SYSTEM_BUS_PATH as we want to compile in the same 
156         final location that lands in the config file
157
158         * bus/config-loader-expat.c (bus_config_load): fix type of
159         XML_Parser variable
160
161         * doc/TODO: remove TODO item for dbus_bus_get()
162
163         * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
164
165 2003-03-31  Havoc Pennington  <hp@pobox.com>
166
167         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
168         (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
169         argument since they are always client side
170
171         * dbus/dbus-server.c (dbus_server_get_address): new function
172
173         * bus/main.c (main): take the configuration file as an argument.
174
175         * test/data/valid-config-files/debug-allow-all.conf: new file to 
176         use with dispatch.c tests for example
177
178         * bus/test-main.c (main): require test data dir
179
180         * bus/bus.c (bus_context_new): change this to take a
181         configuration file name as argument
182
183         * doc/config-file.txt (Elements): add <servicedir>
184
185         * bus/system.conf, bus/session.conf: new files
186         
187         * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
188         well-known socket if none set
189
190         * configure.in: create system.conf and session.conf
191
192 2003-03-30  Havoc Pennington  <hp@pobox.com>
193
194         * bus/config-parser.c: hacking
195         
196         * dbus/dbus-memory.c: don't use DBusList for the list of stuff 
197         to shut down, since it could cause weirdness with the DBusList
198         lock
199
200         * dbus/dbus-list.c (_dbus_list_test): add tests for the
201         link-oriented stack routines
202         (alloc_link): free the mempool if the first alloc from it fails
203
204         * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
205
206         * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
207         from GLib
208         (_dbus_string_skip_white): new
209
210         * doc/config-file.txt (Elements): add <includedir>
211
212 2003-03-28  Havoc Pennington  <hp@pobox.com>
213
214         * dbus/dbus-string.c (_dbus_string_copy_data_len)
215         (_dbus_string_copy_data): new functions
216
217 2003-03-28  Anders Carlsson  <andersca@codefactory.se>
218
219         * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
220         * dbus/dbus-bus.h:
221         Add dbus_bus_get.
222         
223         * dbus/dbus-memory.c:
224         Fix a doc comment.
225         
226 2003-03-28  Havoc Pennington  <hp@pobox.com>
227
228         * bus/test.c (bus_test_flush_bus): remove the sleep from here, 
229         I think it may have just been superstition. Not sure.
230
231         * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
232         failures that were not being handled.
233
234         * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
235
236         * dbus/dbus-memory.c: add ability to set number of mallocs in a
237         row that will fail on out-of-memory.
238
239         * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
240         function for testing out-of-memory handling.
241
242         * bus/config-loader-expat.c (memsuite): don't wrap the dbus
243         allocation functions, they do map exactly to the expat ones.
244
245 2003-03-27  Havoc Pennington  <hp@redhat.com>
246
247         * bus/config-loader-libxml.c (bus_config_load): add another error
248         check
249
250 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
251
252         * doc/TODO:
253         Add note about automatic service activation.
254         
255         * doc/dbus-specification.sgml:
256         Rename the specification and clarify a few things.
257         
258 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
259
260         * Doxyfile.in:
261         * dbus/dbus-address.c:
262         * dbus/dbus-dict.c:
263         * dbus/dbus-marshal.c:
264         * dbus/dbus-server-debug-pipe.c:
265         * dbus/dbus-transport-unix.c:
266         Fix documentation warnings.
267         
268 2003-03-26  Havoc Pennington  <hp@pobox.com>
269
270         * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
271         after every test so it's quick and easy to see which leaked, and
272         so we test multiple dbus_shutdown() calls
273
274         * configure.in: change configure.in XML stuff to also support
275         expat
276
277         * config-loader-libxml.c: some hacking
278
279         * config-loader-expat.c: some hacking
280
281         * config-parser.c: some hacking, plus tests
282
283 2003-03-25  Havoc Pennington  <hp@redhat.com>
284
285         * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
286         
287         * configure.in: add --with-xml option to specify XML library,
288         right now only libxml is supported.
289
290         * bus/config-loader-libxml.c, config-parser.c: sync some minor 
291         nonworking code between home and work, still just stubs
292
293 2003-03-24  Havoc Pennington  <hp@redhat.com>
294
295         * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
296         file
297
298         * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow 
299         NULL argument for "message" if the error is a well-known one, 
300         fill in a generic message in this case.
301
302         * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
303         favor of DBusError
304
305         * bus/test.c (bus_test_flush_bus): add
306
307         * bus/policy.c (bus_policy_test): test code stub
308
309 2003-03-24  Havoc Pennington  <hp@pobox.com>
310
311         * bus/connection.c (bus_connections_setup_connection): set up 
312         the "can this user connect" function, but it always returns 
313         TRUE until we have a config file parser so we can have a config
314         file that allows connections.
315
316 2003-03-23  Havoc Pennington  <hp@pobox.com>
317
318         * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with 
319         DBUS_BUILD_TESTS, actually alloc/free a block of memory for 
320         the mutex, so we can check for proper memory management 
321         and OOM handling.
322
323         * dbus/dbus-dataslot.c: remove the mutex from
324         DBusDataSlotAllocator and lock it manually when using it, 
325         to simplify fitting it into the global slots framework.
326
327         * dbus/dbus-threads.c (init_static_locks): rework how we're
328         handling global locks so they are easily shut down.
329
330         * bus/policy.c (bus_policy_append_rule): fix
331
332         * bus/test-main.c (main): check for memleaks
333
334         * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make 
335         test suite check for memleaks
336
337         * dbus/dbus-memory.c: add support in test mode for tracking 
338         number of outstanding blocks
339
340 2003-03-23  Havoc Pennington  <hp@pobox.com>
341
342         * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
343         policies code
344         
345         * dbus/dbus-hash.h: add ULONG hash keys
346
347         * dbus/dbus-sysdeps.c (_dbus_get_groups): new
348         (_dbus_get_group_id): new function
349
350 2003-03-20  Havoc Pennington  <hp@redhat.com>
351
352         * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
353         new function
354         (dbus_connection_get_unix_user): new function
355
356 2003-03-20  Havoc Pennington  <hp@pobox.com>
357
358         * bus/connection.c (bus_connection_send_oom_error): assert that
359         message has a sender
360         (connection_execute_transaction): ditto
361         (bus_connection_preallocate_oom_error): fix to set the sender, and
362         set recipient to the destination service, not the bus driver
363
364         * bus/policy.c: hacking
365
366         * dbus/dbus-message.c (dbus_message_service_is): new function
367         (dbus_message_sender_is): new
368
369 2003-03-19  Havoc Pennington  <hp@redhat.com>
370
371         * bus/policy.c: start sketching code for policy restrictions on 
372         what connections can do.
373
374 2003-03-18  Havoc Pennington  <hp@redhat.com>
375
376         * doc/TODO: some notes on high-level todo items. Little nitpick
377         stuff is all in @todo, so no need to add it here.
378
379         * doc/config-file.txt: some notes on how config file might look
380
381 2003-03-18  Anders Carlsson  <andersca@codefactory.se>
382
383         * configure.in: 0.6
384
385         * NEWS: Update.
386         
387 2003-03-17  Havoc Pennington  <hp@redhat.com>
388
389         * dbus/dbus-internals.h: add gcc attributes so that 
390         our printf-style functions warn on bad arguments to 
391         format
392         
393         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf 
394         format bug
395
396         * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
397         printf format bug
398
399 2003-03-17  Havoc Pennington  <hp@redhat.com>
400
401         * bus/test-main.c (main): make it print something as it runs 
402         so make check doesn't look stuck
403
404         * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove 
405         from CVS, now obsolete
406
407 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
408
409         * bus/dispatch.c: (bus_dispatch):
410         Refetch the service name since it may have been reallocated
411         when dbus_message_set_sender was called.
412         
413         * dbus/dbus-sysdeps.c: (_dbus_accept):
414         Add address and address length variables and use them to stop
415         valgrind from complaining.
416         
417 2003-03-17  Havoc Pennington  <hp@pobox.com>
418
419         All tests pass, no memleaks, no valgrind complaints.
420         
421         * bus/test.c: refcount handler_slot
422
423         * bus/connection.c (bus_connections_new): refcount
424         connection_data_slot
425
426         * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
427         bytes so that auth scripts pass.
428
429         * bus/dispatch.c: init message_handler_slot so it gets allocated
430         properly
431
432         * bus/dispatch.c (message_handler_slot_ref): fix memleak
433
434         * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
435         dealloc server_pipe_hash when no longer used for benefit of
436         leak checking
437
438         * dbus/dbus-auth.c (process_command): memleak fix
439
440         * bus/dispatch.c (check_hello_message): memleak fix
441
442 2003-03-16  Havoc Pennington  <hp@pobox.com>
443
444         * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
445
446 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
447
448         * bus/activation.c (bus_activation_activate_service): Append
449         the pending activation entry to the list of pending activations.
450
451 2003-03-16  Havoc Pennington  <hp@pobox.com>
452
453         * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
454         connections
455
456         * dbus/dbus-address.c (create_entry): fix OOM handling when
457         failing to alloc entry->method
458
459 2003-03-16  Havoc Pennington  <hp@pobox.com>
460
461         * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
462         the watch
463
464         * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
465         add some missing dbus_set_result
466
467         * bus/dispatch.c (bus_dispatch_add_connection): handle failure to 
468         alloc the DBusMessageHandler
469
470         * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
471         the transport here, since we call this from the finalizer; it 
472         resulted in a double-finalize.
473
474         * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug 
475         where we tried to use transport->connection that was NULL, 
476         happened when transport was disconnected early on due to OOM
477
478         * bus/*.c: adapt to handle OOM for watches/timeouts
479
480         * dbus/dbus-transport-unix.c: port to handle OOM during 
481         watch handling
482         
483         * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
484         reference to unused bytes instead of a copy
485
486         * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
487         out of memory
488
489         * dbus/dbus-connection.c (dbus_connection_handle_watch): return
490         FALSE on OOM
491
492         * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
493         of memory
494
495 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
496
497         * doc/dbus-specification.sgml:
498         Document reply message for ActivateService.
499         
500 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
501
502         * bus/activation.c: (bus_pending_activation_entry_free),
503         (bus_pending_activation_free), (bus_activation_new),
504         (bus_activation_unref), (bus_activation_service_created),
505         (bus_activation_activate_service):
506         * bus/activation.h:
507         * bus/bus.c: (bus_context_new):
508         * bus/desktop-file.c: (new_section):
509         * bus/driver.c: (bus_driver_send_service_deleted),
510         (bus_driver_handle_activate_service):
511         * bus/services.c: (bus_registry_new), (bus_registry_ensure):
512         * bus/services.h:
513         * dbus/dbus-connection.c:
514         (dbus_connection_send_with_reply_and_block):
515         * dbus/dbus-message.c: (dbus_message_append_args_valist):
516         * dbus/dbus-protocol.h:
517         Make activation work better. Now pending activations will be queued
518         and the daemon won't try to activate services that are already registered.
519         
520 2003-03-16  Havoc Pennington  <hp@pobox.com>
521
522         * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
523         connection data
524
525         * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
526         DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
527
528 2003-03-16  Havoc Pennington  <hp@pobox.com>
529
530         * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
531         this. always run the test suite before commit...
532
533         * bus/*: adapt to DBusConnection API changes
534
535         * glib/dbus-gmain.c: adapt to DBusConnection API changes, 
536         requires renaming stuff to avoid dbus_connection_dispatch name 
537         conflict.
538
539         * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
540         function
541
542         * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
543         separate from _dbus_message_loader_return_buffer()
544
545         * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
546         this, because it's now always broken to use; the number of
547         messages in queue vs. the number still buffered by the message
548         loader is undefined/meaningless. Should use
549         dbus_connection_get_dispatch_state().
550         (dbus_connection_dispatch): rename from
551         dbus_connection_dispatch_message
552
553 2003-03-16  Havoc Pennington  <hp@pobox.com>
554
555         * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
556         implementation
557
558 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
559
560         * dbus/dbus-connection.c:
561         (dbus_connection_send_with_reply_and_block):
562         Decrease connection->n_incoming when removing an entry 
563         from the list.
564         * dbus/dbus-dict.c: (dbus_dict_entry_free),
565         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
566         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
567         (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
568         (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
569         (dbus_dict_get_byte_array):
570         Handle NULL arrays and strings. Also add support for byte arrays.
571         
572         * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
573         (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
574         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
575         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
576         (_dbus_demarshal_dict), (demarshal_and_validate_len),
577         (_dbus_marshal_validate_arg), (_dbus_marshal_test):
578         * dbus/dbus-marshal.h:
579         Add support for marshalling and demarshalling empty arrays and strings.
580         
581         * dbus/dbus-message.c: (dbus_message_append_args_valist),
582         (dbus_message_append_string_array),
583         (dbus_message_iter_get_boolean),
584         (dbus_message_iter_get_boolean_array),
585         (dbus_message_iter_get_int32_array),
586         (dbus_message_iter_get_uint32_array),
587         (dbus_message_iter_get_double_array),
588         (dbus_message_iter_get_byte_array),
589         (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
590         (check_message_handling):
591         Add support for getting empty arrays and dicts.
592         
593         * dbus/dbus-string.c: (_dbus_string_validate_utf8):
594         Don't do any validation at all for now, that's better than just checking
595         for ASCII.
596         
597         * test/data/valid-messages/emptiness.message:
598         New test message with lots of empty arrays.
599         
600 2003-03-16  Havoc Pennington  <hp@pobox.com>
601
602         * dbus/dbus-connection.c
603         (_dbus_connection_queue_received_message_link): new function that
604         can't fail due to OOM
605
606         * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
607         new function pops a message together with a list link 
608         containing it.
609
610         * dbus/dbus-transport-unix.c (queue_messages): use new link-based
611         message queuing functions to avoid needing to alloc memory
612
613 2003-03-16  Havoc Pennington  <hp@pobox.com>
614
615         Oops - test code was only testing failure of around 30 of the
616         mallocs in the test path, but it turns out there are 500+
617         mallocs. I believe this was due to misguided linking setup such
618         that there was one copy of dbus_malloc etc. in the daemon and one
619         in the shared lib, and only daemon mallocs were tested. In any
620         case, the test case now tests all 500+ mallocs, and doesn't pass
621         yet, though there are lots of fixes in this patch.
622         
623         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
624         this so that it doesn't need to allocate memory, since it 
625         has no way of indicating failure due to OOM (and would be 
626         annoying if it did).
627
628         * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
629
630         * bus/Makefile.am: rearrange to create two self-contained
631         libraries, to avoid having libraries with overlapping symbols. 
632         that was resulting in weirdness, e.g. I'm pretty sure there 
633         were two copies of global static variables.
634
635         * dbus/dbus-internals.c: move the malloc debug stuff to 
636         dbus-memory.c
637
638         * dbus/dbus-list.c (free_link): free list mempool if it becomes
639         empty.
640
641         * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
642
643         * dbus/dbus-address.c (dbus_parse_address): free list nodes
644         on failure.
645
646         * bus/dispatch.c (bus_dispatch_add_connection): free
647         message_handler_slot when no longer using it, so 
648         memory leak checkers are happy for the test suite.
649
650         * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
651
652         * bus/bus.c (new_connection_callback): disconnect in here if 
653         bus_connections_setup_connection fails.
654
655         * bus/connection.c (bus_connections_unref): fix to free the 
656         connections
657         (bus_connections_setup_connection): if this fails, don't
658         disconnect the connection, just be sure there are no side
659         effects.
660
661         * dbus/dbus-string.c (undo_alignment): unbreak this
662
663         * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
664         leaking
665         (_dbus_auth_new): fix the order in which we free strings 
666         on OOM failure
667
668         * bus/connection.c (bus_connection_disconnected): fix to 
669         not send ServiceDeleted multiple times in case of memory 
670         allocation failure
671
672         * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
673         get the base service name
674         (dbus_bus_register_client): don't return base service name,
675         instead store it on the DBusConnection and have an accessor
676         function for it.
677         (dbus_bus_register_client): rename dbus_bus_register()
678
679         * bus/dispatch.c (check_hello_message): verify that other 
680         connections on the bus also got the correct results, not 
681         just the one sending hello
682
683 2003-03-15  Havoc Pennington  <hp@pobox.com>
684
685         Make it pass the Hello handling test including all OOM codepaths.
686         Now to do other messages...
687         
688         * bus/services.c (bus_service_remove_owner): fix crash when
689         removing owner from an empty list of owners
690         (bus_registry_ensure): don't leave service in the list of 
691         a connection's owned services if we fail to put the service
692         in the hash table.
693
694         * bus/connection.c (bus_connection_preallocate_oom_error): set
695         error flag on the OOM error.
696
697         * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
698         handle _dbus_transport_set_connection failure
699
700         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
701         to create watches up front and simply enable/disable them as
702         needed.
703         (unix_connection_set): this can now fail on OOM
704
705         * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept 
706         of enabling/disabling a watch or timeout.
707
708         * bus/loop.c (bus_loop_iterate): don't touch disabled
709         watches/timeouts
710
711         * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
712
713 2003-03-15  Havoc Pennington  <hp@pobox.com>
714
715         * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
716         write useful test code, after all that futzing around ;-)
717
718         Test does not yet pass because we can't handle OOM in
719         _dbus_transport_messages_pending (basically,
720         dbus_connection_preallocate_send() does not prealloc the write
721         watch). To fix this, I think we need to add new stuff to
722         set_watch_functions, namely a SetEnabled function so we can alloc
723         the watch earlier, then enable it later.
724         
725         * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
726         dbus-memory.c to the convenience lib
727
728         * bus/test.c: rename some static functions to keep them clearly 
729         distinct from stuff in connection.c. Handle client disconnection.
730
731 2003-03-14  Havoc Pennington  <hp@pobox.com>
732
733         * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe 
734         transport, tests more of the real codepath. Set up clients 
735         with bus_setup_debug_client.
736
737         * bus/test.c (bus_setup_debug_client): function to set up debug 
738         "clients" on the main loop
739
740         * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe 
741         support
742
743         * dbus/dbus-server.c (dbus_server_listen): add debug-pipe 
744         server type
745
746         * dbus/dbus-server-debug.c: support a debug server based on pipes
747
748         * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
749         (_dbus_close): new function
750         
751         * configure.in: check for socketpair
752
753 2003-03-14  Havoc Pennington  <hp@redhat.com>
754
755         * dbus/dbus-memory.c: add a "detect buffer overwrites on free" 
756         cheesy hack
757
758         * dbus/dbus-transport-debug.c: rework this a good bit to be 
759         less complicated. hopefully still works.
760
761         * dbus/dbus-server-debug.c (handle_new_client): remove timeout
762         manually
763
764         * glib/dbus-gmain.c (timeout_handler): don't remove timeout 
765         after running it
766
767         * dbus/dbus-message.c (dbus_message_copy): rename from 
768         dbus_message_new_from_message, fix it up to copy 
769         all the message fields, add test case
770
771         * bus/dispatch.c (bus_dispatch_test): add some more test code, 
772         not quite passing yet
773
774 2003-03-14  Havoc Pennington  <hp@pobox.com>
775
776         * bus/loop.c (bus_loop_iterate): add this so we can "run loop
777         until no work remains" in test code. (the large diff here 
778         is just code movement, no actual changes)
779
780         * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
781         1, no point waiting around for test code.
782         (_dbus_server_debug_accept_transport): unref the timeout 
783         after adding it (right?)
784
785         * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
786         
787 2003-03-13  Havoc Pennington  <hp@redhat.com>
788
789         * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
790         out of memory
791
792         * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
793         of memory
794
795         * dbus/dbus-connection.h: Make AddWatchFunction and
796         AddTimeoutFunction return a bool so they can fail on out-of-memory
797
798         * bus/bus.c (bus_context_new): set up timeout handlers
799
800         * bus/connection.c (bus_connections_setup_connection): set up
801         timeout handlers
802
803         * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
804         can fail
805
806         * bus/bus.c (bus_context_new): adapt to changes
807
808         * bus/connection.c: adapt to changes
809
810         * test/watch.c: adapt to DBusWatch changes
811
812         * bus/dispatch.c (bus_dispatch_test): started adding this but
813         didn't finish
814         
815 2003-03-14  Anders Carlsson  <andersca@codefactory.se>
816
817         * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
818
819 2003-03-13  Havoc Pennington  <hp@pobox.com>
820
821         * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c: 
822         set up a test framework as for the library
823
824 2003-03-12  Havoc Pennington  <hp@pobox.com>
825
826         Throughout: purge global variables, introduce BusActivation, 
827         BusConnections, BusRegistry, etc. objects instead.
828         
829         * bus/bus.h, bus/bus.c: introduce BusContext as a global 
830         message bus object
831
832         * test/Makefile.am (TEST_BINARIES): disable bus-test for now, 
833         going to redo this a bit differently I think
834         
835 2003-03-12  Havoc Pennington  <hp@redhat.com>
836
837         Mega-patch that gets the message bus daemon initially handling 
838         out-of-memory. Work still needed. Also lots of random 
839         moving stuff to DBusError instead of ResultCode.
840         
841         * dbus/dbus-list.c (_dbus_list_length_is_one): new function
842
843         * dbus/dbus-connection.c
844         (dbus_connection_send_with_reply_and_block): use DBusError
845
846         * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
847         DBusResultCode
848
849         * dbus/dbus-connection.c (dbus_connection_send): drop the result
850         code here, as the only failure possible is OOM.
851
852         * bus/connection.c (bus_connection_disconnect):
853         rename bus_connection_disconnected as it's a notification only
854
855         * bus/driver.c (bus_driver_handle_acquire_service): don't free
856         "name" on get_args failure, should be done by get_args; 
857         don't disconnect client for bad args, just return an error.
858         (bus_driver_handle_service_exists): ditto
859
860         * bus/services.c (bus_services_list): NULL-terminate returned array
861
862         * bus/driver.c (bus_driver_send_service_lost)
863         (bus_driver_send_service_acquired): send messages from driver to a
864         specific client to the client's unique name, not to the broadcast
865         service.
866
867         * dbus/dbus-message.c (decode_header_data): reject messages that
868         contain no name field
869         (_dbus_message_get_client_serial): rename to
870         dbus_message_get_serial and make public
871         (_dbus_message_set_serial): rename from set_client_serial
872         (_dbus_message_set_reply_serial): make public
873         (_dbus_message_get_reply_serial): make public
874
875         * bus/connection.c (bus_connection_foreach): allow stopping
876         iteration by returning FALSE from foreach function.
877
878         * dbus/dbus-connection.c (dbus_connection_send_preallocated) 
879         (dbus_connection_free_preallocated_send) 
880         (dbus_connection_preallocate_send): new API for sending a message
881         without possibility of malloc failure.
882         (dbus_connection_send_message): rename to just
883         dbus_connection_send (and same for whole function family)
884
885         * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
886
887         * dbus/dbus-sysdeps.c (_dbus_exit): new function
888
889         * bus/activation.c: handle/return errors
890
891         * dbus/dbus-errors.h: add more DBUS_ERROR #define
892
893         * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
894         (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
895         (_dbus_result_from_errno): move to this file
896
897 2003-03-10  Anders Carlsson  <andersca@codefactory.se>
898
899         * dbus/dbus-marshal.c: 
900         (_dbus_marshal_set_string):
901         Take a length argument so we can marshal the correct string
902         length.
903         
904         (_dbus_marshal_dict), (_dbus_demarshal_dict),
905         (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
906         (_dbus_marshal_test):
907         * dbus/dbus-marshal.h:  
908         Add support for marshalling and demarshalling dicts.
909         
910         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
911         Add support for TYPE DICT.
912         
913         * dbus/dbus-message.c: (set_string_field):
914         Adjust header padding.
915         
916         (dbus_message_append_args_valist), (dbus_message_append_dict),
917         (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
918         (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
919         (check_message_handling), (check_have_valid_message):
920         * dbus/dbus-message.h:
921         Add functions for setting and getting dicts.
922
923         * dbus/dbus-protocol.h:
924         Add DBUS_TYPE_DICT.
925         
926         * dbus/dbus.h:
927         Add dbus-dict.h
928         
929         * doc/dbus-specification.sgml:
930         Add information about how dicts are marshalled.
931         
932         * test/data/invalid-messages/dict-with-nil-value.message:
933         * test/data/invalid-messages/too-short-dict.message:
934         * test/data/valid-messages/dict-simple.message:
935         * test/data/valid-messages/dict.message:
936         Add sample messages containing dicts.
937
938 2003-03-08  Anders Carlsson  <andersca@codefactory.se>
939
940         * dbus/dbus-dict.h: Add DBUS_END_DECLS.
941
942 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
943
944         * dbus/Makefile.am:
945         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
946         (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
947         (dbus_dict_set_int32), (dbus_dict_set_uint32),
948         (dbus_dict_set_double), (dbus_dict_set_string),
949         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
950         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
951         (dbus_dict_set_string_array), (_dbus_dict_test):
952         * dbus/dbus-dict.h:
953         Fix according to comments from Havoc.
954         
955 2003-03-06  Michael Meeks  <michael@server.home>
956
957         * configure.in: if we don't have kde-config, disable have_qt.
958
959 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
960
961         * dbus/Makefile.am:
962         Add dbus-dict.[ch]
963         
964         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
965         (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
966         (dbus_dict_remove), (dbus_dict_get_value_type),
967         (dbus_dict_get_keys), (dbus_dict_put_boolean),
968         (dbus_dict_put_int32), (dbus_dict_put_uint32),
969         (dbus_dict_put_double), (dbus_dict_put_string),
970         (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
971         (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
972         (dbus_dict_put_string_array), (dbus_dict_get_boolean),
973         (dbus_dict_get_int32), (dbus_dict_get_uint32),
974         (dbus_dict_get_double), (dbus_dict_get_string),
975         (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
976         (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
977         (dbus_dict_get_string_array), (_dbus_dict_test):
978         * dbus/dbus-dict.h:
979         Add DBusDict implementation
980         
981         * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
982         * dbus/dbus-test.h:
983         Add _dbus_dict_test
984         
985 2003-03-04  Havoc Pennington  <hp@pobox.com>
986
987         * test/data/auth/*: adapt to changes
988
989         * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
990         USERID_BASE64 and change USERNAME_BASE64 to put in username not
991         userid
992
993         * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
994         more stuff from being in a context name, to make the protocol 
995         simpler to deal with
996
997         * dbus/dbus-errors.c (dbus_error_has_name): new function
998         (dbus_error_is_set): new function
999
1000         * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth 
1001         with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1002         
1003         * dbus/dbus-connection.c (dbus_connection_flush): also read
1004         messages during a flush operation
1005
1006         * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1007
1008 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
1009
1010         * configure.in: Check for gethostbyname on Solaris.
1011
1012         * dbus/dbus-transport.c: (_dbus_transport_open):
1013         Remove duplicate "tcp" entry.
1014         
1015         * doc/dbus-specification.sgml:
1016         Clarify some things.
1017         
1018 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
1019
1020         * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1021         * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1022         (_dbus_keyring_test):
1023         * dbus/dbus-md5.c: (_dbus_md5_compute):
1024         * dbus/dbus-sha.c: (_dbus_sha_compute):
1025         Plug memory leaks.
1026
1027 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
1028
1029         * README: Add some things.
1030
1031 2003-03-04  Anders Carlsson  <andersca@codefactory.se>
1032
1033         * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1034         after case DBUS_TYPE_BOOELAN.
1035
1036 2003-03-02  Havoc Pennington  <hp@pobox.com>
1037
1038         * test/break-loader.c (randomly_set_extreme_ints): add test that
1039         sets really huge and small integers
1040
1041         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1042         that length of boolean array fits in the string, and that 
1043         string has room for boolean value in single-bool case.
1044
1045         * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1046         optional value to "ALIGN" command which is what to fill the
1047         alignment with.
1048
1049         * test/data/valid-messages/no-padding.message: add regression
1050         test for the message padding problem
1051
1052 2003-03-02  Havoc Pennington  <hp@pobox.com>
1053
1054         * dbus/dbus-message.c (decode_header_data): fix to always init
1055         message_padding, from Benjamin Dauvergne
1056
1057 2003-03-02  Havoc Pennington  <hp@pobox.com>
1058
1059         * configure.in: 0.5
1060
1061         * NEWS: Update.
1062
1063 2003-03-01  Joe Shaw  <joe@assbarn.com>
1064
1065         * configure.in: Check for "struct cmsgcred" and try to access its
1066         members for BSD-like unices.
1067
1068         * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1069         _dbus_read_credentials_unix_socket().
1070         (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1071         read() for reading the credential byte off the unix socket.  Use
1072         struct cmsgcred on systems that support it.
1073
1074 2003-02-27  Alexander Larsson  <alexl@redhat.com>
1075
1076         * glib/Makefile.am: 
1077         * configure.in:
1078         Make gthreads-2.0 dependency optional. Don't build thread test if
1079         its not found.
1080
1081 2003-02-27  Havoc Pennington  <hp@pobox.com>
1082
1083         * dbus/dbus-connection.c
1084         (dbus_connection_send_message_with_reply_and_block): fix doh!
1085         doh! doh! bug that resulted in never removing a reply from the
1086         queue, no wonder we called get_reply_serial so much ;-)
1087         
1088         * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1089         and client serial instead of demarshaling them every time
1090
1091 2003-02-27  Havoc Pennington  <hp@pobox.com>
1092
1093         * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
1094         more inlined, using dbus-string-private.h, speeds things up 
1095         substantially
1096
1097         * dbus/dbus-string.c (_dbus_string_free): apply align offset
1098         when freeing the string
1099         (_dbus_string_steal_data): fix for align offset
1100         (undo_alignment): new function
1101
1102 2003-02-26  Havoc Pennington  <hp@redhat.com>
1103
1104         All kinds of audit fixes from Owen, plus initial attempt to 
1105         handle unaligned memory returned from malloc.
1106         
1107         * dbus/dbus-string.c (_dbus_string_init): clamp max length to 
1108         leave room for align_offset and nul byte
1109         (fixup_alignment): function to track an align_offset and 
1110         ensure real->str is aligned
1111         (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated, 
1112         to allow a nul byte plus align offset
1113         (_dbus_string_lock): fix overflow issue
1114         (_dbus_string_init_const_len): add assertions on sanity of len, 
1115         assign allocated to be ALLOCATION_PADDING larger than len
1116         (set_length): fixup the overflow handling
1117         (_dbus_string_get_data_len): fix overflow in assertion
1118         (open_gap): detect overflow in size of gap to be opened
1119         (_dbus_string_lengthen): add overflow check
1120         (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
1121         (_dbus_string_append): add overflow check
1122         (_dbus_string_append_unichar): overflow
1123         (_dbus_string_delete): fix overflow in assertion
1124         (_dbus_string_copy_len): overflow in assertion
1125         (_dbus_string_replace_len): overflows in assertions
1126         (_dbus_string_find): change to implement in terms of 
1127         _dbus_string_find_to
1128         (_dbus_string_find_to): assorted fixage
1129         (_dbus_string_equal_c_str): assert c_str != NULL, 
1130         fix logic so the function works
1131         (_dbus_string_ends_with_c_str): fix overflow thingy
1132         (_dbus_string_base64_encode): overflow fix
1133         (_dbus_string_validate_ascii): overflow
1134         (_dbus_string_validate_nul): overflow
1135         
1136 2003-02-26  Havoc Pennington  <hp@redhat.com>
1137
1138         * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
1139
1140 2003-02-26  Alexander Larsson  <alexl@redhat.com>
1141
1142         * configure.in:
1143         Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
1144         
1145         * dbus/dbus-connection.c:
1146         * dbus/dbus-connection.h:
1147         Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
1148         Add dbus_connection_set_wakeup_main_function and use it when queueing
1149         incoming and outgoing messages.
1150         
1151         
1152         * dbus/dbus-dataslot.c:
1153         Threadsafe usage of DBusDataSlotAllocator
1154         
1155         * dbus/dbus-message.c: (dbus_message_get_args_iter):
1156         dbus_new can fail.
1157         
1158         * dbus/dbus-server-unix.c:
1159         Add todo comment
1160         
1161         * glib/dbus-gmain.c:
1162         Implement the new wakeup functions for glib.
1163         
1164         * glib/Makefile.am:
1165         * glib/test-thread-client.c: 
1166         * glib/test-thread-server.c: 
1167         * glib/test-thread.h:
1168         Initial cut at some thread test code. Not really done yet.
1169
1170 2003-02-26  Havoc Pennington  <hp@pobox.com>
1171
1172         * dbus/dbus-connection.c
1173         (dbus_connection_send_message_with_reply_and_block): fix crash
1174         where we ref'd the outgoing message instead of the returned reply
1175
1176         * dbus/dbus-transport-unix.c (do_authentication): check read watch
1177         at the end of this function, so if we didn't need to read for
1178         authentication, we reinstall it for receiving messages
1179
1180         * dbus/dbus-message.c (dbus_message_new_reply): allow replies to 
1181         a NULL sender for peer-to-peer case
1182
1183         * dbus/dbus-transport-unix.c (check_read_watch): handle
1184         !authenticated case correctly
1185
1186         * glib/dbus-gmain.c: add support for DBusServer
1187
1188         * dbus/dbus-server.c: add data slot support
1189
1190         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
1191         return values and handle errors
1192
1193         * dbus/dbus-dataslot.c: factor out the data slot stuff from
1194         DBusConnection
1195
1196         * Doxyfile.in (INPUT): add glib subdir
1197
1198         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename 
1199         setup_with_g_main instead of hookup_with_g_main; write docs
1200         
1201 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
1202
1203         * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
1204         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1205         * dbus/dbus-message.c: (dbus_message_append_boolean),
1206         (dbus_message_append_boolean_array),
1207         (dbus_message_get_args_valist), (_dbus_message_test):
1208         * dbus/dbus-message.h:
1209         * doc/dbus-specification.sgml:
1210         Various fixes as pointed out by Havoc.
1211         
1212         * test/data/invalid-messages/bad-boolean-array.message:
1213         * test/data/invalid-messages/bad-boolean.message:
1214         Add invalid boolean value test cases.
1215         
1216 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
1217
1218         * dbus/dbus-internals.c: (_dbus_type_to_string):
1219         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1220         (_dbus_marshal_validate_arg):
1221         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1222         * dbus/dbus-message.c: (dbus_message_append_args_valist),
1223         (dbus_message_append_boolean), (dbus_message_append_boolean_array),
1224         (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
1225         (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
1226         (dbus_message_iter_get_double),
1227         (dbus_message_iter_get_boolean_array), (message_iter_test):
1228         * dbus/dbus-message.h:
1229         * dbus/dbus-protocol.h:
1230         * doc/dbus-specification.sgml:
1231         * test/data/valid-messages/lots-of-arguments.message:
1232         Add support for boolean and boolean array types.
1233         
1234 2003-02-23  Havoc Pennington  <hp@pobox.com>
1235
1236         * dbus/dbus-keyring.c: finish most of this implementation and 
1237         simple unit test
1238
1239         * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
1240         these barf if the error isn't cleared to NULL
1241
1242         * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
1243         (_dbus_create_directory): new function
1244
1245         * dbus/dbus-errors.c (dbus_set_error): fix warning
1246
1247         * dbus/dbus-string.c (_dbus_string_hex_encode): new function
1248         (_dbus_string_hex_decode): new function
1249         (test_hex_roundtrip): test code
1250
1251         * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
1252
1253         * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
1254
1255         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use 
1256         the save-to-temp/rename trick to atomically write the new file
1257         (_dbus_string_parse_uint): new function
1258
1259 2003-02-22  Havoc Pennington  <hp@pobox.com>
1260
1261         * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
1262
1263 2003-02-22  Havoc Pennington  <hp@pobox.com>
1264
1265         * dbus/dbus-message.c (dbus_message_iter_get_string_array):
1266         (dbus_message_iter_get_byte_array): Fix up doxygen warnings
1267
1268         * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
1269
1270         * dbus/test/data/sha-1: add US government test suite for SHA-1
1271
1272 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1273
1274         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1275         Make string arrays NULL-terminated.
1276         
1277         * dbus/dbus-memory.c: (dbus_free_string_array):
1278         * dbus/dbus-memory.h:
1279         New function for freeing NULL-terminated string arrays.
1280         
1281         * dbus/dbus-message-builder.c: (append_quoted_string),
1282         (_dbus_message_data_load):
1283         Add support for array types.
1284         
1285         * dbus/dbus-message.c: (check_message_handling):
1286         Add more types as test cases.
1287         
1288         * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
1289         (_dbus_string_parse_double):
1290         Add the start offset to the end offset.
1291         
1292         * test/data/valid-messages/lots-of-arguments.message:
1293         New test message with lots of arguments.
1294         
1295 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1296
1297         * dbus/dbus-message.c: (dbus_message_append_nil),
1298         (dbus_message_append_int32), (dbus_message_append_uint32),
1299         (dbus_message_append_double), (dbus_message_append_string),
1300         (dbus_message_append_int32_array),
1301         (dbus_message_append_uint32_array),
1302         (dbus_message_append_double_array),
1303         (dbus_message_append_byte_array),
1304         (dbus_message_append_string_array):
1305         Fix all out-of-memory handling in these functions.
1306
1307 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1308
1309         * dbus/dbus-message.c: (dbus_message_append_nil):
1310         Fix a silly.
1311         
1312 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1313
1314         * dbus/dbus-message.c: (dbus_message_append_args_valist),
1315         (dbus_message_append_nil), (dbus_message_append_int32_array),
1316         (dbus_message_append_uint32_array),
1317         (dbus_message_append_double_array),
1318         (dbus_message_append_byte_array),
1319         (dbus_message_append_string_array), (dbus_message_get_args_valist),
1320         (dbus_message_iter_get_int32_array),
1321         (dbus_message_iter_get_uint32_array),
1322         (dbus_message_iter_get_double_array),
1323         (dbus_message_iter_get_byte_array),
1324         (dbus_message_iter_get_string_array):
1325
1326         * dbus/dbus-message.h:
1327         Add functions for appending and getting arrays.
1328         
1329 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1330
1331         * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
1332         element size at least 8 bytes, fixes mempool tests on
1333         64-bit machines.
1334
1335 2003-02-20  Alexander Larsson  <alexl@redhat.com>
1336
1337         * dbus/dbus-transport-unix.c (unix_do_iteration):
1338         Unlock the connection mutex during a blocking select call.
1339         Add todo about how we need a way to wake up the select.
1340
1341         * dbus/dbus-connection-internal.h: 
1342         * dbus/dbus-connection.c:
1343         Add _dbus_connection_lock and _dbus_connection_unlock.
1344
1345 2003-02-19  Havoc Pennington  <hp@pobox.com>
1346
1347         * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
1348         Doxyfile.in, not Doxyfile
1349
1350         * dbus/dbus-keyring.c: do some hacking on this
1351
1352         * dbus/dbus-sysdeps.c (_dbus_delete_file): new
1353
1354         * dbus/dbus-errors.c (dbus_set_error_const): do not call
1355         dbus_error_init
1356         (dbus_set_error): remove dbus_error_init, check for message ==
1357         NULL *before* we sprintf into it, and add @todo about including 
1358         system headers in this file
1359
1360         * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
1361
1362         * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
1363
1364         * dbus/dbus-sysdeps.c (get_user_info): break this function out to
1365         get various bits of user information based on either username 
1366         or user ID
1367         (_dbus_homedir_from_username): new function
1368
1369 2003-02-19  Anders Carlsson  <andersca@codefactory.se>
1370
1371         * configure.in:
1372         Add check for nonposix getpwnam_r
1373         
1374         * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
1375         Align the pool element size to a sizeof (void *) boundary.
1376         
1377         * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
1378         (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
1379         General Solaris fixes.
1380         
1381         * test/data/valid-messages/simplest-manual.message:
1382         Explicitly state that we want little-endian packing.
1383         
1384 2003-02-19  Mikael Hallendal  <micke@codefactory.se>
1385
1386         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1387
1388         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket): 
1389         Added to create a transport connecting using a tcp/ip socket.
1390
1391         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
1392         to a tcp socket at given host and port.
1393         (_dbus_listen_tcp_socket): added to listen on tcp socket for given
1394         hostname and port.
1395
1396         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1397
1398         * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket): 
1399         Added to create a server listening on a TCP/IP socket.
1400
1401 2003-02-19  Havoc Pennington  <hp@pobox.com>
1402
1403         Throughout: mop up all the Doxygen warnings and undocumented
1404         stuff.
1405         
1406         * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1407         to search any paths.
1408
1409         * dbus/dbus-threads.c: move global mutex initializers to
1410         dbus-internals.h, multiple prototypes was confusing doxygen
1411         besides being kind of ugly
1412
1413         * Doxyfile (PREDEFINED): have Doxygen define
1414         DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from 
1415         docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1416         (do not abuse the feature! it's for stuff like the autogenerated 
1417         macros in dbus-md5.c, not just for things you don't feel like 
1418         documenting...)
1419
1420 2003-02-18  Havoc Pennington  <hp@pobox.com>
1421
1422         * dbus/dbus-string.c (_dbus_string_zero): new function
1423
1424         * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1425         wrap it in some dbus-friendly API
1426
1427         * dbus/dbus-types.h: add 16-bit types
1428
1429 2003-02-18  Joe Shaw  <joe@assbarn.com>
1430
1431         * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1432         credentials from our currently running process.
1433         (get_word): Fix a buglet where we were copying the entire length
1434         instead of relative to our position.
1435
1436         * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1437         keys on the stack... it's 640k of data.
1438
1439         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1440         read the credentials byte off the socket, even if we don't have
1441         SO_PEERCRED.
1442         (_dbus_poll): Implement poll() using select() for systems which
1443         don't have it.
1444
1445         * glib/test-dbus-glib.c (main): Print out an error if no
1446         parameters are given.
1447
1448         * test/data/auth/fallback.auth-script: Added.  Tests that a client
1449         can fallback to a secondary auth mechanism if the first fails.
1450
1451 2003-02-18  Havoc Pennington  <hp@pobox.com>
1452
1453         * AUTHORS: add Alex
1454
1455 2003-02-17  Havoc Pennington  <hp@pobox.com>
1456
1457         * doc/dbus-specification.sgml: lots of cosmetic
1458         cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1459         env variable to DBUS_BUS_ADDRESS, s/client/application/,
1460         s/server/bus/ (except in authentication section). Add a section
1461         "Message Bus Message Routing"
1462
1463 2003-02-17  Anders Carlsson  <andersca@codefactory.se.>
1464
1465         Release 0.4
1466         
1467         * NEWS: Update
1468
1469 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1470
1471         * doc/dbus-specification.sgml:
1472         Specification updates.
1473         
1474 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1475
1476         * bus/activation.c: (bus_activation_init), (child_setup),
1477         (bus_activation_activate_service):
1478         * bus/activation.h:
1479         * bus/main.c: (main):
1480         Set DBUS_ADDRESS environment variable.
1481         
1482         * dbus/dbus-errors.c: (dbus_set_error):
1483         Don't use va_copy since that's a C99 feature.
1484         
1485         * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1486         (_dbus_spawn_async):
1487         * dbus/dbus-sysdeps.h:
1488         Add child_setup_func to _dbus_spawn_async.
1489         
1490         * doc/dbus-specification.sgml:
1491         Update specification.
1492         
1493         * test/spawn-test.c: (setup_func), (main):
1494         Fix test.
1495         
1496 2003-02-17  Alexander Larsson  <alexl@redhat.com>
1497
1498         * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1499         Added todo.
1500
1501 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1502
1503         * doc/.cvsignore:
1504         * doc/Makefile.am:
1505         * doc/dbus-test-plan.sgml:
1506         Add test plan document.
1507         
1508         * test/Makefile.am:
1509         Fix distcheck.
1510         
1511 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1512
1513         * dbus/dbus-message.c: (decode_header_data),
1514         (_dbus_message_loader_return_buffer):
1515         Set the header padding amount when loading a message.
1516
1517 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1518
1519         * bus/dispatch.c: (send_one_message):
1520         Only send broadcast messages to registered connections.
1521         
1522         * dbus/dbus-message.c: (dbus_message_name_is):
1523         * dbus/dbus-message.h:
1524         New convenience function.
1525         
1526         * dbus/dbus-transport-debug.c: (do_reading):
1527         Only dispatch one message per run.
1528
1529         * test/Makefile.am:
1530         * test/bus-test.c: (new_connection_callback), (die),
1531         (test_hello_client1_handler), (test_hello_client2_handler),
1532         (test_hello_replies), (main):
1533
1534         * test/bus-test-loop.[ch]:
1535         Add these.
1536         
1537 2003-02-16  Havoc Pennington  <hp@pobox.com>
1538
1539         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1540         backward conditional
1541
1542 2003-02-16  Alexander Larsson  <alexl@redhat.com>
1543
1544         * dbus/dbus-connection.c:
1545         Implement sent_message_with_reply. (with_reply_and block is still
1546         busted).
1547         Made dispatch_message not lose message if OOM.
1548         
1549         * dbus/dbus-errors.h:
1550         Add NoReply error (for reply timeouts).
1551
1552 2003-02-16  Alexander Larsson  <alexl@redhat.com>
1553
1554         * dbus/dbus-hash.c (_dbus_hash_table_unref):
1555         Actually free keys and values when destroying hashtable.
1556
1557 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1558
1559         * dbus/dbus-auth.c: (client_try_next_mechanism):
1560         Plug a leak.
1561         
1562         * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1563         Return TRUE if there's no thread implementation around.
1564         
1565         * glib/dbus-gmain.c: (free_source),
1566         (dbus_connection_hookup_with_g_main):
1567         Make sure to remove the GSource when the connection is finalized.
1568         
1569 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1570
1571         * bus/dispatch.c: (bus_dispatch_message_handler):
1572         * dbus/dbus-errors.h:
1573         Return an error if someone tries to send a message to a service
1574         that doesn't exist.
1575         
1576 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1577
1578         * bus/activation.c: (load_directory), (bus_activation_init),
1579         (bus_activation_activate_service):
1580         * bus/activation.h:
1581         * bus/driver.c: 
1582         (bus_driver_handle_activate_service), (bus_driver_handle_message):
1583         More work on the activation handling.
1584         
1585         * dbus/dbus-errors.h:
1586         Add some error messages
1587         
1588         * dbus/dbus-message.c: (dbus_message_new_error_reply):
1589         * dbus/dbus-message.h:
1590         New function that creates an error message.
1591         
1592         * dbus/dbus-protocol.h:
1593         Add ACTIVATE_SERVER message.
1594         
1595         * dbus/dbus-server-unix.c: (unix_handle_watch),
1596         (_dbus_server_new_for_domain_socket):
1597         Call _dbus_fd_set_close_on_exec.
1598         
1599         * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1600         (_dbus_spawn_async), (_dbus_disable_sigpipe),
1601         (_dbus_fd_set_close_on_exec):
1602         * dbus/dbus-sysdeps.h:
1603         Add _dbus_fd_set_close_on exec function. Also add function that checks
1604         that all open fds are set to close-on-exec and warns otherwise.
1605         
1606         * dbus/dbus-transport-unix.c:
1607         (_dbus_transport_new_for_domain_socket):
1608         Call _dbus_fd_set_close_on_exec.
1609
1610 2003-02-16  Havoc Pennington  <hp@pobox.com>
1611
1612         * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1613         allow people to avoid setting SIGPIPE to SIG_IGN
1614         (_dbus_connection_new_for_transport): disable SIGPIPE unless 
1615         we've been asked not to
1616
1617 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1618
1619         * dbus/dbus-list.c: (_dbus_list_append_link),
1620         (_dbus_list_prepend_link):
1621         * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1622         (dbus_realloc):
1623         Warning fixes.
1624
1625 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1626
1627         * bus/Makefile.am:
1628         * bus/activation.c: (bus_activation_entry_free),
1629         (add_desktop_file_entry), (load_directory), (bus_activation_init):
1630         * bus/activation.h:
1631         * bus/main.c: (main):
1632         Add simple activation support, doesn't work yet though.
1633
1634 2003-02-15   Zack Rusin  <zack@kde.org>
1635
1636         * qt/dbus-qthread.cpp:  small casting fix
1637
1638 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1639
1640         * dbus/dbus-errors.c: (dbus_set_error):
1641         * dbus/dbus-errors.h:
1642         Add a few errors and make dbus_set_error void.
1643         
1644         * dbus/dbus-sysdeps.c: 
1645         (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1646         (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1647         * dbus/dbus-sysdeps.h:
1648         Add _dbus_spawn_async.
1649         
1650         * test/spawn-test.c: (main):
1651         Test for _dbus_spawn_async.
1652         
1653 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1654
1655         * dbus/dbus-internals.h:
1656         Fix build without tests.
1657         
1658         * dbus/dbus-list.c: (alloc_link):
1659         Fix a segfault when a malloc fails.
1660         
1661         * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1662         (dbus_malloc0), (dbus_realloc):
1663         Add support for malloc debugging.
1664
1665 2003-02-15  Alexander Larsson  <alexl@redhat.com>
1666
1667         * dbus/dbus-threads.c:
1668         * dbus/dbus-threads.h:
1669         Add condvars. Remove static mutext from API.
1670         Implement static mutexes by initializing them from threads_init.
1671         
1672         * glib/dbus-gthread.c:
1673         * qt/dbus-qthread.cpp:
1674         Update with the thread api changes.
1675
1676                 
1677         * dbus/dbus-list.c:
1678         * dbus/dbus-list.h:
1679         Turn StaticMutex into normal mutex + init function.
1680         Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1681         _dbus_list_append_link, _dbus_list_prepend_link
1682
1683
1684         * dbus/dbus-sysdeps.c: 
1685         * dbus/dbus-sysdeps.h:
1686         New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1687         _dbus_atomic_dec. Only slow fallback implementation at the moment.
1688         
1689         * dbus/dbus-protocol.h:
1690         Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1691         
1692         * dbus/dbus-message.c:
1693         Make ref/unref atomic.
1694         Fix some docs.
1695         
1696         * dbus/dbus-connection-internal.h:
1697         * dbus/dbus-connection.c:
1698         * dbus/dbus-connection.h:
1699         Make threadsafe.
1700         Change _peek to _borrow,_return & _steal_borrowed.
1701         Change disconnect callback to event.
1702         Make dbus_connection_dispatch_messages reentrant.
1703         
1704         * dbus/dbus-transport.c:
1705         Don't ref the connection on calls to the transport
1706         implementation.
1707         
1708         * dbus/dbus-message-handler.c:
1709         Make threadsafe.
1710         
1711         * glib/dbus-gmain.c:
1712         Don't use peek_message anymore
1713         
1714         * test/Makefile.am:
1715         * test/debug-thread.c:
1716         * test/debug-thread.h:
1717         Simple thread implementation that asserts() on deadlocks in
1718         single-threaded code.
1719         
1720         * test/bus-test.c:
1721         (main) Call debug_threads_init.
1722
1723         * test/watch.c:
1724         Use disconnect message instead of disconnect callback.
1725
1726         * bus/connection.c:
1727         * bus/connection.h:
1728         Don't call dbus_connection_set_disconnect_function. Instead export
1729         bus_connection_disconnect.
1730         
1731         * bus/dispatch.c:
1732         Call bus_connection_disconnect when we get a disconnected message.
1733         
1734 2003-02-15  Havoc Pennington  <hp@pobox.com>
1735
1736         * dbus/dbus-message.c (dbus_message_new): fool around with the
1737         docs
1738
1739 2003-02-14  Havoc Pennington  <hp@pobox.com>
1740
1741         * dbus/dbus-mempool.c: fail if the debug functions so indicate
1742
1743         * dbus/dbus-memory.c: fail if the debug functions indicate we
1744         should
1745
1746         * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1747         (_dbus_decrement_fail_alloc_counter): debug functions to 
1748         simulate memory allocation failures
1749
1750 2003-02-14  Havoc Pennington  <hp@pobox.com>
1751
1752         * dbus/dbus-errors.h (struct DBusError): add a word of padding 
1753         to DBusError
1754
1755 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1756
1757         * bus/driver.c: (bus_driver_handle_hello):
1758         * bus/driver.h:
1759         * bus/services.c: (bus_service_lookup):
1760         Reorder message sending so we get a more sane order.
1761         
1762         * test/bus-test.c: (message_handler):
1763         Fix tyop.
1764         
1765 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1766
1767         * bus/driver.c: (bus_driver_send_service_deleted),
1768         (bus_driver_send_service_created), (bus_driver_send_service_lost),
1769         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1770         (bus_driver_send_welcome_message),
1771         (bus_driver_handle_list_services),
1772         (bus_driver_handle_acquire_service),
1773         (bus_driver_handle_service_exists):
1774         * dbus/dbus-bus.c: (dbus_bus_register_client),
1775         (dbus_bus_acquire_service), (dbus_bus_service_exists):
1776         * dbus/dbus-errors.c: (dbus_result_to_string):
1777         * dbus/dbus-errors.h:
1778         * dbus/dbus-message.c: (dbus_message_append_args),
1779         (dbus_message_append_args_valist), (dbus_message_get_args),
1780         (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1781         (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1782         (dbus_message_iter_get_byte_array),
1783         (dbus_message_iter_get_string_array), (message_iter_test),
1784         (check_message_handling), (_dbus_message_test):
1785         * dbus/dbus-message.h:
1786         * test/bus-test.c: (main):
1787         Change fields to arguments in messages, so that they won't be
1788         confused with header fields.
1789         
1790         * glib/test-dbus-glib.c: (main):
1791         Remove append_fields from hello message.
1792         
1793 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1794
1795         * dbus/dbus-errors.c:
1796         * dbus/dbus-message.c:
1797         * dbus/dbus-string.c:
1798         Documentation fixes.
1799
1800 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1801
1802         * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1803         (remove_timeout):
1804         Implement support for timeouts in dbus-glib.
1805         
1806 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1807
1808         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1809         * dbus/dbus-message.c: (process_test_subdir):
1810         * test/break-loader.c: (find_breaks_based_on):
1811         Plug some memory leaks.
1812         
1813 2003-02-13  Richard Hult  <rhult@codefactory.se>
1814
1815         * bus/main.c: Fix build.
1816
1817         * dbus/dbus-errors.h: 
1818         * dbus/dbus-errors.c: Fix copyright for Anders.
1819
1820 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1821
1822         * bus/Makefile.am:
1823         Add utils.[ch]
1824         
1825         * bus/connection.c: (bus_connection_foreach):
1826         Fix a warning.
1827         
1828         * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1829         (unescape_string), (new_section), (parse_section_start),
1830         (parse_key_value), (report_error), (bus_desktop_file_load),
1831         (bus_desktop_file_get_string):
1832         * bus/desktop-file.h:
1833         Use DBusError for error reporting.
1834         
1835         * bus/dispatch.c: (send_one_message),
1836         (bus_dispatch_message_handler):
1837         * bus/driver.c: (bus_driver_send_service_deleted),
1838         (bus_driver_send_service_created), (bus_driver_send_service_lost),
1839         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1840         (bus_driver_send_welcome_message),
1841         (bus_driver_handle_list_services),
1842         (bus_driver_handle_acquire_service),
1843         (bus_driver_handle_service_exists):
1844         * bus/loop.c: (bus_loop_run):
1845         * bus/main.c:
1846         Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1847         
1848         * bus/utils.c: (bus_wait_for_memory):
1849         * bus/utils.h:
1850         New files with general utility functions.
1851         
1852         * dbus/dbus-internals.h:
1853         Remove _DBUS_HANDLE_OOM.
1854         
1855 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1856
1857         * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1858         (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1859         * dbus/dbus-errors.h:
1860         Add DBusError structure.
1861         
1862 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1863
1864         * test/data/valid-messages/standard-acquire-service.message:
1865         * test/data/valid-messages/standard-hello.message:
1866         * test/data/valid-messages/standard-list-services.message:
1867         * test/data/valid-messages/standard-service-exists.message:
1868         Add some standard messages.
1869         
1870 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1871
1872         * bus/driver.c: (bus_driver_send_welcome_message),
1873         (bus_driver_handle_list_services),
1874         (bus_driver_handle_acquire_service),
1875         (bus_driver_handle_service_exists), (bus_driver_handle_message):
1876         Update for API changes in libdbus.
1877         
1878         * dbus/dbus-message.c: (dbus_message_new_reply):
1879         * dbus/dbus-message.h:
1880         Remove the name argument. The spec states that replies shouldn't
1881         have a name.
1882
1883 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1884
1885         * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1886         (report_error), (bus_desktop_file_load), (lookup_section),
1887         (lookup_line), (bus_desktop_file_get_raw),
1888         (bus_desktop_file_get_string):
1889         * bus/desktop-file.h:
1890         Some fixes, and new functions for getting a key value from a section.
1891         
1892 2003-02-13  Havoc Pennington  <hp@pobox.com>
1893
1894         * test/data/auth/fail-after-n-attempts.auth-script: new test
1895
1896         * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1897         reject the client.
1898
1899 2003-02-13  Havoc Pennington  <hp@pobox.com>
1900
1901         * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1902         dbus_credentials_match were backward
1903
1904         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1905         NO_CREDENTIALS and ROOT_CREDENTIALS
1906
1907         * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine 
1908         into here. Never process more commands after we've reached an 
1909         end state; store further data as unused bytes.
1910
1911         * test/data/auth/*: add more auth tests
1912         
1913         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
1914         command to match exact string and EXPECT_UNUSED to match unused
1915         bytes
1916
1917         * test/Makefile.am (dist-hook): fix to dist all the test stuff
1918
1919 2003-02-12  Havoc Pennington  <hp@pobox.com>
1920
1921         * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
1922         \r off of popped lines
1923
1924         * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
1925         scripts
1926
1927         * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
1928         SEND, append \r\n
1929
1930 2003-02-12  Havoc Pennington  <hp@pobox.com>
1931
1932         * dbus/Makefile.am: remove break-loader from the build, since it
1933         moved.
1934
1935         * configure.in: add --enable-gcov to turn on coverage profiling
1936         flags and disable optimization
1937
1938 2003-02-10  Havoc Pennington  <hp@pobox.com>
1939
1940         * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync 
1941         initial cut at test framework for DBusAuth from laptop.
1942         Doesn't quite work yet but it compiles and I need to get 
1943         it off the 266mhz laptop. ;-)
1944         
1945         * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
1946         fix a memleak in error case
1947
1948 2003-02-12  Anders Carlsson  <andersca@codefactory.se>
1949
1950         * bus/Makefile.am:
1951         * bus/desktop-file.c:
1952         * bus/desktop-file.h:
1953         Add a desktop file parser.
1954
1955 2003-02-11  Zack Rusin  <zack@kde.org>
1956
1957         * qt/message.[h|cpp]: sample implementation
1958         of the KDE wrapper for DBusMessage
1959
1960 2003-02-09  Zack Rusin  <zack@kde.org>
1961
1962         * test/bus-test.c: make_it_compile
1963         * doc/dbus-specification.sgml: minimal semantic fix
1964
1965 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
1966
1967         Release 0.3
1968         
1969         * NEWS: Update
1970
1971 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
1972
1973         * dbus/Makefile.am:
1974         * dbus/dbus-break-loader.c:
1975         * test/Makefile.am:
1976         * test/break-loader.c:
1977         Move dbus-break-loader to test/ and rename it to break-loader.
1978
1979 2003-02-02  Havoc Pennington  <hp@pobox.com>
1980
1981         * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files 
1982         for code to manage cookies in your home directory
1983
1984         * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1985
1986         * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1987         to authenticate, then disconnect the client.
1988
1989 2003-02-03  Alexander Larsson  <alexl@redhat.com>
1990
1991         * dbus/dbus-message.c (dbus_message_append_fields):
1992         Correct docs.
1993
1994 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1995
1996         * doc/dbus-specification.sgml:
1997         Update address format section.
1998         
1999 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2000
2001         * test/Makefile.am:
2002         * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2003         (message_handler), (new_connection_callback), (loop_quit),
2004         (loop_run), (main):
2005         Add bus test.
2006         
2007 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2008
2009         * bus/driver.c: (bus_driver_handle_service_exists):
2010         Simplify the code a bit.
2011         
2012         * dbus/dbus-bus.c: (dbus_bus_service_exists):
2013         Fix a silly. 
2014         
2015 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2016
2017         * bus/Makefile.am:
2018         Add libdbus-daemon.la and link to it.
2019
2020 2003-02-01  James Willcox  <jwillcox@gnome.org>
2021
2022         * bus/driver.c: (bus_driver_handle_own_service):
2023         Actually include the service reply code in the message.
2024
2025 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2026
2027         * bus/driver.c: (bus_driver_handle_service_exists):
2028         Don't unref the incoming message.
2029         
2030 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2031
2032         * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2033
2034 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
2035
2036         * dbus/dbus-server.c: (dbus_server_listen):
2037         * dbus/dbus-transport.c: (_dbus_transport_open):
2038         ifdef out the calls to the debug transport and server.
2039         
2040 2003-02-02  Alexander Larsson  <alexl@redhat.com>
2041
2042         * dbus/dbus-watch.c (dbus_watch_get_flags):
2043         Add note in the docs that ERROR or HANGUP won't be returned
2044         and are assumed always on.
2045
2046         * glib/dbus-gmain.c (add_watch):
2047         Always add IO_ERR | IO_HUP
2048
2049         * dbus/dbus-message.h:
2050         Add semicolon after dbus_message_iter_get_string_array().
2051         Makes qt code build again
2052
2053 2003-02-01  Anders Carlsson  <andersca@codefactory.se>
2054
2055         * bus/driver.c: (create_unique_client_name),
2056         (bus_driver_handle_hello):
2057         Don't take a name, just use a numeric id to identify
2058         each client.
2059         
2060         * dbus/Makefile.am:
2061         * dbus/dbus-bus.c: (dbus_bus_register_client),
2062         (dbus_bus_acquire_service), (dbus_bus_service_exists):
2063         * dbus/dbus-bus.h:
2064         Add new convenience functions for communicating with the bus.
2065         
2066         * dbus/dbus-message.h:
2067         
2068         * dbus/dbus-protocol.h:
2069         Fix a typo.
2070         
2071 2003-02-01  Alexander Larsson  <alexl@redhat.com>
2072
2073         * dbus/dbus-message.c (dbus_message_append_fields):
2074         Add some more doc comments.
2075
2076 2003-02-01  Havoc Pennington  <hp@pobox.com>
2077
2078         * dbus/dbus-break-loader.c (randomly_modify_length): change 
2079         a 4-byte value in the message as if it were a length
2080
2081         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2082         execute bit on saved files
2083
2084 2003-02-01  Havoc Pennington  <hp@pobox.com>
2085
2086         * dbus/dbus-break-loader.c (main): new program to find messages
2087         that break the loader.
2088
2089         * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2090         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2091
2092         * dbus/dbus-string.c (_dbus_string_set_byte): new
2093         
2094 2003-01-31  Havoc Pennington  <hp@pobox.com>
2095
2096         * dbus/dbus-message.c: refactor the test code to be more general, 
2097         in preparation for writing a "randomly permute test cases to 
2098         try to break the loader" program.
2099
2100 2003-01-31  Havoc Pennington  <hp@pobox.com>
2101         
2102         * doc/dbus-specification.sgml: work on the specification
2103
2104         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check 
2105         the protocol version of the message.
2106
2107         * dbus/dbus-protocol.h: drop special _REPLY names, the spec 
2108         no longer specifies that.
2109         (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 
2110         1/2/3/4)
2111
2112         * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
2113         "break" for DBUS_TYPE_NIL, remove @todo
2114
2115 2003-01-31  Havoc Pennington  <hp@pobox.com>
2116
2117         * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename 
2118         just set_is_error/get_is_error as this is a commonly-used
2119         function, and write docs.
2120
2121 2003-01-31  Anders Carlsson  <andersca@codefactory.se>
2122
2123         * dbus/dbus-address.c: (dbus_address_entry_free):
2124         Free key and value lists.
2125         
2126         * dbus/dbus-internals.c: (_dbus_type_to_string):
2127         Add the types we didn't have.
2128         
2129         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2130         (_dbus_marshal_validate_arg):
2131         Add NIL types.
2132         
2133         * dbus/dbus-message.c: (dbus_message_set_sender):
2134         Remove todo about being able to set sender to NULL.
2135         
2136         (dbus_message_set_is_error_reply),
2137         (dbus_message_get_is_error_reply):
2138         * dbus/dbus-message.h:
2139         New functions.
2140         
2141         * dbus/dbus-protocol.h:
2142         Add error reply flag.
2143         
2144         * test/data/valid-messages/opposite-endian.message:
2145         Add NIL type to test.
2146         
2147 2003-01-31  Havoc Pennington  <hp@pobox.com>
2148
2149         * doc/dbus-specification.sgml: fully specify the header.  Add
2150         flags and major protocol version, and change header/body len to
2151         unsigned.
2152
2153         * dbus/dbus-message-builder.c (append_saved_length): append length
2154         as uint32
2155
2156         * dbus/dbus-message.c (dbus_message_create_header): change header
2157         length and body length to unsigned. Add the new fields from the
2158         spec
2159         (_dbus_message_loader_return_buffer): unsigned header/body len
2160
2161 2003-01-30  Havoc Pennington  <hp@pobox.com>
2162
2163         * dbus/dbus-auth.c: rework to use only REJECTED, no 
2164         MECHANISMS
2165
2166         * doc/dbus-sasl-profile.txt: drop MECHANISMS and just 
2167         use REJECTED, suggested by Mark McLoughlin
2168
2169 2003-01-30  Havoc Pennington  <hp@pobox.com>
2170
2171         * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
2172         a better way to report errors here. e.g.  "unix address lacks
2173         path" or something. also "no such file" when the path doesn't
2174         exist, etc.
2175
2176         * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
2177         leaking list nodes
2178         (dbus_parse_address): add @todo about documenting address format, 
2179         and allowing , and ; to be escaped
2180
2181 2003-01-30  Anders Carlsson  <andersca@codefactory.se>
2182
2183         * dbus/Makefile.am:
2184         Add dbus-address.[ch]
2185         
2186         * dbus/dbus-address.c: (dbus_address_entry_free),
2187         (dbus_address_entries_free), (create_entry),
2188         (dbus_address_entry_get_method), (dbus_address_entry_get_value),
2189         (dbus_parse_address), (_dbus_address_test):
2190         * dbus/dbus-address.h:
2191         New files for dealing with address parsing.
2192         
2193         * dbus/dbus-connection.c:
2194         Document timeout functions.
2195         
2196         * dbus/dbus-message.c:
2197         Document dbus_message_new_from_message.
2198         
2199         * dbus/dbus-server-debug.c:
2200         Document.
2201         
2202         * dbus/dbus-server.c: (dbus_server_listen):
2203         Parse address and use correct server implementation.
2204         
2205         * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
2206         * dbus/dbus-string.h:
2207         New function with test.
2208         
2209         * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
2210         * dbus/dbus-test.h:
2211         Add address tests.
2212         
2213         * dbus/dbus-transport-debug.c:
2214         Document.
2215         
2216         * dbus/dbus-transport.c: (_dbus_transport_open):
2217         Parse address and use correct transport implementation. 
2218
2219 2003-01-30  Havoc Pennington  <hp@pobox.com>
2220
2221         * dbus/dbus-message.c: use message->byte_order instead of 
2222         DBUS_COMPILER_BYTE_ORDER throughout.
2223         (dbus_message_create_header): pad header to align the 
2224         start of the body of the message to 8-byte boundary
2225
2226         * dbus/dbus-marshal.h: make all the demarshalers take const 
2227         DBusString arguments.
2228
2229         * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
2230         validate message args here, so we don't have to do slow validation
2231         later, and so we catch bad messages as they are incoming. Also add
2232         better checks on header_len and body_len. Also fill in
2233         message->byte_order
2234
2235         * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
2236         implemented properly)
2237         (_dbus_string_validate_nul): new function to check all-nul
2238
2239         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename 
2240         get_arg_end_pos and remove all validation
2241         (_dbus_marshal_validate_arg): actually do validation here.
2242
2243 2003-01-29  Havoc Pennington  <hp@pobox.com>
2244
2245         * dbus/dbus-message.c (check_message_handling): fix assertion
2246         failure on set_client_serial
2247
2248 2003-01-28  Havoc Pennington  <hp@pobox.com>
2249
2250         * dbus/dbus-server-debug.c: Add doc section comments
2251         
2252         * dbus/dbus-transport-debug.c: add doc section comments
2253         
2254 2003-01-28  Havoc Pennington  <hp@redhat.com>
2255
2256         * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
2257         the reverse order from how I had it
2258         (_dbus_string_base64_encode): reverse encoding order. I was
2259         basically byteswapping everything during encoding.
2260
2261 2003-01-28  Anders Carlsson  <andersca@codefactory.se>
2262
2263         * dbus/dbus-connection-internal.h:
2264         * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
2265         (_dbus_connection_remove_timeout):
2266         Add functions for adding and removing timeouts.
2267         
2268         * dbus/dbus-message.c: (dbus_message_new_from_message):
2269         Add new function that takes a message and creates an exact
2270         copy of it, but with the refcount set to 1.
2271         (check_message_handling):
2272         Fix build error.
2273         
2274         * dbus/dbus-server-protected.h:
2275         * dbus/dbus-server.c: (_dbus_server_init_base),
2276         (_dbus_server_finalize_base), (_dbus_server_add_timeout),
2277         (dbus_server_set_timeout_functions):
2278         (_dbus_server_remove_timeout):
2279         New functions so that a server can add and remove timeouts.
2280
2281         (dbus_server_listen):
2282         Add commented out call to dbus_server_debug_new.
2283
2284         * dbus/dbus-timeout.c: (_dbus_timeout_new):
2285         Actually set the handler, doh.
2286         
2287         * dbus/dbus-transport.c: (_dbus_transport_open):
2288         Add commented out call to dbus_transport_debug_client_new.
2289         
2290         * dbus/Makefile.am:
2291         Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
2292         
2293 2003-01-28  Havoc Pennington  <hp@pobox.com>
2294
2295         * dbus/dbus-message.c (check_message_handling): function to check 
2296         on the loaded message, iterates over it etc.
2297
2298 2003-01-28  Havoc Pennington  <hp@pobox.com>
2299
2300         * test/Makefile.am (dist-hook): fix make distdir
2301
2302         * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
2303
2304 2003-01-27  Havoc Pennington  <hp@pobox.com>
2305
2306         * dbus/dbus-mempool.c (time_for_size): replace printf with 
2307         _dbus_verbose
2308
2309         * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
2310         empty lines; fix the SAVE_LENGTH stuff to be
2311         START_LENGTH/END_LENGTH so it actually works; couple other 
2312         bugfixes
2313         
2314         * test/Makefile.am (dist-hook): add dist-hook for .message files
2315
2316         * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
2317         can be constant or locked.
2318         (_dbus_string_free): allow freeing a const string as
2319         documented/intended
2320
2321         * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
2322
2323         * dbus/dbus-test-main.c (main): take an argument which is the 
2324         directory containing test data
2325
2326         * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
2327         argument to this and load all the messages in test/data/
2328         checking that they can be loaded or not loaded as appropriate.
2329
2330 2003-01-27  Anders Carlsson  <andersca@codefactory.se>
2331
2332         * bus/dispatch.c: (bus_dispatch_message_handler):
2333         Dispatch messages sent to services.
2334         
2335         * bus/driver.c: (bus_driver_send_service_deleted),
2336         (bus_driver_send_service_created), (bus_driver_send_service_lost),
2337         (bus_driver_send_service_acquired):
2338         Add helper functions for sending service related messages.
2339
2340         (bus_driver_send_welcome_message):
2341         Send HELLO_REPLY instead of WELCOME.
2342         
2343         (bus_driver_handle_list_services):
2344         Send LIST_SERVICES_REPLY instead of SERVICES.
2345         
2346         (bus_driver_handle_own_service),
2347         (bus_driver_handle_service_exists):
2348         New message handlers.
2349         
2350         (bus_driver_handle_message):
2351         Invoke new message handlers.
2352         
2353         (bus_driver_remove_connection):
2354         Don't remove any services here since that's done automatically
2355         by bus_service_remove_owner now.
2356         
2357         * bus/driver.h:
2358         New function signatures.
2359         
2360         * bus/services.c: (bus_service_add_owner):
2361         Send ServiceAcquired message if we're the only primary owner.
2362         
2363         (bus_service_remove_owner):
2364         Send ServiceAcquired/ServiceLost messages.
2365         
2366         (bus_service_set_prohibit_replacement),
2367         (bus_service_get_prohibit_replacement):
2368         Functions for setting prohibit replacement.
2369         
2370         (bus_service_has_owner):
2371         New function that checks if a connection is in the owner queue of 
2372         a certain service.
2373         
2374         * bus/services.h:
2375         Add new function signatures.
2376         
2377         * dbus/dbus-list.c: (_dbus_list_test):
2378         Add tests for _dbus_list_remove_last and traversing the list backwards.
2379         
2380         * dbus/dbus-list.h:
2381         Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
2382         go any further, so return NULL then.
2383         
2384         * dbus/dbus-protocol.h:
2385         Add new messages, service flags and service replies.
2386         
2387 2003-01-26  Havoc Pennington  <hp@pobox.com>
2388
2389         * dbus/dbus-message-builder.c: implement, completely untested.
2390
2391         * test/data/*: add data to be used in testing. 
2392         ".message" files are our simple loadable text format.
2393         ".message-raw" will be binary dumps of messages.
2394
2395         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
2396
2397 2003-01-26  Havoc Pennington  <hp@pobox.com>
2398
2399         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
2400
2401         * dbus/dbus-errors.c (dbus_result_to_string): add
2402         file errors
2403
2404         * dbus/dbus-message-builder.c: new file, will contain code to load
2405         up messages from files. Not implemented yet.
2406
2407 2003-01-26  Havoc Pennington  <hp@pobox.com>
2408
2409         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2410         the sender by setting to NULL
2411
2412 2003-01-26  Havoc Pennington  <hp@pobox.com>
2413
2414         The unit tests pass, but otherwise untested.  If it breaks, the
2415         tests should have been better. ;-)
2416         
2417         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2418         the connection.
2419
2420         * dbus/dbus-message.c: redo everything so we maintain 
2421         message->header as the only copy of the various fields.
2422         This avoids the possibility of out-of-memory in some cases,
2423         for example dbus_message_lock() can't run out of memory anymore,
2424         and avoids extra copying. Figured I may as well go ahead and do 
2425         this since it was busted for dbus_message_lock to not return 
2426         failure on OOM, and dbus_message_write_header was totally
2427         unchecked for OOM. Also fixed some random other bugs.
2428
2429         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2430         that strings are nul-terminated. Also, end_pos can be equal 
2431         to string length just not greater than, I think.
2432         (_dbus_marshal_set_int32): new function
2433         (_dbus_marshal_set_uint32): new function
2434         (_dbus_marshal_set_string): new function
2435
2436         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2437         a warning, init timeout_list to NULL
2438         (dbus_connection_send_message): don't use uninitialized variable
2439         "serial"
2440
2441         * dbus/dbus-string.c (_dbus_string_replace_len): new function
2442
2443 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
2444
2445         * bus/driver.c: (bus_driver_handle_hello),
2446         (bus_driver_send_welcome_message):
2447         Plug leaks
2448         
2449 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
2450
2451         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2452         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2453         (dbus_connection_unref):
2454         * dbus/dbus-marshal.c: (_dbus_marshal_test):
2455         * dbus/dbus-message.c: (dbus_message_unref),
2456         Plug memory leaks.
2457         
2458         (dbus_message_get_fields): 
2459         Remove debugging printout.
2460
2461         (_dbus_message_loader_return_buffer):
2462         Don't store the header string.
2463         
2464         (_dbus_message_test):
2465         Plug leaks.
2466
2467 2003-01-26  Richard Hult  <rhult@codefactory.se>
2468
2469         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2470         the file descriptor list, since it can change under us.
2471
2472 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2473
2474         * glib/dbus-gmain.c: (dbus_connection_prepare),
2475         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2476         (remove_watch), (dbus_connection_hookup_with_g_main):
2477         Rewrite the glib handling to use its own GSource instead of a 
2478         GIOChannel so we can catch messages put in the queue while waiting
2479         for a reply.
2480         
2481 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2482
2483         * bus/Makefile.am:
2484         * bus/connection.c: (connection_disconnect_handler),
2485         (connection_watch_callback), (bus_connection_setup):
2486         * bus/dispatch.c: (send_one_message),
2487         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2488         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2489         * bus/dispatch.h:
2490         * bus/driver.c: (bus_driver_send_service_deleted),
2491         (bus_driver_send_service_created), (bus_driver_handle_hello),
2492         (bus_driver_send_welcome_message),
2493         (bus_driver_handle_list_services), (bus_driver_remove_connection),
2494         (bus_driver_handle_message):
2495         * bus/driver.h:
2496         Refactor code, put the message dispatching in its own file. Use 
2497         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2498         is disconnected.
2499         
2500 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2501
2502         * dbus/dbus-internals.h:
2503         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2504         
2505         * dbus/dbus-message.c: (dbus_message_get_sender):
2506         * dbus/dbus-message.h:
2507         Implement dbus_message_get_sender.
2508         
2509         * dbus/dbus-protocol.h:
2510         Add message and service defines.
2511         
2512 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2513
2514         * dbus/dbus-connection.c: (dbus_connection_send_message):
2515         * dbus/dbus-message-internal.h:
2516         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2517         (dbus_message_write_header):
2518         Remove _dbus_messag_unlock and don't set the client serial on a 
2519         message if one already exists.
2520         
2521 2003-01-24  Havoc Pennington  <hp@pobox.com>
2522
2523         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2524         list_pool
2525
2526         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
2527         on OOM
2528
2529 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2530
2531         * dbus/dbus-list.c: (alloc_link), (free_link):
2532         Use a memory pool for the links.
2533         
2534 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2535
2536         * bus/connection.c: (bus_connection_foreach):
2537         * bus/connection.h:
2538         Add new bus_connection_foreach function.
2539         
2540         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2541         Add function that broadcasts a message to all clients.
2542         
2543         (bus_driver_send_service_created), (bus_driver_handle_hello),
2544         (bus_driver_send_welcome_message),
2545         (bus_driver_handle_list_services), (bus_driver_message_handler):
2546         Implement functions that take care of listing services, and notifying
2547         clients when new services are created.
2548         
2549         * bus/services.c: (bus_services_list):
2550         * bus/services.h:
2551         Add new function that returns an array of strings with the currently
2552         registered services.
2553         
2554         * glib/dbus-glib.h:
2555         * glib/dbus-gmain.c:
2556         Update copyright year.
2557         
2558 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2559
2560         * dbus/dbus-connection.c: (dbus_connection_send_message):
2561         Unlock the message in case it was sent earlier.
2562         
2563         (dbus_connection_send_message_with_reply_and_block):
2564         Remove the reply message from the list.
2565         
2566         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2567         Set array_len and new_pos correctly.
2568         
2569         (_dbus_marshal_test):
2570         Remove debug output.
2571         
2572         * dbus/dbus-message-internal.h:
2573         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2574         New function that returns the reply serial.
2575         
2576         (_dbus_message_unlock):
2577         New function that unlocks a message and resets its header.
2578
2579         (dbus_message_append_string_array), 
2580         (dbus_message_get_fields_valist),
2581         (dbus_message_iter_get_field_type),
2582         (dbus_message_iter_get_string_array),   
2583         (dbus_message_get_fields),      
2584         (dbus_message_append_fields_valist):
2585         Handle string arrays.
2586         
2587         (dbus_message_set_sender):
2588         Make this function public since the bus daemon needs it.
2589         
2590         (decode_header_data):
2591         Set the reply serial to -1 initially.
2592
2593         * dbus/dbus-message.h:
2594         Add dbus_message_set_sender.    
2595
2596 2003-01-24  Havoc Pennington  <hp@pobox.com>
2597
2598         * doc/dbus-specification.sgml: add some stuff
2599
2600 2003-01-22  Havoc Pennington  <hp@pobox.com>
2601
2602         * doc/dbus-specification.sgml: Start to document the protocol.
2603
2604 2003-01-22  Havoc Pennington  <hp@pobox.com>
2605
2606         * dbus/dbus-connection.c
2607         (dbus_connection_send_message_with_reply_and_block): add some @todo
2608
2609         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2610
2611 2003-01-21  Havoc Pennington  <hp@pobox.com>
2612
2613         (patch untested because can't compile)
2614         
2615         * bus/driver.c (create_unique_client_name): make this function
2616         never recycle client names. Also, caller should initialize 
2617         the DBusString.
2618
2619         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2620
2621 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2622
2623         * dbus/dbus-marshal.c: (_dbus_marshal_double),
2624         (_dbus_marshal_int32), (_dbus_marshal_uint32),
2625         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2626         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2627         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2628         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2629         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2630         * dbus/dbus-marshal.h:
2631         * dbus/dbus-protocol.h:
2632         Add support for marshalling and demarshalling integer, double
2633         and string arrays.
2634         
2635 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2636
2637         * bus/Makefile.am:
2638         Add driver.[ch]
2639         
2640         * bus/connection.c: (connection_disconnect_handler):
2641         Remove the connection from the bus driver's list.
2642         
2643         (connection_watch_callback): Dispatch messages.
2644
2645         (free_connection_data): Free connection name.
2646         
2647         (bus_connection_setup): Add connection to the bus driver's list.
2648         (bus_connection_remove_owned_service): 
2649         (bus_connection_set_name), (bus_connection_get_name):
2650         Add functions for setting and getting the connection's name.
2651         
2652         * bus/connection.h:
2653         Add function headers.
2654         
2655         * bus/driver.c: (create_unique_client_name),
2656         (bus_driver_handle_hello_message),
2657         (bus_driver_send_welcome_message), (bus_driver_message_handler),
2658         (bus_driver_add_connection), (bus_driver_remove_connection):
2659         * bus/driver.h:
2660         * bus/main.c:
2661         * bus/services.c: (bus_service_free):
2662         * bus/services.h:
2663         New file that handles communication and registreation with the bus
2664         itself. 
2665         
2666 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2667
2668         * dbus/dbus-connection.c: (dbus_connection_send_message):
2669         Add a new client_serial parameter.
2670         
2671         (dbus_connection_send_message_with_reply):
2672         Remove a @todo since we've implemented the blocking function.
2673         
2674         (dbus_connection_send_message_with_reply_and_block):
2675         New function that sends a message and waits for a reply and
2676         then returns the reply.
2677         
2678         * dbus/dbus-connection.h:
2679         Add new functions.
2680         
2681         * dbus/dbus-errors.c: (dbus_result_to_string):
2682         * dbus/dbus-errors.h:
2683         Add new DBUS_RESULT.
2684         
2685         * dbus/dbus-message-internal.h:
2686         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2687         (_dbus_message_set_sender), (dbus_message_write_header),
2688         (dbus_message_new_reply), (decode_header_data),
2689         (_dbus_message_loader_return_buffer), (_dbus_message_test):
2690         * dbus/dbus-message.h:
2691         Add new functions that set the reply serial and sender.
2692         Also marshal and demarshal them correctly and add test.
2693         
2694         * dbus/dbus-protocol.h:
2695         Add new DBUS_MESSAGE_TYPE_SENDER.
2696         
2697         * glib/dbus-glib.h:
2698         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2699         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2700         (dbus_connection_hookup_with_g_main):
2701         * glib/test-dbus-glib.c: (main):
2702         Rewrite to use GIOChannel and remove the GSource crack.
2703         
2704         * test/echo-client.c: (main):
2705         * test/watch.c: (check_messages):
2706         Update for changed APIs
2707         
2708 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
2709
2710         * dbus/Makefile.am: Add dbus-timeout.[cħ]
2711         
2712         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2713         Create a DBusTimeoutList.       
2714         (dbus_connection_set_timeout_functions): Add new function to
2715         set timeout callbacks
2716         
2717         * dbus/dbus-connection.h: Add public DBusTimeout API.
2718         
2719         * dbus/dbus-message.c: (dbus_message_get_service):
2720         * dbus/dbus-message.h:  New function.
2721
2722         * dbus/dbus-server.c: Fix small doc typo.
2723         
2724         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2725
2726 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
2727
2728         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2729         of the string, just as long as specified.
2730
2731 2003-01-19  Havoc Pennington  <hp@pobox.com>
2732
2733         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2734         new function
2735
2736         * dbus/dbus-server.c (dbus_server_set_max_connections)
2737         (dbus_server_get_max_connections, dbus_server_get_n_connections):
2738         keep track of current number of connections, and add API for
2739         setting a max (but haven't implemented enforcing the max yet)
2740
2741 2003-01-18  Havoc Pennington  <hp@pobox.com>
2742
2743         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2744         reading/writing if read_watch != NULL or write_watch != NULL.
2745
2746         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2747         the message loader code to actually load message->header and
2748         message->body into the newly-created message.
2749
2750         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2751         in OOM case
2752
2753         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
2754         (dbus_connection_get_max_message_size) 
2755         (dbus_connection_set_max_live_messages_size) 
2756         (dbus_connection_get_max_live_messages_size): implement some
2757         resource limitation functions
2758
2759         * dbus/dbus-resources.c: new file implementing some of the
2760         resource limits stuff
2761
2762         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2763         missing docs, add @todo to handle OOM etc.
2764
2765         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2766         docs
2767         
2768 2003-01-18  Havoc Pennington  <hp@pobox.com>
2769
2770         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
2771         connection if it hasn't been already.
2772
2773         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2774         replace with DisconnectFunction.
2775
2776 2003-01-18  Havoc Pennington  <hp@pobox.com>
2777
2778         Building --disable-verbose-mode --disable-asserts --disable-tests
2779         cuts the library from 112K to 45K or so
2780         
2781         * configure.in: check for varargs macro support, 
2782         add --enable-verbose-mode, --enable-asserts. 
2783
2784         * dbus/dbus-internals.h (_dbus_assert): support
2785         DBUS_DISABLE_ASSERT
2786         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2787
2788 2003-01-18  Havoc Pennington  <hp@pobox.com>
2789
2790         * dbus/dbus-test.c: include config.h so that tests actually run
2791
2792         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2793         so the failure mode when that assumption fails will be plenty
2794         obvious.
2795
2796 2003-01-18  Havoc Pennington  <hp@pobox.com>
2797
2798         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2799
2800         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2801         the distribution
2802
2803         * test/Makefile.am: don't use special variable "TESTS" for echo-*
2804         since we don't want to use those in make check
2805
2806 2003-01-15  Havoc Pennington  <hp@redhat.com>
2807
2808         Release 0.2
2809         
2810         * NEWS: update
2811
2812 2003-01-15  Havoc Pennington  <hp@redhat.com>
2813
2814         * test/Makefile.am: fix so that test source code ends up in the
2815         distribution on make distcheck
2816
2817 2003-01-15  Havoc Pennington  <hp@redhat.com>
2818
2819         Release 0.1.
2820         
2821         * NEWS: update  
2822
2823 2003-01-15  Havoc Pennington  <hp@redhat.com>
2824
2825         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2826         fix build when --disable-tests
2827
2828         * Makefile.am (EXTRA_DIST): put HACKING in here
2829
2830         * HACKING: document procedure for making a tarball release.
2831
2832 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
2833
2834         * bus/connection.c: (connection_error_handler),
2835         (bus_connection_setup):
2836         * bus/main.c: (main):
2837         Make sure that the DBusConnectionData struct is NULLed
2838         out to prevent a segfault.
2839         
2840         * dbus/dbus-errors.c: (dbus_result_to_string):
2841         * dbus/dbus-errors.h:
2842         * dbus/dbus-message.c: (dbus_message_get_fields),
2843         (dbus_message_get_fields_valist), (_dbus_message_test):
2844         * dbus/dbus-message.h:
2845         Make dbus_message_get_fields return a result code so we can
2846         track invalid fields as well as oom.
2847         
2848 2003-01-11  Havoc Pennington  <hp@pobox.com>
2849
2850         * configure.in: change --enable-test/--enable-ansi action-if-given
2851         to enable_foo=$enableval instead of enable_foo=yes
2852
2853 2003-01-08  Havoc Pennington  <hp@pobox.com>
2854
2855         * dbus/dbus-string.c (_dbus_string_align_length): new function
2856
2857         * dbus/dbus-test-main.c: move main() for test app here
2858         * dbus/dbus-test.c
2859         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2860         symbol to run tests, because dbus-test isn't in the main 
2861         library
2862
2863         Code review nitpicks.
2864         
2865         * dbus/dbus-message.c (dbus_message_write_header): add newlines
2866         for people with narrow emacs ;-). Assert client_serial was filled
2867         in. Assert message->name != NULL.
2868         (dbus_message_append_fields): have "first_field_type" arg separate
2869         from va list, needed for C++ binding that also uses varargs IIRC
2870         and helps with type safety
2871         (dbus_message_new): add @todo about using DBusString to store
2872         service/name internally
2873         (dbus_message_new): don't leak ->service and ->name on OOM later
2874         in the function
2875         (dbus_message_unref): free the service name
2876         (dbus_message_get_fields): same change to varargs
2877         i.e. first_field_type
2878         (_dbus_message_loader_return_buffer): assert that the message data
2879         is aligned (if not it's a bug in our code). Put in verbose griping
2880         about why we set corrupted = TRUE.
2881         (decode_header_data): add FIXME that char* is evil.  Was going to
2882         add FIXME about evil locale-specific string.h strncmp, but just
2883         switched to wacky string-as-uint32 optimization. Move check for
2884         "no room for field name" above get_const_data_len() to avoid
2885         assertion failure in get_const_data_len if we have trailing 2
2886         bytes or the like. Check for service and name fields being
2887         provided twice. Don't leak service/name on error. Require field
2888         names to be aligned to 4 bytes.
2889
2890         * dbus/dbus-marshal.c: move byte swap stuff to header
2891         (_dbus_pack_int32): uscore-prefix
2892         (_dbus_unpack_int32): uscore-prefix
2893         (_dbus_unpack_uint32): export
2894         (_dbus_demarshal_string): add @todo complaining about use of
2895         memcpy()
2896         (_dbus_marshal_get_field_end_pos): add @todo about bad error
2897         handling allowing corrupt data to go unchecked
2898
2899 2003-01-08  Havoc Pennington  <hp@redhat.com>
2900
2901         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
2902         to the select() as needed for authentication. (should be using
2903         _dbus_poll() not select, but for another day)
2904
2905         * dbus/dbus.h: include dbus/dbus-protocol.h
2906
2907 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
2908
2909         * dbus/Makefile.am (dbusinclude_HEADERS): Install
2910         dbus-connection.h
2911
2912 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
2913
2914         * dbus/dbus-internals.c: (_dbus_type_to_string):
2915         New function that returns a string describing a type.
2916         
2917         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
2918         * dbus/dbus-marshal.h:
2919         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
2920         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
2921         (dbus_message_iter_get_byte_array):
2922         * dbus/dbus-message.h:
2923         Add new convenience functions for appending and getting message fields.
2924         Also add demarshalling routines for byte arrays.
2925
2926 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2927
2928         * dbus/dbus-connection-internal.h:
2929         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2930         (_dbus_connection_get_next_client_serial),
2931         (dbus_connection_send_message):
2932         * dbus/dbus-internals.h:
2933         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
2934         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
2935         (_dbus_marshal_uint32), (_dbus_demarshal_double),
2936         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
2937         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
2938         (_dbus_verbose_bytes), (_dbus_marshal_test):
2939         * dbus/dbus-marshal.h:
2940         * dbus/dbus-message-internal.h:
2941         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
2942         (dbus_message_write_header), (_dbus_message_lock),
2943         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
2944         (dbus_message_get_name), (dbus_message_append_int32),
2945         (dbus_message_append_uint32), (dbus_message_append_double),
2946         (dbus_message_append_string), (dbus_message_append_byte_array),
2947         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
2948         (dbus_message_iter_unref), (dbus_message_iter_has_next),
2949         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
2950         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
2951         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
2952         (decode_header_data), (_dbus_message_loader_return_buffer),
2953         (message_iter_test), (_dbus_message_test):
2954         * dbus/dbus-message.h:
2955         * dbus/dbus-protocol.h:
2956         * dbus/dbus-test.c: (main):
2957         * dbus/dbus-test.h:
2958         * glib/test-dbus-glib.c: (message_handler), (main):
2959         * test/echo-client.c: (main):
2960         * test/watch.c: (check_messages):
2961         Make messages sendable and receivable for real.
2962         
2963 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2964
2965         * dbus/dbus-marshal.c: (_dbus_marshal_double),
2966         (_dbus_marshal_string), (_dbus_marshal_byte_array):
2967         * dbus/dbus-message.c: (dbus_message_append_int32),
2968         (dbus_message_append_uint32), (dbus_message_append_double),
2969         (dbus_message_append_string), (dbus_message_append_byte_array):
2970         Handle OOM restoration.
2971         
2972 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2973
2974         * dbus/dbus-marshal.c: (_dbus_marshal_string),
2975         (_dbus_demarshal_string), (_dbus_marshal_test):
2976         * dbus/dbus-marshal.h:
2977         * dbus/dbus-message.c: (dbus_message_get_name),
2978         Document these functions.
2979         
2980         (dbus_message_append_int32), (dbus_message_append_uint32),
2981         (dbus_message_append_double), (dbus_message_append_string),
2982         (dbus_message_append_byte_array):
2983         * dbus/dbus-message.h:
2984         Add functions for adding message fields of different types.
2985         
2986         * dbus/dbus-protocol.h:
2987         Add the different types.
2988
2989 2003-01-05  Havoc Pennington  <hp@pobox.com>
2990
2991         * bus/connection.c: implement routines for handling connections,
2992         first thing is keeping a list of owned services on each connection
2993         and setting up watches etc.
2994
2995         * bus/services.c: implement a mapping from service names to lists
2996         of connections
2997
2998         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2999
3000         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3001         to use static mutexes for global data
3002
3003         * dbus/dbus-connection.c (dbus_connection_set_data): add new
3004         collection of functions to set/get application-specific data
3005         on the DBusConnection.
3006
3007 2003-01-04  Havoc Pennington  <hp@pobox.com>
3008
3009         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3010         (_dbus_poll): new function
3011
3012         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3013         copied from GLib
3014
3015         * bus/loop.c: initial code for the daemon main loop
3016
3017 2003-01-04  Havoc Pennington  <hp@pobox.com>
3018
3019         * test/watch.c (error_handler): make it safe if the error handler 
3020         is called multiple times (if we s/error handler/disconnect
3021         handler/ we should just guarantee it's called only once)
3022
3023         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3024         error handler on disconnect (it's quite possible we should
3025         just change the error handler to a "disconnect handler," I'm 
3026         not sure we have any other meaningful errors)
3027
3028         * configure.in: check for getpwnam_r
3029
3030         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3031         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3032         mechanism as in SASL spec, using socket credentials
3033
3034         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3035         (_dbus_send_credentials_unix_socket): new function
3036
3037         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3038         dbus_accept()
3039         (_dbus_write): only check errno if <0 returned
3040         (_dbus_write_two): ditto
3041
3042 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
3043
3044         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3045         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3046         (_dbus_marshal_test):
3047         * dbus/dbus-marshal.h:
3048         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3049         to _dbus_marshal_utf8_string. Also fix some tests.
3050         
3051 2002-12-28  Harri Porten  <porten@kde.org>
3052
3053         * configure.in: added check for C++ compiler and a very cheesy
3054         check for the Qt integration
3055
3056         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3057
3058         * qt/Makefile.am: added 
3059
3060         * qt/.cvsignore: added  
3061
3062         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3063         latter, added #ifdef QT_THREAD_SUPPORT guard.
3064
3065         * dbus/Makefile.am: added missing headers for make dist
3066
3067 2002-12-28  Kristian Rietveld  <kris@gtk.org>
3068
3069         * dbus/Makefile.am: fixup export-symbols-regex.
3070
3071 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
3072
3073         * acinclude.m4: Add this file and put the 
3074         PKG_CHECK_MODULE macro in it.
3075
3076 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
3077
3078         * dbus/dbus-marshal.c: (_dbus_marshal_string),
3079         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3080         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3081         (_dbus_marshal_test):
3082         Make the demarshalling routines align the pos argument.
3083         Add string marshalling tests and fix the obvious bugs 
3084         discovered.
3085         
3086 2002-12-26  Havoc Pennington  <hp@pobox.com>
3087
3088         * dbus/dbus-auth.c: fixes fixes fixes
3089
3090         * dbus/dbus-transport-unix.c: wire up support for
3091         encoding/decoding data on the wire
3092
3093         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
3094         (_dbus_auth_decode_data): append to target string 
3095         instead of nuking it.
3096
3097 2002-12-26  Havoc Pennington  <hp@pobox.com>
3098
3099         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
3100         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
3101         doh
3102
3103         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
3104         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
3105         now). Main point is because I wanted unpack_uint32 to implement
3106         _dbus_verbose_bytes
3107         (_dbus_verbose_bytes): new function
3108
3109         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
3110
3111         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
3112         mechanism to handle a corrupt message stream
3113         (_dbus_message_loader_new): fix preallocation to only prealloc, 
3114         not prelengthen
3115         
3116         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
3117         (_dbus_string_test): enhance tests for copy/move and fix the
3118         functions
3119
3120         * dbus/dbus-transport-unix.c: Hold references in more places to 
3121         avoid reentrancy problems
3122
3123         * dbus/dbus-transport.c: ditto
3124
3125         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
3126         leak reference count in no-message case
3127
3128         * test/watch.c (do_mainloop): handle adding/removing watches
3129         during iteration over the watches. Also, ref the connection/server
3130         stored on a watch, so we don't try to mangle a destroyed one.
3131
3132         * dbus/dbus-transport-unix.c (do_authentication): perform
3133         authentication
3134
3135         * dbus/dbus-auth.c (get_state): add a state
3136         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
3137         (_dbus_auth_get_unused_bytes): append the unused bytes
3138         to the passed in string, rather than prepend
3139
3140         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
3141         the auth conversation DBusAuth
3142
3143         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
3144         (_dbus_transport_new_for_domain_socket): when creating a
3145         transport, pass in whether it's a client-side or server-side
3146         transport so we know which DBusAuth to create
3147
3148 2002-12-03  Havoc Pennington  <hp@pobox.com>
3149
3150         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
3151         _after_ finalizing the derived members
3152         (unix_connection_set): unref watch if we fail to add it
3153
3154         * dbus/dbus-connection.c (dbus_connection_unref): delete the
3155         transport first, so that the connection owned by the 
3156         transport will be valid as the transport finalizes.
3157
3158         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
3159         if necessary, and remove watches from the connection.
3160         
3161         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
3162         
3163 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
3164
3165         * dbus/dbus-marshal.c: (_dbus_marshal_string),
3166         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3167         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3168         (_dbus_marshal_test):
3169         * dbus/dbus-marshal.h:
3170         Add string marshal functions and have the demarshal functions
3171         return the new position.
3172         
3173 2002-12-25  Havoc Pennington  <hp@pobox.com>
3174
3175         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
3176         it is a simple protocol that just maps directly to SASL.
3177
3178         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
3179         initial implementation, not actually used yet.
3180         
3181         * dbus/dbus-string.c (_dbus_string_find): new function
3182         (_dbus_string_equal): new function
3183         (_dbus_string_base64_encode): new function
3184         (_dbus_string_base64_decode): new function
3185
3186 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
3187
3188         * dbus/Makefile.am:
3189         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
3190         (_dbus_marshal_int32), (_dbus_marshal_uint32),
3191         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3192         (_dbus_demarshal_uint32), (_dbus_marshal_test):
3193         * dbus/dbus-marshal.h:
3194         * dbus/dbus-protocol.h:
3195         * dbus/dbus-test.c: (main):
3196         * dbus/dbus-test.h:
3197         Add un-optimized marshalling/demarshalling routines.
3198         
3199 2002-12-25  Harri Porten  <porten@kde.org>
3200
3201         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
3202
3203 2002-12-24  Zack Rusin  <zack@kde.org>
3204
3205         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
3206         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
3207         main loop stuff
3208
3209 2002-12-24  Havoc Pennington  <hp@pobox.com>
3210
3211         * glib/dbus-gthread.c: fix include
3212
3213         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
3214         I think glib API needs to change, though, as you don't 
3215         want to use DBusMessageFunction, you want to use the 
3216         DBusMessageHandler object. Probably 
3217         dbus_connection_open_with_g_main_loop()
3218         and dbus_connection_setup_g_main_loop() or something like that
3219         (but think of better names...) that just create a connection 
3220         that has watch/timeout functions etc. already set up.
3221
3222         * dbus/dbus-connection.c
3223         (dbus_connection_send_message_with_reply): new function just to 
3224         show how the message handler helps us deal with replies.
3225
3226         * dbus/dbus-list.c (_dbus_list_remove_last): new function
3227
3228         * dbus/dbus-string.c (_dbus_string_test): free a string that
3229         wasn't
3230
3231         * dbus/dbus-hash.c: use memory pools for the hash entries
3232         (rebuild_table): be more paranoid about overflow, and 
3233         shrink table when we can
3234         (_dbus_hash_test): reduce number of sprintfs and write
3235         valid C89. Add tests for case where we grow and then 
3236         shrink the hash table.
3237
3238         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
3239
3240         * dbus/dbus-connection.c (dbus_connection_register_handler) 
3241         (dbus_connection_unregister_handler): new functions
3242
3243         * dbus/dbus-message.c (dbus_message_get_name): new
3244
3245         * dbus/dbus-list.c: fix docs typo
3246
3247         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
3248         an object representing a handler for messages.
3249
3250 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
3251
3252         * glib/dbus-glib.h:
3253         * glib/dbus-gthread.c: (dbus_gthread_init):
3254         Don't use the gdbus prefix for public functions.
3255         
3256 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
3257
3258         * Makefile.am:
3259         * configure.in:
3260         Add GLib checks and fixup .pc files
3261         
3262         * glib/Makefile.am:
3263         * glib/dbus-glib.h:
3264         * glib/dbus-gmain.c: (gdbus_connection_prepare),
3265         (gdbus_connection_check), (gdbus_connection_dispatch),
3266         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
3267         (dbus_connection_gsource_new):
3268         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
3269         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
3270         * glib/test-dbus-glib.c: (message_handler), (main):
3271         Add GLib support.
3272         
3273 2002-12-15  Harri Porten  <porten@kde.org>
3274
3275         * autogen.sh: check for libtoolize before attempting to use it 
3276         
3277         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
3278         struct.
3279         
3280         * .cvsignore: ignore more stamp files
3281
3282         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
3283
3284         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
3285         without make install.
3286
3287 2002-12-15  Havoc Pennington  <hp@pobox.com>
3288
3289         * dbus/dbus-threads.c: add thread stubs that a higher library
3290         layer can fill in. e.g. the GLib wrapper might fill them in with
3291         GThread stuff. We still need to use this thread API to
3292         thread-safe-ize the library.
3293
3294 2002-12-12  Havoc Pennington  <hp@pobox.com>
3295
3296         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
3297         below new interfaces and include fewer system headers.
3298
3299         * dbus/dbus-sysdeps.c (_dbus_read): new function
3300         (_dbus_write): new function
3301         (_dbus_write_two): new function
3302         (_dbus_connect_unix_socket): new function
3303         (_dbus_listen_unix_socket): new function
3304
3305         * dbus/dbus-message-internal.h: change interfaces to use
3306         DBusString
3307
3308 2002-12-11  Havoc Pennington  <hp@pobox.com>
3309
3310         * dbus/dbus-types.h: add dbus_unichar
3311
3312         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
3313
3314         * dbus/dbus-connection.c (dbus_connection_send_message): return
3315         TRUE on success
3316
3317         * dbus/dbus-transport.c: include dbus-watch.h   
3318
3319         * dbus/dbus-connection.c: include dbus-message-internal.h
3320
3321         * HACKING: add file with coding guidelines stuff.
3322
3323         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
3324         handling here, for security purposes (as in vsftpd). Not actually
3325         using this class yet.
3326
3327         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
3328         system/libc usage here, as in vsftpd, for ease of auditing (and
3329         should also simplify portability). Haven't actually moved all the
3330         system/libc usage into here yet.
3331         
3332 2002-11-25  Havoc Pennington  <hp@pobox.com>
3333
3334         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
3335         always print the first verbose message.
3336
3337 2002-11-24  Havoc Pennington  <hp@pobox.com>
3338
3339         * test/echo-client.c, test/echo-server.c: cheesy test 
3340         clients.
3341         
3342         * configure.in (AC_CHECK_FUNCS): check for writev
3343
3344         * dbus/dbus-message.c (_dbus_message_get_network_data): new
3345         function
3346
3347         * dbus/dbus-list.c (_dbus_list_foreach): new function
3348
3349         * dbus/dbus-internals.c (_dbus_verbose): new function
3350
3351         * dbus/dbus-server.c, dbus/dbus-server.h: public object
3352         representing a server that listens for connections.
3353
3354         * dbus/.cvsignore: create
3355
3356         * dbus/dbus-errors.h, dbus/dbus-errors.c:
3357         public API for reporting errors
3358
3359         * dbus/dbus-connection.h, dbus/dbus-connection.c:
3360         public object representing a connection that 
3361         sends/receives messages. (Same object used for 
3362         both client and server.)
3363
3364         * dbus/dbus-transport.h, dbus/dbus-transport.c:
3365         Basic abstraction for different kinds of stream
3366         that we might read/write messages from.
3367
3368 2002-11-23  Havoc Pennington  <hp@pobox.com>
3369
3370         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
3371         _DBUS_INT_MAX
3372
3373         * dbus/dbus-test.c (main): add list test, and include 
3374         dbus-test.h as intended
3375
3376         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
3377         (_dbus_hash_table_remove_int): return value indicates 
3378         whether the entry existed to remove
3379
3380         * dbus/dbus-list.c: add linked list utility class, 
3381         with docs and tests
3382
3383         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
3384         array sometimes.
3385
3386 2002-11-23  Havoc Pennington  <hp@pobox.com>
3387
3388         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
3389         DBUS_END_DECLS to nothing, that should fix this once and for all
3390
3391         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
3392
3393         * dbus/dbus-message.c, dbus/dbus-hash.c: 
3394         add some missing @brief
3395
3396 2002-11-23  Havoc Pennington  <hp@pobox.com>
3397
3398         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
3399         to avoid confusing Doxygen
3400
3401         * dbus/dbus-hash.c: @} not }@
3402
3403         * dbus/dbus-message.c (struct DBusMessage): split out 
3404         internals docs
3405
3406 2002-11-23  Havoc Pennington  <hp@pobox.com>
3407
3408         * configure.in: pile on more warning flags if using gcc
3409
3410         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
3411         to document static functions
3412
3413         * configure.in: add summary to end of configure so it 
3414         looks nice and attractive
3415
3416         * dbus/dbus-hash.c: finish implementation and write unit 
3417         tests and docs
3418
3419         * configure.in: add --enable-tests to enable unit tests
3420
3421         * dbus/dbus-test.c: test program to run unit tests 
3422         for all files in dbus/*, initially runs a test for 
3423         dbus-hash.c
3424         
3425         * dbus/dbus-internals.h: file to hold some internal utility stuff
3426
3427 2002-11-22  Havoc Pennington  <hp@redhat.com>
3428
3429         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
3430         "ported" away from Tcl
3431
3432         * dbus/dbus-types.h: header for types such as dbus_bool_t
3433
3434 2002-11-22  Havoc Pennington  <hp@redhat.com>
3435
3436         * dbus/dbus.h: fixups for doc warnings
3437
3438         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
3439         macros
3440         (QUIET): make it quiet so we can see warnings
3441
3442         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3443
3444 2002-11-22  Havoc Pennington  <hp@redhat.com>
3445
3446         * Makefile.am: include "Doxyfile" target in all-local
3447
3448         * configure.in: generate the Doxyfile
3449
3450         * Doxyfile.in: move Doxyfile here, so we can use 
3451         configure to generate a Doxyfile with the right 
3452         version number etc.
3453
3454 2002-11-22  Havoc Pennington  <hp@redhat.com>
3455
3456         * dbus/dbus-message.c: move inline docs into .c file
3457
3458         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3459         so all docs are under doc/
3460         (MAN_EXTENSION): generate man pages. Use extension 
3461         ".3dbus" which matches ".3qt" on my system, 
3462         I guess this is OK, I don't know really.
3463         (FILE_PATTERNS): look for .c files not .h, makes sense
3464         for plain C I think
3465
3466 2002-11-22  Havoc Pennington  <hp@pobox.com>
3467
3468         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
3469         because any app can be a server, and any app can be a client, 
3470         the bus is a special kind of server.
3471
3472 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
3473
3474         * Doxyfile : adding. Still needs Makefile rules to be generated
3475         automatically (just run "doxygen" in the toplevel dir for now to
3476         generate docs)
3477         
3478         * dbus/dbus-message.h : Adding sample docs (javadoc since
3479         resembles gtk-doc a little more)
3480
3481         * dbus/dbus.h : Adding sample docs
3482
3483 2002-11-21  Havoc Pennington  <hp@redhat.com>
3484
3485         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
3486         so we can allow ourselves to include files directly, 
3487         instead of having to use dbus.h
3488
3489         * dbus/dbus.h: fill in
3490
3491         * dbus/dbus-message.h: sketch out a sample header file.
3492         Include griping if you include it directly instead of 
3493         via dbus.h
3494
3495         * dbus/dbus-macros.h: new file with macros for extern "C", 
3496         TRUE/FALSE, NULL, etc.
3497
3498         * doc/file-boilerplate.c: put include guards in here
3499
3500 2002-11-21  Havoc Pennington  <hp@redhat.com>
3501
3502         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3503
3504         * COPYING: include the GPL as well, and license code 
3505         under both AFL and GPL.
3506
3507 2002-11-21  Havoc Pennington  <hp@redhat.com>
3508
3509         * acconfig.h: get rid of this
3510
3511         * autogen.sh (run_configure): add --no-configure option
3512
3513         * configure.in: remove AC_ARG_PROGRAM to make
3514         autoconf complain less. add AC_PREREQ. 
3515         add AC_DEFINE third arg.
3516         
3517 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
3518
3519         * doc/Makefile.am:
3520         Fix references so we can distcheck.
3521
3522 2002-11-21  Havoc Pennington  <hp@redhat.com>
3523
3524         * Initial module creation
3525