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