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