[gnet-devel] Error when redirecting on the same host



			Dear GNet hackers,

I think I found a bug in GNet 2.0.8, running on my NetBSD/amd64 5.0_RC2
machine. Here is the situation:

- I am hosting a web server on my local machine, which is called
  "syn.defora.rom" (Apache 1.3)
- the address "http://syn.defora.rom/images/index.php"; redirects to
 "http://syn.defora.rom/"; (302)
- GNet sends a GNET_CONN_HTTP_REDIRECT event as expected, all good
- GNet then returns a GNET_CONN_HTTP_ERROR event, with the
  GNET_CONN_HTTP_ERROR_PROTOCOL_UNSUPPORTED error code

If I change the redirection to "http://localhost/"; it works as expected.

Reading GNet's source code, I saw this:

In file src/conn-http.c, function gnet_conn_http_set_uri_internal, line 513:

 513 static gboolean
 514 gnet_conn_http_set_uri_internal (GConnHttp *conn, const gchar *uri,
 515     gboolean uri_is_escaped)
[...]
 529         if (strstr(uri,"://") == NULL)
[...]
 535         else
 536         {
 537                 if (g_ascii_strncasecmp(uri, "http:", 5) != 0)
 538                         return FALSE; /* unsupported protocol */
 539
 540                 conn->uri = gnet_uri_new(uri);
 541         }
 542
 543         if (conn->uri && old_hostname &&
g_ascii_strcasecmp(conn->uri->hostname, old_hostname) != 0)

which looks relevant, but I don't see why it would fail. Any thoughts?

If you want to look at my code, you can find it here:
http://www.defora.org/os/project/browse/340/Surfer?file=/src/ghtml-gtkhtml.c,v

Thanks for this nice library,
-- 
khorben


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]