2003-01-26 Havoc Pennington <hp@pobox.com>
[platform/upstream/dbus.git] / ChangeLog
1 2003-01-26  Havoc Pennington  <hp@pobox.com>
2
3         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
4
5         * dbus/dbus-errors.c (dbus_result_to_string): add
6         file errors
7
8         * dbus/dbus-message-builder.c: new file, will contain code to load
9         up messages from files. Not implemented yet.
10
11 2003-01-26  Havoc Pennington  <hp@pobox.com>
12
13         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
14         the sender by setting to NULL
15
16 2003-01-26  Havoc Pennington  <hp@pobox.com>
17
18         The unit tests pass, but otherwise untested.  If it breaks, the
19         tests should have been better. ;-)
20         
21         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
22         the connection.
23
24         * dbus/dbus-message.c: redo everything so we maintain 
25         message->header as the only copy of the various fields.
26         This avoids the possibility of out-of-memory in some cases,
27         for example dbus_message_lock() can't run out of memory anymore,
28         and avoids extra copying. Figured I may as well go ahead and do 
29         this since it was busted for dbus_message_lock to not return 
30         failure on OOM, and dbus_message_write_header was totally
31         unchecked for OOM. Also fixed some random other bugs.
32
33         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
34         that strings are nul-terminated. Also, end_pos can be equal 
35         to string length just not greater than, I think.
36         (_dbus_marshal_set_int32): new function
37         (_dbus_marshal_set_uint32): new function
38         (_dbus_marshal_set_string): new function
39
40         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
41         a warning, init timeout_list to NULL
42         (dbus_connection_send_message): don't use uninitialized variable
43         "serial"
44
45         * dbus/dbus-string.c (_dbus_string_replace_len): new function
46
47 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
48
49         * bus/driver.c: (bus_driver_handle_hello),
50         (bus_driver_send_welcome_message):
51         Plug leaks
52         
53 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
54
55         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
56         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
57         (dbus_connection_unref):
58         * dbus/dbus-marshal.c: (_dbus_marshal_test):
59         * dbus/dbus-message.c: (dbus_message_unref),
60         Plug memory leaks.
61         
62         (dbus_message_get_fields): 
63         Remove debugging printout.
64
65         (_dbus_message_loader_return_buffer):
66         Don't store the header string.
67         
68         (_dbus_message_test):
69         Plug leaks.
70
71 2003-01-26  Richard Hult  <rhult@codefactory.se>
72
73         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
74         the file descriptor list, since it can change under us.
75
76 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
77
78         * glib/dbus-gmain.c: (dbus_connection_prepare),
79         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
80         (remove_watch), (dbus_connection_hookup_with_g_main):
81         Rewrite the glib handling to use its own GSource instead of a 
82         GIOChannel so we can catch messages put in the queue while waiting
83         for a reply.
84         
85 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
86
87         * bus/Makefile.am:
88         * bus/connection.c: (connection_disconnect_handler),
89         (connection_watch_callback), (bus_connection_setup):
90         * bus/dispatch.c: (send_one_message),
91         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
92         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
93         * bus/dispatch.h:
94         * bus/driver.c: (bus_driver_send_service_deleted),
95         (bus_driver_send_service_created), (bus_driver_handle_hello),
96         (bus_driver_send_welcome_message),
97         (bus_driver_handle_list_services), (bus_driver_remove_connection),
98         (bus_driver_handle_message):
99         * bus/driver.h:
100         Refactor code, put the message dispatching in its own file. Use 
101         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
102         is disconnected.
103         
104 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
105
106         * dbus/dbus-internals.h:
107         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
108         
109         * dbus/dbus-message.c: (dbus_message_get_sender):
110         * dbus/dbus-message.h:
111         Implement dbus_message_get_sender.
112         
113         * dbus/dbus-protocol.h:
114         Add message and service defines.
115         
116 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
117
118         * dbus/dbus-connection.c: (dbus_connection_send_message):
119         * dbus/dbus-message-internal.h:
120         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
121         (dbus_message_write_header):
122         Remove _dbus_messag_unlock and don't set the client serial on a 
123         message if one already exists.
124         
125 2003-01-24  Havoc Pennington  <hp@pobox.com>
126
127         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
128         list_pool
129
130         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
131         on OOM
132
133 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
134
135         * dbus/dbus-list.c: (alloc_link), (free_link):
136         Use a memory pool for the links.
137         
138 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
139
140         * bus/connection.c: (bus_connection_foreach):
141         * bus/connection.h:
142         Add new bus_connection_foreach function.
143         
144         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
145         Add function that broadcasts a message to all clients.
146         
147         (bus_driver_send_service_created), (bus_driver_handle_hello),
148         (bus_driver_send_welcome_message),
149         (bus_driver_handle_list_services), (bus_driver_message_handler):
150         Implement functions that take care of listing services, and notifying
151         clients when new services are created.
152         
153         * bus/services.c: (bus_services_list):
154         * bus/services.h:
155         Add new function that returns an array of strings with the currently
156         registered services.
157         
158         * glib/dbus-glib.h:
159         * glib/dbus-gmain.c:
160         Update copyright year.
161         
162 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
163
164         * dbus/dbus-connection.c: (dbus_connection_send_message):
165         Unlock the message in case it was sent earlier.
166         
167         (dbus_connection_send_message_with_reply_and_block):
168         Remove the reply message from the list.
169         
170         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
171         Set array_len and new_pos correctly.
172         
173         (_dbus_marshal_test):
174         Remove debug output.
175         
176         * dbus/dbus-message-internal.h:
177         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
178         New function that returns the reply serial.
179         
180         (_dbus_message_unlock):
181         New function that unlocks a message and resets its header.
182
183         (dbus_message_append_string_array), 
184         (dbus_message_get_fields_valist),
185         (dbus_message_iter_get_field_type),
186         (dbus_message_iter_get_string_array),   
187         (dbus_message_get_fields),      
188         (dbus_message_append_fields_valist):
189         Handle string arrays.
190         
191         (dbus_message_set_sender):
192         Make this function public since the bus daemon needs it.
193         
194         (decode_header_data):
195         Set the reply serial to -1 initially.
196
197         * dbus/dbus-message.h:
198         Add dbus_message_set_sender.    
199
200 2003-01-24  Havoc Pennington  <hp@pobox.com>
201
202         * doc/dbus-specification.sgml: add some stuff
203
204 2003-01-22  Havoc Pennington  <hp@pobox.com>
205
206         * doc/dbus-specification.sgml: Start to document the protocol.
207
208 2003-01-22  Havoc Pennington  <hp@pobox.com>
209
210         * dbus/dbus-connection.c
211         (dbus_connection_send_message_with_reply_and_block): add some @todo
212
213         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
214
215 2003-01-21  Havoc Pennington  <hp@pobox.com>
216
217         (patch untested because can't compile)
218         
219         * bus/driver.c (create_unique_client_name): make this function
220         never recycle client names. Also, caller should initialize 
221         the DBusString.
222
223         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
224
225 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
226
227         * dbus/dbus-marshal.c: (_dbus_marshal_double),
228         (_dbus_marshal_int32), (_dbus_marshal_uint32),
229         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
230         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
231         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
232         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
233         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
234         * dbus/dbus-marshal.h:
235         * dbus/dbus-protocol.h:
236         Add support for marshalling and demarshalling integer, double
237         and string arrays.
238         
239 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
240
241         * bus/Makefile.am:
242         Add driver.[ch]
243         
244         * bus/connection.c: (connection_disconnect_handler):
245         Remove the connection from the bus driver's list.
246         
247         (connection_watch_callback): Dispatch messages.
248
249         (free_connection_data): Free connection name.
250         
251         (bus_connection_setup): Add connection to the bus driver's list.
252         (bus_connection_remove_owned_service): 
253         (bus_connection_set_name), (bus_connection_get_name):
254         Add functions for setting and getting the connection's name.
255         
256         * bus/connection.h:
257         Add function headers.
258         
259         * bus/driver.c: (create_unique_client_name),
260         (bus_driver_handle_hello_message),
261         (bus_driver_send_welcome_message), (bus_driver_message_handler),
262         (bus_driver_add_connection), (bus_driver_remove_connection):
263         * bus/driver.h:
264         * bus/main.c:
265         * bus/services.c: (bus_service_free):
266         * bus/services.h:
267         New file that handles communication and registreation with the bus
268         itself. 
269         
270 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
271
272         * dbus/dbus-connection.c: (dbus_connection_send_message):
273         Add a new client_serial parameter.
274         
275         (dbus_connection_send_message_with_reply):
276         Remove a @todo since we've implemented the blocking function.
277         
278         (dbus_connection_send_message_with_reply_and_block):
279         New function that sends a message and waits for a reply and
280         then returns the reply.
281         
282         * dbus/dbus-connection.h:
283         Add new functions.
284         
285         * dbus/dbus-errors.c: (dbus_result_to_string):
286         * dbus/dbus-errors.h:
287         Add new DBUS_RESULT.
288         
289         * dbus/dbus-message-internal.h:
290         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
291         (_dbus_message_set_sender), (dbus_message_write_header),
292         (dbus_message_new_reply), (decode_header_data),
293         (_dbus_message_loader_return_buffer), (_dbus_message_test):
294         * dbus/dbus-message.h:
295         Add new functions that set the reply serial and sender.
296         Also marshal and demarshal them correctly and add test.
297         
298         * dbus/dbus-protocol.h:
299         Add new DBUS_MESSAGE_TYPE_SENDER.
300         
301         * glib/dbus-glib.h:
302         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
303         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
304         (dbus_connection_hookup_with_g_main):
305         * glib/test-dbus-glib.c: (main):
306         Rewrite to use GIOChannel and remove the GSource crack.
307         
308         * test/echo-client.c: (main):
309         * test/watch.c: (check_messages):
310         Update for changed APIs
311         
312 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
313
314         * dbus/Makefile.am: Add dbus-timeout.[cħ]
315         
316         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
317         Create a DBusTimeoutList.       
318         (dbus_connection_set_timeout_functions): Add new function to
319         set timeout callbacks
320         
321         * dbus/dbus-connection.h: Add public DBusTimeout API.
322         
323         * dbus/dbus-message.c: (dbus_message_get_service):
324         * dbus/dbus-message.h:  New function.
325
326         * dbus/dbus-server.c: Fix small doc typo.
327         
328         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
329
330 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
331
332         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
333         of the string, just as long as specified.
334
335 2003-01-19  Havoc Pennington  <hp@pobox.com>
336
337         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
338         new function
339
340         * dbus/dbus-server.c (dbus_server_set_max_connections)
341         (dbus_server_get_max_connections, dbus_server_get_n_connections):
342         keep track of current number of connections, and add API for
343         setting a max (but haven't implemented enforcing the max yet)
344
345 2003-01-18  Havoc Pennington  <hp@pobox.com>
346
347         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
348         reading/writing if read_watch != NULL or write_watch != NULL.
349
350         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
351         the message loader code to actually load message->header and
352         message->body into the newly-created message.
353
354         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
355         in OOM case
356
357         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
358         (dbus_connection_get_max_message_size) 
359         (dbus_connection_set_max_live_messages_size) 
360         (dbus_connection_get_max_live_messages_size): implement some
361         resource limitation functions
362
363         * dbus/dbus-resources.c: new file implementing some of the
364         resource limits stuff
365
366         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
367         missing docs, add @todo to handle OOM etc.
368
369         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
370         docs
371         
372 2003-01-18  Havoc Pennington  <hp@pobox.com>
373
374         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
375         connection if it hasn't been already.
376
377         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
378         replace with DisconnectFunction.
379
380 2003-01-18  Havoc Pennington  <hp@pobox.com>
381
382         Building --disable-verbose-mode --disable-asserts --disable-tests
383         cuts the library from 112K to 45K or so
384         
385         * configure.in: check for varargs macro support, 
386         add --enable-verbose-mode, --enable-asserts. 
387
388         * dbus/dbus-internals.h (_dbus_assert): support
389         DBUS_DISABLE_ASSERT
390         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
391
392 2003-01-18  Havoc Pennington  <hp@pobox.com>
393
394         * dbus/dbus-test.c: include config.h so that tests actually run
395
396         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
397         so the failure mode when that assumption fails will be plenty
398         obvious.
399
400 2003-01-18  Havoc Pennington  <hp@pobox.com>
401
402         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
403
404         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
405         the distribution
406
407         * test/Makefile.am: don't use special variable "TESTS" for echo-*
408         since we don't want to use those in make check
409
410 2003-01-15  Havoc Pennington  <hp@redhat.com>
411
412         Release 0.2
413         
414         * NEWS: update
415
416 2003-01-15  Havoc Pennington  <hp@redhat.com>
417
418         * test/Makefile.am: fix so that test source code ends up in the
419         distribution on make distcheck
420
421 2003-01-15  Havoc Pennington  <hp@redhat.com>
422
423         Release 0.1.
424         
425         * NEWS: update  
426
427 2003-01-15  Havoc Pennington  <hp@redhat.com>
428
429         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
430         fix build when --disable-tests
431
432         * Makefile.am (EXTRA_DIST): put HACKING in here
433
434         * HACKING: document procedure for making a tarball release.
435
436 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
437
438         * bus/connection.c: (connection_error_handler),
439         (bus_connection_setup):
440         * bus/main.c: (main):
441         Make sure that the DBusConnectionData struct is NULLed
442         out to prevent a segfault.
443         
444         * dbus/dbus-errors.c: (dbus_result_to_string):
445         * dbus/dbus-errors.h:
446         * dbus/dbus-message.c: (dbus_message_get_fields),
447         (dbus_message_get_fields_valist), (_dbus_message_test):
448         * dbus/dbus-message.h:
449         Make dbus_message_get_fields return a result code so we can
450         track invalid fields as well as oom.
451         
452 2003-01-11  Havoc Pennington  <hp@pobox.com>
453
454         * configure.in: change --enable-test/--enable-ansi action-if-given
455         to enable_foo=$enableval instead of enable_foo=yes
456
457 2003-01-08  Havoc Pennington  <hp@pobox.com>
458
459         * dbus/dbus-string.c (_dbus_string_align_length): new function
460
461         * dbus/dbus-test-main.c: move main() for test app here
462         * dbus/dbus-test.c
463         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
464         symbol to run tests, because dbus-test isn't in the main 
465         library
466
467         Code review nitpicks.
468         
469         * dbus/dbus-message.c (dbus_message_write_header): add newlines
470         for people with narrow emacs ;-). Assert client_serial was filled
471         in. Assert message->name != NULL.
472         (dbus_message_append_fields): have "first_field_type" arg separate
473         from va list, needed for C++ binding that also uses varargs IIRC
474         and helps with type safety
475         (dbus_message_new): add @todo about using DBusString to store
476         service/name internally
477         (dbus_message_new): don't leak ->service and ->name on OOM later
478         in the function
479         (dbus_message_unref): free the service name
480         (dbus_message_get_fields): same change to varargs
481         i.e. first_field_type
482         (_dbus_message_loader_return_buffer): assert that the message data
483         is aligned (if not it's a bug in our code). Put in verbose griping
484         about why we set corrupted = TRUE.
485         (decode_header_data): add FIXME that char* is evil.  Was going to
486         add FIXME about evil locale-specific string.h strncmp, but just
487         switched to wacky string-as-uint32 optimization. Move check for
488         "no room for field name" above get_const_data_len() to avoid
489         assertion failure in get_const_data_len if we have trailing 2
490         bytes or the like. Check for service and name fields being
491         provided twice. Don't leak service/name on error. Require field
492         names to be aligned to 4 bytes.
493
494         * dbus/dbus-marshal.c: move byte swap stuff to header
495         (_dbus_pack_int32): uscore-prefix
496         (_dbus_unpack_int32): uscore-prefix
497         (_dbus_unpack_uint32): export
498         (_dbus_demarshal_string): add @todo complaining about use of
499         memcpy()
500         (_dbus_marshal_get_field_end_pos): add @todo about bad error
501         handling allowing corrupt data to go unchecked
502
503 2003-01-08  Havoc Pennington  <hp@redhat.com>
504
505         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
506         to the select() as needed for authentication. (should be using
507         _dbus_poll() not select, but for another day)
508
509         * dbus/dbus.h: include dbus/dbus-protocol.h
510
511 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
512
513         * dbus/Makefile.am (dbusinclude_HEADERS): Install
514         dbus-connection.h
515
516 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
517
518         * dbus/dbus-internals.c: (_dbus_type_to_string):
519         New function that returns a string describing a type.
520         
521         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
522         * dbus/dbus-marshal.h:
523         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
524         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
525         (dbus_message_iter_get_byte_array):
526         * dbus/dbus-message.h:
527         Add new convenience functions for appending and getting message fields.
528         Also add demarshalling routines for byte arrays.
529
530 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
531
532         * dbus/dbus-connection-internal.h:
533         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
534         (_dbus_connection_get_next_client_serial),
535         (dbus_connection_send_message):
536         * dbus/dbus-internals.h:
537         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
538         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
539         (_dbus_marshal_uint32), (_dbus_demarshal_double),
540         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
541         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
542         (_dbus_verbose_bytes), (_dbus_marshal_test):
543         * dbus/dbus-marshal.h:
544         * dbus/dbus-message-internal.h:
545         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
546         (dbus_message_write_header), (_dbus_message_lock),
547         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
548         (dbus_message_get_name), (dbus_message_append_int32),
549         (dbus_message_append_uint32), (dbus_message_append_double),
550         (dbus_message_append_string), (dbus_message_append_byte_array),
551         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
552         (dbus_message_iter_unref), (dbus_message_iter_has_next),
553         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
554         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
555         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
556         (decode_header_data), (_dbus_message_loader_return_buffer),
557         (message_iter_test), (_dbus_message_test):
558         * dbus/dbus-message.h:
559         * dbus/dbus-protocol.h:
560         * dbus/dbus-test.c: (main):
561         * dbus/dbus-test.h:
562         * glib/test-dbus-glib.c: (message_handler), (main):
563         * test/echo-client.c: (main):
564         * test/watch.c: (check_messages):
565         Make messages sendable and receivable for real.
566         
567 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
568
569         * dbus/dbus-marshal.c: (_dbus_marshal_double),
570         (_dbus_marshal_string), (_dbus_marshal_byte_array):
571         * dbus/dbus-message.c: (dbus_message_append_int32),
572         (dbus_message_append_uint32), (dbus_message_append_double),
573         (dbus_message_append_string), (dbus_message_append_byte_array):
574         Handle OOM restoration.
575         
576 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
577
578         * dbus/dbus-marshal.c: (_dbus_marshal_string),
579         (_dbus_demarshal_string), (_dbus_marshal_test):
580         * dbus/dbus-marshal.h:
581         * dbus/dbus-message.c: (dbus_message_get_name),
582         Document these functions.
583         
584         (dbus_message_append_int32), (dbus_message_append_uint32),
585         (dbus_message_append_double), (dbus_message_append_string),
586         (dbus_message_append_byte_array):
587         * dbus/dbus-message.h:
588         Add functions for adding message fields of different types.
589         
590         * dbus/dbus-protocol.h:
591         Add the different types.
592
593 2003-01-05  Havoc Pennington  <hp@pobox.com>
594
595         * bus/connection.c: implement routines for handling connections,
596         first thing is keeping a list of owned services on each connection
597         and setting up watches etc.
598
599         * bus/services.c: implement a mapping from service names to lists
600         of connections
601
602         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
603
604         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
605         to use static mutexes for global data
606
607         * dbus/dbus-connection.c (dbus_connection_set_data): add new
608         collection of functions to set/get application-specific data
609         on the DBusConnection.
610
611 2003-01-04  Havoc Pennington  <hp@pobox.com>
612
613         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
614         (_dbus_poll): new function
615
616         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
617         copied from GLib
618
619         * bus/loop.c: initial code for the daemon main loop
620
621 2003-01-04  Havoc Pennington  <hp@pobox.com>
622
623         * test/watch.c (error_handler): make it safe if the error handler 
624         is called multiple times (if we s/error handler/disconnect
625         handler/ we should just guarantee it's called only once)
626
627         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
628         error handler on disconnect (it's quite possible we should
629         just change the error handler to a "disconnect handler," I'm 
630         not sure we have any other meaningful errors)
631
632         * configure.in: check for getpwnam_r
633
634         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
635         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
636         mechanism as in SASL spec, using socket credentials
637
638         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
639         (_dbus_send_credentials_unix_socket): new function
640
641         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
642         dbus_accept()
643         (_dbus_write): only check errno if <0 returned
644         (_dbus_write_two): ditto
645
646 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
647
648         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
649         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
650         (_dbus_marshal_test):
651         * dbus/dbus-marshal.h:
652         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
653         to _dbus_marshal_utf8_string. Also fix some tests.
654         
655 2002-12-28  Harri Porten  <porten@kde.org>
656
657         * configure.in: added check for C++ compiler and a very cheesy
658         check for the Qt integration
659
660         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
661
662         * qt/Makefile.am: added 
663
664         * qt/.cvsignore: added  
665
666         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
667         latter, added #ifdef QT_THREAD_SUPPORT guard.
668
669         * dbus/Makefile.am: added missing headers for make dist
670
671 2002-12-28  Kristian Rietveld  <kris@gtk.org>
672
673         * dbus/Makefile.am: fixup export-symbols-regex.
674
675 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
676
677         * acinclude.m4: Add this file and put the 
678         PKG_CHECK_MODULE macro in it.
679
680 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
681
682         * dbus/dbus-marshal.c: (_dbus_marshal_string),
683         (_dbus_demarshal_double), (_dbus_demarshal_int32),
684         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
685         (_dbus_marshal_test):
686         Make the demarshalling routines align the pos argument.
687         Add string marshalling tests and fix the obvious bugs 
688         discovered.
689         
690 2002-12-26  Havoc Pennington  <hp@pobox.com>
691
692         * dbus/dbus-auth.c: fixes fixes fixes
693
694         * dbus/dbus-transport-unix.c: wire up support for
695         encoding/decoding data on the wire
696
697         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
698         (_dbus_auth_decode_data): append to target string 
699         instead of nuking it.
700
701 2002-12-26  Havoc Pennington  <hp@pobox.com>
702
703         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
704         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
705         doh
706
707         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
708         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
709         now). Main point is because I wanted unpack_uint32 to implement
710         _dbus_verbose_bytes
711         (_dbus_verbose_bytes): new function
712
713         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
714
715         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
716         mechanism to handle a corrupt message stream
717         (_dbus_message_loader_new): fix preallocation to only prealloc, 
718         not prelengthen
719         
720         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
721         (_dbus_string_test): enhance tests for copy/move and fix the
722         functions
723
724         * dbus/dbus-transport-unix.c: Hold references in more places to 
725         avoid reentrancy problems
726
727         * dbus/dbus-transport.c: ditto
728
729         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
730         leak reference count in no-message case
731
732         * test/watch.c (do_mainloop): handle adding/removing watches
733         during iteration over the watches. Also, ref the connection/server
734         stored on a watch, so we don't try to mangle a destroyed one.
735
736         * dbus/dbus-transport-unix.c (do_authentication): perform
737         authentication
738
739         * dbus/dbus-auth.c (get_state): add a state
740         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
741         (_dbus_auth_get_unused_bytes): append the unused bytes
742         to the passed in string, rather than prepend
743
744         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
745         the auth conversation DBusAuth
746
747         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
748         (_dbus_transport_new_for_domain_socket): when creating a
749         transport, pass in whether it's a client-side or server-side
750         transport so we know which DBusAuth to create
751
752 2002-12-03  Havoc Pennington  <hp@pobox.com>
753
754         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
755         _after_ finalizing the derived members
756         (unix_connection_set): unref watch if we fail to add it
757
758         * dbus/dbus-connection.c (dbus_connection_unref): delete the
759         transport first, so that the connection owned by the 
760         transport will be valid as the transport finalizes.
761
762         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
763         if necessary, and remove watches from the connection.
764         
765         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
766         
767 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
768
769         * dbus/dbus-marshal.c: (_dbus_marshal_string),
770         (_dbus_demarshal_double), (_dbus_demarshal_int32),
771         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
772         (_dbus_marshal_test):
773         * dbus/dbus-marshal.h:
774         Add string marshal functions and have the demarshal functions
775         return the new position.
776         
777 2002-12-25  Havoc Pennington  <hp@pobox.com>
778
779         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
780         it is a simple protocol that just maps directly to SASL.
781
782         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
783         initial implementation, not actually used yet.
784         
785         * dbus/dbus-string.c (_dbus_string_find): new function
786         (_dbus_string_equal): new function
787         (_dbus_string_base64_encode): new function
788         (_dbus_string_base64_decode): new function
789
790 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
791
792         * dbus/Makefile.am:
793         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
794         (_dbus_marshal_int32), (_dbus_marshal_uint32),
795         (_dbus_demarshal_double), (_dbus_demarshal_int32),
796         (_dbus_demarshal_uint32), (_dbus_marshal_test):
797         * dbus/dbus-marshal.h:
798         * dbus/dbus-protocol.h:
799         * dbus/dbus-test.c: (main):
800         * dbus/dbus-test.h:
801         Add un-optimized marshalling/demarshalling routines.
802         
803 2002-12-25  Harri Porten  <porten@kde.org>
804
805         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
806
807 2002-12-24  Zack Rusin  <zack@kde.org>
808
809         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
810         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
811         main loop stuff
812
813 2002-12-24  Havoc Pennington  <hp@pobox.com>
814
815         * glib/dbus-gthread.c: fix include
816
817         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
818         I think glib API needs to change, though, as you don't 
819         want to use DBusMessageFunction, you want to use the 
820         DBusMessageHandler object. Probably 
821         dbus_connection_open_with_g_main_loop()
822         and dbus_connection_setup_g_main_loop() or something like that
823         (but think of better names...) that just create a connection 
824         that has watch/timeout functions etc. already set up.
825
826         * dbus/dbus-connection.c
827         (dbus_connection_send_message_with_reply): new function just to 
828         show how the message handler helps us deal with replies.
829
830         * dbus/dbus-list.c (_dbus_list_remove_last): new function
831
832         * dbus/dbus-string.c (_dbus_string_test): free a string that
833         wasn't
834
835         * dbus/dbus-hash.c: use memory pools for the hash entries
836         (rebuild_table): be more paranoid about overflow, and 
837         shrink table when we can
838         (_dbus_hash_test): reduce number of sprintfs and write
839         valid C89. Add tests for case where we grow and then 
840         shrink the hash table.
841
842         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
843
844         * dbus/dbus-connection.c (dbus_connection_register_handler) 
845         (dbus_connection_unregister_handler): new functions
846
847         * dbus/dbus-message.c (dbus_message_get_name): new
848
849         * dbus/dbus-list.c: fix docs typo
850
851         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
852         an object representing a handler for messages.
853
854 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
855
856         * glib/dbus-glib.h:
857         * glib/dbus-gthread.c: (dbus_gthread_init):
858         Don't use the gdbus prefix for public functions.
859         
860 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
861
862         * Makefile.am:
863         * configure.in:
864         Add GLib checks and fixup .pc files
865         
866         * glib/Makefile.am:
867         * glib/dbus-glib.h:
868         * glib/dbus-gmain.c: (gdbus_connection_prepare),
869         (gdbus_connection_check), (gdbus_connection_dispatch),
870         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
871         (dbus_connection_gsource_new):
872         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
873         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
874         * glib/test-dbus-glib.c: (message_handler), (main):
875         Add GLib support.
876         
877 2002-12-15  Harri Porten  <porten@kde.org>
878
879         * autogen.sh: check for libtoolize before attempting to use it 
880         
881         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
882         struct.
883         
884         * .cvsignore: ignore more stamp files
885
886         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
887
888         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
889         without make install.
890
891 2002-12-15  Havoc Pennington  <hp@pobox.com>
892
893         * dbus/dbus-threads.c: add thread stubs that a higher library
894         layer can fill in. e.g. the GLib wrapper might fill them in with
895         GThread stuff. We still need to use this thread API to
896         thread-safe-ize the library.
897
898 2002-12-12  Havoc Pennington  <hp@pobox.com>
899
900         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
901         below new interfaces and include fewer system headers.
902
903         * dbus/dbus-sysdeps.c (_dbus_read): new function
904         (_dbus_write): new function
905         (_dbus_write_two): new function
906         (_dbus_connect_unix_socket): new function
907         (_dbus_listen_unix_socket): new function
908
909         * dbus/dbus-message-internal.h: change interfaces to use
910         DBusString
911
912 2002-12-11  Havoc Pennington  <hp@pobox.com>
913
914         * dbus/dbus-types.h: add dbus_unichar
915
916         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
917
918         * dbus/dbus-connection.c (dbus_connection_send_message): return
919         TRUE on success
920
921         * dbus/dbus-transport.c: include dbus-watch.h   
922
923         * dbus/dbus-connection.c: include dbus-message-internal.h
924
925         * HACKING: add file with coding guidelines stuff.
926
927         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
928         handling here, for security purposes (as in vsftpd). Not actually
929         using this class yet.
930
931         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
932         system/libc usage here, as in vsftpd, for ease of auditing (and
933         should also simplify portability). Haven't actually moved all the
934         system/libc usage into here yet.
935         
936 2002-11-25  Havoc Pennington  <hp@pobox.com>
937
938         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
939         always print the first verbose message.
940
941 2002-11-24  Havoc Pennington  <hp@pobox.com>
942
943         * test/echo-client.c, test/echo-server.c: cheesy test 
944         clients.
945         
946         * configure.in (AC_CHECK_FUNCS): check for writev
947
948         * dbus/dbus-message.c (_dbus_message_get_network_data): new
949         function
950
951         * dbus/dbus-list.c (_dbus_list_foreach): new function
952
953         * dbus/dbus-internals.c (_dbus_verbose): new function
954
955         * dbus/dbus-server.c, dbus/dbus-server.h: public object
956         representing a server that listens for connections.
957
958         * dbus/.cvsignore: create
959
960         * dbus/dbus-errors.h, dbus/dbus-errors.c:
961         public API for reporting errors
962
963         * dbus/dbus-connection.h, dbus/dbus-connection.c:
964         public object representing a connection that 
965         sends/receives messages. (Same object used for 
966         both client and server.)
967
968         * dbus/dbus-transport.h, dbus/dbus-transport.c:
969         Basic abstraction for different kinds of stream
970         that we might read/write messages from.
971
972 2002-11-23  Havoc Pennington  <hp@pobox.com>
973
974         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
975         _DBUS_INT_MAX
976
977         * dbus/dbus-test.c (main): add list test, and include 
978         dbus-test.h as intended
979
980         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
981         (_dbus_hash_table_remove_int): return value indicates 
982         whether the entry existed to remove
983
984         * dbus/dbus-list.c: add linked list utility class, 
985         with docs and tests
986
987         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
988         array sometimes.
989
990 2002-11-23  Havoc Pennington  <hp@pobox.com>
991
992         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
993         DBUS_END_DECLS to nothing, that should fix this once and for all
994
995         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
996
997         * dbus/dbus-message.c, dbus/dbus-hash.c: 
998         add some missing @brief
999
1000 2002-11-23  Havoc Pennington  <hp@pobox.com>
1001
1002         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
1003         to avoid confusing Doxygen
1004
1005         * dbus/dbus-hash.c: @} not }@
1006
1007         * dbus/dbus-message.c (struct DBusMessage): split out 
1008         internals docs
1009
1010 2002-11-23  Havoc Pennington  <hp@pobox.com>
1011
1012         * configure.in: pile on more warning flags if using gcc
1013
1014         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
1015         to document static functions
1016
1017         * configure.in: add summary to end of configure so it 
1018         looks nice and attractive
1019
1020         * dbus/dbus-hash.c: finish implementation and write unit 
1021         tests and docs
1022
1023         * configure.in: add --enable-tests to enable unit tests
1024
1025         * dbus/dbus-test.c: test program to run unit tests 
1026         for all files in dbus/*, initially runs a test for 
1027         dbus-hash.c
1028         
1029         * dbus/dbus-internals.h: file to hold some internal utility stuff
1030
1031 2002-11-22  Havoc Pennington  <hp@redhat.com>
1032
1033         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
1034         "ported" away from Tcl
1035
1036         * dbus/dbus-types.h: header for types such as dbus_bool_t
1037
1038 2002-11-22  Havoc Pennington  <hp@redhat.com>
1039
1040         * dbus/dbus.h: fixups for doc warnings
1041
1042         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
1043         macros
1044         (QUIET): make it quiet so we can see warnings
1045
1046         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1047
1048 2002-11-22  Havoc Pennington  <hp@redhat.com>
1049
1050         * Makefile.am: include "Doxyfile" target in all-local
1051
1052         * configure.in: generate the Doxyfile
1053
1054         * Doxyfile.in: move Doxyfile here, so we can use 
1055         configure to generate a Doxyfile with the right 
1056         version number etc.
1057
1058 2002-11-22  Havoc Pennington  <hp@redhat.com>
1059
1060         * dbus/dbus-message.c: move inline docs into .c file
1061
1062         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1063         so all docs are under doc/
1064         (MAN_EXTENSION): generate man pages. Use extension 
1065         ".3dbus" which matches ".3qt" on my system, 
1066         I guess this is OK, I don't know really.
1067         (FILE_PATTERNS): look for .c files not .h, makes sense
1068         for plain C I think
1069
1070 2002-11-22  Havoc Pennington  <hp@pobox.com>
1071
1072         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
1073         because any app can be a server, and any app can be a client, 
1074         the bus is a special kind of server.
1075
1076 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
1077
1078         * Doxyfile : adding. Still needs Makefile rules to be generated
1079         automatically (just run "doxygen" in the toplevel dir for now to
1080         generate docs)
1081         
1082         * dbus/dbus-message.h : Adding sample docs (javadoc since
1083         resembles gtk-doc a little more)
1084
1085         * dbus/dbus.h : Adding sample docs
1086
1087 2002-11-21  Havoc Pennington  <hp@redhat.com>
1088
1089         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
1090         so we can allow ourselves to include files directly, 
1091         instead of having to use dbus.h
1092
1093         * dbus/dbus.h: fill in
1094
1095         * dbus/dbus-message.h: sketch out a sample header file.
1096         Include griping if you include it directly instead of 
1097         via dbus.h
1098
1099         * dbus/dbus-macros.h: new file with macros for extern "C", 
1100         TRUE/FALSE, NULL, etc.
1101
1102         * doc/file-boilerplate.c: put include guards in here
1103
1104 2002-11-21  Havoc Pennington  <hp@redhat.com>
1105
1106         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1107
1108         * COPYING: include the GPL as well, and license code 
1109         under both AFL and GPL.
1110
1111 2002-11-21  Havoc Pennington  <hp@redhat.com>
1112
1113         * acconfig.h: get rid of this
1114
1115         * autogen.sh (run_configure): add --no-configure option
1116
1117         * configure.in: remove AC_ARG_PROGRAM to make
1118         autoconf complain less. add AC_PREREQ. 
1119         add AC_DEFINE third arg.
1120         
1121 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
1122
1123         * doc/Makefile.am:
1124         Fix references so we can distcheck.
1125
1126 2002-11-21  Havoc Pennington  <hp@redhat.com>
1127
1128         * Initial module creation
1129