Actually, this is completely wrong :) urlDefaultPort() wants a protocol_t, not a port. The trouble here is that http->request isn't filled out, so I can't yet use http->request->protocol to determine whether the port number is different from the default.
Henrik, any ideas? Adrian On Fri, Jan 25, 2008, Adrian Chadd wrote: > On Wed, Jan 23, 2008, Mark Nottingham wrote: > > That's kind of what I was thinking, but was balking at the extra > > logic. If it's already hanging around, all the better. > > I just replied to the bug. This code may do the right thing: > > if (vport) > snprintf(http->uri, url_sz, "%s://%s:%d%s", > conn->port->protocol, t, port, url); > else if (port != urlDefaultPort(conn->port->protocol)) > snprintf(http->uri, url_sz, "%s://%s:%d%s", > conn->port->protocol, t, port, url); > else > snprintf(http->uri, url_sz, "%s://%s%s", > conn->port->protocol, t, url); > > See if that works? > > > > Adrian
