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