From: Junio C Hamano <gitster@pobox.com>
To: "Kirill A. Korinskiy" <catap@catap.ru>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] http-push.c: DAV must support olny http and https scheme
Date: Sun, 12 Apr 2009 01:48:05 -0700 [thread overview]
Message-ID: <7vd4bi9s1m.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1239371060-3978-1-git-send-email-catap@catap.ru> (Kirill A. Korinskiy's message of "Fri, 10 Apr 2009 17:44:20 +0400")
"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.
> + ls->dentry_name = xmalloc(strlen(path) -
> + remote->path_len + 1);
> + strcpy(ls->dentry_name, path + remote->path_len);
> } else if (!strcmp(ctx->name, DAV_PROPFIND_COLLECTION)) {
> ls->dentry_flags |= IS_DIR;
> }
> --
> 1.6.2
next prev parent reply other threads:[~2009-04-12 8:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-10 13:44 [PATCH] http-push.c: DAV must support olny http and https scheme Kirill A. Korinskiy
2009-04-12 8:48 ` Junio C Hamano [this message]
2009-04-12 9:00 ` Mike Hommey
2009-04-12 18:45 ` Junio C Hamano
2009-04-12 18:49 ` Kirill A. Korinskiy
2009-04-12 19:33 ` Junio C Hamano
2009-04-13 16:44 ` Matthieu Moy
-- strict thread matches above, loose matches on Subject: below --
2009-04-13 12:42 Kirill A. Korinskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vd4bi9s1m.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=catap@catap.ru \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).