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