2003-02-23 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / ChangeLog
1 2003-02-23  Havoc Pennington  <hp@pobox.com>
2
3         * dbus/dbus-keyring.c: finish most of this implementation and 
4         simple unit test
5
6         * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
7         these barf if the error isn't cleared to NULL
8
9         * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
10         (_dbus_create_directory): new function
11
12         * dbus/dbus-errors.c (dbus_set_error): fix warning
13
14         * dbus/dbus-string.c (_dbus_string_hex_encode): new function
15         (_dbus_string_hex_decode): new function
16         (test_hex_roundtrip): test code
17
18         * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
19
20         * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
21
22         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use 
23         the save-to-temp/rename trick to atomically write the new file
24         (_dbus_string_parse_uint): new function
25
26 2003-02-22  Havoc Pennington  <hp@pobox.com>
27
28         * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
29
30 2003-02-22  Havoc Pennington  <hp@pobox.com>
31
32         * dbus/dbus-message.c (dbus_message_iter_get_string_array):
33         (dbus_message_iter_get_byte_array): Fix up doxygen warnings
34
35         * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
36
37         * dbus/test/data/sha-1: add US government test suite for SHA-1
38
39 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
40
41         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
42         Make string arrays NULL-terminated.
43         
44         * dbus/dbus-memory.c: (dbus_free_string_array):
45         * dbus/dbus-memory.h:
46         New function for freeing NULL-terminated string arrays.
47         
48         * dbus/dbus-message-builder.c: (append_quoted_string),
49         (_dbus_message_data_load):
50         Add support for array types.
51         
52         * dbus/dbus-message.c: (check_message_handling):
53         Add more types as test cases.
54         
55         * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
56         (_dbus_string_parse_double):
57         Add the start offset to the end offset.
58         
59         * test/data/valid-messages/lots-of-arguments.message:
60         New test message with lots of arguments.
61         
62 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
63
64         * dbus/dbus-message.c: (dbus_message_append_nil),
65         (dbus_message_append_int32), (dbus_message_append_uint32),
66         (dbus_message_append_double), (dbus_message_append_string),
67         (dbus_message_append_int32_array),
68         (dbus_message_append_uint32_array),
69         (dbus_message_append_double_array),
70         (dbus_message_append_byte_array),
71         (dbus_message_append_string_array):
72         Fix all out-of-memory handling in these functions.
73
74 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
75
76         * dbus/dbus-message.c: (dbus_message_append_nil):
77         Fix a silly.
78         
79 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
80
81         * dbus/dbus-message.c: (dbus_message_append_args_valist),
82         (dbus_message_append_nil), (dbus_message_append_int32_array),
83         (dbus_message_append_uint32_array),
84         (dbus_message_append_double_array),
85         (dbus_message_append_byte_array),
86         (dbus_message_append_string_array), (dbus_message_get_args_valist),
87         (dbus_message_iter_get_int32_array),
88         (dbus_message_iter_get_uint32_array),
89         (dbus_message_iter_get_double_array),
90         (dbus_message_iter_get_byte_array),
91         (dbus_message_iter_get_string_array):
92
93         * dbus/dbus-message.h:
94         Add functions for appending and getting arrays.
95         
96 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
97
98         * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
99         element size at least 8 bytes, fixes mempool tests on
100         64-bit machines.
101
102 2003-02-20  Alexander Larsson  <alexl@redhat.com>
103
104         * dbus/dbus-transport-unix.c (unix_do_iteration):
105         Unlock the connection mutex during a blocking select call.
106         Add todo about how we need a way to wake up the select.
107
108         * dbus/dbus-connection-internal.h: 
109         * dbus/dbus-connection.c:
110         Add _dbus_connection_lock and _dbus_connection_unlock.
111
112 2003-02-19  Havoc Pennington  <hp@pobox.com>
113
114         * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
115         Doxyfile.in, not Doxyfile
116
117         * dbus/dbus-keyring.c: do some hacking on this
118
119         * dbus/dbus-sysdeps.c (_dbus_delete_file): new
120
121         * dbus/dbus-errors.c (dbus_set_error_const): do not call
122         dbus_error_init
123         (dbus_set_error): remove dbus_error_init, check for message ==
124         NULL *before* we sprintf into it, and add @todo about including 
125         system headers in this file
126
127         * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
128
129         * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
130
131         * dbus/dbus-sysdeps.c (get_user_info): break this function out to
132         get various bits of user information based on either username 
133         or user ID
134         (_dbus_homedir_from_username): new function
135
136 2003-02-19  Anders Carlsson  <andersca@codefactory.se>
137
138         * configure.in:
139         Add check for nonposix getpwnam_r
140         
141         * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
142         Align the pool element size to a sizeof (void *) boundary.
143         
144         * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
145         (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
146         General Solaris fixes.
147         
148         * test/data/valid-messages/simplest-manual.message:
149         Explicitly state that we want little-endian packing.
150         
151 2003-02-19  Mikael Hallendal  <micke@codefactory.se>
152
153         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
154
155         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket): 
156         Added to create a transport connecting using a tcp/ip socket.
157
158         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
159         to a tcp socket at given host and port.
160         (_dbus_listen_tcp_socket): added to listen on tcp socket for given
161         hostname and port.
162
163         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
164
165         * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket): 
166         Added to create a server listening on a TCP/IP socket.
167
168 2003-02-19  Havoc Pennington  <hp@pobox.com>
169
170         Throughout: mop up all the Doxygen warnings and undocumented
171         stuff.
172         
173         * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
174         to search any paths.
175
176         * dbus/dbus-threads.c: move global mutex initializers to
177         dbus-internals.h, multiple prototypes was confusing doxygen
178         besides being kind of ugly
179
180         * Doxyfile (PREDEFINED): have Doxygen define
181         DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from 
182         docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
183         (do not abuse the feature! it's for stuff like the autogenerated 
184         macros in dbus-md5.c, not just for things you don't feel like 
185         documenting...)
186
187 2003-02-18  Havoc Pennington  <hp@pobox.com>
188
189         * dbus/dbus-string.c (_dbus_string_zero): new function
190
191         * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
192         wrap it in some dbus-friendly API
193
194         * dbus/dbus-types.h: add 16-bit types
195
196 2003-02-18  Joe Shaw  <joe@assbarn.com>
197
198         * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
199         credentials from our currently running process.
200         (get_word): Fix a buglet where we were copying the entire length
201         instead of relative to our position.
202
203         * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
204         keys on the stack... it's 640k of data.
205
206         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
207         read the credentials byte off the socket, even if we don't have
208         SO_PEERCRED.
209         (_dbus_poll): Implement poll() using select() for systems which
210         don't have it.
211
212         * glib/test-dbus-glib.c (main): Print out an error if no
213         parameters are given.
214
215         * test/data/auth/fallback.auth-script: Added.  Tests that a client
216         can fallback to a secondary auth mechanism if the first fails.
217
218 2003-02-18  Havoc Pennington  <hp@pobox.com>
219
220         * AUTHORS: add Alex
221
222 2003-02-17  Havoc Pennington  <hp@pobox.com>
223
224         * doc/dbus-specification.sgml: lots of cosmetic
225         cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
226         env variable to DBUS_BUS_ADDRESS, s/client/application/,
227         s/server/bus/ (except in authentication section). Add a section
228         "Message Bus Message Routing"
229
230 2003-02-17  Anders Carlsson  <andersca@codefactory.se.>
231
232         Release 0.4
233         
234         * NEWS: Update
235
236 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
237
238         * doc/dbus-specification.sgml:
239         Specification updates.
240         
241 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
242
243         * bus/activation.c: (bus_activation_init), (child_setup),
244         (bus_activation_activate_service):
245         * bus/activation.h:
246         * bus/main.c: (main):
247         Set DBUS_ADDRESS environment variable.
248         
249         * dbus/dbus-errors.c: (dbus_set_error):
250         Don't use va_copy since that's a C99 feature.
251         
252         * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
253         (_dbus_spawn_async):
254         * dbus/dbus-sysdeps.h:
255         Add child_setup_func to _dbus_spawn_async.
256         
257         * doc/dbus-specification.sgml:
258         Update specification.
259         
260         * test/spawn-test.c: (setup_func), (main):
261         Fix test.
262         
263 2003-02-17  Alexander Larsson  <alexl@redhat.com>
264
265         * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
266         Added todo.
267
268 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
269
270         * doc/.cvsignore:
271         * doc/Makefile.am:
272         * doc/dbus-test-plan.sgml:
273         Add test plan document.
274         
275         * test/Makefile.am:
276         Fix distcheck.
277         
278 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
279
280         * dbus/dbus-message.c: (decode_header_data),
281         (_dbus_message_loader_return_buffer):
282         Set the header padding amount when loading a message.
283
284 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
285
286         * bus/dispatch.c: (send_one_message):
287         Only send broadcast messages to registered connections.
288         
289         * dbus/dbus-message.c: (dbus_message_name_is):
290         * dbus/dbus-message.h:
291         New convenience function.
292         
293         * dbus/dbus-transport-debug.c: (do_reading):
294         Only dispatch one message per run.
295
296         * test/Makefile.am:
297         * test/bus-test.c: (new_connection_callback), (die),
298         (test_hello_client1_handler), (test_hello_client2_handler),
299         (test_hello_replies), (main):
300
301         * test/bus-test-loop.[ch]:
302         Add these.
303         
304 2003-02-16  Havoc Pennington  <hp@pobox.com>
305
306         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
307         backward conditional
308
309 2003-02-16  Alexander Larsson  <alexl@redhat.com>
310
311         * dbus/dbus-connection.c:
312         Implement sent_message_with_reply. (with_reply_and block is still
313         busted).
314         Made dispatch_message not lose message if OOM.
315         
316         * dbus/dbus-errors.h:
317         Add NoReply error (for reply timeouts).
318
319 2003-02-16  Alexander Larsson  <alexl@redhat.com>
320
321         * dbus/dbus-hash.c (_dbus_hash_table_unref):
322         Actually free keys and values when destroying hashtable.
323
324 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
325
326         * dbus/dbus-auth.c: (client_try_next_mechanism):
327         Plug a leak.
328         
329         * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
330         Return TRUE if there's no thread implementation around.
331         
332         * glib/dbus-gmain.c: (free_source),
333         (dbus_connection_hookup_with_g_main):
334         Make sure to remove the GSource when the connection is finalized.
335         
336 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
337
338         * bus/dispatch.c: (bus_dispatch_message_handler):
339         * dbus/dbus-errors.h:
340         Return an error if someone tries to send a message to a service
341         that doesn't exist.
342         
343 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
344
345         * bus/activation.c: (load_directory), (bus_activation_init),
346         (bus_activation_activate_service):
347         * bus/activation.h:
348         * bus/driver.c: 
349         (bus_driver_handle_activate_service), (bus_driver_handle_message):
350         More work on the activation handling.
351         
352         * dbus/dbus-errors.h:
353         Add some error messages
354         
355         * dbus/dbus-message.c: (dbus_message_new_error_reply):
356         * dbus/dbus-message.h:
357         New function that creates an error message.
358         
359         * dbus/dbus-protocol.h:
360         Add ACTIVATE_SERVER message.
361         
362         * dbus/dbus-server-unix.c: (unix_handle_watch),
363         (_dbus_server_new_for_domain_socket):
364         Call _dbus_fd_set_close_on_exec.
365         
366         * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
367         (_dbus_spawn_async), (_dbus_disable_sigpipe),
368         (_dbus_fd_set_close_on_exec):
369         * dbus/dbus-sysdeps.h:
370         Add _dbus_fd_set_close_on exec function. Also add function that checks
371         that all open fds are set to close-on-exec and warns otherwise.
372         
373         * dbus/dbus-transport-unix.c:
374         (_dbus_transport_new_for_domain_socket):
375         Call _dbus_fd_set_close_on_exec.
376
377 2003-02-16  Havoc Pennington  <hp@pobox.com>
378
379         * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
380         allow people to avoid setting SIGPIPE to SIG_IGN
381         (_dbus_connection_new_for_transport): disable SIGPIPE unless 
382         we've been asked not to
383
384 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
385
386         * dbus/dbus-list.c: (_dbus_list_append_link),
387         (_dbus_list_prepend_link):
388         * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
389         (dbus_realloc):
390         Warning fixes.
391
392 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
393
394         * bus/Makefile.am:
395         * bus/activation.c: (bus_activation_entry_free),
396         (add_desktop_file_entry), (load_directory), (bus_activation_init):
397         * bus/activation.h:
398         * bus/main.c: (main):
399         Add simple activation support, doesn't work yet though.
400
401 2003-02-15   Zack Rusin  <zack@kde.org>
402
403         * qt/dbus-qthread.cpp:  small casting fix
404
405 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
406
407         * dbus/dbus-errors.c: (dbus_set_error):
408         * dbus/dbus-errors.h:
409         Add a few errors and make dbus_set_error void.
410         
411         * dbus/dbus-sysdeps.c: 
412         (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
413         (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
414         * dbus/dbus-sysdeps.h:
415         Add _dbus_spawn_async.
416         
417         * test/spawn-test.c: (main):
418         Test for _dbus_spawn_async.
419         
420 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
421
422         * dbus/dbus-internals.h:
423         Fix build without tests.
424         
425         * dbus/dbus-list.c: (alloc_link):
426         Fix a segfault when a malloc fails.
427         
428         * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
429         (dbus_malloc0), (dbus_realloc):
430         Add support for malloc debugging.
431
432 2003-02-15  Alexander Larsson  <alexl@redhat.com>
433
434         * dbus/dbus-threads.c:
435         * dbus/dbus-threads.h:
436         Add condvars. Remove static mutext from API.
437         Implement static mutexes by initializing them from threads_init.
438         
439         * glib/dbus-gthread.c:
440         * qt/dbus-qthread.cpp:
441         Update with the thread api changes.
442
443                 
444         * dbus/dbus-list.c:
445         * dbus/dbus-list.h:
446         Turn StaticMutex into normal mutex + init function.
447         Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
448         _dbus_list_append_link, _dbus_list_prepend_link
449
450
451         * dbus/dbus-sysdeps.c: 
452         * dbus/dbus-sysdeps.h:
453         New type dbus_atomic_t, and new functions _dbus_atomic_inc,
454         _dbus_atomic_dec. Only slow fallback implementation at the moment.
455         
456         * dbus/dbus-protocol.h:
457         Add DBUS_MESSAGE_LOCAL_DISCONNECT define
458         
459         * dbus/dbus-message.c:
460         Make ref/unref atomic.
461         Fix some docs.
462         
463         * dbus/dbus-connection-internal.h:
464         * dbus/dbus-connection.c:
465         * dbus/dbus-connection.h:
466         Make threadsafe.
467         Change _peek to _borrow,_return & _steal_borrowed.
468         Change disconnect callback to event.
469         Make dbus_connection_dispatch_messages reentrant.
470         
471         * dbus/dbus-transport.c:
472         Don't ref the connection on calls to the transport
473         implementation.
474         
475         * dbus/dbus-message-handler.c:
476         Make threadsafe.
477         
478         * glib/dbus-gmain.c:
479         Don't use peek_message anymore
480         
481         * test/Makefile.am:
482         * test/debug-thread.c:
483         * test/debug-thread.h:
484         Simple thread implementation that asserts() on deadlocks in
485         single-threaded code.
486         
487         * test/bus-test.c:
488         (main) Call debug_threads_init.
489
490         * test/watch.c:
491         Use disconnect message instead of disconnect callback.
492
493         * bus/connection.c:
494         * bus/connection.h:
495         Don't call dbus_connection_set_disconnect_function. Instead export
496         bus_connection_disconnect.
497         
498         * bus/dispatch.c:
499         Call bus_connection_disconnect when we get a disconnected message.
500         
501 2003-02-15  Havoc Pennington  <hp@pobox.com>
502
503         * dbus/dbus-message.c (dbus_message_new): fool around with the
504         docs
505
506 2003-02-14  Havoc Pennington  <hp@pobox.com>
507
508         * dbus/dbus-mempool.c: fail if the debug functions so indicate
509
510         * dbus/dbus-memory.c: fail if the debug functions indicate we
511         should
512
513         * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
514         (_dbus_decrement_fail_alloc_counter): debug functions to 
515         simulate memory allocation failures
516
517 2003-02-14  Havoc Pennington  <hp@pobox.com>
518
519         * dbus/dbus-errors.h (struct DBusError): add a word of padding 
520         to DBusError
521
522 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
523
524         * bus/driver.c: (bus_driver_handle_hello):
525         * bus/driver.h:
526         * bus/services.c: (bus_service_lookup):
527         Reorder message sending so we get a more sane order.
528         
529         * test/bus-test.c: (message_handler):
530         Fix tyop.
531         
532 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
533
534         * bus/driver.c: (bus_driver_send_service_deleted),
535         (bus_driver_send_service_created), (bus_driver_send_service_lost),
536         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
537         (bus_driver_send_welcome_message),
538         (bus_driver_handle_list_services),
539         (bus_driver_handle_acquire_service),
540         (bus_driver_handle_service_exists):
541         * dbus/dbus-bus.c: (dbus_bus_register_client),
542         (dbus_bus_acquire_service), (dbus_bus_service_exists):
543         * dbus/dbus-errors.c: (dbus_result_to_string):
544         * dbus/dbus-errors.h:
545         * dbus/dbus-message.c: (dbus_message_append_args),
546         (dbus_message_append_args_valist), (dbus_message_get_args),
547         (dbus_message_get_args_valist), (dbus_message_get_args_iter),
548         (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
549         (dbus_message_iter_get_byte_array),
550         (dbus_message_iter_get_string_array), (message_iter_test),
551         (check_message_handling), (_dbus_message_test):
552         * dbus/dbus-message.h:
553         * test/bus-test.c: (main):
554         Change fields to arguments in messages, so that they won't be
555         confused with header fields.
556         
557         * glib/test-dbus-glib.c: (main):
558         Remove append_fields from hello message.
559         
560 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
561
562         * dbus/dbus-errors.c:
563         * dbus/dbus-message.c:
564         * dbus/dbus-string.c:
565         Documentation fixes.
566
567 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
568
569         * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
570         (remove_timeout):
571         Implement support for timeouts in dbus-glib.
572         
573 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
574
575         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
576         * dbus/dbus-message.c: (process_test_subdir):
577         * test/break-loader.c: (find_breaks_based_on):
578         Plug some memory leaks.
579         
580 2003-02-13  Richard Hult  <rhult@codefactory.se>
581
582         * bus/main.c: Fix build.
583
584         * dbus/dbus-errors.h: 
585         * dbus/dbus-errors.c: Fix copyright for Anders.
586
587 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
588
589         * bus/Makefile.am:
590         Add utils.[ch]
591         
592         * bus/connection.c: (bus_connection_foreach):
593         Fix a warning.
594         
595         * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
596         (unescape_string), (new_section), (parse_section_start),
597         (parse_key_value), (report_error), (bus_desktop_file_load),
598         (bus_desktop_file_get_string):
599         * bus/desktop-file.h:
600         Use DBusError for error reporting.
601         
602         * bus/dispatch.c: (send_one_message),
603         (bus_dispatch_message_handler):
604         * bus/driver.c: (bus_driver_send_service_deleted),
605         (bus_driver_send_service_created), (bus_driver_send_service_lost),
606         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
607         (bus_driver_send_welcome_message),
608         (bus_driver_handle_list_services),
609         (bus_driver_handle_acquire_service),
610         (bus_driver_handle_service_exists):
611         * bus/loop.c: (bus_loop_run):
612         * bus/main.c:
613         Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
614         
615         * bus/utils.c: (bus_wait_for_memory):
616         * bus/utils.h:
617         New files with general utility functions.
618         
619         * dbus/dbus-internals.h:
620         Remove _DBUS_HANDLE_OOM.
621         
622 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
623
624         * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
625         (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
626         * dbus/dbus-errors.h:
627         Add DBusError structure.
628         
629 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
630
631         * test/data/valid-messages/standard-acquire-service.message:
632         * test/data/valid-messages/standard-hello.message:
633         * test/data/valid-messages/standard-list-services.message:
634         * test/data/valid-messages/standard-service-exists.message:
635         Add some standard messages.
636         
637 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
638
639         * bus/driver.c: (bus_driver_send_welcome_message),
640         (bus_driver_handle_list_services),
641         (bus_driver_handle_acquire_service),
642         (bus_driver_handle_service_exists), (bus_driver_handle_message):
643         Update for API changes in libdbus.
644         
645         * dbus/dbus-message.c: (dbus_message_new_reply):
646         * dbus/dbus-message.h:
647         Remove the name argument. The spec states that replies shouldn't
648         have a name.
649
650 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
651
652         * bus/desktop-file.c: (parse_section_start), (parse_key_value),
653         (report_error), (bus_desktop_file_load), (lookup_section),
654         (lookup_line), (bus_desktop_file_get_raw),
655         (bus_desktop_file_get_string):
656         * bus/desktop-file.h:
657         Some fixes, and new functions for getting a key value from a section.
658         
659 2003-02-13  Havoc Pennington  <hp@pobox.com>
660
661         * test/data/auth/fail-after-n-attempts.auth-script: new test
662
663         * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
664         reject the client.
665
666 2003-02-13  Havoc Pennington  <hp@pobox.com>
667
668         * dbus/dbus-auth.c (handle_server_data_external_mech): args to
669         dbus_credentials_match were backward
670
671         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
672         NO_CREDENTIALS and ROOT_CREDENTIALS
673
674         * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine 
675         into here. Never process more commands after we've reached an 
676         end state; store further data as unused bytes.
677
678         * test/data/auth/*: add more auth tests
679         
680         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
681         command to match exact string and EXPECT_UNUSED to match unused
682         bytes
683
684         * test/Makefile.am (dist-hook): fix to dist all the test stuff
685
686 2003-02-12  Havoc Pennington  <hp@pobox.com>
687
688         * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
689         \r off of popped lines
690
691         * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
692         scripts
693
694         * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
695         SEND, append \r\n
696
697 2003-02-12  Havoc Pennington  <hp@pobox.com>
698
699         * dbus/Makefile.am: remove break-loader from the build, since it
700         moved.
701
702         * configure.in: add --enable-gcov to turn on coverage profiling
703         flags and disable optimization
704
705 2003-02-10  Havoc Pennington  <hp@pobox.com>
706
707         * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync 
708         initial cut at test framework for DBusAuth from laptop.
709         Doesn't quite work yet but it compiles and I need to get 
710         it off the 266mhz laptop. ;-)
711         
712         * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
713         fix a memleak in error case
714
715 2003-02-12  Anders Carlsson  <andersca@codefactory.se>
716
717         * bus/Makefile.am:
718         * bus/desktop-file.c:
719         * bus/desktop-file.h:
720         Add a desktop file parser.
721
722 2003-02-11  Zack Rusin  <zack@kde.org>
723
724         * qt/message.[h|cpp]: sample implementation
725         of the KDE wrapper for DBusMessage
726
727 2003-02-09  Zack Rusin  <zack@kde.org>
728
729         * test/bus-test.c: make_it_compile
730         * doc/dbus-specification.sgml: minimal semantic fix
731
732 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
733
734         Release 0.3
735         
736         * NEWS: Update
737
738 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
739
740         * dbus/Makefile.am:
741         * dbus/dbus-break-loader.c:
742         * test/Makefile.am:
743         * test/break-loader.c:
744         Move dbus-break-loader to test/ and rename it to break-loader.
745
746 2003-02-02  Havoc Pennington  <hp@pobox.com>
747
748         * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files 
749         for code to manage cookies in your home directory
750
751         * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
752
753         * dbus/dbus-auth.c (get_state): impose a maximum number of tries
754         to authenticate, then disconnect the client.
755
756 2003-02-03  Alexander Larsson  <alexl@redhat.com>
757
758         * dbus/dbus-message.c (dbus_message_append_fields):
759         Correct docs.
760
761 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
762
763         * doc/dbus-specification.sgml:
764         Update address format section.
765         
766 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
767
768         * test/Makefile.am:
769         * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
770         (message_handler), (new_connection_callback), (loop_quit),
771         (loop_run), (main):
772         Add bus test.
773         
774 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
775
776         * bus/driver.c: (bus_driver_handle_service_exists):
777         Simplify the code a bit.
778         
779         * dbus/dbus-bus.c: (dbus_bus_service_exists):
780         Fix a silly. 
781         
782 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
783
784         * bus/Makefile.am:
785         Add libdbus-daemon.la and link to it.
786
787 2003-02-01  James Willcox  <jwillcox@gnome.org>
788
789         * bus/driver.c: (bus_driver_handle_own_service):
790         Actually include the service reply code in the message.
791
792 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
793
794         * bus/driver.c: (bus_driver_handle_service_exists):
795         Don't unref the incoming message.
796         
797 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
798
799         * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
800
801 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
802
803         * dbus/dbus-server.c: (dbus_server_listen):
804         * dbus/dbus-transport.c: (_dbus_transport_open):
805         ifdef out the calls to the debug transport and server.
806         
807 2003-02-02  Alexander Larsson  <alexl@redhat.com>
808
809         * dbus/dbus-watch.c (dbus_watch_get_flags):
810         Add note in the docs that ERROR or HANGUP won't be returned
811         and are assumed always on.
812
813         * glib/dbus-gmain.c (add_watch):
814         Always add IO_ERR | IO_HUP
815
816         * dbus/dbus-message.h:
817         Add semicolon after dbus_message_iter_get_string_array().
818         Makes qt code build again
819
820 2003-02-01  Anders Carlsson  <andersca@codefactory.se>
821
822         * bus/driver.c: (create_unique_client_name),
823         (bus_driver_handle_hello):
824         Don't take a name, just use a numeric id to identify
825         each client.
826         
827         * dbus/Makefile.am:
828         * dbus/dbus-bus.c: (dbus_bus_register_client),
829         (dbus_bus_acquire_service), (dbus_bus_service_exists):
830         * dbus/dbus-bus.h:
831         Add new convenience functions for communicating with the bus.
832         
833         * dbus/dbus-message.h:
834         
835         * dbus/dbus-protocol.h:
836         Fix a typo.
837         
838 2003-02-01  Alexander Larsson  <alexl@redhat.com>
839
840         * dbus/dbus-message.c (dbus_message_append_fields):
841         Add some more doc comments.
842
843 2003-02-01  Havoc Pennington  <hp@pobox.com>
844
845         * dbus/dbus-break-loader.c (randomly_modify_length): change 
846         a 4-byte value in the message as if it were a length
847
848         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
849         execute bit on saved files
850
851 2003-02-01  Havoc Pennington  <hp@pobox.com>
852
853         * dbus/dbus-break-loader.c (main): new program to find messages
854         that break the loader.
855
856         * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
857         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
858
859         * dbus/dbus-string.c (_dbus_string_set_byte): new
860         
861 2003-01-31  Havoc Pennington  <hp@pobox.com>
862
863         * dbus/dbus-message.c: refactor the test code to be more general, 
864         in preparation for writing a "randomly permute test cases to 
865         try to break the loader" program.
866
867 2003-01-31  Havoc Pennington  <hp@pobox.com>
868         
869         * doc/dbus-specification.sgml: work on the specification
870
871         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check 
872         the protocol version of the message.
873
874         * dbus/dbus-protocol.h: drop special _REPLY names, the spec 
875         no longer specifies that.
876         (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 
877         1/2/3/4)
878
879         * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
880         "break" for DBUS_TYPE_NIL, remove @todo
881
882 2003-01-31  Havoc Pennington  <hp@pobox.com>
883
884         * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename 
885         just set_is_error/get_is_error as this is a commonly-used
886         function, and write docs.
887
888 2003-01-31  Anders Carlsson  <andersca@codefactory.se>
889
890         * dbus/dbus-address.c: (dbus_address_entry_free):
891         Free key and value lists.
892         
893         * dbus/dbus-internals.c: (_dbus_type_to_string):
894         Add the types we didn't have.
895         
896         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
897         (_dbus_marshal_validate_arg):
898         Add NIL types.
899         
900         * dbus/dbus-message.c: (dbus_message_set_sender):
901         Remove todo about being able to set sender to NULL.
902         
903         (dbus_message_set_is_error_reply),
904         (dbus_message_get_is_error_reply):
905         * dbus/dbus-message.h:
906         New functions.
907         
908         * dbus/dbus-protocol.h:
909         Add error reply flag.
910         
911         * test/data/valid-messages/opposite-endian.message:
912         Add NIL type to test.
913         
914 2003-01-31  Havoc Pennington  <hp@pobox.com>
915
916         * doc/dbus-specification.sgml: fully specify the header.  Add
917         flags and major protocol version, and change header/body len to
918         unsigned.
919
920         * dbus/dbus-message-builder.c (append_saved_length): append length
921         as uint32
922
923         * dbus/dbus-message.c (dbus_message_create_header): change header
924         length and body length to unsigned. Add the new fields from the
925         spec
926         (_dbus_message_loader_return_buffer): unsigned header/body len
927
928 2003-01-30  Havoc Pennington  <hp@pobox.com>
929
930         * dbus/dbus-auth.c: rework to use only REJECTED, no 
931         MECHANISMS
932
933         * doc/dbus-sasl-profile.txt: drop MECHANISMS and just 
934         use REJECTED, suggested by Mark McLoughlin
935
936 2003-01-30  Havoc Pennington  <hp@pobox.com>
937
938         * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
939         a better way to report errors here. e.g.  "unix address lacks
940         path" or something. also "no such file" when the path doesn't
941         exist, etc.
942
943         * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
944         leaking list nodes
945         (dbus_parse_address): add @todo about documenting address format, 
946         and allowing , and ; to be escaped
947
948 2003-01-30  Anders Carlsson  <andersca@codefactory.se>
949
950         * dbus/Makefile.am:
951         Add dbus-address.[ch]
952         
953         * dbus/dbus-address.c: (dbus_address_entry_free),
954         (dbus_address_entries_free), (create_entry),
955         (dbus_address_entry_get_method), (dbus_address_entry_get_value),
956         (dbus_parse_address), (_dbus_address_test):
957         * dbus/dbus-address.h:
958         New files for dealing with address parsing.
959         
960         * dbus/dbus-connection.c:
961         Document timeout functions.
962         
963         * dbus/dbus-message.c:
964         Document dbus_message_new_from_message.
965         
966         * dbus/dbus-server-debug.c:
967         Document.
968         
969         * dbus/dbus-server.c: (dbus_server_listen):
970         Parse address and use correct server implementation.
971         
972         * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
973         * dbus/dbus-string.h:
974         New function with test.
975         
976         * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
977         * dbus/dbus-test.h:
978         Add address tests.
979         
980         * dbus/dbus-transport-debug.c:
981         Document.
982         
983         * dbus/dbus-transport.c: (_dbus_transport_open):
984         Parse address and use correct transport implementation. 
985
986 2003-01-30  Havoc Pennington  <hp@pobox.com>
987
988         * dbus/dbus-message.c: use message->byte_order instead of 
989         DBUS_COMPILER_BYTE_ORDER throughout.
990         (dbus_message_create_header): pad header to align the 
991         start of the body of the message to 8-byte boundary
992
993         * dbus/dbus-marshal.h: make all the demarshalers take const 
994         DBusString arguments.
995
996         * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
997         validate message args here, so we don't have to do slow validation
998         later, and so we catch bad messages as they are incoming. Also add
999         better checks on header_len and body_len. Also fill in
1000         message->byte_order
1001
1002         * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1003         implemented properly)
1004         (_dbus_string_validate_nul): new function to check all-nul
1005
1006         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename 
1007         get_arg_end_pos and remove all validation
1008         (_dbus_marshal_validate_arg): actually do validation here.
1009
1010 2003-01-29  Havoc Pennington  <hp@pobox.com>
1011
1012         * dbus/dbus-message.c (check_message_handling): fix assertion
1013         failure on set_client_serial
1014
1015 2003-01-28  Havoc Pennington  <hp@pobox.com>
1016
1017         * dbus/dbus-server-debug.c: Add doc section comments
1018         
1019         * dbus/dbus-transport-debug.c: add doc section comments
1020         
1021 2003-01-28  Havoc Pennington  <hp@redhat.com>
1022
1023         * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1024         the reverse order from how I had it
1025         (_dbus_string_base64_encode): reverse encoding order. I was
1026         basically byteswapping everything during encoding.
1027
1028 2003-01-28  Anders Carlsson  <andersca@codefactory.se>
1029
1030         * dbus/dbus-connection-internal.h:
1031         * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1032         (_dbus_connection_remove_timeout):
1033         Add functions for adding and removing timeouts.
1034         
1035         * dbus/dbus-message.c: (dbus_message_new_from_message):
1036         Add new function that takes a message and creates an exact
1037         copy of it, but with the refcount set to 1.
1038         (check_message_handling):
1039         Fix build error.
1040         
1041         * dbus/dbus-server-protected.h:
1042         * dbus/dbus-server.c: (_dbus_server_init_base),
1043         (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1044         (dbus_server_set_timeout_functions):
1045         (_dbus_server_remove_timeout):
1046         New functions so that a server can add and remove timeouts.
1047
1048         (dbus_server_listen):
1049         Add commented out call to dbus_server_debug_new.
1050
1051         * dbus/dbus-timeout.c: (_dbus_timeout_new):
1052         Actually set the handler, doh.
1053         
1054         * dbus/dbus-transport.c: (_dbus_transport_open):
1055         Add commented out call to dbus_transport_debug_client_new.
1056         
1057         * dbus/Makefile.am:
1058         Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1059         
1060 2003-01-28  Havoc Pennington  <hp@pobox.com>
1061
1062         * dbus/dbus-message.c (check_message_handling): function to check 
1063         on the loaded message, iterates over it etc.
1064
1065 2003-01-28  Havoc Pennington  <hp@pobox.com>
1066
1067         * test/Makefile.am (dist-hook): fix make distdir
1068
1069         * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1070
1071 2003-01-27  Havoc Pennington  <hp@pobox.com>
1072
1073         * dbus/dbus-mempool.c (time_for_size): replace printf with 
1074         _dbus_verbose
1075
1076         * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1077         empty lines; fix the SAVE_LENGTH stuff to be
1078         START_LENGTH/END_LENGTH so it actually works; couple other 
1079         bugfixes
1080         
1081         * test/Makefile.am (dist-hook): add dist-hook for .message files
1082
1083         * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1084         can be constant or locked.
1085         (_dbus_string_free): allow freeing a const string as
1086         documented/intended
1087
1088         * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1089
1090         * dbus/dbus-test-main.c (main): take an argument which is the 
1091         directory containing test data
1092
1093         * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1094         argument to this and load all the messages in test/data/
1095         checking that they can be loaded or not loaded as appropriate.
1096
1097 2003-01-27  Anders Carlsson  <andersca@codefactory.se>
1098
1099         * bus/dispatch.c: (bus_dispatch_message_handler):
1100         Dispatch messages sent to services.
1101         
1102         * bus/driver.c: (bus_driver_send_service_deleted),
1103         (bus_driver_send_service_created), (bus_driver_send_service_lost),
1104         (bus_driver_send_service_acquired):
1105         Add helper functions for sending service related messages.
1106
1107         (bus_driver_send_welcome_message):
1108         Send HELLO_REPLY instead of WELCOME.
1109         
1110         (bus_driver_handle_list_services):
1111         Send LIST_SERVICES_REPLY instead of SERVICES.
1112         
1113         (bus_driver_handle_own_service),
1114         (bus_driver_handle_service_exists):
1115         New message handlers.
1116         
1117         (bus_driver_handle_message):
1118         Invoke new message handlers.
1119         
1120         (bus_driver_remove_connection):
1121         Don't remove any services here since that's done automatically
1122         by bus_service_remove_owner now.
1123         
1124         * bus/driver.h:
1125         New function signatures.
1126         
1127         * bus/services.c: (bus_service_add_owner):
1128         Send ServiceAcquired message if we're the only primary owner.
1129         
1130         (bus_service_remove_owner):
1131         Send ServiceAcquired/ServiceLost messages.
1132         
1133         (bus_service_set_prohibit_replacement),
1134         (bus_service_get_prohibit_replacement):
1135         Functions for setting prohibit replacement.
1136         
1137         (bus_service_has_owner):
1138         New function that checks if a connection is in the owner queue of 
1139         a certain service.
1140         
1141         * bus/services.h:
1142         Add new function signatures.
1143         
1144         * dbus/dbus-list.c: (_dbus_list_test):
1145         Add tests for _dbus_list_remove_last and traversing the list backwards.
1146         
1147         * dbus/dbus-list.h:
1148         Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1149         go any further, so return NULL then.
1150         
1151         * dbus/dbus-protocol.h:
1152         Add new messages, service flags and service replies.
1153         
1154 2003-01-26  Havoc Pennington  <hp@pobox.com>
1155
1156         * dbus/dbus-message-builder.c: implement, completely untested.
1157
1158         * test/data/*: add data to be used in testing. 
1159         ".message" files are our simple loadable text format.
1160         ".message-raw" will be binary dumps of messages.
1161
1162         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1163
1164 2003-01-26  Havoc Pennington  <hp@pobox.com>
1165
1166         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1167
1168         * dbus/dbus-errors.c (dbus_result_to_string): add
1169         file errors
1170
1171         * dbus/dbus-message-builder.c: new file, will contain code to load
1172         up messages from files. Not implemented yet.
1173
1174 2003-01-26  Havoc Pennington  <hp@pobox.com>
1175
1176         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
1177         the sender by setting to NULL
1178
1179 2003-01-26  Havoc Pennington  <hp@pobox.com>
1180
1181         The unit tests pass, but otherwise untested.  If it breaks, the
1182         tests should have been better. ;-)
1183         
1184         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
1185         the connection.
1186
1187         * dbus/dbus-message.c: redo everything so we maintain 
1188         message->header as the only copy of the various fields.
1189         This avoids the possibility of out-of-memory in some cases,
1190         for example dbus_message_lock() can't run out of memory anymore,
1191         and avoids extra copying. Figured I may as well go ahead and do 
1192         this since it was busted for dbus_message_lock to not return 
1193         failure on OOM, and dbus_message_write_header was totally
1194         unchecked for OOM. Also fixed some random other bugs.
1195
1196         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
1197         that strings are nul-terminated. Also, end_pos can be equal 
1198         to string length just not greater than, I think.
1199         (_dbus_marshal_set_int32): new function
1200         (_dbus_marshal_set_uint32): new function
1201         (_dbus_marshal_set_string): new function
1202
1203         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
1204         a warning, init timeout_list to NULL
1205         (dbus_connection_send_message): don't use uninitialized variable
1206         "serial"
1207
1208         * dbus/dbus-string.c (_dbus_string_replace_len): new function
1209
1210 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
1211
1212         * bus/driver.c: (bus_driver_handle_hello),
1213         (bus_driver_send_welcome_message):
1214         Plug leaks
1215         
1216 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
1217
1218         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
1219         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1220         (dbus_connection_unref):
1221         * dbus/dbus-marshal.c: (_dbus_marshal_test):
1222         * dbus/dbus-message.c: (dbus_message_unref),
1223         Plug memory leaks.
1224         
1225         (dbus_message_get_fields): 
1226         Remove debugging printout.
1227
1228         (_dbus_message_loader_return_buffer):
1229         Don't store the header string.
1230         
1231         (_dbus_message_test):
1232         Plug leaks.
1233
1234 2003-01-26  Richard Hult  <rhult@codefactory.se>
1235
1236         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
1237         the file descriptor list, since it can change under us.
1238
1239 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1240
1241         * glib/dbus-gmain.c: (dbus_connection_prepare),
1242         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
1243         (remove_watch), (dbus_connection_hookup_with_g_main):
1244         Rewrite the glib handling to use its own GSource instead of a 
1245         GIOChannel so we can catch messages put in the queue while waiting
1246         for a reply.
1247         
1248 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1249
1250         * bus/Makefile.am:
1251         * bus/connection.c: (connection_disconnect_handler),
1252         (connection_watch_callback), (bus_connection_setup):
1253         * bus/dispatch.c: (send_one_message),
1254         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
1255         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
1256         * bus/dispatch.h:
1257         * bus/driver.c: (bus_driver_send_service_deleted),
1258         (bus_driver_send_service_created), (bus_driver_handle_hello),
1259         (bus_driver_send_welcome_message),
1260         (bus_driver_handle_list_services), (bus_driver_remove_connection),
1261         (bus_driver_handle_message):
1262         * bus/driver.h:
1263         Refactor code, put the message dispatching in its own file. Use 
1264         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
1265         is disconnected.
1266         
1267 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1268
1269         * dbus/dbus-internals.h:
1270         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
1271         
1272         * dbus/dbus-message.c: (dbus_message_get_sender):
1273         * dbus/dbus-message.h:
1274         Implement dbus_message_get_sender.
1275         
1276         * dbus/dbus-protocol.h:
1277         Add message and service defines.
1278         
1279 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1280
1281         * dbus/dbus-connection.c: (dbus_connection_send_message):
1282         * dbus/dbus-message-internal.h:
1283         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
1284         (dbus_message_write_header):
1285         Remove _dbus_messag_unlock and don't set the client serial on a 
1286         message if one already exists.
1287         
1288 2003-01-24  Havoc Pennington  <hp@pobox.com>
1289
1290         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
1291         list_pool
1292
1293         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
1294         on OOM
1295
1296 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1297
1298         * dbus/dbus-list.c: (alloc_link), (free_link):
1299         Use a memory pool for the links.
1300         
1301 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1302
1303         * bus/connection.c: (bus_connection_foreach):
1304         * bus/connection.h:
1305         Add new bus_connection_foreach function.
1306         
1307         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
1308         Add function that broadcasts a message to all clients.
1309         
1310         (bus_driver_send_service_created), (bus_driver_handle_hello),
1311         (bus_driver_send_welcome_message),
1312         (bus_driver_handle_list_services), (bus_driver_message_handler):
1313         Implement functions that take care of listing services, and notifying
1314         clients when new services are created.
1315         
1316         * bus/services.c: (bus_services_list):
1317         * bus/services.h:
1318         Add new function that returns an array of strings with the currently
1319         registered services.
1320         
1321         * glib/dbus-glib.h:
1322         * glib/dbus-gmain.c:
1323         Update copyright year.
1324         
1325 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
1326
1327         * dbus/dbus-connection.c: (dbus_connection_send_message):
1328         Unlock the message in case it was sent earlier.
1329         
1330         (dbus_connection_send_message_with_reply_and_block):
1331         Remove the reply message from the list.
1332         
1333         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1334         Set array_len and new_pos correctly.
1335         
1336         (_dbus_marshal_test):
1337         Remove debug output.
1338         
1339         * dbus/dbus-message-internal.h:
1340         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
1341         New function that returns the reply serial.
1342         
1343         (_dbus_message_unlock):
1344         New function that unlocks a message and resets its header.
1345
1346         (dbus_message_append_string_array), 
1347         (dbus_message_get_fields_valist),
1348         (dbus_message_iter_get_field_type),
1349         (dbus_message_iter_get_string_array),   
1350         (dbus_message_get_fields),      
1351         (dbus_message_append_fields_valist):
1352         Handle string arrays.
1353         
1354         (dbus_message_set_sender):
1355         Make this function public since the bus daemon needs it.
1356         
1357         (decode_header_data):
1358         Set the reply serial to -1 initially.
1359
1360         * dbus/dbus-message.h:
1361         Add dbus_message_set_sender.    
1362
1363 2003-01-24  Havoc Pennington  <hp@pobox.com>
1364
1365         * doc/dbus-specification.sgml: add some stuff
1366
1367 2003-01-22  Havoc Pennington  <hp@pobox.com>
1368
1369         * doc/dbus-specification.sgml: Start to document the protocol.
1370
1371 2003-01-22  Havoc Pennington  <hp@pobox.com>
1372
1373         * dbus/dbus-connection.c
1374         (dbus_connection_send_message_with_reply_and_block): add some @todo
1375
1376         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
1377
1378 2003-01-21  Havoc Pennington  <hp@pobox.com>
1379
1380         (patch untested because can't compile)
1381         
1382         * bus/driver.c (create_unique_client_name): make this function
1383         never recycle client names. Also, caller should initialize 
1384         the DBusString.
1385
1386         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
1387
1388 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
1389
1390         * dbus/dbus-marshal.c: (_dbus_marshal_double),
1391         (_dbus_marshal_int32), (_dbus_marshal_uint32),
1392         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
1393         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
1394         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1395         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1396         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
1397         * dbus/dbus-marshal.h:
1398         * dbus/dbus-protocol.h:
1399         Add support for marshalling and demarshalling integer, double
1400         and string arrays.
1401         
1402 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
1403
1404         * bus/Makefile.am:
1405         Add driver.[ch]
1406         
1407         * bus/connection.c: (connection_disconnect_handler):
1408         Remove the connection from the bus driver's list.
1409         
1410         (connection_watch_callback): Dispatch messages.
1411
1412         (free_connection_data): Free connection name.
1413         
1414         (bus_connection_setup): Add connection to the bus driver's list.
1415         (bus_connection_remove_owned_service): 
1416         (bus_connection_set_name), (bus_connection_get_name):
1417         Add functions for setting and getting the connection's name.
1418         
1419         * bus/connection.h:
1420         Add function headers.
1421         
1422         * bus/driver.c: (create_unique_client_name),
1423         (bus_driver_handle_hello_message),
1424         (bus_driver_send_welcome_message), (bus_driver_message_handler),
1425         (bus_driver_add_connection), (bus_driver_remove_connection):
1426         * bus/driver.h:
1427         * bus/main.c:
1428         * bus/services.c: (bus_service_free):
1429         * bus/services.h:
1430         New file that handles communication and registreation with the bus
1431         itself. 
1432         
1433 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
1434
1435         * dbus/dbus-connection.c: (dbus_connection_send_message):
1436         Add a new client_serial parameter.
1437         
1438         (dbus_connection_send_message_with_reply):
1439         Remove a @todo since we've implemented the blocking function.
1440         
1441         (dbus_connection_send_message_with_reply_and_block):
1442         New function that sends a message and waits for a reply and
1443         then returns the reply.
1444         
1445         * dbus/dbus-connection.h:
1446         Add new functions.
1447         
1448         * dbus/dbus-errors.c: (dbus_result_to_string):
1449         * dbus/dbus-errors.h:
1450         Add new DBUS_RESULT.
1451         
1452         * dbus/dbus-message-internal.h:
1453         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
1454         (_dbus_message_set_sender), (dbus_message_write_header),
1455         (dbus_message_new_reply), (decode_header_data),
1456         (_dbus_message_loader_return_buffer), (_dbus_message_test):
1457         * dbus/dbus-message.h:
1458         Add new functions that set the reply serial and sender.
1459         Also marshal and demarshal them correctly and add test.
1460         
1461         * dbus/dbus-protocol.h:
1462         Add new DBUS_MESSAGE_TYPE_SENDER.
1463         
1464         * glib/dbus-glib.h:
1465         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
1466         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
1467         (dbus_connection_hookup_with_g_main):
1468         * glib/test-dbus-glib.c: (main):
1469         Rewrite to use GIOChannel and remove the GSource crack.
1470         
1471         * test/echo-client.c: (main):
1472         * test/watch.c: (check_messages):
1473         Update for changed APIs
1474         
1475 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
1476
1477         * dbus/Makefile.am: Add dbus-timeout.[cħ]
1478         
1479         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
1480         Create a DBusTimeoutList.       
1481         (dbus_connection_set_timeout_functions): Add new function to
1482         set timeout callbacks
1483         
1484         * dbus/dbus-connection.h: Add public DBusTimeout API.
1485         
1486         * dbus/dbus-message.c: (dbus_message_get_service):
1487         * dbus/dbus-message.h:  New function.
1488
1489         * dbus/dbus-server.c: Fix small doc typo.
1490         
1491         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
1492
1493 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
1494
1495         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
1496         of the string, just as long as specified.
1497
1498 2003-01-19  Havoc Pennington  <hp@pobox.com>
1499
1500         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1501         new function
1502
1503         * dbus/dbus-server.c (dbus_server_set_max_connections)
1504         (dbus_server_get_max_connections, dbus_server_get_n_connections):
1505         keep track of current number of connections, and add API for
1506         setting a max (but haven't implemented enforcing the max yet)
1507
1508 2003-01-18  Havoc Pennington  <hp@pobox.com>
1509
1510         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1511         reading/writing if read_watch != NULL or write_watch != NULL.
1512
1513         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1514         the message loader code to actually load message->header and
1515         message->body into the newly-created message.
1516
1517         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1518         in OOM case
1519
1520         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
1521         (dbus_connection_get_max_message_size) 
1522         (dbus_connection_set_max_live_messages_size) 
1523         (dbus_connection_get_max_live_messages_size): implement some
1524         resource limitation functions
1525
1526         * dbus/dbus-resources.c: new file implementing some of the
1527         resource limits stuff
1528
1529         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1530         missing docs, add @todo to handle OOM etc.
1531
1532         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1533         docs
1534         
1535 2003-01-18  Havoc Pennington  <hp@pobox.com>
1536
1537         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
1538         connection if it hasn't been already.
1539
1540         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1541         replace with DisconnectFunction.
1542
1543 2003-01-18  Havoc Pennington  <hp@pobox.com>
1544
1545         Building --disable-verbose-mode --disable-asserts --disable-tests
1546         cuts the library from 112K to 45K or so
1547         
1548         * configure.in: check for varargs macro support, 
1549         add --enable-verbose-mode, --enable-asserts. 
1550
1551         * dbus/dbus-internals.h (_dbus_assert): support
1552         DBUS_DISABLE_ASSERT
1553         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1554
1555 2003-01-18  Havoc Pennington  <hp@pobox.com>
1556
1557         * dbus/dbus-test.c: include config.h so that tests actually run
1558
1559         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1560         so the failure mode when that assumption fails will be plenty
1561         obvious.
1562
1563 2003-01-18  Havoc Pennington  <hp@pobox.com>
1564
1565         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1566
1567         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1568         the distribution
1569
1570         * test/Makefile.am: don't use special variable "TESTS" for echo-*
1571         since we don't want to use those in make check
1572
1573 2003-01-15  Havoc Pennington  <hp@redhat.com>
1574
1575         Release 0.2
1576         
1577         * NEWS: update
1578
1579 2003-01-15  Havoc Pennington  <hp@redhat.com>
1580
1581         * test/Makefile.am: fix so that test source code ends up in the
1582         distribution on make distcheck
1583
1584 2003-01-15  Havoc Pennington  <hp@redhat.com>
1585
1586         Release 0.1.
1587         
1588         * NEWS: update  
1589
1590 2003-01-15  Havoc Pennington  <hp@redhat.com>
1591
1592         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1593         fix build when --disable-tests
1594
1595         * Makefile.am (EXTRA_DIST): put HACKING in here
1596
1597         * HACKING: document procedure for making a tarball release.
1598
1599 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
1600
1601         * bus/connection.c: (connection_error_handler),
1602         (bus_connection_setup):
1603         * bus/main.c: (main):
1604         Make sure that the DBusConnectionData struct is NULLed
1605         out to prevent a segfault.
1606         
1607         * dbus/dbus-errors.c: (dbus_result_to_string):
1608         * dbus/dbus-errors.h:
1609         * dbus/dbus-message.c: (dbus_message_get_fields),
1610         (dbus_message_get_fields_valist), (_dbus_message_test):
1611         * dbus/dbus-message.h:
1612         Make dbus_message_get_fields return a result code so we can
1613         track invalid fields as well as oom.
1614         
1615 2003-01-11  Havoc Pennington  <hp@pobox.com>
1616
1617         * configure.in: change --enable-test/--enable-ansi action-if-given
1618         to enable_foo=$enableval instead of enable_foo=yes
1619
1620 2003-01-08  Havoc Pennington  <hp@pobox.com>
1621
1622         * dbus/dbus-string.c (_dbus_string_align_length): new function
1623
1624         * dbus/dbus-test-main.c: move main() for test app here
1625         * dbus/dbus-test.c
1626         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1627         symbol to run tests, because dbus-test isn't in the main 
1628         library
1629
1630         Code review nitpicks.
1631         
1632         * dbus/dbus-message.c (dbus_message_write_header): add newlines
1633         for people with narrow emacs ;-). Assert client_serial was filled
1634         in. Assert message->name != NULL.
1635         (dbus_message_append_fields): have "first_field_type" arg separate
1636         from va list, needed for C++ binding that also uses varargs IIRC
1637         and helps with type safety
1638         (dbus_message_new): add @todo about using DBusString to store
1639         service/name internally
1640         (dbus_message_new): don't leak ->service and ->name on OOM later
1641         in the function
1642         (dbus_message_unref): free the service name
1643         (dbus_message_get_fields): same change to varargs
1644         i.e. first_field_type
1645         (_dbus_message_loader_return_buffer): assert that the message data
1646         is aligned (if not it's a bug in our code). Put in verbose griping
1647         about why we set corrupted = TRUE.
1648         (decode_header_data): add FIXME that char* is evil.  Was going to
1649         add FIXME about evil locale-specific string.h strncmp, but just
1650         switched to wacky string-as-uint32 optimization. Move check for
1651         "no room for field name" above get_const_data_len() to avoid
1652         assertion failure in get_const_data_len if we have trailing 2
1653         bytes or the like. Check for service and name fields being
1654         provided twice. Don't leak service/name on error. Require field
1655         names to be aligned to 4 bytes.
1656
1657         * dbus/dbus-marshal.c: move byte swap stuff to header
1658         (_dbus_pack_int32): uscore-prefix
1659         (_dbus_unpack_int32): uscore-prefix
1660         (_dbus_unpack_uint32): export
1661         (_dbus_demarshal_string): add @todo complaining about use of
1662         memcpy()
1663         (_dbus_marshal_get_field_end_pos): add @todo about bad error
1664         handling allowing corrupt data to go unchecked
1665
1666 2003-01-08  Havoc Pennington  <hp@redhat.com>
1667
1668         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
1669         to the select() as needed for authentication. (should be using
1670         _dbus_poll() not select, but for another day)
1671
1672         * dbus/dbus.h: include dbus/dbus-protocol.h
1673
1674 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
1675
1676         * dbus/Makefile.am (dbusinclude_HEADERS): Install
1677         dbus-connection.h
1678
1679 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
1680
1681         * dbus/dbus-internals.c: (_dbus_type_to_string):
1682         New function that returns a string describing a type.
1683         
1684         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1685         * dbus/dbus-marshal.h:
1686         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1687         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1688         (dbus_message_iter_get_byte_array):
1689         * dbus/dbus-message.h:
1690         Add new convenience functions for appending and getting message fields.
1691         Also add demarshalling routines for byte arrays.
1692
1693 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1694
1695         * dbus/dbus-connection-internal.h:
1696         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1697         (_dbus_connection_get_next_client_serial),
1698         (dbus_connection_send_message):
1699         * dbus/dbus-internals.h:
1700         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1701         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1702         (_dbus_marshal_uint32), (_dbus_demarshal_double),
1703         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1704         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1705         (_dbus_verbose_bytes), (_dbus_marshal_test):
1706         * dbus/dbus-marshal.h:
1707         * dbus/dbus-message-internal.h:
1708         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1709         (dbus_message_write_header), (_dbus_message_lock),
1710         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1711         (dbus_message_get_name), (dbus_message_append_int32),
1712         (dbus_message_append_uint32), (dbus_message_append_double),
1713         (dbus_message_append_string), (dbus_message_append_byte_array),
1714         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1715         (dbus_message_iter_unref), (dbus_message_iter_has_next),
1716         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1717         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1718         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1719         (decode_header_data), (_dbus_message_loader_return_buffer),
1720         (message_iter_test), (_dbus_message_test):
1721         * dbus/dbus-message.h:
1722         * dbus/dbus-protocol.h:
1723         * dbus/dbus-test.c: (main):
1724         * dbus/dbus-test.h:
1725         * glib/test-dbus-glib.c: (message_handler), (main):
1726         * test/echo-client.c: (main):
1727         * test/watch.c: (check_messages):
1728         Make messages sendable and receivable for real.
1729         
1730 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1731
1732         * dbus/dbus-marshal.c: (_dbus_marshal_double),
1733         (_dbus_marshal_string), (_dbus_marshal_byte_array):
1734         * dbus/dbus-message.c: (dbus_message_append_int32),
1735         (dbus_message_append_uint32), (dbus_message_append_double),
1736         (dbus_message_append_string), (dbus_message_append_byte_array):
1737         Handle OOM restoration.
1738         
1739 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1740
1741         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1742         (_dbus_demarshal_string), (_dbus_marshal_test):
1743         * dbus/dbus-marshal.h:
1744         * dbus/dbus-message.c: (dbus_message_get_name),
1745         Document these functions.
1746         
1747         (dbus_message_append_int32), (dbus_message_append_uint32),
1748         (dbus_message_append_double), (dbus_message_append_string),
1749         (dbus_message_append_byte_array):
1750         * dbus/dbus-message.h:
1751         Add functions for adding message fields of different types.
1752         
1753         * dbus/dbus-protocol.h:
1754         Add the different types.
1755
1756 2003-01-05  Havoc Pennington  <hp@pobox.com>
1757
1758         * bus/connection.c: implement routines for handling connections,
1759         first thing is keeping a list of owned services on each connection
1760         and setting up watches etc.
1761
1762         * bus/services.c: implement a mapping from service names to lists
1763         of connections
1764
1765         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
1766
1767         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
1768         to use static mutexes for global data
1769
1770         * dbus/dbus-connection.c (dbus_connection_set_data): add new
1771         collection of functions to set/get application-specific data
1772         on the DBusConnection.
1773
1774 2003-01-04  Havoc Pennington  <hp@pobox.com>
1775
1776         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
1777         (_dbus_poll): new function
1778
1779         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
1780         copied from GLib
1781
1782         * bus/loop.c: initial code for the daemon main loop
1783
1784 2003-01-04  Havoc Pennington  <hp@pobox.com>
1785
1786         * test/watch.c (error_handler): make it safe if the error handler 
1787         is called multiple times (if we s/error handler/disconnect
1788         handler/ we should just guarantee it's called only once)
1789
1790         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
1791         error handler on disconnect (it's quite possible we should
1792         just change the error handler to a "disconnect handler," I'm 
1793         not sure we have any other meaningful errors)
1794
1795         * configure.in: check for getpwnam_r
1796
1797         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
1798         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
1799         mechanism as in SASL spec, using socket credentials
1800
1801         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
1802         (_dbus_send_credentials_unix_socket): new function
1803
1804         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
1805         dbus_accept()
1806         (_dbus_write): only check errno if <0 returned
1807         (_dbus_write_two): ditto
1808
1809 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
1810
1811         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
1812         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
1813         (_dbus_marshal_test):
1814         * dbus/dbus-marshal.h:
1815         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
1816         to _dbus_marshal_utf8_string. Also fix some tests.
1817         
1818 2002-12-28  Harri Porten  <porten@kde.org>
1819
1820         * configure.in: added check for C++ compiler and a very cheesy
1821         check for the Qt integration
1822
1823         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
1824
1825         * qt/Makefile.am: added 
1826
1827         * qt/.cvsignore: added  
1828
1829         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
1830         latter, added #ifdef QT_THREAD_SUPPORT guard.
1831
1832         * dbus/Makefile.am: added missing headers for make dist
1833
1834 2002-12-28  Kristian Rietveld  <kris@gtk.org>
1835
1836         * dbus/Makefile.am: fixup export-symbols-regex.
1837
1838 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
1839
1840         * acinclude.m4: Add this file and put the 
1841         PKG_CHECK_MODULE macro in it.
1842
1843 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
1844
1845         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1846         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1847         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1848         (_dbus_marshal_test):
1849         Make the demarshalling routines align the pos argument.
1850         Add string marshalling tests and fix the obvious bugs 
1851         discovered.
1852         
1853 2002-12-26  Havoc Pennington  <hp@pobox.com>
1854
1855         * dbus/dbus-auth.c: fixes fixes fixes
1856
1857         * dbus/dbus-transport-unix.c: wire up support for
1858         encoding/decoding data on the wire
1859
1860         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
1861         (_dbus_auth_decode_data): append to target string 
1862         instead of nuking it.
1863
1864 2002-12-26  Havoc Pennington  <hp@pobox.com>
1865
1866         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
1867         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
1868         doh
1869
1870         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
1871         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
1872         now). Main point is because I wanted unpack_uint32 to implement
1873         _dbus_verbose_bytes
1874         (_dbus_verbose_bytes): new function
1875
1876         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
1877
1878         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
1879         mechanism to handle a corrupt message stream
1880         (_dbus_message_loader_new): fix preallocation to only prealloc, 
1881         not prelengthen
1882         
1883         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
1884         (_dbus_string_test): enhance tests for copy/move and fix the
1885         functions
1886
1887         * dbus/dbus-transport-unix.c: Hold references in more places to 
1888         avoid reentrancy problems
1889
1890         * dbus/dbus-transport.c: ditto
1891
1892         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
1893         leak reference count in no-message case
1894
1895         * test/watch.c (do_mainloop): handle adding/removing watches
1896         during iteration over the watches. Also, ref the connection/server
1897         stored on a watch, so we don't try to mangle a destroyed one.
1898
1899         * dbus/dbus-transport-unix.c (do_authentication): perform
1900         authentication
1901
1902         * dbus/dbus-auth.c (get_state): add a state
1903         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
1904         (_dbus_auth_get_unused_bytes): append the unused bytes
1905         to the passed in string, rather than prepend
1906
1907         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
1908         the auth conversation DBusAuth
1909
1910         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
1911         (_dbus_transport_new_for_domain_socket): when creating a
1912         transport, pass in whether it's a client-side or server-side
1913         transport so we know which DBusAuth to create
1914
1915 2002-12-03  Havoc Pennington  <hp@pobox.com>
1916
1917         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
1918         _after_ finalizing the derived members
1919         (unix_connection_set): unref watch if we fail to add it
1920
1921         * dbus/dbus-connection.c (dbus_connection_unref): delete the
1922         transport first, so that the connection owned by the 
1923         transport will be valid as the transport finalizes.
1924
1925         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
1926         if necessary, and remove watches from the connection.
1927         
1928         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
1929         
1930 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
1931
1932         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1933         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1934         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1935         (_dbus_marshal_test):
1936         * dbus/dbus-marshal.h:
1937         Add string marshal functions and have the demarshal functions
1938         return the new position.
1939         
1940 2002-12-25  Havoc Pennington  <hp@pobox.com>
1941
1942         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
1943         it is a simple protocol that just maps directly to SASL.
1944
1945         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
1946         initial implementation, not actually used yet.
1947         
1948         * dbus/dbus-string.c (_dbus_string_find): new function
1949         (_dbus_string_equal): new function
1950         (_dbus_string_base64_encode): new function
1951         (_dbus_string_base64_decode): new function
1952
1953 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
1954
1955         * dbus/Makefile.am:
1956         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
1957         (_dbus_marshal_int32), (_dbus_marshal_uint32),
1958         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1959         (_dbus_demarshal_uint32), (_dbus_marshal_test):
1960         * dbus/dbus-marshal.h:
1961         * dbus/dbus-protocol.h:
1962         * dbus/dbus-test.c: (main):
1963         * dbus/dbus-test.h:
1964         Add un-optimized marshalling/demarshalling routines.
1965         
1966 2002-12-25  Harri Porten  <porten@kde.org>
1967
1968         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
1969
1970 2002-12-24  Zack Rusin  <zack@kde.org>
1971
1972         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
1973         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
1974         main loop stuff
1975
1976 2002-12-24  Havoc Pennington  <hp@pobox.com>
1977
1978         * glib/dbus-gthread.c: fix include
1979
1980         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
1981         I think glib API needs to change, though, as you don't 
1982         want to use DBusMessageFunction, you want to use the 
1983         DBusMessageHandler object. Probably 
1984         dbus_connection_open_with_g_main_loop()
1985         and dbus_connection_setup_g_main_loop() or something like that
1986         (but think of better names...) that just create a connection 
1987         that has watch/timeout functions etc. already set up.
1988
1989         * dbus/dbus-connection.c
1990         (dbus_connection_send_message_with_reply): new function just to 
1991         show how the message handler helps us deal with replies.
1992
1993         * dbus/dbus-list.c (_dbus_list_remove_last): new function
1994
1995         * dbus/dbus-string.c (_dbus_string_test): free a string that
1996         wasn't
1997
1998         * dbus/dbus-hash.c: use memory pools for the hash entries
1999         (rebuild_table): be more paranoid about overflow, and 
2000         shrink table when we can
2001         (_dbus_hash_test): reduce number of sprintfs and write
2002         valid C89. Add tests for case where we grow and then 
2003         shrink the hash table.
2004
2005         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2006
2007         * dbus/dbus-connection.c (dbus_connection_register_handler) 
2008         (dbus_connection_unregister_handler): new functions
2009
2010         * dbus/dbus-message.c (dbus_message_get_name): new
2011
2012         * dbus/dbus-list.c: fix docs typo
2013
2014         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2015         an object representing a handler for messages.
2016
2017 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
2018
2019         * glib/dbus-glib.h:
2020         * glib/dbus-gthread.c: (dbus_gthread_init):
2021         Don't use the gdbus prefix for public functions.
2022         
2023 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
2024
2025         * Makefile.am:
2026         * configure.in:
2027         Add GLib checks and fixup .pc files
2028         
2029         * glib/Makefile.am:
2030         * glib/dbus-glib.h:
2031         * glib/dbus-gmain.c: (gdbus_connection_prepare),
2032         (gdbus_connection_check), (gdbus_connection_dispatch),
2033         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2034         (dbus_connection_gsource_new):
2035         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2036         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2037         * glib/test-dbus-glib.c: (message_handler), (main):
2038         Add GLib support.
2039         
2040 2002-12-15  Harri Porten  <porten@kde.org>
2041
2042         * autogen.sh: check for libtoolize before attempting to use it 
2043         
2044         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2045         struct.
2046         
2047         * .cvsignore: ignore more stamp files
2048
2049         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2050
2051         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2052         without make install.
2053
2054 2002-12-15  Havoc Pennington  <hp@pobox.com>
2055
2056         * dbus/dbus-threads.c: add thread stubs that a higher library
2057         layer can fill in. e.g. the GLib wrapper might fill them in with
2058         GThread stuff. We still need to use this thread API to
2059         thread-safe-ize the library.
2060
2061 2002-12-12  Havoc Pennington  <hp@pobox.com>
2062
2063         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2064         below new interfaces and include fewer system headers.
2065
2066         * dbus/dbus-sysdeps.c (_dbus_read): new function
2067         (_dbus_write): new function
2068         (_dbus_write_two): new function
2069         (_dbus_connect_unix_socket): new function
2070         (_dbus_listen_unix_socket): new function
2071
2072         * dbus/dbus-message-internal.h: change interfaces to use
2073         DBusString
2074
2075 2002-12-11  Havoc Pennington  <hp@pobox.com>
2076
2077         * dbus/dbus-types.h: add dbus_unichar
2078
2079         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2080
2081         * dbus/dbus-connection.c (dbus_connection_send_message): return
2082         TRUE on success
2083
2084         * dbus/dbus-transport.c: include dbus-watch.h   
2085
2086         * dbus/dbus-connection.c: include dbus-message-internal.h
2087
2088         * HACKING: add file with coding guidelines stuff.
2089
2090         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2091         handling here, for security purposes (as in vsftpd). Not actually
2092         using this class yet.
2093
2094         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2095         system/libc usage here, as in vsftpd, for ease of auditing (and
2096         should also simplify portability). Haven't actually moved all the
2097         system/libc usage into here yet.
2098         
2099 2002-11-25  Havoc Pennington  <hp@pobox.com>
2100
2101         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
2102         always print the first verbose message.
2103
2104 2002-11-24  Havoc Pennington  <hp@pobox.com>
2105
2106         * test/echo-client.c, test/echo-server.c: cheesy test 
2107         clients.
2108         
2109         * configure.in (AC_CHECK_FUNCS): check for writev
2110
2111         * dbus/dbus-message.c (_dbus_message_get_network_data): new
2112         function
2113
2114         * dbus/dbus-list.c (_dbus_list_foreach): new function
2115
2116         * dbus/dbus-internals.c (_dbus_verbose): new function
2117
2118         * dbus/dbus-server.c, dbus/dbus-server.h: public object
2119         representing a server that listens for connections.
2120
2121         * dbus/.cvsignore: create
2122
2123         * dbus/dbus-errors.h, dbus/dbus-errors.c:
2124         public API for reporting errors
2125
2126         * dbus/dbus-connection.h, dbus/dbus-connection.c:
2127         public object representing a connection that 
2128         sends/receives messages. (Same object used for 
2129         both client and server.)
2130
2131         * dbus/dbus-transport.h, dbus/dbus-transport.c:
2132         Basic abstraction for different kinds of stream
2133         that we might read/write messages from.
2134
2135 2002-11-23  Havoc Pennington  <hp@pobox.com>
2136
2137         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
2138         _DBUS_INT_MAX
2139
2140         * dbus/dbus-test.c (main): add list test, and include 
2141         dbus-test.h as intended
2142
2143         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
2144         (_dbus_hash_table_remove_int): return value indicates 
2145         whether the entry existed to remove
2146
2147         * dbus/dbus-list.c: add linked list utility class, 
2148         with docs and tests
2149
2150         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
2151         array sometimes.
2152
2153 2002-11-23  Havoc Pennington  <hp@pobox.com>
2154
2155         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2156         DBUS_END_DECLS to nothing, that should fix this once and for all
2157
2158         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2159
2160         * dbus/dbus-message.c, dbus/dbus-hash.c: 
2161         add some missing @brief
2162
2163 2002-11-23  Havoc Pennington  <hp@pobox.com>
2164
2165         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
2166         to avoid confusing Doxygen
2167
2168         * dbus/dbus-hash.c: @} not }@
2169
2170         * dbus/dbus-message.c (struct DBusMessage): split out 
2171         internals docs
2172
2173 2002-11-23  Havoc Pennington  <hp@pobox.com>
2174
2175         * configure.in: pile on more warning flags if using gcc
2176
2177         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
2178         to document static functions
2179
2180         * configure.in: add summary to end of configure so it 
2181         looks nice and attractive
2182
2183         * dbus/dbus-hash.c: finish implementation and write unit 
2184         tests and docs
2185
2186         * configure.in: add --enable-tests to enable unit tests
2187
2188         * dbus/dbus-test.c: test program to run unit tests 
2189         for all files in dbus/*, initially runs a test for 
2190         dbus-hash.c
2191         
2192         * dbus/dbus-internals.h: file to hold some internal utility stuff
2193
2194 2002-11-22  Havoc Pennington  <hp@redhat.com>
2195
2196         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
2197         "ported" away from Tcl
2198
2199         * dbus/dbus-types.h: header for types such as dbus_bool_t
2200
2201 2002-11-22  Havoc Pennington  <hp@redhat.com>
2202
2203         * dbus/dbus.h: fixups for doc warnings
2204
2205         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
2206         macros
2207         (QUIET): make it quiet so we can see warnings
2208
2209         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
2210
2211 2002-11-22  Havoc Pennington  <hp@redhat.com>
2212
2213         * Makefile.am: include "Doxyfile" target in all-local
2214
2215         * configure.in: generate the Doxyfile
2216
2217         * Doxyfile.in: move Doxyfile here, so we can use 
2218         configure to generate a Doxyfile with the right 
2219         version number etc.
2220
2221 2002-11-22  Havoc Pennington  <hp@redhat.com>
2222
2223         * dbus/dbus-message.c: move inline docs into .c file
2224
2225         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
2226         so all docs are under doc/
2227         (MAN_EXTENSION): generate man pages. Use extension 
2228         ".3dbus" which matches ".3qt" on my system, 
2229         I guess this is OK, I don't know really.
2230         (FILE_PATTERNS): look for .c files not .h, makes sense
2231         for plain C I think
2232
2233 2002-11-22  Havoc Pennington  <hp@pobox.com>
2234
2235         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
2236         because any app can be a server, and any app can be a client, 
2237         the bus is a special kind of server.
2238
2239 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
2240
2241         * Doxyfile : adding. Still needs Makefile rules to be generated
2242         automatically (just run "doxygen" in the toplevel dir for now to
2243         generate docs)
2244         
2245         * dbus/dbus-message.h : Adding sample docs (javadoc since
2246         resembles gtk-doc a little more)
2247
2248         * dbus/dbus.h : Adding sample docs
2249
2250 2002-11-21  Havoc Pennington  <hp@redhat.com>
2251
2252         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
2253         so we can allow ourselves to include files directly, 
2254         instead of having to use dbus.h
2255
2256         * dbus/dbus.h: fill in
2257
2258         * dbus/dbus-message.h: sketch out a sample header file.
2259         Include griping if you include it directly instead of 
2260         via dbus.h
2261
2262         * dbus/dbus-macros.h: new file with macros for extern "C", 
2263         TRUE/FALSE, NULL, etc.
2264
2265         * doc/file-boilerplate.c: put include guards in here
2266
2267 2002-11-21  Havoc Pennington  <hp@redhat.com>
2268
2269         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
2270
2271         * COPYING: include the GPL as well, and license code 
2272         under both AFL and GPL.
2273
2274 2002-11-21  Havoc Pennington  <hp@redhat.com>
2275
2276         * acconfig.h: get rid of this
2277
2278         * autogen.sh (run_configure): add --no-configure option
2279
2280         * configure.in: remove AC_ARG_PROGRAM to make
2281         autoconf complain less. add AC_PREREQ. 
2282         add AC_DEFINE third arg.
2283         
2284 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
2285
2286         * doc/Makefile.am:
2287         Fix references so we can distcheck.
2288
2289 2002-11-21  Havoc Pennington  <hp@redhat.com>
2290
2291         * Initial module creation
2292