After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684265 - crash in SoupServer if interface property is not resolved
crash in SoupServer if interface property is not resolved
Status: RESOLVED OBSOLETE
Product: libsoup
Classification: Core
Component: HTTP Transport
2.39.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-09-18 05:04 UTC by Ángel Guzmán Maeso (shakaran)
Modified: 2014-05-02 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ángel Guzmán Maeso (shakaran) 2012-09-18 05:04:34 UTC
Executing this source code file in python2.7 crash.

from gi.repository import Soup

class HTTPServer(Soup.Server):
    def __init__(self, address='127.0.0.1', port=8082):
        interface = Soup.Address.new(address, port)
        Soup.Server.__init__(self, port = port,  interface = interface)

HTTPServer()

I just play a bit with Soup.Server trying to bind a custom address (localhost) as interface.

The interface property http://developer.gnome.org/libsoup/stable/SoupServer.html#SoupServer--interface seems to be readable/writable.
Comment 1 Dan Winship 2012-09-18 14:08:42 UTC
you need to do

  interface.resolve_sync(None)

before passing it to Soup.Server.__init__()

This isn't technically a bug, but there's no good reason for it to force you to do that, so I'll fix this at some point. (We're in hard code freeze right now though.)
Comment 2 Ángel Guzmán Maeso (shakaran) 2012-09-18 14:17:00 UTC
Thanks Dan,

Doing interface.resolve_sync(None) avoid the crash perfectly. Good to know that you can fixed in the future. I will wait for the fix when the hard code freeze ends.

Regards
Comment 3 Dan Winship 2014-05-02 13:33:59 UTC
SoupServer:interface is now deprecated in git master; there is a new API that involves creating the server first and then making calls to the soup_server_listen*() family of functions to set up the listeners.