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