An ecore loop based libpurple client...

"Marco Trevisan (Treviño)" mail at
Tue Mar 31 18:57:13 EDT 2009

Hello, I'm posting here what I've already posted in enlightenment-devel
since we're still looking for a solution for getting a libpurple client
to work with ecore (that would allow to write an EFL GUI around it).

Hello, today as a first step, I've tried to port the libpurple example
"nullclient.c" to make it use the ecore_loop instead of the GMainLoop.

To get this, I had mostly to write the wrapper functions needed to
populate the PurpleEventLoopUiOps struct.
Thanks to the ecore_timer* and the ecore_main_fd* functions all this was
quite easy, and you can see my result looking at the nullclient-ecore.c
attached file.

Unfortunately testing it with the msn-purple plugin (I've tried also
with Facebook, but I've some issues with the certs) the test client
attached segfaults. As you can easily try (but I could attach also some
logs, if you need) the client runs correctly and initializes the
connection, however after getting and sending some data (wireshark
confirms it too :P), it crashes. :(

Using the standard connection mode with gdb I get this:

> (01:42:42) dns: DNS query for '' queued
> (01:42:42) dns: Successfully sent DNS request to child 2317
> (01:42:43) dns: Got response for '(null)'
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1214175024 (LWP 2314)]
> 0xb7ef469d in host_resolved (data=0x80ade50, source=12,
>     at dnsquery.c:558
> 558             purple_input_remove(query_data->resolver->inpa);
> (gdb) dns[2317]: nobody needs me... =(

While using the Http mode (in the case of msn) I get this:

> (01:44:38) certificate: Successfully verified certificate for
> (01:44:39) soap: Sending secure request.
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1213843248 (LWP 2330)]
> 0xb7685386 in msn_soap_write_cb_internal (data=0x80adf10, fd=<value
optimized out>,
>     cond=<value optimized out>, initial=0) at soap.c:546
> 546             written = purple_ssl_write(conn->ssl, conn->buf->str +

However I figure that they depends on the same issue, but from my
knowledges I can't really understand where I'm wrong :(.

Do you have any idea why is this not working as expected?


I've made one more test using Google Talk (so a jabber server), and now
I've a different behavior:
 - If I run it in gdb or I set to TRUE the purple_debug_set_enabled
   function, I can connect to the server with no problems, and as you
   can see here [2], also the null_write_conv callback is working well
   since I receive the incoming messages.
 - If I run it in the normal way, after connecting, it crashes with this

    libpurple initialized.
    Setting Google Talk Jabber!
    Account connected: trevi55 at prpl-jabber
    max_fd: 11
    cr: 2, cw: 0, ce: 0

   As far I know it seems connected to the max number of opened fd;
   maybe haven't they been closed correctly?!?

However, as an e17 newbie, it seems a good step to me :P


Treviño's World - Life and Linux

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullclient-ecore.c
Type: text/x-csrc
Size: 10033 bytes
Desc: not available
URL: <>

More information about the Devel mailing list