Tag Archives: GCancellable

Recent libgdata work

Having totally failed to blog much recently, I thought I'd post an update on libgdata, and the work I've been doing over the last few days on it.

I'm aiming to get libgdata 0.8.0 released in good time to be used in GNOME 3.0, since it contains a lot of fixes and API breaks. What will be new in 0.8? The major change is that libgdata will be fully asynchronous — every long-running operation now has an asynchronous API. As part of the work on this, I've changed the way uploads work, too, so that they're now conducted exclusively via streaming I/O. This means that the data being uploaded to PicasaWeb as a new photo (for example) can just as easily come from memory as it can from disk.

Other improvements include lots of XML escaping fixes, some memory leak fixes, and improvements to cancellation support. Cancellation support is one of the things left on the to-do list before 0.8.0 can be released. While I naïvely thought that cancellation support in libgdata had been fairly good, after poking around in the code for the last few days I've been shown to be very, very wrong. Cancellation doesn't work in many cases, and is racy in others. That will be fixed before 0.8.0

Funnily enough, all this work was prompted by the need to fix the test suite so that libgdata passed its tests on build.gnome.org. It turns out that due to a recent change to g_str_hash() in GLib master, libgdata's test suites started to fail, as they implicitly relied on the order of entries in a hash table when doing XML comparisons using strcmp(). Obviously, this wasn't a brilliant idea. I suppose this is a little word of warning, then: if things involving hash tables in your program suddenly break with GLib ? 2.27.4, it might be because you're (erroneously) relying on the order of entries in a hash table.

The changes to fix the test suite have been backported to libgdata's 0.6 and 0.7 branches, and are present in the new 0.6.6 release. I was a little over-eager with the 0.7 branch, and released 0.7.1 too early, so that doesn't have the fixes. They'll be in 0.7.2 though, whenever that comes out.