UPnP in libpurple

Mark Doliner mark at kingant.net
Mon Jul 7 22:24:28 EDT 2008


On Mon, Jul 7, 2008 at 7:05 PM, Ryan Govostes <rgovostes at gmail.com> wrote:
> Presently, I have libnatpmp compiled into libpurple and have rewritten
> natpmp.c accordingly. I do not have a NAT-PMP router, so I had a
> friend test it, and everything seemed to go well. I wrote a
> Makefile.am for it and changed others as necessary. I do need to make
> it a configuration switch to enable/disable, reverting to the old
> behavior.
>
> A problem we're facing is that NAT-PMP has long timeouts. For
> instance, when we try to get our public IP address, the timeout is 128
> seconds, even if the router doesn't support NAT-PMP! Since the
> function to get the IP blocks while we wait for the response, my
> implementation cannot realistically follow spec.
>
> How can we change this to be asynchronous?

libpurple isn't multi-threaded, so I think NAT-PMP would need to
support asynchronous function calls and would itself need to be
non-blocking.  Then you would need to integrate it with libpurple's
eventloop code, which could be a little tricky, and could also be a
lot of work.

-Mark




More information about the Devel mailing list