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