bce8784af9698f059a047d5e6687ac77527c9a3b
[platform/upstream/dbus.git] / ChangeLog
1 2003-02-15  Havoc Pennington  <hp@pobox.com>
2
3         * dbus/dbus-message.c (dbus_message_new): fool around with the
4         docs
5
6 2003-02-14  Havoc Pennington  <hp@pobox.com>
7
8         * dbus/dbus-mempool.c: fail if the debug functions so indicate
9
10         * dbus/dbus-memory.c: fail if the debug functions indicate we
11         should
12
13         * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
14         (_dbus_decrement_fail_alloc_counter): debug functions to 
15         simulate memory allocation failures
16
17 2003-02-14  Havoc Pennington  <hp@pobox.com>
18
19         * dbus/dbus-errors.h (struct DBusError): add a word of padding 
20         to DBusError
21
22 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
23
24         * bus/driver.c: (bus_driver_handle_hello):
25         * bus/driver.h:
26         * bus/services.c: (bus_service_lookup):
27         Reorder message sending so we get a more sane order.
28         
29         * test/bus-test.c: (message_handler):
30         Fix tyop.
31         
32 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
33
34         * bus/driver.c: (bus_driver_send_service_deleted),
35         (bus_driver_send_service_created), (bus_driver_send_service_lost),
36         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
37         (bus_driver_send_welcome_message),
38         (bus_driver_handle_list_services),
39         (bus_driver_handle_acquire_service),
40         (bus_driver_handle_service_exists):
41         * dbus/dbus-bus.c: (dbus_bus_register_client),
42         (dbus_bus_acquire_service), (dbus_bus_service_exists):
43         * dbus/dbus-errors.c: (dbus_result_to_string):
44         * dbus/dbus-errors.h:
45         * dbus/dbus-message.c: (dbus_message_append_args),
46         (dbus_message_append_args_valist), (dbus_message_get_args),
47         (dbus_message_get_args_valist), (dbus_message_get_args_iter),
48         (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
49         (dbus_message_iter_get_byte_array),
50         (dbus_message_iter_get_string_array), (message_iter_test),
51         (check_message_handling), (_dbus_message_test):
52         * dbus/dbus-message.h:
53         * test/bus-test.c: (main):
54         Change fields to arguments in messages, so that they won't be
55         confused with header fields.
56         
57         * glib/test-dbus-glib.c: (main):
58         Remove append_fields from hello message.
59         
60 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
61
62         * dbus/dbus-errors.c:
63         * dbus/dbus-message.c:
64         * dbus/dbus-string.c:
65         Documentation fixes.
66
67 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
68
69         * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
70         (remove_timeout):
71         Implement support for timeouts in dbus-glib.
72         
73 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
74
75         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
76         * dbus/dbus-message.c: (process_test_subdir):
77         * test/break-loader.c: (find_breaks_based_on):
78         Plug some memory leaks.
79         
80 2003-02-13  Richard Hult  <rhult@codefactory.se>
81
82         * bus/main.c: Fix build.
83
84         * dbus/dbus-errors.h: 
85         * dbus/dbus-errors.c: Fix copyright for Anders.
86
87 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
88
89         * bus/Makefile.am:
90         Add utils.[ch]
91         
92         * bus/connection.c: (bus_connection_foreach):
93         Fix a warning.
94         
95         * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
96         (unescape_string), (new_section), (parse_section_start),
97         (parse_key_value), (report_error), (bus_desktop_file_load),
98         (bus_desktop_file_get_string):
99         * bus/desktop-file.h:
100         Use DBusError for error reporting.
101         
102         * bus/dispatch.c: (send_one_message),
103         (bus_dispatch_message_handler):
104         * bus/driver.c: (bus_driver_send_service_deleted),
105         (bus_driver_send_service_created), (bus_driver_send_service_lost),
106         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
107         (bus_driver_send_welcome_message),
108         (bus_driver_handle_list_services),
109         (bus_driver_handle_acquire_service),
110         (bus_driver_handle_service_exists):
111         * bus/loop.c: (bus_loop_run):
112         * bus/main.c:
113         Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
114         
115         * bus/utils.c: (bus_wait_for_memory):
116         * bus/utils.h:
117         New files with general utility functions.
118         
119         * dbus/dbus-internals.h:
120         Remove _DBUS_HANDLE_OOM.
121         
122 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
123
124         * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
125         (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
126         * dbus/dbus-errors.h:
127         Add DBusError structure.
128         
129 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
130
131         * test/data/valid-messages/standard-acquire-service.message:
132         * test/data/valid-messages/standard-hello.message:
133         * test/data/valid-messages/standard-list-services.message:
134         * test/data/valid-messages/standard-service-exists.message:
135         Add some standard messages.
136         
137 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
138
139         * bus/driver.c: (bus_driver_send_welcome_message),
140         (bus_driver_handle_list_services),
141         (bus_driver_handle_acquire_service),
142         (bus_driver_handle_service_exists), (bus_driver_handle_message):
143         Update for API changes in libdbus.
144         
145         * dbus/dbus-message.c: (dbus_message_new_reply):
146         * dbus/dbus-message.h:
147         Remove the name argument. The spec states that replies shouldn't
148         have a name.
149
150 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
151
152         * bus/desktop-file.c: (parse_section_start), (parse_key_value),
153         (report_error), (bus_desktop_file_load), (lookup_section),
154         (lookup_line), (bus_desktop_file_get_raw),
155         (bus_desktop_file_get_string):
156         * bus/desktop-file.h:
157         Some fixes, and new functions for getting a key value from a section.
158         
159 2003-02-13  Havoc Pennington  <hp@pobox.com>
160
161         * test/data/auth/fail-after-n-attempts.auth-script: new test
162
163         * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
164         reject the client.
165
166 2003-02-13  Havoc Pennington  <hp@pobox.com>
167
168         * dbus/dbus-auth.c (handle_server_data_external_mech): args to
169         dbus_credentials_match were backward
170
171         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
172         NO_CREDENTIALS and ROOT_CREDENTIALS
173
174         * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine 
175         into here. Never process more commands after we've reached an 
176         end state; store further data as unused bytes.
177
178         * test/data/auth/*: add more auth tests
179         
180         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
181         command to match exact string and EXPECT_UNUSED to match unused
182         bytes
183
184         * test/Makefile.am (dist-hook): fix to dist all the test stuff
185
186 2003-02-12  Havoc Pennington  <hp@pobox.com>
187
188         * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
189         \r off of popped lines
190
191         * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
192         scripts
193
194         * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
195         SEND, append \r\n
196
197 2003-02-12  Havoc Pennington  <hp@pobox.com>
198
199         * dbus/Makefile.am: remove break-loader from the build, since it
200         moved.
201
202         * configure.in: add --enable-gcov to turn on coverage profiling
203         flags and disable optimization
204
205 2003-02-10  Havoc Pennington  <hp@pobox.com>
206
207         * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync 
208         initial cut at test framework for DBusAuth from laptop.
209         Doesn't quite work yet but it compiles and I need to get 
210         it off the 266mhz laptop. ;-)
211         
212         * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
213         fix a memleak in error case
214
215 2003-02-12  Anders Carlsson  <andersca@codefactory.se>
216
217         * bus/Makefile.am:
218         * bus/desktop-file.c:
219         * bus/desktop-file.h:
220         Add a desktop file parser.
221
222 2003-02-11  Zack Rusin  <zack@kde.org>
223
224         * qt/message.[h|cpp]: sample implementation
225         of the KDE wrapper for DBusMessage
226
227 2003-02-09  Zack Rusin  <zack@kde.org>
228
229         * test/bus-test.c: make_it_compile
230         * doc/dbus-specification.sgml: minimal semantic fix
231
232 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
233
234         Release 0.3
235         
236         * NEWS: Update
237
238 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
239
240         * dbus/Makefile.am:
241         * dbus/dbus-break-loader.c:
242         * test/Makefile.am:
243         * test/break-loader.c:
244         Move dbus-break-loader to test/ and rename it to break-loader.
245
246 2003-02-02  Havoc Pennington  <hp@pobox.com>
247
248         * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files 
249         for code to manage cookies in your home directory
250
251         * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
252
253         * dbus/dbus-auth.c (get_state): impose a maximum number of tries
254         to authenticate, then disconnect the client.
255
256 2003-02-03  Alexander Larsson  <alexl@redhat.com>
257
258         * dbus/dbus-message.c (dbus_message_append_fields):
259         Correct docs.
260
261 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
262
263         * doc/dbus-specification.sgml:
264         Update address format section.
265         
266 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
267
268         * test/Makefile.am:
269         * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
270         (message_handler), (new_connection_callback), (loop_quit),
271         (loop_run), (main):
272         Add bus test.
273         
274 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
275
276         * bus/driver.c: (bus_driver_handle_service_exists):
277         Simplify the code a bit.
278         
279         * dbus/dbus-bus.c: (dbus_bus_service_exists):
280         Fix a silly. 
281         
282 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
283
284         * bus/Makefile.am:
285         Add libdbus-daemon.la and link to it.
286
287 2003-02-01  James Willcox  <jwillcox@gnome.org>
288
289         * bus/driver.c: (bus_driver_handle_own_service):
290         Actually include the service reply code in the message.
291
292 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
293
294         * bus/driver.c: (bus_driver_handle_service_exists):
295         Don't unref the incoming message.
296         
297 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
298
299         * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
300
301 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
302
303         * dbus/dbus-server.c: (dbus_server_listen):
304         * dbus/dbus-transport.c: (_dbus_transport_open):
305         ifdef out the calls to the debug transport and server.
306         
307 2003-02-02  Alexander Larsson  <alexl@redhat.com>
308
309         * dbus/dbus-watch.c (dbus_watch_get_flags):
310         Add note in the docs that ERROR or HANGUP won't be returned
311         and are assumed always on.
312
313         * glib/dbus-gmain.c (add_watch):
314         Always add IO_ERR | IO_HUP
315
316         * dbus/dbus-message.h:
317         Add semicolon after dbus_message_iter_get_string_array().
318         Makes qt code build again
319
320 2003-02-01  Anders Carlsson  <andersca@codefactory.se>
321
322         * bus/driver.c: (create_unique_client_name),
323         (bus_driver_handle_hello):
324         Don't take a name, just use a numeric id to identify
325         each client.
326         
327         * dbus/Makefile.am:
328         * dbus/dbus-bus.c: (dbus_bus_register_client),
329         (dbus_bus_acquire_service), (dbus_bus_service_exists):
330         * dbus/dbus-bus.h:
331         Add new convenience functions for communicating with the bus.
332         
333         * dbus/dbus-message.h:
334         
335         * dbus/dbus-protocol.h:
336         Fix a typo.
337         
338 2003-02-01  Alexander Larsson  <alexl@redhat.com>
339
340         * dbus/dbus-message.c (dbus_message_append_fields):
341         Add some more doc comments.
342
343 2003-02-01  Havoc Pennington  <hp@pobox.com>
344
345         * dbus/dbus-break-loader.c (randomly_modify_length): change 
346         a 4-byte value in the message as if it were a length
347
348         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
349         execute bit on saved files
350
351 2003-02-01  Havoc Pennington  <hp@pobox.com>
352
353         * dbus/dbus-break-loader.c (main): new program to find messages
354         that break the loader.
355
356         * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
357         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
358
359         * dbus/dbus-string.c (_dbus_string_set_byte): new
360         
361 2003-01-31  Havoc Pennington  <hp@pobox.com>
362
363         * dbus/dbus-message.c: refactor the test code to be more general, 
364         in preparation for writing a "randomly permute test cases to 
365         try to break the loader" program.
366
367 2003-01-31  Havoc Pennington  <hp@pobox.com>
368         
369         * doc/dbus-specification.sgml: work on the specification
370
371         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check 
372         the protocol version of the message.
373
374         * dbus/dbus-protocol.h: drop special _REPLY names, the spec 
375         no longer specifies that.
376         (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 
377         1/2/3/4)
378
379         * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
380         "break" for DBUS_TYPE_NIL, remove @todo
381
382 2003-01-31  Havoc Pennington  <hp@pobox.com>
383
384         * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename 
385         just set_is_error/get_is_error as this is a commonly-used
386         function, and write docs.
387
388 2003-01-31  Anders Carlsson  <andersca@codefactory.se>
389
390         * dbus/dbus-address.c: (dbus_address_entry_free):
391         Free key and value lists.
392         
393         * dbus/dbus-internals.c: (_dbus_type_to_string):
394         Add the types we didn't have.
395         
396         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
397         (_dbus_marshal_validate_arg):
398         Add NIL types.
399         
400         * dbus/dbus-message.c: (dbus_message_set_sender):
401         Remove todo about being able to set sender to NULL.
402         
403         (dbus_message_set_is_error_reply),
404         (dbus_message_get_is_error_reply):
405         * dbus/dbus-message.h:
406         New functions.
407         
408         * dbus/dbus-protocol.h:
409         Add error reply flag.
410         
411         * test/data/valid-messages/opposite-endian.message:
412         Add NIL type to test.
413         
414 2003-01-31  Havoc Pennington  <hp@pobox.com>
415
416         * doc/dbus-specification.sgml: fully specify the header.  Add
417         flags and major protocol version, and change header/body len to
418         unsigned.
419
420         * dbus/dbus-message-builder.c (append_saved_length): append length
421         as uint32
422
423         * dbus/dbus-message.c (dbus_message_create_header): change header
424         length and body length to unsigned. Add the new fields from the
425         spec
426         (_dbus_message_loader_return_buffer): unsigned header/body len
427
428 2003-01-30  Havoc Pennington  <hp@pobox.com>
429
430         * dbus/dbus-auth.c: rework to use only REJECTED, no 
431         MECHANISMS
432
433         * doc/dbus-sasl-profile.txt: drop MECHANISMS and just 
434         use REJECTED, suggested by Mark McLoughlin
435
436 2003-01-30  Havoc Pennington  <hp@pobox.com>
437
438         * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
439         a better way to report errors here. e.g.  "unix address lacks
440         path" or something. also "no such file" when the path doesn't
441         exist, etc.
442
443         * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
444         leaking list nodes
445         (dbus_parse_address): add @todo about documenting address format, 
446         and allowing , and ; to be escaped
447
448 2003-01-30  Anders Carlsson  <andersca@codefactory.se>
449
450         * dbus/Makefile.am:
451         Add dbus-address.[ch]
452         
453         * dbus/dbus-address.c: (dbus_address_entry_free),
454         (dbus_address_entries_free), (create_entry),
455         (dbus_address_entry_get_method), (dbus_address_entry_get_value),
456         (dbus_parse_address), (_dbus_address_test):
457         * dbus/dbus-address.h:
458         New files for dealing with address parsing.
459         
460         * dbus/dbus-connection.c:
461         Document timeout functions.
462         
463         * dbus/dbus-message.c:
464         Document dbus_message_new_from_message.
465         
466         * dbus/dbus-server-debug.c:
467         Document.
468         
469         * dbus/dbus-server.c: (dbus_server_listen):
470         Parse address and use correct server implementation.
471         
472         * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
473         * dbus/dbus-string.h:
474         New function with test.
475         
476         * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
477         * dbus/dbus-test.h:
478         Add address tests.
479         
480         * dbus/dbus-transport-debug.c:
481         Document.
482         
483         * dbus/dbus-transport.c: (_dbus_transport_open):
484         Parse address and use correct transport implementation. 
485
486 2003-01-30  Havoc Pennington  <hp@pobox.com>
487
488         * dbus/dbus-message.c: use message->byte_order instead of 
489         DBUS_COMPILER_BYTE_ORDER throughout.
490         (dbus_message_create_header): pad header to align the 
491         start of the body of the message to 8-byte boundary
492
493         * dbus/dbus-marshal.h: make all the demarshalers take const 
494         DBusString arguments.
495
496         * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
497         validate message args here, so we don't have to do slow validation
498         later, and so we catch bad messages as they are incoming. Also add
499         better checks on header_len and body_len. Also fill in
500         message->byte_order
501
502         * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
503         implemented properly)
504         (_dbus_string_validate_nul): new function to check all-nul
505
506         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename 
507         get_arg_end_pos and remove all validation
508         (_dbus_marshal_validate_arg): actually do validation here.
509
510 2003-01-29  Havoc Pennington  <hp@pobox.com>
511
512         * dbus/dbus-message.c (check_message_handling): fix assertion
513         failure on set_client_serial
514
515 2003-01-28  Havoc Pennington  <hp@pobox.com>
516
517         * dbus/dbus-server-debug.c: Add doc section comments
518         
519         * dbus/dbus-transport-debug.c: add doc section comments
520         
521 2003-01-28  Havoc Pennington  <hp@redhat.com>
522
523         * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
524         the reverse order from how I had it
525         (_dbus_string_base64_encode): reverse encoding order. I was
526         basically byteswapping everything during encoding.
527
528 2003-01-28  Anders Carlsson  <andersca@codefactory.se>
529
530         * dbus/dbus-connection-internal.h:
531         * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
532         (_dbus_connection_remove_timeout):
533         Add functions for adding and removing timeouts.
534         
535         * dbus/dbus-message.c: (dbus_message_new_from_message):
536         Add new function that takes a message and creates an exact
537         copy of it, but with the refcount set to 1.
538         (check_message_handling):
539         Fix build error.
540         
541         * dbus/dbus-server-protected.h:
542         * dbus/dbus-server.c: (_dbus_server_init_base),
543         (_dbus_server_finalize_base), (_dbus_server_add_timeout),
544         (dbus_server_set_timeout_functions):
545         (_dbus_server_remove_timeout):
546         New functions so that a server can add and remove timeouts.
547
548         (dbus_server_listen):
549         Add commented out call to dbus_server_debug_new.
550
551         * dbus/dbus-timeout.c: (_dbus_timeout_new):
552         Actually set the handler, doh.
553         
554         * dbus/dbus-transport.c: (_dbus_transport_open):
555         Add commented out call to dbus_transport_debug_client_new.
556         
557         * dbus/Makefile.am:
558         Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
559         
560 2003-01-28  Havoc Pennington  <hp@pobox.com>
561
562         * dbus/dbus-message.c (check_message_handling): function to check 
563         on the loaded message, iterates over it etc.
564
565 2003-01-28  Havoc Pennington  <hp@pobox.com>
566
567         * test/Makefile.am (dist-hook): fix make distdir
568
569         * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
570
571 2003-01-27  Havoc Pennington  <hp@pobox.com>
572
573         * dbus/dbus-mempool.c (time_for_size): replace printf with 
574         _dbus_verbose
575
576         * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
577         empty lines; fix the SAVE_LENGTH stuff to be
578         START_LENGTH/END_LENGTH so it actually works; couple other 
579         bugfixes
580         
581         * test/Makefile.am (dist-hook): add dist-hook for .message files
582
583         * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
584         can be constant or locked.
585         (_dbus_string_free): allow freeing a const string as
586         documented/intended
587
588         * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
589
590         * dbus/dbus-test-main.c (main): take an argument which is the 
591         directory containing test data
592
593         * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
594         argument to this and load all the messages in test/data/
595         checking that they can be loaded or not loaded as appropriate.
596
597 2003-01-27  Anders Carlsson  <andersca@codefactory.se>
598
599         * bus/dispatch.c: (bus_dispatch_message_handler):
600         Dispatch messages sent to services.
601         
602         * bus/driver.c: (bus_driver_send_service_deleted),
603         (bus_driver_send_service_created), (bus_driver_send_service_lost),
604         (bus_driver_send_service_acquired):
605         Add helper functions for sending service related messages.
606
607         (bus_driver_send_welcome_message):
608         Send HELLO_REPLY instead of WELCOME.
609         
610         (bus_driver_handle_list_services):
611         Send LIST_SERVICES_REPLY instead of SERVICES.
612         
613         (bus_driver_handle_own_service),
614         (bus_driver_handle_service_exists):
615         New message handlers.
616         
617         (bus_driver_handle_message):
618         Invoke new message handlers.
619         
620         (bus_driver_remove_connection):
621         Don't remove any services here since that's done automatically
622         by bus_service_remove_owner now.
623         
624         * bus/driver.h:
625         New function signatures.
626         
627         * bus/services.c: (bus_service_add_owner):
628         Send ServiceAcquired message if we're the only primary owner.
629         
630         (bus_service_remove_owner):
631         Send ServiceAcquired/ServiceLost messages.
632         
633         (bus_service_set_prohibit_replacement),
634         (bus_service_get_prohibit_replacement):
635         Functions for setting prohibit replacement.
636         
637         (bus_service_has_owner):
638         New function that checks if a connection is in the owner queue of 
639         a certain service.
640         
641         * bus/services.h:
642         Add new function signatures.
643         
644         * dbus/dbus-list.c: (_dbus_list_test):
645         Add tests for _dbus_list_remove_last and traversing the list backwards.
646         
647         * dbus/dbus-list.h:
648         Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
649         go any further, so return NULL then.
650         
651         * dbus/dbus-protocol.h:
652         Add new messages, service flags and service replies.
653         
654 2003-01-26  Havoc Pennington  <hp@pobox.com>
655
656         * dbus/dbus-message-builder.c: implement, completely untested.
657
658         * test/data/*: add data to be used in testing. 
659         ".message" files are our simple loadable text format.
660         ".message-raw" will be binary dumps of messages.
661
662         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
663
664 2003-01-26  Havoc Pennington  <hp@pobox.com>
665
666         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
667
668         * dbus/dbus-errors.c (dbus_result_to_string): add
669         file errors
670
671         * dbus/dbus-message-builder.c: new file, will contain code to load
672         up messages from files. Not implemented yet.
673
674 2003-01-26  Havoc Pennington  <hp@pobox.com>
675
676         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
677         the sender by setting to NULL
678
679 2003-01-26  Havoc Pennington  <hp@pobox.com>
680
681         The unit tests pass, but otherwise untested.  If it breaks, the
682         tests should have been better. ;-)
683         
684         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
685         the connection.
686
687         * dbus/dbus-message.c: redo everything so we maintain 
688         message->header as the only copy of the various fields.
689         This avoids the possibility of out-of-memory in some cases,
690         for example dbus_message_lock() can't run out of memory anymore,
691         and avoids extra copying. Figured I may as well go ahead and do 
692         this since it was busted for dbus_message_lock to not return 
693         failure on OOM, and dbus_message_write_header was totally
694         unchecked for OOM. Also fixed some random other bugs.
695
696         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
697         that strings are nul-terminated. Also, end_pos can be equal 
698         to string length just not greater than, I think.
699         (_dbus_marshal_set_int32): new function
700         (_dbus_marshal_set_uint32): new function
701         (_dbus_marshal_set_string): new function
702
703         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
704         a warning, init timeout_list to NULL
705         (dbus_connection_send_message): don't use uninitialized variable
706         "serial"
707
708         * dbus/dbus-string.c (_dbus_string_replace_len): new function
709
710 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
711
712         * bus/driver.c: (bus_driver_handle_hello),
713         (bus_driver_send_welcome_message):
714         Plug leaks
715         
716 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
717
718         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
719         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
720         (dbus_connection_unref):
721         * dbus/dbus-marshal.c: (_dbus_marshal_test):
722         * dbus/dbus-message.c: (dbus_message_unref),
723         Plug memory leaks.
724         
725         (dbus_message_get_fields): 
726         Remove debugging printout.
727
728         (_dbus_message_loader_return_buffer):
729         Don't store the header string.
730         
731         (_dbus_message_test):
732         Plug leaks.
733
734 2003-01-26  Richard Hult  <rhult@codefactory.se>
735
736         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
737         the file descriptor list, since it can change under us.
738
739 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
740
741         * glib/dbus-gmain.c: (dbus_connection_prepare),
742         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
743         (remove_watch), (dbus_connection_hookup_with_g_main):
744         Rewrite the glib handling to use its own GSource instead of a 
745         GIOChannel so we can catch messages put in the queue while waiting
746         for a reply.
747         
748 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
749
750         * bus/Makefile.am:
751         * bus/connection.c: (connection_disconnect_handler),
752         (connection_watch_callback), (bus_connection_setup):
753         * bus/dispatch.c: (send_one_message),
754         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
755         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
756         * bus/dispatch.h:
757         * bus/driver.c: (bus_driver_send_service_deleted),
758         (bus_driver_send_service_created), (bus_driver_handle_hello),
759         (bus_driver_send_welcome_message),
760         (bus_driver_handle_list_services), (bus_driver_remove_connection),
761         (bus_driver_handle_message):
762         * bus/driver.h:
763         Refactor code, put the message dispatching in its own file. Use 
764         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
765         is disconnected.
766         
767 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
768
769         * dbus/dbus-internals.h:
770         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
771         
772         * dbus/dbus-message.c: (dbus_message_get_sender):
773         * dbus/dbus-message.h:
774         Implement dbus_message_get_sender.
775         
776         * dbus/dbus-protocol.h:
777         Add message and service defines.
778         
779 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
780
781         * dbus/dbus-connection.c: (dbus_connection_send_message):
782         * dbus/dbus-message-internal.h:
783         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
784         (dbus_message_write_header):
785         Remove _dbus_messag_unlock and don't set the client serial on a 
786         message if one already exists.
787         
788 2003-01-24  Havoc Pennington  <hp@pobox.com>
789
790         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
791         list_pool
792
793         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
794         on OOM
795
796 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
797
798         * dbus/dbus-list.c: (alloc_link), (free_link):
799         Use a memory pool for the links.
800         
801 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
802
803         * bus/connection.c: (bus_connection_foreach):
804         * bus/connection.h:
805         Add new bus_connection_foreach function.
806         
807         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
808         Add function that broadcasts a message to all clients.
809         
810         (bus_driver_send_service_created), (bus_driver_handle_hello),
811         (bus_driver_send_welcome_message),
812         (bus_driver_handle_list_services), (bus_driver_message_handler):
813         Implement functions that take care of listing services, and notifying
814         clients when new services are created.
815         
816         * bus/services.c: (bus_services_list):
817         * bus/services.h:
818         Add new function that returns an array of strings with the currently
819         registered services.
820         
821         * glib/dbus-glib.h:
822         * glib/dbus-gmain.c:
823         Update copyright year.
824         
825 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
826
827         * dbus/dbus-connection.c: (dbus_connection_send_message):
828         Unlock the message in case it was sent earlier.
829         
830         (dbus_connection_send_message_with_reply_and_block):
831         Remove the reply message from the list.
832         
833         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
834         Set array_len and new_pos correctly.
835         
836         (_dbus_marshal_test):
837         Remove debug output.
838         
839         * dbus/dbus-message-internal.h:
840         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
841         New function that returns the reply serial.
842         
843         (_dbus_message_unlock):
844         New function that unlocks a message and resets its header.
845
846         (dbus_message_append_string_array), 
847         (dbus_message_get_fields_valist),
848         (dbus_message_iter_get_field_type),
849         (dbus_message_iter_get_string_array),   
850         (dbus_message_get_fields),      
851         (dbus_message_append_fields_valist):
852         Handle string arrays.
853         
854         (dbus_message_set_sender):
855         Make this function public since the bus daemon needs it.
856         
857         (decode_header_data):
858         Set the reply serial to -1 initially.
859
860         * dbus/dbus-message.h:
861         Add dbus_message_set_sender.    
862
863 2003-01-24  Havoc Pennington  <hp@pobox.com>
864
865         * doc/dbus-specification.sgml: add some stuff
866
867 2003-01-22  Havoc Pennington  <hp@pobox.com>
868
869         * doc/dbus-specification.sgml: Start to document the protocol.
870
871 2003-01-22  Havoc Pennington  <hp@pobox.com>
872
873         * dbus/dbus-connection.c
874         (dbus_connection_send_message_with_reply_and_block): add some @todo
875
876         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
877
878 2003-01-21  Havoc Pennington  <hp@pobox.com>
879
880         (patch untested because can't compile)
881         
882         * bus/driver.c (create_unique_client_name): make this function
883         never recycle client names. Also, caller should initialize 
884         the DBusString.
885
886         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
887
888 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
889
890         * dbus/dbus-marshal.c: (_dbus_marshal_double),
891         (_dbus_marshal_int32), (_dbus_marshal_uint32),
892         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
893         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
894         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
895         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
896         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
897         * dbus/dbus-marshal.h:
898         * dbus/dbus-protocol.h:
899         Add support for marshalling and demarshalling integer, double
900         and string arrays.
901         
902 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
903
904         * bus/Makefile.am:
905         Add driver.[ch]
906         
907         * bus/connection.c: (connection_disconnect_handler):
908         Remove the connection from the bus driver's list.
909         
910         (connection_watch_callback): Dispatch messages.
911
912         (free_connection_data): Free connection name.
913         
914         (bus_connection_setup): Add connection to the bus driver's list.
915         (bus_connection_remove_owned_service): 
916         (bus_connection_set_name), (bus_connection_get_name):
917         Add functions for setting and getting the connection's name.
918         
919         * bus/connection.h:
920         Add function headers.
921         
922         * bus/driver.c: (create_unique_client_name),
923         (bus_driver_handle_hello_message),
924         (bus_driver_send_welcome_message), (bus_driver_message_handler),
925         (bus_driver_add_connection), (bus_driver_remove_connection):
926         * bus/driver.h:
927         * bus/main.c:
928         * bus/services.c: (bus_service_free):
929         * bus/services.h:
930         New file that handles communication and registreation with the bus
931         itself. 
932         
933 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
934
935         * dbus/dbus-connection.c: (dbus_connection_send_message):
936         Add a new client_serial parameter.
937         
938         (dbus_connection_send_message_with_reply):
939         Remove a @todo since we've implemented the blocking function.
940         
941         (dbus_connection_send_message_with_reply_and_block):
942         New function that sends a message and waits for a reply and
943         then returns the reply.
944         
945         * dbus/dbus-connection.h:
946         Add new functions.
947         
948         * dbus/dbus-errors.c: (dbus_result_to_string):
949         * dbus/dbus-errors.h:
950         Add new DBUS_RESULT.
951         
952         * dbus/dbus-message-internal.h:
953         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
954         (_dbus_message_set_sender), (dbus_message_write_header),
955         (dbus_message_new_reply), (decode_header_data),
956         (_dbus_message_loader_return_buffer), (_dbus_message_test):
957         * dbus/dbus-message.h:
958         Add new functions that set the reply serial and sender.
959         Also marshal and demarshal them correctly and add test.
960         
961         * dbus/dbus-protocol.h:
962         Add new DBUS_MESSAGE_TYPE_SENDER.
963         
964         * glib/dbus-glib.h:
965         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
966         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
967         (dbus_connection_hookup_with_g_main):
968         * glib/test-dbus-glib.c: (main):
969         Rewrite to use GIOChannel and remove the GSource crack.
970         
971         * test/echo-client.c: (main):
972         * test/watch.c: (check_messages):
973         Update for changed APIs
974         
975 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
976
977         * dbus/Makefile.am: Add dbus-timeout.[cħ]
978         
979         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
980         Create a DBusTimeoutList.       
981         (dbus_connection_set_timeout_functions): Add new function to
982         set timeout callbacks
983         
984         * dbus/dbus-connection.h: Add public DBusTimeout API.
985         
986         * dbus/dbus-message.c: (dbus_message_get_service):
987         * dbus/dbus-message.h:  New function.
988
989         * dbus/dbus-server.c: Fix small doc typo.
990         
991         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
992
993 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
994
995         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
996         of the string, just as long as specified.
997
998 2003-01-19  Havoc Pennington  <hp@pobox.com>
999
1000         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1001         new function
1002
1003         * dbus/dbus-server.c (dbus_server_set_max_connections)
1004         (dbus_server_get_max_connections, dbus_server_get_n_connections):
1005         keep track of current number of connections, and add API for
1006         setting a max (but haven't implemented enforcing the max yet)
1007
1008 2003-01-18  Havoc Pennington  <hp@pobox.com>
1009
1010         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1011         reading/writing if read_watch != NULL or write_watch != NULL.
1012
1013         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1014         the message loader code to actually load message->header and
1015         message->body into the newly-created message.
1016
1017         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1018         in OOM case
1019
1020         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
1021         (dbus_connection_get_max_message_size) 
1022         (dbus_connection_set_max_live_messages_size) 
1023         (dbus_connection_get_max_live_messages_size): implement some
1024         resource limitation functions
1025
1026         * dbus/dbus-resources.c: new file implementing some of the
1027         resource limits stuff
1028
1029         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1030         missing docs, add @todo to handle OOM etc.
1031
1032         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1033         docs
1034         
1035 2003-01-18  Havoc Pennington  <hp@pobox.com>
1036
1037         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
1038         connection if it hasn't been already.
1039
1040         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1041         replace with DisconnectFunction.
1042
1043 2003-01-18  Havoc Pennington  <hp@pobox.com>
1044
1045         Building --disable-verbose-mode --disable-asserts --disable-tests
1046         cuts the library from 112K to 45K or so
1047         
1048         * configure.in: check for varargs macro support, 
1049         add --enable-verbose-mode, --enable-asserts. 
1050
1051         * dbus/dbus-internals.h (_dbus_assert): support
1052         DBUS_DISABLE_ASSERT
1053         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1054
1055 2003-01-18  Havoc Pennington  <hp@pobox.com>
1056
1057         * dbus/dbus-test.c: include config.h so that tests actually run
1058
1059         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1060         so the failure mode when that assumption fails will be plenty
1061         obvious.
1062
1063 2003-01-18  Havoc Pennington  <hp@pobox.com>
1064
1065         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1066
1067         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1068         the distribution
1069
1070         * test/Makefile.am: don't use special variable "TESTS" for echo-*
1071         since we don't want to use those in make check
1072
1073 2003-01-15  Havoc Pennington  <hp@redhat.com>
1074
1075         Release 0.2
1076         
1077         * NEWS: update
1078
1079 2003-01-15  Havoc Pennington  <hp@redhat.com>
1080
1081         * test/Makefile.am: fix so that test source code ends up in the
1082         distribution on make distcheck
1083
1084 2003-01-15  Havoc Pennington  <hp@redhat.com>
1085
1086         Release 0.1.
1087         
1088         * NEWS: update  
1089
1090 2003-01-15  Havoc Pennington  <hp@redhat.com>
1091
1092         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1093         fix build when --disable-tests
1094
1095         * Makefile.am (EXTRA_DIST): put HACKING in here
1096
1097         * HACKING: document procedure for making a tarball release.
1098
1099 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
1100
1101         * bus/connection.c: (connection_error_handler),
1102         (bus_connection_setup):
1103         * bus/main.c: (main):
1104         Make sure that the DBusConnectionData struct is NULLed
1105         out to prevent a segfault.
1106         
1107         * dbus/dbus-errors.c: (dbus_result_to_string):
1108         * dbus/dbus-errors.h:
1109         * dbus/dbus-message.c: (dbus_message_get_fields),
1110         (dbus_message_get_fields_valist), (_dbus_message_test):
1111         * dbus/dbus-message.h:
1112         Make dbus_message_get_fields return a result code so we can
1113         track invalid fields as well as oom.
1114         
1115 2003-01-11  Havoc Pennington  <hp@pobox.com>
1116
1117         * configure.in: change --enable-test/--enable-ansi action-if-given
1118         to enable_foo=$enableval instead of enable_foo=yes
1119
1120 2003-01-08  Havoc Pennington  <hp@pobox.com>
1121
1122         * dbus/dbus-string.c (_dbus_string_align_length): new function
1123
1124         * dbus/dbus-test-main.c: move main() for test app here
1125         * dbus/dbus-test.c
1126         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1127         symbol to run tests, because dbus-test isn't in the main 
1128         library
1129
1130         Code review nitpicks.
1131         
1132         * dbus/dbus-message.c (dbus_message_write_header): add newlines
1133         for people with narrow emacs ;-). Assert client_serial was filled
1134         in. Assert message->name != NULL.
1135         (dbus_message_append_fields): have "first_field_type" arg separate
1136         from va list, needed for C++ binding that also uses varargs IIRC
1137         and helps with type safety
1138         (dbus_message_new): add @todo about using DBusString to store
1139         service/name internally
1140         (dbus_message_new): don't leak ->service and ->name on OOM later
1141         in the function
1142         (dbus_message_unref): free the service name
1143         (dbus_message_get_fields): same change to varargs
1144         i.e. first_field_type
1145         (_dbus_message_loader_return_buffer): assert that the message data
1146         is aligned (if not it's a bug in our code). Put in verbose griping
1147         about why we set corrupted = TRUE.
1148         (decode_header_data): add FIXME that char* is evil.  Was going to
1149         add FIXME about evil locale-specific string.h strncmp, but just
1150         switched to wacky string-as-uint32 optimization. Move check for
1151         "no room for field name" above get_const_data_len() to avoid
1152         assertion failure in get_const_data_len if we have trailing 2
1153         bytes or the like. Check for service and name fields being
1154         provided twice. Don't leak service/name on error. Require field
1155         names to be aligned to 4 bytes.
1156
1157         * dbus/dbus-marshal.c: move byte swap stuff to header
1158         (_dbus_pack_int32): uscore-prefix
1159         (_dbus_unpack_int32): uscore-prefix
1160         (_dbus_unpack_uint32): export
1161         (_dbus_demarshal_string): add @todo complaining about use of
1162         memcpy()
1163         (_dbus_marshal_get_field_end_pos): add @todo about bad error
1164         handling allowing corrupt data to go unchecked
1165
1166 2003-01-08  Havoc Pennington  <hp@redhat.com>
1167
1168         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
1169         to the select() as needed for authentication. (should be using
1170         _dbus_poll() not select, but for another day)
1171
1172         * dbus/dbus.h: include dbus/dbus-protocol.h
1173
1174 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
1175
1176         * dbus/Makefile.am (dbusinclude_HEADERS): Install
1177         dbus-connection.h
1178
1179 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
1180
1181         * dbus/dbus-internals.c: (_dbus_type_to_string):
1182         New function that returns a string describing a type.
1183         
1184         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1185         * dbus/dbus-marshal.h:
1186         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1187         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1188         (dbus_message_iter_get_byte_array):
1189         * dbus/dbus-message.h:
1190         Add new convenience functions for appending and getting message fields.
1191         Also add demarshalling routines for byte arrays.
1192
1193 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1194
1195         * dbus/dbus-connection-internal.h:
1196         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1197         (_dbus_connection_get_next_client_serial),
1198         (dbus_connection_send_message):
1199         * dbus/dbus-internals.h:
1200         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1201         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1202         (_dbus_marshal_uint32), (_dbus_demarshal_double),
1203         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1204         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1205         (_dbus_verbose_bytes), (_dbus_marshal_test):
1206         * dbus/dbus-marshal.h:
1207         * dbus/dbus-message-internal.h:
1208         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1209         (dbus_message_write_header), (_dbus_message_lock),
1210         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1211         (dbus_message_get_name), (dbus_message_append_int32),
1212         (dbus_message_append_uint32), (dbus_message_append_double),
1213         (dbus_message_append_string), (dbus_message_append_byte_array),
1214         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1215         (dbus_message_iter_unref), (dbus_message_iter_has_next),
1216         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1217         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1218         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1219         (decode_header_data), (_dbus_message_loader_return_buffer),
1220         (message_iter_test), (_dbus_message_test):
1221         * dbus/dbus-message.h:
1222         * dbus/dbus-protocol.h:
1223         * dbus/dbus-test.c: (main):
1224         * dbus/dbus-test.h:
1225         * glib/test-dbus-glib.c: (message_handler), (main):
1226         * test/echo-client.c: (main):
1227         * test/watch.c: (check_messages):
1228         Make messages sendable and receivable for real.
1229         
1230 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1231
1232         * dbus/dbus-marshal.c: (_dbus_marshal_double),
1233         (_dbus_marshal_string), (_dbus_marshal_byte_array):
1234         * dbus/dbus-message.c: (dbus_message_append_int32),
1235         (dbus_message_append_uint32), (dbus_message_append_double),
1236         (dbus_message_append_string), (dbus_message_append_byte_array):
1237         Handle OOM restoration.
1238         
1239 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
1240
1241         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1242         (_dbus_demarshal_string), (_dbus_marshal_test):
1243         * dbus/dbus-marshal.h:
1244         * dbus/dbus-message.c: (dbus_message_get_name),
1245         Document these functions.
1246         
1247         (dbus_message_append_int32), (dbus_message_append_uint32),
1248         (dbus_message_append_double), (dbus_message_append_string),
1249         (dbus_message_append_byte_array):
1250         * dbus/dbus-message.h:
1251         Add functions for adding message fields of different types.
1252         
1253         * dbus/dbus-protocol.h:
1254         Add the different types.
1255
1256 2003-01-05  Havoc Pennington  <hp@pobox.com>
1257
1258         * bus/connection.c: implement routines for handling connections,
1259         first thing is keeping a list of owned services on each connection
1260         and setting up watches etc.
1261
1262         * bus/services.c: implement a mapping from service names to lists
1263         of connections
1264
1265         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
1266
1267         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
1268         to use static mutexes for global data
1269
1270         * dbus/dbus-connection.c (dbus_connection_set_data): add new
1271         collection of functions to set/get application-specific data
1272         on the DBusConnection.
1273
1274 2003-01-04  Havoc Pennington  <hp@pobox.com>
1275
1276         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
1277         (_dbus_poll): new function
1278
1279         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
1280         copied from GLib
1281
1282         * bus/loop.c: initial code for the daemon main loop
1283
1284 2003-01-04  Havoc Pennington  <hp@pobox.com>
1285
1286         * test/watch.c (error_handler): make it safe if the error handler 
1287         is called multiple times (if we s/error handler/disconnect
1288         handler/ we should just guarantee it's called only once)
1289
1290         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
1291         error handler on disconnect (it's quite possible we should
1292         just change the error handler to a "disconnect handler," I'm 
1293         not sure we have any other meaningful errors)
1294
1295         * configure.in: check for getpwnam_r
1296
1297         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
1298         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
1299         mechanism as in SASL spec, using socket credentials
1300
1301         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
1302         (_dbus_send_credentials_unix_socket): new function
1303
1304         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
1305         dbus_accept()
1306         (_dbus_write): only check errno if <0 returned
1307         (_dbus_write_two): ditto
1308
1309 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
1310
1311         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
1312         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
1313         (_dbus_marshal_test):
1314         * dbus/dbus-marshal.h:
1315         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
1316         to _dbus_marshal_utf8_string. Also fix some tests.
1317         
1318 2002-12-28  Harri Porten  <porten@kde.org>
1319
1320         * configure.in: added check for C++ compiler and a very cheesy
1321         check for the Qt integration
1322
1323         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
1324
1325         * qt/Makefile.am: added 
1326
1327         * qt/.cvsignore: added  
1328
1329         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
1330         latter, added #ifdef QT_THREAD_SUPPORT guard.
1331
1332         * dbus/Makefile.am: added missing headers for make dist
1333
1334 2002-12-28  Kristian Rietveld  <kris@gtk.org>
1335
1336         * dbus/Makefile.am: fixup export-symbols-regex.
1337
1338 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
1339
1340         * acinclude.m4: Add this file and put the 
1341         PKG_CHECK_MODULE macro in it.
1342
1343 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
1344
1345         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1346         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1347         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1348         (_dbus_marshal_test):
1349         Make the demarshalling routines align the pos argument.
1350         Add string marshalling tests and fix the obvious bugs 
1351         discovered.
1352         
1353 2002-12-26  Havoc Pennington  <hp@pobox.com>
1354
1355         * dbus/dbus-auth.c: fixes fixes fixes
1356
1357         * dbus/dbus-transport-unix.c: wire up support for
1358         encoding/decoding data on the wire
1359
1360         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
1361         (_dbus_auth_decode_data): append to target string 
1362         instead of nuking it.
1363
1364 2002-12-26  Havoc Pennington  <hp@pobox.com>
1365
1366         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
1367         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
1368         doh
1369
1370         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
1371         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
1372         now). Main point is because I wanted unpack_uint32 to implement
1373         _dbus_verbose_bytes
1374         (_dbus_verbose_bytes): new function
1375
1376         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
1377
1378         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
1379         mechanism to handle a corrupt message stream
1380         (_dbus_message_loader_new): fix preallocation to only prealloc, 
1381         not prelengthen
1382         
1383         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
1384         (_dbus_string_test): enhance tests for copy/move and fix the
1385         functions
1386
1387         * dbus/dbus-transport-unix.c: Hold references in more places to 
1388         avoid reentrancy problems
1389
1390         * dbus/dbus-transport.c: ditto
1391
1392         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
1393         leak reference count in no-message case
1394
1395         * test/watch.c (do_mainloop): handle adding/removing watches
1396         during iteration over the watches. Also, ref the connection/server
1397         stored on a watch, so we don't try to mangle a destroyed one.
1398
1399         * dbus/dbus-transport-unix.c (do_authentication): perform
1400         authentication
1401
1402         * dbus/dbus-auth.c (get_state): add a state
1403         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
1404         (_dbus_auth_get_unused_bytes): append the unused bytes
1405         to the passed in string, rather than prepend
1406
1407         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
1408         the auth conversation DBusAuth
1409
1410         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
1411         (_dbus_transport_new_for_domain_socket): when creating a
1412         transport, pass in whether it's a client-side or server-side
1413         transport so we know which DBusAuth to create
1414
1415 2002-12-03  Havoc Pennington  <hp@pobox.com>
1416
1417         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
1418         _after_ finalizing the derived members
1419         (unix_connection_set): unref watch if we fail to add it
1420
1421         * dbus/dbus-connection.c (dbus_connection_unref): delete the
1422         transport first, so that the connection owned by the 
1423         transport will be valid as the transport finalizes.
1424
1425         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
1426         if necessary, and remove watches from the connection.
1427         
1428         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
1429         
1430 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
1431
1432         * dbus/dbus-marshal.c: (_dbus_marshal_string),
1433         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1434         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1435         (_dbus_marshal_test):
1436         * dbus/dbus-marshal.h:
1437         Add string marshal functions and have the demarshal functions
1438         return the new position.
1439         
1440 2002-12-25  Havoc Pennington  <hp@pobox.com>
1441
1442         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
1443         it is a simple protocol that just maps directly to SASL.
1444
1445         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
1446         initial implementation, not actually used yet.
1447         
1448         * dbus/dbus-string.c (_dbus_string_find): new function
1449         (_dbus_string_equal): new function
1450         (_dbus_string_base64_encode): new function
1451         (_dbus_string_base64_decode): new function
1452
1453 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
1454
1455         * dbus/Makefile.am:
1456         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
1457         (_dbus_marshal_int32), (_dbus_marshal_uint32),
1458         (_dbus_demarshal_double), (_dbus_demarshal_int32),
1459         (_dbus_demarshal_uint32), (_dbus_marshal_test):
1460         * dbus/dbus-marshal.h:
1461         * dbus/dbus-protocol.h:
1462         * dbus/dbus-test.c: (main):
1463         * dbus/dbus-test.h:
1464         Add un-optimized marshalling/demarshalling routines.
1465         
1466 2002-12-25  Harri Porten  <porten@kde.org>
1467
1468         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
1469
1470 2002-12-24  Zack Rusin  <zack@kde.org>
1471
1472         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
1473         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
1474         main loop stuff
1475
1476 2002-12-24  Havoc Pennington  <hp@pobox.com>
1477
1478         * glib/dbus-gthread.c: fix include
1479
1480         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
1481         I think glib API needs to change, though, as you don't 
1482         want to use DBusMessageFunction, you want to use the 
1483         DBusMessageHandler object. Probably 
1484         dbus_connection_open_with_g_main_loop()
1485         and dbus_connection_setup_g_main_loop() or something like that
1486         (but think of better names...) that just create a connection 
1487         that has watch/timeout functions etc. already set up.
1488
1489         * dbus/dbus-connection.c
1490         (dbus_connection_send_message_with_reply): new function just to 
1491         show how the message handler helps us deal with replies.
1492
1493         * dbus/dbus-list.c (_dbus_list_remove_last): new function
1494
1495         * dbus/dbus-string.c (_dbus_string_test): free a string that
1496         wasn't
1497
1498         * dbus/dbus-hash.c: use memory pools for the hash entries
1499         (rebuild_table): be more paranoid about overflow, and 
1500         shrink table when we can
1501         (_dbus_hash_test): reduce number of sprintfs and write
1502         valid C89. Add tests for case where we grow and then 
1503         shrink the hash table.
1504
1505         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
1506
1507         * dbus/dbus-connection.c (dbus_connection_register_handler) 
1508         (dbus_connection_unregister_handler): new functions
1509
1510         * dbus/dbus-message.c (dbus_message_get_name): new
1511
1512         * dbus/dbus-list.c: fix docs typo
1513
1514         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1515         an object representing a handler for messages.
1516
1517 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
1518
1519         * glib/dbus-glib.h:
1520         * glib/dbus-gthread.c: (dbus_gthread_init):
1521         Don't use the gdbus prefix for public functions.
1522         
1523 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
1524
1525         * Makefile.am:
1526         * configure.in:
1527         Add GLib checks and fixup .pc files
1528         
1529         * glib/Makefile.am:
1530         * glib/dbus-glib.h:
1531         * glib/dbus-gmain.c: (gdbus_connection_prepare),
1532         (gdbus_connection_check), (gdbus_connection_dispatch),
1533         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1534         (dbus_connection_gsource_new):
1535         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1536         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1537         * glib/test-dbus-glib.c: (message_handler), (main):
1538         Add GLib support.
1539         
1540 2002-12-15  Harri Porten  <porten@kde.org>
1541
1542         * autogen.sh: check for libtoolize before attempting to use it 
1543         
1544         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1545         struct.
1546         
1547         * .cvsignore: ignore more stamp files
1548
1549         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1550
1551         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1552         without make install.
1553
1554 2002-12-15  Havoc Pennington  <hp@pobox.com>
1555
1556         * dbus/dbus-threads.c: add thread stubs that a higher library
1557         layer can fill in. e.g. the GLib wrapper might fill them in with
1558         GThread stuff. We still need to use this thread API to
1559         thread-safe-ize the library.
1560
1561 2002-12-12  Havoc Pennington  <hp@pobox.com>
1562
1563         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1564         below new interfaces and include fewer system headers.
1565
1566         * dbus/dbus-sysdeps.c (_dbus_read): new function
1567         (_dbus_write): new function
1568         (_dbus_write_two): new function
1569         (_dbus_connect_unix_socket): new function
1570         (_dbus_listen_unix_socket): new function
1571
1572         * dbus/dbus-message-internal.h: change interfaces to use
1573         DBusString
1574
1575 2002-12-11  Havoc Pennington  <hp@pobox.com>
1576
1577         * dbus/dbus-types.h: add dbus_unichar
1578
1579         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1580
1581         * dbus/dbus-connection.c (dbus_connection_send_message): return
1582         TRUE on success
1583
1584         * dbus/dbus-transport.c: include dbus-watch.h   
1585
1586         * dbus/dbus-connection.c: include dbus-message-internal.h
1587
1588         * HACKING: add file with coding guidelines stuff.
1589
1590         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1591         handling here, for security purposes (as in vsftpd). Not actually
1592         using this class yet.
1593
1594         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1595         system/libc usage here, as in vsftpd, for ease of auditing (and
1596         should also simplify portability). Haven't actually moved all the
1597         system/libc usage into here yet.
1598         
1599 2002-11-25  Havoc Pennington  <hp@pobox.com>
1600
1601         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
1602         always print the first verbose message.
1603
1604 2002-11-24  Havoc Pennington  <hp@pobox.com>
1605
1606         * test/echo-client.c, test/echo-server.c: cheesy test 
1607         clients.
1608         
1609         * configure.in (AC_CHECK_FUNCS): check for writev
1610
1611         * dbus/dbus-message.c (_dbus_message_get_network_data): new
1612         function
1613
1614         * dbus/dbus-list.c (_dbus_list_foreach): new function
1615
1616         * dbus/dbus-internals.c (_dbus_verbose): new function
1617
1618         * dbus/dbus-server.c, dbus/dbus-server.h: public object
1619         representing a server that listens for connections.
1620
1621         * dbus/.cvsignore: create
1622
1623         * dbus/dbus-errors.h, dbus/dbus-errors.c:
1624         public API for reporting errors
1625
1626         * dbus/dbus-connection.h, dbus/dbus-connection.c:
1627         public object representing a connection that 
1628         sends/receives messages. (Same object used for 
1629         both client and server.)
1630
1631         * dbus/dbus-transport.h, dbus/dbus-transport.c:
1632         Basic abstraction for different kinds of stream
1633         that we might read/write messages from.
1634
1635 2002-11-23  Havoc Pennington  <hp@pobox.com>
1636
1637         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
1638         _DBUS_INT_MAX
1639
1640         * dbus/dbus-test.c (main): add list test, and include 
1641         dbus-test.h as intended
1642
1643         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
1644         (_dbus_hash_table_remove_int): return value indicates 
1645         whether the entry existed to remove
1646
1647         * dbus/dbus-list.c: add linked list utility class, 
1648         with docs and tests
1649
1650         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
1651         array sometimes.
1652
1653 2002-11-23  Havoc Pennington  <hp@pobox.com>
1654
1655         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1656         DBUS_END_DECLS to nothing, that should fix this once and for all
1657
1658         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1659
1660         * dbus/dbus-message.c, dbus/dbus-hash.c: 
1661         add some missing @brief
1662
1663 2002-11-23  Havoc Pennington  <hp@pobox.com>
1664
1665         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
1666         to avoid confusing Doxygen
1667
1668         * dbus/dbus-hash.c: @} not }@
1669
1670         * dbus/dbus-message.c (struct DBusMessage): split out 
1671         internals docs
1672
1673 2002-11-23  Havoc Pennington  <hp@pobox.com>
1674
1675         * configure.in: pile on more warning flags if using gcc
1676
1677         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
1678         to document static functions
1679
1680         * configure.in: add summary to end of configure so it 
1681         looks nice and attractive
1682
1683         * dbus/dbus-hash.c: finish implementation and write unit 
1684         tests and docs
1685
1686         * configure.in: add --enable-tests to enable unit tests
1687
1688         * dbus/dbus-test.c: test program to run unit tests 
1689         for all files in dbus/*, initially runs a test for 
1690         dbus-hash.c
1691         
1692         * dbus/dbus-internals.h: file to hold some internal utility stuff
1693
1694 2002-11-22  Havoc Pennington  <hp@redhat.com>
1695
1696         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
1697         "ported" away from Tcl
1698
1699         * dbus/dbus-types.h: header for types such as dbus_bool_t
1700
1701 2002-11-22  Havoc Pennington  <hp@redhat.com>
1702
1703         * dbus/dbus.h: fixups for doc warnings
1704
1705         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
1706         macros
1707         (QUIET): make it quiet so we can see warnings
1708
1709         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1710
1711 2002-11-22  Havoc Pennington  <hp@redhat.com>
1712
1713         * Makefile.am: include "Doxyfile" target in all-local
1714
1715         * configure.in: generate the Doxyfile
1716
1717         * Doxyfile.in: move Doxyfile here, so we can use 
1718         configure to generate a Doxyfile with the right 
1719         version number etc.
1720
1721 2002-11-22  Havoc Pennington  <hp@redhat.com>
1722
1723         * dbus/dbus-message.c: move inline docs into .c file
1724
1725         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1726         so all docs are under doc/
1727         (MAN_EXTENSION): generate man pages. Use extension 
1728         ".3dbus" which matches ".3qt" on my system, 
1729         I guess this is OK, I don't know really.
1730         (FILE_PATTERNS): look for .c files not .h, makes sense
1731         for plain C I think
1732
1733 2002-11-22  Havoc Pennington  <hp@pobox.com>
1734
1735         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
1736         because any app can be a server, and any app can be a client, 
1737         the bus is a special kind of server.
1738
1739 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
1740
1741         * Doxyfile : adding. Still needs Makefile rules to be generated
1742         automatically (just run "doxygen" in the toplevel dir for now to
1743         generate docs)
1744         
1745         * dbus/dbus-message.h : Adding sample docs (javadoc since
1746         resembles gtk-doc a little more)
1747
1748         * dbus/dbus.h : Adding sample docs
1749
1750 2002-11-21  Havoc Pennington  <hp@redhat.com>
1751
1752         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
1753         so we can allow ourselves to include files directly, 
1754         instead of having to use dbus.h
1755
1756         * dbus/dbus.h: fill in
1757
1758         * dbus/dbus-message.h: sketch out a sample header file.
1759         Include griping if you include it directly instead of 
1760         via dbus.h
1761
1762         * dbus/dbus-macros.h: new file with macros for extern "C", 
1763         TRUE/FALSE, NULL, etc.
1764
1765         * doc/file-boilerplate.c: put include guards in here
1766
1767 2002-11-21  Havoc Pennington  <hp@redhat.com>
1768
1769         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1770
1771         * COPYING: include the GPL as well, and license code 
1772         under both AFL and GPL.
1773
1774 2002-11-21  Havoc Pennington  <hp@redhat.com>
1775
1776         * acconfig.h: get rid of this
1777
1778         * autogen.sh (run_configure): add --no-configure option
1779
1780         * configure.in: remove AC_ARG_PROGRAM to make
1781         autoconf complain less. add AC_PREREQ. 
1782         add AC_DEFINE third arg.
1783         
1784 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
1785
1786         * doc/Makefile.am:
1787         Fix references so we can distcheck.
1788
1789 2002-11-21  Havoc Pennington  <hp@redhat.com>
1790
1791         * Initial module creation
1792