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