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