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 698163 - proxy-resolver not working with port 80
proxy-resolver not working with port 80
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: HTTP Transport
2.42.x
Other OpenBSD
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-16 21:04 UTC by david
Modified: 2013-04-26 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (537 bytes, patch)
2013-04-18 01:47 UTC, david
rejected Details | Review

Description david 2013-04-16 21:04:40 UTC
I am using libsoup 2.42.0, glib 2.36.0, and the new proxy-resolver feature to connect to tor/socks5 directly.  However, port 80 doesn't seem to work with xombrero/webkit.  I have written a small app to demonstrate.  

#include <libsoup/soup.h>

#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
        GProxyResolver *r;
        SoupSession *s;
        SoupMessage *msg;
        guint status;
        int i;
        char *hosts[] = {
                "http://www.google.com",
                "https://www.google.com",
                "http://www.google.com:80",
                "http://labs.webmetrics.com:8080"
        };

        r = g_simple_proxy_resolver_new("socks5://127.0.0.1:9050", NULL);
        s = soup_session_new();
        g_object_set(s, "proxy-resolver", r, NULL);

        for (i = 0; i < sizeof(hosts) / sizeof(hosts[0]); i++) {
                msg = soup_message_new("GET", hosts[i]);
                status = soup_session_send_message(s, msg);
                printf("%s: soup:%s http:%d\n", hosts[i],
                        soup_status_get_phrase(status), msg->status_code);
        }
        return (0);
}

http://www.google.com: soup:Cannot connect to destination http:4
https://www.google.com: soup:OK http:200
http://www.google.com:80: soup:Cannot connect to destination http:4
http://labs.webmetrics.com:8080: soup:OK http:200

On the first and third test (port 80 tests), Tor says:
 Tor[17353]: Application asked to connect to port 0. Refusing.

Seems like libsoup or gio is ignoring setting the port number if it is supposed to be 80?
Comment 1 david 2013-04-18 01:47:50 UTC
Created attachment 241789 [details] [review]
Patch

This fixes the issue by just setting the port.
Comment 2 Dan Winship 2013-04-18 14:34:33 UTC
Fixed in git. Thanks for the patch, though it wasn't quite right; we
can't make soup_uri_to_string() include the port number
unconditionally, because that would break other things. So I added a
new internal helper so we can force it to get added just in this case.
Comment 3 david 2013-04-20 16:07:58 UTC
Is this worth a 2.42.2 release?
Comment 4 Dan Winship 2013-04-22 14:40:53 UTC
2.42.2 will be with GNOME 3.8.2, but that's almost a month away, so maybe it's worth doing a 2.42.1.1...
Comment 5 david 2013-04-22 14:58:32 UTC
no objection here. would be much appreciated.
Comment 6 Dan Winship 2013-04-24 20:09:03 UTC
2.42.2 is now tagged in git and available on ftp.gnome.org
Comment 7 Alban Crequy 2013-04-26 11:17:47 UTC
*** Bug 698877 has been marked as a duplicate of this bug. ***