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