/* This does not follow RFC 2068, but yet if the url is not absolute,
* handle it as everyone does. */
/* This does not follow RFC 2068, but yet if the url is not absolute,
* handle it as everyone does. */
- if( !strncmp( p, "/", 1 ) && !strncmp( p_sys->psz_location, "http", 4))
+ if( !strncmp( p, "/", 1 ) && ( !p_sys->psz_location || !strncmp( p_sys->psz_location, "http", 4) ) )
psz_http_ext = "";
else if( !strncmp( p_sys->psz_location+4, "s:", 2) )
psz_http_ext = "s";
else
psz_http_ext = NULL; /* Shouldn't happen */
psz_http_ext = "";
else if( !strncmp( p_sys->psz_location+4, "s:", 2) )
psz_http_ext = "s";
else
psz_http_ext = NULL; /* Shouldn't happen */
asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext,
p_sys->url.psz_host, p_sys->url.i_port, p);
asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext,
p_sys->url.psz_host, p_sys->url.i_port, p);