[MPlayer-dev-eng] [PATCH 3/7] Use authorization field to pass server authentication through proxy
Clément Bœsch
ubitux at gmail.com
Fri Nov 19 00:11:58 CET 2010
On Thu, Nov 18, 2010 at 10:32:50PM +0100, Reimar Döffinger wrote:
> On Thu, Nov 18, 2010 at 09:34:24PM +0100, Clément Bœsch wrote:
> > diff --git a/stream/network.c b/stream/network.c
> > index 02ddcc8..6b7117c 100644
> > --- a/stream/network.c
> > +++ b/stream/network.c
> > @@ -209,7 +209,12 @@ http_send_request( URL_t *url, off_t pos ) {
> > mp_msg(MSGT_NETWORK, MSGL_ERR, "Invalid URL '%s' to proxify\n", url->file+1);
> > goto err_out;
> > }
> > - http_set_uri( http_hdr, server_url->url );
> > + snprintf(str, sizeof(str), "%s://%s:%d%s",
> > + server_url->protocol,
> > + server_url->hostname,
> > + server_url->port ? server_url->port : 80,
> > + server_url->file);
> > + http_set_uri(http_hdr, str);
>
> What's your opinion on removing user/password from ->url in
> url_new instead?
> I think it is quite ugly, but I guess I am fine with it if
> you think it's the best solution.
> I do feel a bit uncomfortable about using fixed-size, on-stack
> destination, URLs can get quite gigantic...
Indeed, fixed-size for URLs is a problem. But I'm not sure about some
issues that can be caused by the modification of the url field. The first
one that come to my mind is the http_proxy url build in
stream/network.c:178 for example. This will need modification, and it may
be not the only case.
However, it's still possible to add a field say "noauth_url". This can
also be used when writing the stream URL on stdout (and avoid displaying
the authentication). This solution looks like harmless.
Patch attached with this solution.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
--
Clément B.
Not sent from a jesusPhone.
More information about the MPlayer-dev-eng
mailing list