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