Re: [PATCH] http-push.c: DAV must support olny http and https scheme
- From
Mike Hommey <mh@glandium.org>
- Date
- Apr 12, 2009, 09:00 UTC
- Message-ID
- <20090412090053.GA9920@glandium.org>
- In-Reply-To
- <7vd4bi9s1m.fsf@gitster.siamese.dyndns.org>
On Sun, Apr 12, 2009 at 01:48:05AM -0700, Junio C Hamano wrote:
Show 42 quoted lines
> "Kirill A. Korinskiy" <catap@catap.ru> writes:
>
> > If the response from remote web-server have scp or other not http-like
> > scheme http-push can't go to change url, because DAV must work only
> > over HTTP (http and https scheme).
> >
> > Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
> > ---
> > http-push.c | 19 ++++++++++---------
> > 1 files changed, 10 insertions(+), 9 deletions(-)
> >
> > diff --git a/http-push.c b/http-push.c
> > index feeb340..48c9a04 100644
> > --- a/http-push.c
> > +++ b/http-push.c
> > @@ -1457,16 +1457,17 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
> > }
> > } else if (!strcmp(ctx->name, DAV_PROPFIND_NAME) && ctx->cdata) {
> > char *path = ctx->cdata;
> > - if (*ctx->cdata == 'h') {
> > - path = strstr(path, "//");
> > - if (path) {
> > - path = strchr(path+2, '/');
> > - }
> > - }
> > - if (path) {
> > - path += repo->path_len;
> > - ls->dentry_name = xstrdup(path);
> > + if (!strcmp(ctx->cdata, "http://")) {
> > + path = strchr(path + sizeof("http://") - 1, '/');
> > + } else if (!strcmp(ctx->cdata, "https://")) {
> > + path = strchr(path + sizeof("https://") - 1, '/');
> > }
> > +
> > + path += remote->path_len;
>
> http-push.c: In function 'handle_remote_ls_ctx':
> http-push.c:1466: error: 'remote' undeclared (first use in this function)
> http-push.c:1466: error: (Each undeclared identifier is reported only once
> http-push.c:1466: error: for each function it appears in.)
>
> Ah, crap.s/remote/repo/. He must have done his patch before 7b5201a and rebased afterwards without checking.
Mike