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 666399 - HTTP/1.0 not working with IPV6
HTTP/1.0 not working with IPV6
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.32.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2011-12-17 04:21 UTC by David Schleef
Modified: 2012-02-14 02:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Schleef 2011-12-17 04:21:22 UTC
I am creating a SoupServer using:

  if6 = soup_address_new_any (SOUP_ADDRESS_FAMILY_IPV6, server->port);
  server->server = soup_server_new (SOUP_SERVER_INTERFACE, if6,
      SOUP_SERVER_PORT, server->port, NULL);

And then connecting to it using a client that uses HTTP/1.0.  (Don't ask, not my choice.)

I'm getting Bad Request errors, and I tracked it down to soup-message-server-io.c, in this line:

                /* No Host header, no AbsoluteUri */
                SoupAddress *addr = soup_socket_get_local_address (sock);
                const char *host = soup_address_get_physical (addr);

                url = g_strdup_printf ("%s://%s:%d%s",
                                       soup_socket_is_ssl (sock) ? "https" : "ht
                                       host, soup_address_get_port (addr),
                                       req_path);

The URL that gets created here is:

  http://::ffff:10.0.2.23:8080/push

This does not get parsed correctly by soup_uri_new(), thus ending in Bad Request.

AFAICT, this is a regression created by the g-inet changes.

It works correctly with an IPV4-only server.

I can see several possible ways/places to fix this, but not sure the best.  I'd be happy to create a patch with some direction.
Comment 1 David Schleef 2011-12-17 04:25:34 UTC
Just noticed this is with 2.32.2.  However, I don't see any commits that would affect this.
Comment 2 Dan Winship 2011-12-19 18:26:58 UTC
(In reply to comment #0)
> I can see several possible ways/places to fix this, but not sure the best.  I'd
> be happy to create a patch with some direction.

Easiest would probably be to let SoupURI deal with it. Create an empty URI with soup_uri_new(NULL) and then fill it in with soup_uri_set_*() calls; soup_uri_to_string() will put []s around the host if it's an IPv6 literal.
Comment 3 Dan Winship 2012-02-14 02:42:47 UTC
fixed in git