==2389== 59 (24 direct, 35 indirect) bytes in 1 blocks are definitely lost in loss record 290 of 315
==2389== at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2389== by 0x4057094: g_malloc (gmem.c:134)
==2389== by 0x406F2D6: g_slice_alloc (gslice.c:836)
==2389== by 0x406F31B: g_slice_alloc0 (gslice.c:848)
==2389== by 0x403A8A6: g_error_new_literal (gerror.c:117)
==2389== by 0x403AC31: g_set_error_literal (gerror.c:314)
==2389== by 0x41AFD15: g_memory_input_stream_truncate (gmemoryinputstream.c:517)
==2389== by 0x41BAC0F: g_seekable_truncate (gseekable.c:174)
==2389== by 0x8049595: test_truncate (memory-input-stream.c:123)
Bug #628331.
==2530== 13 bytes in 1 blocks are definitely lost in loss record 373 of 681
==2530== at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==2530== by 0x4057094: g_malloc (gmem.c:134)
==2530== by 0x40573DB: g_malloc_n (gmem.c:281)
==2530== by 0x40717FC: g_strdup (gstrfuncs.c:101)
==2530== by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
==2530== by 0x4123F0B: g_object_get_valist (gobject.c:1643)
==2530== by 0x41240FF: g_object_get (gobject.c:1731)
==2530== by 0x804A4BA: test_basic (gsettings.c:28)
Bug #628331.
Allow modifying a GDBusMessage in a filter function and also add tests
for this. This breaks API but leaves ABI (almost) intact - at least
dconf's GSettings backend (the only big user I know of) will keep
working.
https://bugzilla.gnome.org/show_bug.cgi?id=624546
Signed-off-by: David Zeuthen <davidz@redhat.com>
==26538== 145 (24 direct, 121 indirect) bytes in 1 blocks are definitely lost in loss record 765 of 790
==26538== at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==26538== by 0x405233C: g_malloc (gmem.c:134)
==26538== by 0x406A57E: g_slice_alloc (gslice.c:836)
==26538== by 0x406A60C: g_slice_copy (gslice.c:858)
==26538== by 0x4035C5A: g_error_copy (gerror.c:160)
==26538== by 0x41B6387: g_simple_async_result_set_from_error (gsimpleasyncresult.c:638)
==26538== by 0x41FCDEB: g_dbus_connection_call_done (gdbusconnection.c:4808)
==26538== by 0x41B682E: g_simple_async_result_complete (gsimpleasyncresult.c:762)
==26538== by 0x41B686A: complete_in_idle_cb (gsimpleasyncresult.c:772)
==26538== by 0x404DA7C: g_idle_dispatch (gmain.c:4224)
==26538== by 0x4049FCD: g_main_dispatch (gmain.c:2119)
==26538== by 0x404B2C1: g_main_context_dispatch (gmain.c:2672)
==26538== by 0x404B716: g_main_context_iterate (gmain.c:2750)
==26538== by 0x404BE7F: g_main_loop_run (gmain.c:2958)
==26538== by 0x804B5CC: test_connection_send (gdbus-connection.c:407)
==26538== by 0x4073D04: test_case_run (gtestutils.c:1174)
Bug #627187.
==25403== 49 (24 direct, 25 indirect) bytes in 1 blocks are definitely lost in loss record 603 of 787
==25403== at 0x4005BDC: malloc (vg_replace_malloc.c:195)
==25403== by 0x405233C: g_malloc (gmem.c:134)
==25403== by 0x406A57E: g_slice_alloc (gslice.c:836)
==25403== by 0x406A5C3: g_slice_alloc0 (gslice.c:848)
==25403== by 0x4035B4E: g_error_new_literal (gerror.c:117)
==25403== by 0x4035ED9: g_set_error_literal (gerror.c:314)
==25403== by 0x41F6434: g_dbus_connection_close_sync (gdbusconnection.c:1284)
==25403== by 0x804A861: test_connection_life_cycle (gdbus-connection.c:158)
==25403== by 0x4073D04: test_case_run (gtestutils.c:1174)
==25403== by 0x4073FC2: g_test_run_suite_internal (gtestutils.c:1223)
==25403== by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403== by 0x4074077: g_test_run_suite_internal (gtestutils.c:1233)
==25403== by 0x40741FB: g_test_run_suite (gtestutils.c:1274)
==25403== by 0x40733E5: g_test_run (gtestutils.c:877)
==25403== by 0x804DC92: main (gdbus-connection.c:1024)
Bug #627187.
Add GZlibCompressor:file-info property. If it contains a non-NULL
GFileInfo, and the compressor is in GZIP mode, the filename and
modification time from the file info are written to the GZIP header
in the output data.
Add GZlibDeompressor:file-info property. If the decompressor is in GZIP
mode, and the GZIP data contains a GZIP header, the filename and
modification time are read from it, stored in a GFileInfo, and the
file-info property is notified.
Bug #617691.
If sending a lot of data and/or the other peer is not reading it, then
socket buffers can overflow. This is communicated from the kernel by
returning EAGAIN. In GIO, it is modelled by g_output_stream_write()
and g_socket_send_message() returning G_IO_ERROR_WOULD_BLOCK.
It is also problematic that that we're using synchronous IO in the
shared GDBus IO thread. It means that one GDBusConnection can lock up
others.
It turns out that by porting from g_output_stream_write() to
g_output_stream_write_async() we fix the EAGAIN issue. For GSocket, we
still need to handle things manually (by creating a GSource) as
g_socket_send_message() is used.
We check the new behavior in Michael's producer/consumer test case (at
/gdbus/overflow in gdbus-peer.c) added in the last commit.
Also add a test case that sends and receives a 20 MiB message.
Also add a new `transport' G_DBUS_DEBUG option so it is easy to
inspect partial writes:
$ G_DBUS_DEBUG=transport ./gdbus-connection -p /gdbus/connection/large_message
[...]
========================================================================
GDBus-debug:Transport:
>>>> WROTE 128000 bytes of message with serial 4 and
size 20971669 from offset 0 on a GSocketOutputStream
========================================================================
GDBus-debug:Transport:
>>>> WROTE 128000 bytes of message with serial 4 and
size 20971669 from offset 128000 on a GSocketOutputStream
========================================================================
GDBus-debug:Transport:
>>>> WROTE 128000 bytes of message with serial 4 and
size 20971669 from offset 256000 on a GSocketOutputStream
[...]
========================================================================
GDBus-debug:Transport:
>>>> WROTE 43669 bytes of message with serial 4 and
size 20971669 from offset 20928000 on a GSocketOutputStream
[...]
========================================================================
GDBus-debug:Transport:
<<<< READ 16 bytes of message with serial 3 and
size 20971620 to offset 0 from a GSocketInputStream
========================================================================
GDBus-debug:Transport:
<<<< READ 15984 bytes of message with serial 3 and
size 20971620 to offset 16 from a GSocketInputStream
========================================================================
GDBus-debug:Transport:
<<<< READ 16000 bytes of message with serial 3 and
size 20971620 to offset 16000 from a GSocketInputStream
[...]
========================================================================
GDBus-debug:Transport:
<<<< READ 144000 bytes of message with serial 3 and
size 20971620 to offset 20720000 from a GSocketInputStream
========================================================================
GDBus-debug:Transport:
<<<< READ 107620 bytes of message with serial 3 and
size 20971620 to offset 20864000 from a GSocketInputStream
OK
https://bugzilla.gnome.org/show_bug.cgi?id=626748
Signed-off-by: David Zeuthen <davidz@redhat.com>
GSocket has a timeout flag now, but when using GSocketClient there was
no way to set the timeout until after connecting (or failing). Fix
that by adding a timeout property to GSocketClient.
The GClosure API is a bit funky (and badly documented), and requires
you to set a marshaller on the closure, and the marshaller has an
implicit 'this' argument, and the caller is reponsible for unsetting
the values after invoking the closure.
I've added some calls of the _with_closures variants to the
gdbus-names test now.
The D-Bus spec mentions exactly what header fields are required for
various message types. Add tests for this as well.
Also disallow empty interfaces for signals since the D-Bus spec says
this is Verboten already.
Signed-off-by: David Zeuthen <davidz@redhat.com>
Also use this in the test cases to check that serialization to and
from both big and little endian works.
Signed-off-by: David Zeuthen <davidz@redhat.com>
the FdSource was calling g_cancellable_disconnect while holding the
main context lock, which is bad news if the ::cancelled handler is
trying to get that lock to wake up the mainloop...
Bug 586432