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