mupnp updated

mupnp has been updated to version 0.1.1.

The point is that i was experimenting problems with firehol firewall wich had UPnP ports enabled but I still wasn’t retriving any answer.

To fix this i had to hack a little on miniupnp library and finished searching when i found the TX_FROM_UPNP_PORT constant wich wasn’t set by default due to compatibility problems with Windows XP. I just made a slight change and converted it in a runtime check instead of a compile time one. This changed the C api of the library for the upnpDiscover function, and added a value to the initialization of the high level interface written to interface with the library which is automatically set to send data from the upnp port.

I have sent the patch to the mainstream developer, but it would require api changes and more modification to make it work correctly on the full fledged library.

With this last fix the rtorrent ruby controller is almost ready, i just have to comment the code and write a post about it

The gem is already available for upgrade on the rubyforge webstite or gem utility.


, , , ,

  1. #1 by Sho on July 13, 2009 - 1:00 pm

    Wow, I’m glad to find this project! Thanks for all your work!

    One problem though; I can’t seem to require the gem. It builds ok but then this happens:

    >> require ‘miniupnp’
    LoadError: dlsym(0x1b747c0, Init_miniupnp): symbol not found – /Library/Ruby/Gems/1.8/gems/mupnp-0.1.2/lib/miniupnp.bundle

    Is that something you’ve seen? This is on

    $ ruby -v
    ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

    thanks again!


  2. #2 by Sho on July 13, 2009 - 2:08 pm

    Weird. I cloned the repository and built manually, and it works fine if required by path. It just doesn’t work installed as a gem.

    Oh well, I can just require it manually and use it that way. Thanks again : D

    • #3 by Dario Meloni on July 13, 2009 - 4:35 pm

      really weird, i never installed the gem in the ruby root installation but in home subfolder setting the environment variable GEM_HOME

      • #4 by Sho on July 13, 2009 - 8:34 pm

        Strange! Does it work for you if you install in ruby root?

      • #5 by Dario Meloni on July 13, 2009 - 8:49 pm

        I get the error if it is installed in the root directory and not if in the local gem repository… really weird!

        and moreover

        nm /Library/Ruby/Gems/1.8/gems/mupnp-0.1.2/lib/miniupnp.bundle | grep Init_

        the global function Init_MiniUPnP is defined in both! Anyway it’s better not to mess with the preinstalled gems and keep yours apart to avoid confusion and problems. I can’t really help with the problem you have found, i don’t get why it happends in the first place O.o

      • #6 by Sho on July 13, 2009 - 9:12 pm

        Thanks for checking it out. I have no idea what’s wrong either, I also confirmed the init was there.

        Oh well! I’ll just use it the way you suggested. Thanks again!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: