An ecore loop based libpurple client...

"Marco Trevisan (Treviño)" mail at 3v1n0.net
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 'login.live.com' 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,
cond=PURPLE_INPUT_READ)
>     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
login.live.com
> (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 +
conn->handled_len,

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?

Thanks.

---
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
   error:

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

   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

[1]
http://www.mail-archive.com/enlightenment-devel@lists.sourceforge.net/msg20928.html
[2] http://www.flickr.com/photos/trevi55/3400441400/

-- 
Treviño's World - Life and Linux
http://www.3v1n0.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullclient-ecore.c
Type: text/x-csrc
Size: 10033 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20090401/677f1483/attachment-0002.c>


More information about the Devel mailing list