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